/* pilot/reworked/assets/glass.css — WEVA-W-041, round 2
 *
 * Shared by every page in the consolidated prototype: self-hosted Inter,
 * the Weva brand tokens (from app/static/weva.css / docs/brand/
 * brand_profile.md's dark-mode table, not re-derived), and the
 * liquid-glass component system. Nothing here invents a colour — every
 * value traces back to the documented palette. Restraint rule (round 1's
 * research, still binding): glass belongs on the navigation/floating-
 * control layer only — the side rail, its panels, the mobile slide-out,
 * a floating search field. Page content — cards, hero panels, list items
 * — is a plain, opaque, rounded .surface. Never nested glass on glass.
 *
 * Round 2 (2026-09-23): the header/top-bar nav is retired. Navigation now
 * lives in a glass side rail on the right edge, matching
 * feedback_2026-09-23/reference/05_side_nav_glass.png's structure — see
 * uiux_navigation_guide.md's round-2 addendum for the read on that
 * reference and why the primary destinations (Dashboard/Circles/Skills/
 * Directory/Requests) and the utility icons (share/info/notifications/
 * avatar) were combined into one rail rather than two.
 */

/* ---------------------------------------------------------- self-hosted Inter ---
 * Copied verbatim from app/static/weva.css lines 1-30 (same files, same
 * unicode-range split, same font-display: swap) — the fix for the closed
 * font-loading defect (tests/defects.json, web/performance, high). Do not
 * re-derive or re-subset; do not add fonts.googleapis.com back. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* -------------------------------------------------------------- brand tokens ---
 * Same names, same roles as app/static/weva.css :root — dark is the
 * default, light lives behind data-theme="light" on <html>.
 *
 * WEVA-W-235 round 3 (criterion 12): every colour below is a reference to
 * W-221's generated brand tokens (app/static/brand/tokens.css, written by
 * scripts/make_brand_assets.py from docs/brand/brand_profile.md), or a
 * color-mix() of them, the way app/static/tokens.css does it; this file
 * types no colour value of its own. Every page that links this file links
 * weva.css first, which brings the brand tokens (its @import), and the
 * brand file switches its values under :root[data-theme="light"], so most
 * names are set once and follow the mode. The pre-rebrand palette this
 * block carried (Senfgelb as the accent, Leinen-Weiss glass lines, the
 * near-black/near-white bases of W-050) went with W-221's rebrand
 * (Mat, 2026-10-12, Daniel's palette).
 *
 * Roles, as weva.css (round 2) set them: --primary (headings) is the
 * brand's text colour; --accent is accent-fill, the colour a label sits on,
 * with --on-accent as that label (brand_profile.md: a label never sits on
 * Purple or Bright Purple, 3.65:1 in dark).
 *
 * WEVA-W-262: --base-dark / --base-light, the hooks the rail's colour picker
 * wrote (round 6 criterion 7), are retired with the picker. --bg is the brand
 * ground in both modes; in light mode that is the member's light set (Paper,
 * Blue Hour or Ochre), which the brand file switches on <html data-light-set>. */
:root {

  /* WEVA-W-262: the slider that moved this is retired; 3 is now fixed.
     Glass-intensity slider (round 6 criterion 7), 0-10, default 3 — Mat:
     "the current intensity should be a 3 out of 10". Every formula below
     is calibrated so intensity=3 reproduces round 4's fixed numbers
     exactly (blur 18px, saturate 150%, glass-bg alpha 55%/74%, pointer-
     glow 0.35/0.6) — so the *default* look does not change, only the
     range around it becomes user-adjustable. */
  --glass-intensity: 3;
  --glass-blur:      clamp(4px, calc(4.8px + var(--glass-intensity) * 4.4px), 46px);
  --glass-saturate:  clamp(100%, calc(100% + var(--glass-intensity) * 16.67%), 260%);
  --glass-alpha:        clamp(6%, calc(10% + var(--glass-intensity) * 15%), 92%);
  --glass-alpha-strong: clamp(10%, calc(29% + var(--glass-intensity) * 15%), 96%);
  --glass-glow-hover: clamp(0.1, calc(0.2 + var(--glass-intensity) * 0.05), 0.9);
  --glass-glow-press: clamp(0.2, calc(0.45 + var(--glass-intensity) * 0.05), 0.95);

  --bg:           var(--brand-ground);
  --surface:      var(--brand-surface);
  --surface-2:    color-mix(in srgb, var(--brand-surface), var(--brand-accent) 8%);  /* chips, hover, the glass tint */
  --border:       var(--brand-border);
  --text:         var(--brand-text);
  --text2:        var(--brand-text-2);
  --primary:      var(--brand-text);          /* headings: the brand's text colour */
  --accent:       var(--brand-accent-fill);   /* the fill under a label */
  --accent-hover: var(--brand-accent-bright); /* Bright Purple's role: hover, glow */
  --on-accent:    var(--brand-on-accent);     /* the label on accent-fill */

  /* Hues for the background glow, the shadows and the top highlight: the
     brand accent and Blue light the backdrop (Blue's role: "second light in
     the background"); shadows take the ground's hue and the highlight the
     text colour in dark, and swap in light (below), as tokens.css does. */
  --glow-a:        var(--brand-accent);
  --glow-b:        var(--brand-blue);
  --shadow-hue:    var(--brand-ground);
  --shine-hue:     var(--brand-text);

  /* Glass surface — a translucent read of --surface-2 at the
     intensity-driven alpha above, never a colour that is not already
     derived from the palette. */
  --glass-bg:      color-mix(in srgb, var(--surface-2) var(--glass-alpha), transparent);
  --glass-bg-strong: color-mix(in srgb, var(--surface-2) var(--glass-alpha-strong), transparent);
  --glass-border:  var(--brand-border);
  --glass-shine:   color-mix(in srgb, var(--shine-hue) 16%, transparent);

  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --rail-w: 76px;
  --rail-w-labelled: 232px;

  /* One spacing scale for every card/list grid (round 4 criterion 10) —
     applied uniformly rather than tuned per container, per Mat's own
     instruction ("pick one scale and apply it uniformly"). */
  --gap-lg: 18px;

  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg:           var(--brand-ground);   /* the light set's ground (WEVA-W-262) */
  --shadow-hue:   var(--brand-text);     /* a dark violet, not the light ground */
  --glow-a:       var(--brand-glow-1);   /* WEVA-W-262: the light set's own glows */
  --glow-b:       var(--brand-glow-2);
  --shine-hue:    var(--brand-surface);  /* White */

  /* Everything else above follows the brand file's light values on its own.
     WEVA-W-235 round 3: the round 7 note below predates the rebrand; its
     decision (light-mode glass is a light frost read from --surface-2, not
     a dark panel) stands, now with --surface-2 mixed from the brand
     surface and accent.

     Round 7 (2026-09-24), reversing round 6 criterion 6 for these two
     surfaces specifically: Mat's own words — "the rolling over banner
     need to be lighter as the background, even in light mode is still
     quite dark. Same for the side navigation menu. the buttons are not
     well visible." Round 6's darker tint (sourced from --primary, a
     computed near-black shade of --base-light) made every .glass
     consumer read as dark navigation chrome, and their own icons/buttons
     (rendered in var(--text)/var(--text2), dark-on-light) lost contrast
     against it. Decision, stated explicitly (criterion 2): round 6's
     darker-glass idea does not survive anywhere in light mode. Every
     .glass consumer in this build — .side-rail, .top-band, .rail-toggle,
     .rail-avatar-pop (assets/shell.js) — *is* large functional navigation
     chrome; there is no separate small/decorative glass moment to keep
     the darker tint on (.pointer-glass's own hover highlight reads from
     --glass-shine, not --glass-bg, and is unchanged). So this single
     token, not a second one layered alongside it, is replaced for the
     whole light theme. Sourced from --surface-2 — itself a computed tone
     of --base-light (criterion 7: still base-derived, not a new hex) —
     which reads as a light, subtle frost distinguishable from the page's
     own lighter background/surfaces rather than a dark panel, restoring
     contrast for --text/--text2 rendered on top of it. Same
     intensity-driven alpha as dark mode; dark mode's own tokens above are
     untouched. */
  --glass-shine:   color-mix(in srgb, var(--shine-hue) 90%, transparent);

  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* The soft gradient backdrop the reference screenshots show, built from
     tokens already in the palette — no new colour. Round 2 criterion 4:
     "deepen the existing dark palette... lean harder into it" is read as
     more of the ground tone showing through and a stronger glow rather
     than a new hue — see .hero-band / .hero-glow below.
     WEVA-W-261 round 2 (WEVA-2728): no `background-attachment: fixed` (a fixed
     background is repainted on every scroll); the glows scroll with the page.
     On a member page (`html.shell-v2`) the body carries no glows at all: the
     still `.shell-sky` layer (shell.css) paints the ground's glows, once. */
  background-repeat: no-repeat;
  padding-right: var(--rail-w);
}
:root:not(.shell-v2) body {
  background-image:
    radial-gradient(760px 520px at 22% -6%, color-mix(in srgb, var(--glow-a) 8%, transparent), transparent 65%),
    radial-gradient(620px 460px at 86% 8%, color-mix(in srgb, var(--glow-b) 14%, transparent), transparent 70%);
}
:root[data-theme="light"]:not(.shell-v2) body {
  background-image:
    radial-gradient(760px 520px at 22% -6%, color-mix(in srgb, var(--glow-a) 10%, transparent), transparent 65%),
    radial-gradient(620px 460px at 86% 8%, color-mix(in srgb, var(--glow-b) 10%, transparent), transparent 70%);
}

.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 24px; }

a { color: inherit; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--surface); color: var(--text);
  padding: 10px 16px; border-radius: var(--radius-sm);
}
.skip-link:focus { left: 16px; top: 16px; }

/* Visually hidden but still announced — headings that give an unlabeled
   .surface-only section a name for assistive tech, without adding visible
   heading text the design doesn't call for. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Visible focus everywhere, independent of any glass border. */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pilot-badge {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  /* the toast: the text and ground colours swapped, so it reads in both
     modes (WEVA-W-235: --on-accent is now the light label colour) */
  background: var(--text);
  color: var(--bg);
  font-size: 11px;
  letter-spacing: 0.02em;
  padding: 6px 14px;
  border-radius: 999px;
  pointer-events: none;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--shadow-hue) 25%, transparent);
}

/* ------------------------------------------------------------ glass surfaces ---
 * Side rail, its panels/popovers, and the mobile slide-out only — see the
 * file banner above. Everything else uses .surface instead. */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow: 0 12px 40px color-mix(in srgb, var(--shadow-hue) 18%, transparent), inset 0 1px 0 color-mix(in srgb, var(--shine-hue) 8%, transparent);
}

/* A complete, legible, blur-free design when backdrop-filter is unsupported —
 * not a broken-looking degradation. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-bg-strong); }
}

/* A visitor who has asked for less transparency gets an opaque, blur-free
 * surface instead — same layout, no glass effect. */
@media (prefers-reduced-transparency: reduce) {
  .glass {
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Plain, opaque, rounded content surface — the "rounded cards" acceptance
 * criterion calls for, deliberately not glass (restraint rule). Round 4
 * criterion 11: a faint top-left highlight + a slightly deeper shadow for
 * lift ("shimmer... slight light from the top left"), built only from
 * tokens already in the palette (--glass-shine reads from the brand text
 * colour in dark and the brand surface in light). */
.surface {
  position: relative;
  background: var(--surface);
  background-image: linear-gradient(135deg, color-mix(in srgb, var(--glass-shine) 55%, transparent) 0%, transparent 48%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--shadow-hue) 14%, transparent), inset 0 1px 0 var(--glass-shine);
}

/* ================================================== pointer-reactive glass ===
 * Round 4 criterion 7/8, per docs/archive/validation_2026-09-24.md's
 * recommended pattern: a pointer-positioned radial-gradient pseudo-element
 * consuming --x/--y custom properties (set by shell.js on pointermove,
 * coalesced through requestAnimationFrame), plus an .is-pressed state on
 * pointerdown. Framed honestly per that research as "translucent glass with
 * a pointer-positioned specular/illumination layer" — not a reproduction of
 * Apple's lensing/refraction (no web equivalent without WebGL/SVG-
 * displacement, which the research advises against for a first pass).
 * `z-index: -1` + `isolation: isolate` keeps the highlight behind the
 * element's own text/icon content without needing `overflow: hidden` on
 * the element itself — important for .side-rail, whose tooltips render
 * outside its own box and would otherwise get clipped. */
.pointer-glass {
  position: relative;
  isolation: isolate;
}
.pointer-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(180px circle at var(--x, 50%) var(--y, 50%), var(--glass-shine) 0%, transparent 62%);
  opacity: 0;
  transition: opacity 220ms ease;
  pointer-events: none;
}
.pointer-glass:hover::before,
.pointer-glass:focus-within::before { opacity: var(--glass-glow-hover); }
.pointer-glass.is-pressed::before { opacity: var(--glass-glow-press); }
.pointer-glass.is-pressed {
  transform: scale(0.985);
  transition: transform 150ms ease;
}
/* Reduced motion: a static, low-contrast highlight replaces the pointer-
 * follow and the press-scale — never the only state feedback (borders,
 * backgrounds and text colour already carry interaction state elsewhere). */
@media (prefers-reduced-motion: reduce) {
  .pointer-glass::before,
  .pointer-glass:hover::before,
  .pointer-glass:focus-within::before,
  .pointer-glass.is-pressed::before {
    opacity: 0.14;
  }
  .pointer-glass.is-pressed { transform: none; }
}
/* Higher contrast: drop the highlight layer entirely rather than risk it
 * reducing text contrast. */
@media (prefers-contrast: more) {
  .pointer-glass::before { display: none; }
}

/* ================================================================ side rail ===
 * Fixed to the right edge on every page, glass, holding both the primary
 * destinations (Dashboard/Circles/Skills/Directory/Requests) and the
 * utility controls (share/info/notifications/avatar) in one column —
 * round 2 criterion 1 and criterion 10. */
.side-rail {
  position: fixed;
  top: 14px;
  right: 14px;
  bottom: 14px;
  width: var(--rail-w);
  z-index: 200;
  border-radius: var(--radius-lg);
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.rail-home {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  margin-bottom: 10px;
  text-decoration: none;
}
.rail-home img { width: 24px; height: 24px; display: block; }
.rail-home img.for-light { display: none; }
:root[data-theme="light"] .rail-home img.for-light { display: block; }
:root[data-theme="light"] .rail-home img.for-dark  { display: none; }

.rail-primary {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 4px;
  width: 100%;
}
.rail-primary li { display: flex; justify-content: center; position: relative; }
.rail-link {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: var(--radius-md);
  color: var(--text2);
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}
.rail-link svg { width: 20px; height: 20px; }
.rail-link:hover { color: var(--text); background: var(--glass-shine); }
.rail-link[aria-current="page"] {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}
.rail-link .rail-tooltip {
  position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  white-space: nowrap;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity 140ms ease;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--shadow-hue) 18%, transparent);
}
.rail-link:hover .rail-tooltip, .rail-link:focus-visible .rail-tooltip { opacity: 1; }

.rail-divider { width: 32px; height: 1px; background: var(--glass-border); margin: 10px 0; flex-shrink: 0; }

.rail-utility {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 4px;
  width: 100%;
}
.rail-utility li { display: flex; justify-content: center; position: relative; }

.rail-badge-dot {
  position: absolute; top: 8px; right: 16px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
}

.rail-spacer { flex: 1; min-height: 12px; }

.rail-theme {
  display: flex; flex-direction: column; gap: 4px;
  padding: 4px; border-radius: 999px;
  background: var(--glass-shine);
  margin-bottom: 8px;
}
.rail-theme button {
  border: none; background: transparent; color: var(--text2);
  font-family: inherit; font-size: 11px; font-weight: 700;
  padding: 6px; border-radius: 999px; cursor: pointer; width: 42px;
}
.rail-theme button[aria-pressed="true"] { background: var(--surface); color: var(--text); }

.rail-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  background: color-mix(in srgb, var(--accent) 30%, var(--surface-2));
  color: var(--text);
  border: none; cursor: pointer;
  flex-shrink: 0;
}

/* WEVA-211 (round 9): .rail-avatar-row wraps the button + its popover
   (unchanged from before, still the .rail-popover's own position:relative
   anchor). .rail-avatar-inline wraps only the button + the account-handle
   label — it, not the circular button itself, is what the mobile drawer
   stretches full-width, so .rail-avatar keeps its fixed 42px circle at
   every width instead of being distorted into an oval by a direct
   width:100% override. */
/* WEVA-W-064: position:relative moved here from shell.js's own inline
   style="position:relative" attribute - the real app's CSP (style-src
   'self', no 'unsafe-inline') blocks an inline style attribute outright,
   which the pilot's own unrestricted static pages never surfaced. */
.rail-avatar-row { position: relative; }
.rail-avatar-inline {
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.rail-avatar-label { display: none; }

/* ---- popovers hung off a rail button (info / notifications / share / avatar) --- */
.rail-popover {
  display: none;
  position: absolute;
  right: calc(100% + 12px);
  min-width: 240px;
  border-radius: var(--radius-md);
  padding: 8px;
  z-index: 220;
  /* WEVA-207: content anchored bottom:0 grows upward with no ceiling — once
     a popover's total content exceeds the space above its anchor button, a
     scroll fallback is what keeps every control inside it reachable, rather
     than letting the top of the content render above the viewport. */
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.rail-popover.align-bottom { bottom: 0; }
[aria-expanded="true"] + .rail-popover,
.rail-popover.is-open { display: block; }

.rail-popover-inner { display: flex; flex-direction: column; gap: 2px; }
.rail-popover-link, .rail-popover button.rail-popover-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text);
  font-family: inherit; font-size: 14px; font-weight: 600;
  background: transparent; border: none; cursor: pointer; text-align: left; width: 100%;
}
.rail-popover-link:hover { background: var(--glass-shine); }
.rail-popover-blurb { display: block; font-size: 12px; font-weight: 400; color: var(--text2); }
.rail-popover-title { display: block; padding: 8px 10px 4px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text2); }
/* WEVA-253: chat.js's own three uses of .rail-popover-title (Attach, Mode,
   Routing) are static, intentionally all-caps section-header labels, so the
   uppercase rule above stays their default. shell.js's account popover
   reuses the same class to show the signed-in member's own real GitHub
   handle (WEVA-W-092) - case-sensitive identity, not a label - so this
   modifier, applied alongside the base class rather than replacing it,
   turns the transform off for that one use without touching chat.js's. */
.rail-popover-title--identity { text-transform: none; }

/* ---- Settings panel, opened inline from the avatar menu (round 6
   criterion 7) — base colours + glass intensity, persisted to
   localStorage the same way the theme switch already is. Still a
   prototype: "the functionality itself I will pilot... a working,
   persisted-locally control is enough" (Mat). --- */
.rail-settings-panel { display: flex; flex-direction: column; gap: 10px; padding: 8px 10px 6px; }
.settings-row { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text2); }
.settings-row .settings-value { font-weight: 700; color: var(--text); }
.settings-row input[type="color"] {
  width: 100%; height: 32px; padding: 2px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.settings-row input[type="range"] { width: 100%; accent-color: var(--accent); }
.settings-hint { margin: 2px 0 0; font-size: 11px; font-weight: 400; color: var(--text2); }

/* ---- info ("i") tooltip used inline in forms (criteria 12/16) --- */
.info-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface-2); color: var(--text2);
  font-size: 11px; font-weight: 700; font-style: normal;
  border: none; cursor: pointer; position: relative; flex-shrink: 0;
}
.info-icon .info-popover {
  display: none;
  position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%);
  width: 240px; max-width: 60vw;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 12.5px; font-weight: 400; text-align: left;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--shadow-hue) 20%, transparent);
  z-index: 50;
}
.info-icon[aria-expanded="true"] .info-popover { display: block; }

/* ---- main content offset for the fixed right rail --- */
.page-main { padding: 24px 0 60px; }

/* --------------------------------------------------------------- footer --- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 28px 0 60px;
  color: var(--text2);
  font-size: 13px;
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-left: auto; }
.footer-nav a { text-decoration: none; color: var(--text2); }
.footer-nav a:hover { color: var(--text); }

/* ------------------------------------------------------------- 390px rail --- */
.rail-toggle {
  display: none;
  position: fixed; top: 14px; right: 14px; z-index: 210;
  width: 44px; height: 44px; border-radius: 50%;
  align-items: center; justify-content: center;
  color: var(--text); cursor: pointer;
}
.rail-toggle .bars, .rail-toggle .bars::before, .rail-toggle .bars::after {
  content: ""; display: block; width: 18px; height: 1.6px;
  background: currentColor; border-radius: 2px;
}
.rail-toggle .bars::before { transform: translateY(-5px); }
.rail-toggle .bars::after { transform: translateY(3.4px); }

@media (max-width: 900px) {
  body { padding-right: 0; }
  .side-rail { display: none; }
  .rail-toggle { display: flex; }
  body.rail-open .side-rail {
    display: flex;
    top: 0; right: 0; bottom: 0; left: auto;
    width: min(280px, 84vw);
    border-radius: 0;
    padding-top: 64px;
    /* WEVA round 3 (mobile-width rail): the drawer's own content — nav
       items, theme toggle, avatar — can exceed the viewport height once
       everything after padding-top: 64px is stacked; WEVA-207 gave the
       account popover a scroll fallback but the drawer itself had none,
       so the avatar/theme row at the bottom was clipped by the viewport
       edge with nothing to scroll it into view. Same fix, same reasoning. */
    padding-bottom: 24px;
    overflow-y: auto;
    align-items: stretch;
  }
  body.rail-open .rail-link { justify-content: flex-start; width: 100%; padding-inline: 14px; gap: 10px; }
  body.rail-open .rail-link-label { display: inline; font-size: 14px; font-weight: 600; }
  /* WEVA-211 (round 9): .rail-avatar itself is deliberately absent from the
     rule above — it stays a fixed 42px circle (see .rail-avatar-inline's
     own comment). Only the wrapping row stretches full-width, with the
     account-handle label shown next to the circle so the row still reads
     full width, matching .rail-link's own row. */
  body.rail-open .rail-avatar-inline { width: 100%; justify-content: flex-start; padding-inline: 14px; }
  body.rail-open .rail-avatar-label { display: inline; font-size: 14px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
  body.rail-open .rail-tooltip { display: none !important; }
  body.rail-open .rail-popover { position: static; margin-top: 4px; box-shadow: none; }
  /* .rail-theme (Dark/Light) was never adapted for the mobile drawer — it
     kept its desktop styling, a narrow 42px-wide vertical pill meant to
     sit centered in the ~72px rail column, which read as inconsistent/
     misaligned once the drawer went full-width. Adapted to a full-width
     row of two equal buttons, the same shape .rail-link rows already use
     at this width, rather than inventing a second mobile treatment. */
  body.rail-open .rail-theme {
    flex-direction: row;
    width: 100%;
    box-sizing: border-box;
    padding-inline: 14px;
    padding-block: 0;
    margin-bottom: 8px;
    gap: 8px;
    background: transparent;
    border-radius: 0;
  }
  body.rail-open .rail-theme button {
    flex: 1;
    width: auto;
    padding: 10px 6px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    background: var(--glass-shine);
  }
  body.rail-open .rail-theme button[aria-pressed="true"] { background: var(--surface); color: var(--text); }
  .wrap { padding-inline: 20px; }
  /* The fixed pilot badge/toast otherwise sit visually under the open
     390px slide-out (they are pointer-events:none so nothing was ever
     unclickable, but it read as a layering mistake) — hidden while open. */
  body.rail-open .pilot-badge, body.rail-open #shell-toast { display: none; }
}
.rail-link-label { display: none; }

/* -------------------------------------------------------------- motion ---
 * No morph/parallax survives a reduced-motion request, and backdrop-filter
 * itself is never the animated property either way (transform/opacity
 * only). The marquee (round 2 criterion 3) is explicitly paused too. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
  .marquee-track { animation: none !important; }
}
/* WEVA-W-261 round 2: a member's Motion at Off stops the same motion as the
 * device's reduced-motion request above ("Nothing moves."). html[data-motion]
 * is set before the first paint by templates/_member_appearance.html, on
 * member pages only; signed-out pages never carry it. */
:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after {
  animation-duration: 0.001ms !important; transition-duration: 0.001ms !important;
}
:root[data-motion="off"] { scroll-behavior: auto; }
:root[data-motion="off"] .marquee-track { animation: none !important; }
