/* ==========================================================================
   Waidrn v3 shell — topbar, visual breadcrumb, root banner, a)/b) panes, footer
   --------------------------------------------------------------------------
   Owner: lead-08 (issue #542 / V3-03). Loaded only by the v3 shell
   (`html[data-shell="v3"]`); the v2 site never requests it.

   Visual reference: the committed v3 design set (`mockups/v3/pages/*.svg`,
   renders in `mockups/v3/renders/`) and its token sheet `mockups/v3/_tokens.css`.
   The token block below continues that sheet; the one deliberate deviation is
   the a11y-approved contrast fix: `--faint` is #737E8B (dark) / #5B6570 (light)
   so captions/disabled text stay AA on the dark surfaces. Design lane (#543) may
   replace this file wholesale as long as the structural classes/ids stay
   (contract: docs/V3-SHELL.md § 6).

   Rules kept by construction:
   · no inline styles/scripts (CSP `style-src 'self'`) — every icon shape is
     styled from here, the topbar/banner/footer markup carries no style attr;
   · no layout shift — sticky topbar has a fixed height, the JS-revealed theme
     toggle reserves its slot, rail/card borders never change width on hover;
   · reduced motion — every transition/animation is neutralised below;
   · AA contrast — `--faint` is only used on surfaces where it clears 4.5:1
     (bg, bg-deep, bg-rail, panel); raised rows (panel-2/3) use `--ink-3`.
   ========================================================================== */

/* Inter and Space Grotesk are variable fonts: one file each, declared once over a range
   of weights. A weight outside the range is drawn at its nearest end: Inter at 650 or
   700 is drawn at 600, as it was when 600 was its heaviest face. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("/static/fonts/Inter.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500 700; font-display: swap; src: url("/static/fonts/SpaceGrotesk.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/IBMPlexMono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/IBMPlexMono-500.woff2") format("woff2"); }

html[data-shell="v3"] {
  /* ---- surface stack (mockups/v3/_tokens.css) -------------------------- */
  --bg: #0A0B0C;
  --bg-deep: #060708;
  --bg-rail: #0C0E11;
  --panel: #101317;
  --panel-2: #14181D;
  --panel-3: #1A1F26;
  --panel-4: #212832;
  --line: #232A33;
  --line-2: #303944;
  --line-3: #3C4753;

  /* ---- ink scale -------------------------------------------------------- */
  --ink: #ECF0F4;
  --ink-2: #C3CBD5;
  --ink-3: #8D98A5;
  /* The dimmest ink still has to be read: 5.0 to 1 on --panel, 4.8 on --panel-2
     (#737E8B measured 4.5 and 4.3). Switched-off items use it; captions use --ink-3. */
  --faint: #7B8693;
  /* WCAG 1.4.11 control-boundary fix (lead-12 token audit): --line/--line-2 are
     decorative hairlines (1.29:1-1.97:1) and must not be the only visual edge of
     an interactive control. Interactive boundaries use --control-line, which
     resolves to the AA --faint per theme (#737E8B dark: 4.51:1 on panel /
     4.77:1 on page; #5B6570 light). Decorative hairlines keep --line/--line-2. */
  --control-line: var(--faint);

  /* ---- brand + semantic accents ---------------------------------------- */
  --gold: #E8C987;
  --gold-bright: #F3DCAC;
  --gold-dim: #8E7A4C;
  --gold-line: #4A3F22;
  --gold-bg: #1B170D;
  --money: #E8B14C;
  --accent: #8FC7EE;
  --green: #68D6A8;
  --green-bg: #0E221A;
  --green-line: #2C4D3D;
  --violet: #B8A4FF;
  --violet-bg: #191527;
  --rose: #E87A94;

  /* ---- atmosphere placeholder (#611; CSS-only, off by default) ---------- */
  --atmo-a: rgba(232, 201, 135, 0.15);
  --atmo-b: rgba(143, 199, 238, 0.12);
  --atmo-c: rgba(184, 164, 255, 0.09);

  /* ---- type ------------------------------------------------------------- */
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --fs-display: 30px;
  --fs-h1: 25px;
  --fs-h2: 20px;
  --fs-h3: 15px;
  --fs-title: 13.5px;
  --fs-body: 13px;
  --fs-meta: 11.5px;
  --fs-label: 10.5px;
  --fs-micro: 9.5px;
  --ls-caps: 0.14em;

  /* ---- geometry --------------------------------------------------------- */
  --topbar-h: 56px;
  --rail-w: 300px;
  --canvas-w: 850px;
  --gutter: 22px;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 10px;

  /* ---- motion ----------------------------------------------------------- */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --fast: 120ms;
  --slow: 240ms;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.65), 0 6px 18px rgba(0, 0, 0, 0.5);

  color-scheme: dark;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  scroll-padding-top: calc(var(--topbar-h) + 12px);
}

html[data-shell="v3"][data-theme="light"] {
  --bg: #F5F3EE;
  --bg-deep: #FFFFFF;
  --bg-rail: #EFEDE7;
  --panel: #FFFFFF;
  --panel-2: #F7F5F0;
  --panel-3: #EDEAE3;
  --panel-4: #E5E0D6;
  --line: #DCD7CC;
  --line-2: #C7C0B2;
  --line-3: #B5AD9E;
  --ink: #14171A;
  --ink-2: #333A42;
  --ink-3: #5C6672;
  --faint: #5B6570;
  --gold: #7A5A16;
  --gold-bright: #5E4510;
  --gold-dim: #A98C4E;
  --gold-line: #C9B98C;
  --gold-bg: #FBF3DC;
  --money: #8A5A0A;
  --accent: #1D5F8A;
  --green: #16704C;
  --green-bg: #E2F2EA;
  --green-line: #A9CDBC;
  --violet: #4B3A8F;
  --rose: #9E2F45;
  --atmo-a: rgba(122, 90, 22, 0.10);
  --atmo-b: rgba(29, 95, 138, 0.09);
  --atmo-c: rgba(75, 58, 143, 0.07);
  color-scheme: light;
}

/* ==========================================================================
   Base
   ========================================================================== */
html[data-shell="v3"] *, html[data-shell="v3"] *::before, html[data-shell="v3"] *::after { box-sizing: border-box; }
/* Belt-and-braces overflow guard: the shell never scrolls sideways. The
   explorer tile strip is an internal scroll region (see Responsive) and every
   other flex/grid child can shrink; `clip` (not `hidden`) keeps position:sticky
   working. */
html[data-shell="v3"],
html[data-shell="v3"] body { overflow-x: clip; }
html[data-shell="v3"] body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
}
/* Base element defaults use zero-specificity `:where()` on purpose: component
   classes (`.v3-login`, `.v3-card-title`, `.v3-banner-copy`, …) set their own
   colour/margin and must win without `!important` or specificity stacking. */
:where(html[data-shell="v3"]) :where(a) { color: var(--accent); text-decoration: none; }
:where(html[data-shell="v3"]) :where(a):hover { color: var(--gold-bright); text-decoration: underline; text-underline-offset: 2px; }
:where(html[data-shell="v3"]) :where(:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: var(--radius-xs); }
:where(html[data-shell="v3"]) :where(h1, h2, h3, h4) {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 8px;
}
:where(html[data-shell="v3"]) :where(h1) { font-size: var(--fs-h1); }
:where(html[data-shell="v3"]) :where(h2) { font-size: var(--fs-h2); }
:where(html[data-shell="v3"]) :where(h3) { font-size: var(--fs-h3); }
:where(html[data-shell="v3"]) :where(p) { margin: 0 0 10px; }
:where(html[data-shell="v3"]) :where(::selection) { background: var(--gold); color: var(--bg-deep); }
html[data-shell="v3"] #v3-content:focus-visible { outline-offset: -2px; }

/* Inline SVG icon geometry (shapes are markup-only; styling lives here so the
   shell keeps `style-src 'self'` with no inline style attributes). */
html[data-shell="v3"] .v3-icon {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-shell="v3"] .v3-mono,
html[data-shell="v3"] .v3-tile-count,
html[data-shell="v3"] .v3-card-meta,
html[data-shell="v3"] .v3-footer-meta { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Shell frame: sticky topbar, scrollable a), flex footer at the end.
   position/isolation hold the atmosphere placeholder layer behind the content
   (a z-index:-1 fixed pseudo-element inside this stacking context). */
.v3-shell {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.v3-shell > .v3-body {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1580px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  align-items: start;
  /* The body stretches to push the footer down; keep the tracks themselves at
     their content height instead of letting grid stretch distribute the slack
     between a) and b) (that showed up as a gap above b) on short phone pages). */
  align-content: start;
}

/* Skip link: first focusable thing on the page, visible only when focused. */
.v3-skip,
.v3-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.v3-skip {
  left: 14px;
  top: -100px;
  z-index: 100;
  width: auto;
  height: auto;
  margin: 0;
  padding: 8px 14px;
  clip: auto;
  background: var(--gold);
  color: var(--bg-deep);
  border-radius: 8px;
  font-weight: 600;
  font-size: 12px;
  transition: top var(--fast) var(--ease);
}
.v3-skip:focus,
.v3-skip:focus-visible { top: 12px; color: var(--bg-deep); text-decoration: none; outline: 2px solid var(--bg-deep); outline-offset: 2px; }

/* ==========================================================================
   Topbar
   ========================================================================== */
.v3-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--line);
}
.v3-topbar-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--topbar-h);
  max-width: 1580px;
  margin: 0 auto;
  padding: 0 20px;
}

.v3-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}
.v3-logo:hover { color: var(--gold-bright); text-decoration: none; }
.v3-logo-mark { width: 24px; height: 24px; flex: 0 0 auto; filter: drop-shadow(0 0 6px rgba(232,201,135,.18)); }
.v3-logo-word { transform: translateY(1px); }
.v3-main-nav { display: flex; align-items: center; gap: 1px; flex: 0 1 auto; min-width: 0; }
.v3-main-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 12.5px;
  white-space: nowrap;
}
.v3-nav-icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: .82; }
.v3-main-nav a:hover { color: var(--gold-bright); background: var(--panel-2); text-decoration: none; }
@media (max-width: 1180px) {
  .v3-main-nav a { padding: 6px 6px; font-size: 11.5px; }
  .v3-search { flex: 0 1 280px; }
}
@media (max-width: 980px) { .v3-main-nav { display: none; } }

/* ---- visual breadcrumb --------------------------------------------------- */
.v3-breadcrumb { flex: 1 1 auto; min-width: 0; }
.v3-breadcrumb ol {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
  overflow: hidden;
}
.v3-crumb {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  flex: 0 1 auto;
  white-space: nowrap;
  font-size: var(--fs-body);
  color: var(--ink-3);
}
.v3-crumb a {
  display: inline-block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 6px 2px;
  border-radius: var(--radius-xs);
  color: var(--ink-3);
}
.v3-crumb a:hover { color: var(--gold); text-decoration: none; }
.v3-crumb.is-current { flex: 0 0 auto; position: relative; }
.v3-crumb.is-current span {
  position: relative;
  padding: 6px 2px;
  color: var(--ink);
  font-weight: 600;
}
.v3-crumb.is-current span::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  height: 2px;
  border-radius: 1px;
  background: var(--gold);
}
.v3-crumb-sep { color: var(--faint); padding: 0 3px; font-size: var(--fs-meta); }

/* ---- search ------------------------------------------------------------- */
.v3-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 380px;
  min-width: 0;
  height: 34px;
  padding: 0 4px 0 10px;
  background: var(--panel);
  /* interactive boundary: WCAG 1.4.11 (see --control-line) */
  border: 1px solid var(--control-line);
  border-radius: var(--radius);
  transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
.v3-search:hover { border-color: var(--ink-3); }
.v3-search:focus-within {
  border-color: var(--gold);
  background: var(--panel-2);
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.v3-search .v3-icon { flex: 0 0 auto; width: 15px; height: 15px; color: var(--faint); }
.v3-search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  background: transparent;
  border: 0;
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-body);
  outline: none;
  appearance: none;
}
.v3-search input[type="search"]:focus-visible { outline: none; }
.v3-search input::placeholder { color: var(--faint); opacity: 1; }
.v3-search input::-webkit-search-cancel-button { appearance: none; }
.v3-search-go {
  flex: 0 0 auto;
  height: 26px;
  padding: 0 10px;
  background: var(--panel-2);
  color: var(--ink-2);
  border: 1px solid var(--control-line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--fs-meta);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
.v3-search-go:hover { color: var(--ink); background: var(--panel-3); border-color: var(--gold-line); }

/* ---- actions ------------------------------------------------------------ */
.v3-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: 0 0 auto; }
.v3-icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  cursor: pointer;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.v3-icon-btn:hover { background: var(--panel-2); border-color: var(--line); color: var(--ink); }
.v3-icon-btn .v3-icon { width: 17px; height: 17px; }
.v3-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 2px var(--bg-deep);
}

/* Theme toggle: hidden until the enhancer runs, but its slot is reserved so
   revealing it cannot shift the actions (CLS). Without JS nothing is hidden
   from the a11y tree and no dead control is offered; when scripting is off
   entirely the reserved slot is removed instead. */
.v3-icon-btn[hidden] { display: inline-grid; visibility: hidden; }
@media (scripting: none) {
  .v3-icon-btn[hidden] { display: none; }
}
.v3-icon-btn.v3-theme {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--gold);
}
.v3-icon-btn.v3-theme:hover { border-color: var(--gold-line); background: var(--panel-3); color: var(--gold-bright); }
.v3-theme-icon { display: inline-grid; place-items: center; }
html[data-shell="v3"]:not([data-theme="light"]) .v3-theme-icon.v3-theme-sun { display: none; }
html[data-shell="v3"][data-theme="light"] .v3-theme-icon.v3-theme-moon { display: none; }

.v3-login {
  display: inline-block;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--gold-bright);
  font-weight: 600;
  font-size: var(--fs-body);
  line-height: 1;
}
.v3-login:hover { background: var(--panel-2); color: var(--gold-bright); text-decoration: none; }
.v3-signup {
  display: inline-block;
  padding: 7px 16px;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  background: transparent;
  color: var(--gold-bright);
  font-weight: 600;
  font-size: var(--fs-body);
  line-height: 1;
}
.v3-signup:hover { border-color: var(--gold); background: var(--gold-bg); color: var(--gold-bright); text-decoration: none; }

.v3-avatar {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--panel-3);
  border: 1px solid var(--control-line);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--fs-meta);
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  list-style: none;
  transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
.v3-avatar::-webkit-details-marker { display: none; }
.v3-avatar::marker { content: ""; }
.v3-avatar:hover { border-color: var(--gold-line); background: var(--panel-4); }
.v3-usermenu { position: relative; }
.v3-usermenu[open] > .v3-avatar { border-color: var(--gold-line); background: var(--panel-2); }
.v3-usermenu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  min-width: 232px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: v3-pop var(--fast) var(--ease);
}
.v3-usermenu-panel a,
.v3-usermenu-panel button {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font: inherit;
  font-size: var(--fs-body);
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.v3-usermenu-panel a:hover,
.v3-usermenu-panel button:hover { background: var(--panel-2); color: var(--ink); text-decoration: none; }
.v3-usermenu-id {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.v3-usermenu-id b { color: var(--ink); font-size: var(--fs-body); font-weight: 600; }
.v3-usermenu-id span { color: var(--faint); font-size: var(--fs-meta); }
/* The account's other profiles, as buttons that switch to them. */
.v3-usermenu-switch {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 4px 0;
  padding: 4px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.v3-usermenu-label { padding: 4px 10px 2px; color: var(--ink-3); font-size: var(--fs-meta); }
.v3-usermenu-switch button { width: 100%; overflow-wrap: anywhere; }
.v3-usermenu-tag { color: var(--ink-3); font-size: var(--fs-meta); }
.v3-logout { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 6px; }
.v3-logout button { width: 100%; color: var(--rose); }
.v3-logout button:hover { color: var(--rose); background: var(--panel-2); }

/* ==========================================================================
   Root banner (only on `/`, SSR only)
   ========================================================================== */
.v3-banner {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--bg-rail);
}
/* Decorative atmosphere (#611): CSS-generated orbs/gradients, aria-hidden in the
   markup, absolutely positioned behind the copy — no layout shift, no external
   art, pointer-events off. Motion is opt-in via prefers-reduced-motion only and
   the layer is flattened under forced-colors. */
.v3-banner-atmosphere {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.v3-banner-atmosphere::before {
  content: "";
  position: absolute;
  inset: -40% -8% -60% -8%;
  background:
    radial-gradient(1100px 300px at 10% -20%, var(--atmo-a), transparent 64%),
    radial-gradient(820px 260px at 92% -10%, var(--atmo-b), transparent 62%);
  opacity: 0.95;
}
.v3-banner-orb {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, var(--atmo-a), transparent 68%);
  opacity: 0.9;
}
.v3-banner-orb-gold { width: min(56vw, 620px); height: min(56vw, 620px); left: -9%; top: -78%; }
.v3-banner-orb-blue {
  width: min(44vw, 480px); height: min(44vw, 480px); right: -6%; top: -66%;
  background: radial-gradient(circle at 42% 34%, var(--atmo-b), transparent 70%);
}
.v3-banner-grain {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 4px 4px;
  opacity: 0.5;
}
html[data-theme="light"] .v3-banner-grain { opacity: 0.35; }

.v3-banner-inner {
  position: relative;
  z-index: 1;
  max-width: 1580px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.v3-banner-open { flex: 1 1 640px; min-width: 0; color: var(--ink); }
.v3-banner-open:hover { color: var(--ink); text-decoration: none; }
.v3-banner-copy {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: var(--ink);
  max-width: 88ch;
  transition: color var(--fast) var(--ease);
}
.v3-banner-open:hover .v3-banner-copy { color: var(--gold-bright); }
.v3-banner-more {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid var(--gold-line);
  background: var(--gold-bg);
  color: var(--gold);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--fs-body);
  line-height: 1;
}
.v3-banner-more:hover { color: var(--gold-bright); border-color: var(--gold); text-decoration: none; }
.v3-banner-arrow { transition: transform var(--fast) var(--ease); }
.v3-banner-more:hover .v3-banner-arrow { transform: translateX(2px); }

/* ==========================================================================
   Atmosphere placeholder (#611) — CSS-only, opt-in, off by default
   --------------------------------------------------------------------------
   `.v3-shell[data-v3-atmosphere="off"]` ships today. A future realm-travel lane
   (or a server flag) may flip the attribute to "on" per realm; this block is the
   whole dependency-free layer: fixed, behind the shell content, low-opacity
   gradient washes, pointer-events off, no extra markup, no JS. It is disabled
   under forced-colors and reduced-motion (static colour is not information).
   ========================================================================== */
.v3-shell[data-v3-atmosphere="on"]::before,
.v3-shell[data-v3-atmosphere="on"]::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.v3-shell[data-v3-atmosphere="on"]::before {
  background:
    radial-gradient(62vw 62vw at 8% 4%, var(--atmo-a), transparent 62%),
    radial-gradient(54vw 54vw at 92% 18%, var(--atmo-b), transparent 60%),
    radial-gradient(50vw 50vw at 48% 108%, var(--atmo-c), transparent 64%);
  opacity: 0.9;
}
.v3-shell[data-v3-atmosphere="on"]::after {
  background:
    radial-gradient(38vw 38vw at 74% 62%, var(--atmo-c), transparent 66%),
    radial-gradient(34vw 34vw at 22% 78%, var(--atmo-b), transparent 68%);
  opacity: 0.55;
}
@media (prefers-reduced-motion: no-preference) {
  .v3-shell[data-v3-atmosphere="on"]::before { animation: v3-atmo-drift 96s var(--ease) infinite alternate; }
  .v3-banner-orb-gold { animation: v3-atmo-drift 46s var(--ease) infinite alternate; }
  .v3-banner-orb-blue { animation: v3-atmo-drift-b 58s var(--ease) infinite alternate; }
}
@keyframes v3-atmo-drift {
  from { transform: translate3d(-1.2%, -0.8%, 0) scale(1); }
  to { transform: translate3d(1.4%, 1%, 0) scale(1.03); }
}
@keyframes v3-atmo-drift-b {
  from { transform: translate3d(1.2%, 0.8%, 0); }
  to { transform: translate3d(-1.4%, -1%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .v3-shell[data-v3-atmosphere="on"]::before,
  .v3-shell[data-v3-atmosphere="on"]::after { display: none; }
}
@media (forced-colors: active) {
  html[data-shell="v3"] .v3-shell[data-v3-atmosphere="on"]::before,
  html[data-shell="v3"] .v3-shell[data-v3-atmosphere="on"]::after,
  html[data-shell="v3"] .v3-banner-atmosphere { display: none; }
}

/* ==========================================================================
   a) Realms Explorer rail
   ========================================================================== */
.v3-explorer {
  position: relative;
  align-self: start;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px 26px;
  border-right: 1px solid var(--line);
  background: transparent;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.v3-explorer::-webkit-scrollbar { width: 4px; height: 4px; }
.v3-explorer::-webkit-scrollbar-track { background: transparent; }
.v3-explorer::-webkit-scrollbar-thumb { background: transparent; border-radius: 2px; }
.v3-explorer.is-scrolling::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--line-3), var(--gold-dim));
}
.v3-explorer.is-scrolling { scrollbar-color: var(--line-3) transparent; }

.v3-explorer-head { padding: 2px 8px 6px; }
.v3-explorer-head h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 4px;
  font-family: var(--font-ui);
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.v3-explorer-head h2::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: var(--gold);
  transform: rotate(45deg);
}
.v3-explorer-head .v3-hint { padding: 0; margin: 0 0 8px 16px; }
.v3-hint { color: var(--faint); font-size: var(--fs-meta); line-height: 1.5; margin: 0 8px 10px; }

.v3-explorer-search { margin: 10px 8px 12px; }
.v3-explorer-search input {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  background: var(--panel);
  border: 1px solid var(--control-line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-meta);
  appearance: none;
}
.v3-explorer-search input::placeholder { color: var(--faint); opacity: 1; }
.v3-explorer-search input:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold-line); }

/* Rail rows: the design set's icon + label + tabular count rhythm. */
.v3-tiles { list-style: none; display: flex; flex-direction: column; gap: 2px; margin: 0 0 12px; padding: 0; }
.v3-tile a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: var(--fs-body);
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.v3-tile a:hover {
  background: var(--panel-2);
  border-color: var(--line);
  border-left-color: var(--gold-line);
  color: var(--ink);
  text-decoration: none;
}
.v3-tile-title { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: var(--fs-body); }
.v3-tile-title::before {
  content: "";
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: var(--faint);
  transform: rotate(45deg);
  transition: background-color var(--fast) var(--ease);
}
.v3-tile a:hover .v3-tile-title::before { background: var(--gold); }
.v3-tile-count { flex: 0 0 auto; font-size: var(--fs-micro); color: var(--faint); letter-spacing: 0.02em; }
.v3-tile a:hover .v3-tile-count { color: var(--ink-3); }

/* No-JS disclosure: `<details>` stays an ordinary disclosure. */
.v3-explorer-more { margin: 4px 8px 0; border-top: 1px solid var(--line); padding-top: 6px; }
.v3-explorer-more summary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 4px;
  list-style: none;
  cursor: pointer;
  color: var(--ink-3);
  font-size: var(--fs-meta);
  font-weight: 500;
  border-radius: var(--radius-xs);
}
.v3-explorer-more summary::-webkit-details-marker { display: none; }
.v3-explorer-more summary::marker { content: ""; }
.v3-explorer-more summary::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--fast) var(--ease);
}
.v3-explorer-more[open] summary::before { transform: rotate(45deg); }
.v3-explorer-more summary:hover { color: var(--ink); background: var(--panel-2); }
.v3-explorer-more ul { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.v3-explorer-more li a {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  color: var(--ink-2);
  font-size: var(--fs-meta);
}
.v3-explorer-more li a:hover { background: var(--panel-2); color: var(--ink); text-decoration: none; }
.v3-explorer-more li a:hover span { color: var(--ink-3); }
.v3-explorer-more li span { color: var(--faint); }

/* ==========================================================================
   b) Content
   ========================================================================== */
.v3-content { min-width: 0; padding: 28px 32px 64px; }
.v3-content-head { max-width: 1180px; margin: 0 0 20px; }
.v3-content-head h1 {
  margin: 0 0 8px;
  font-size: var(--fs-display);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.v3-lede { max-width: 78ch; margin: 0 0 12px; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.v3-content-head .v3-hint { margin: 0; font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--faint); }

/* Cards: the design set's panel grammar (raised row, kind accent on the left). */
.v3-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  max-width: 1280px;
}
.v3-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 13px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 2px solid var(--line-2);
  border-radius: var(--radius);
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.v3-card:hover { background: var(--panel-2); }
.v3-card:hover .v3-card-title { color: var(--gold); }
.v3-card-title {
  display: block;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-title);
  line-height: 1.35;
}
.v3-card-title:hover { color: var(--gold); text-decoration: none; }
.v3-card-meta { margin: 0; color: var(--ink-3); font-size: var(--fs-meta); }
.v3-kind-wish { border-left-color: var(--violet); }
.v3-kind-work { border-left-color: var(--accent); }
.v3-kind-thread { border-left-color: var(--green); }
.v3-kind-project { border-left-color: var(--gold); }

.v3-prose { max-width: 72ch; color: var(--ink-2); font-size: 14px; line-height: 1.65; }
.v3-prose h1 { color: var(--ink); font-size: var(--fs-h1); margin-bottom: 12px; }
.v3-prose h2 { color: var(--ink); margin-top: 22px; }
.v3-prose p, .v3-prose ul, .v3-prose ol { margin: 0 0 12px; }
.v3-prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.v3-prose a:hover { color: var(--gold-bright); }
.v3-prose code, .v3-prose pre { font-family: var(--font-mono); font-size: var(--fs-meta); }
.v3-prose code { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-xs); padding: 1px 5px; color: var(--ink); }
.v3-prose pre { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; overflow-x: auto; }
.v3-prose pre code { background: none; border: 0; padding: 0; }

/* Modes without a): +b) uses the whole frame and centres its reading column.
   Zero specificity so the per-mode widths below win without !important. */
:where(.v3-shell > .v3-body > #v3-content:first-child) {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
}
html[data-shell="v3"] body[data-mode="detail"] #v3-content { max-width: 1100px; }
html[data-shell="v3"] body[data-mode="page"] #v3-content { max-width: 900px; padding-top: 34px; }
html[data-shell="v3"] body[data-mode="admin"] #v3-content { max-width: 1400px; }
html[data-shell="v3"] body[data-mode="auth"] #v3-content { max-width: 560px; padding-top: clamp(24px, 7vh, 72px); }
html[data-shell="v3"] body[data-mode="auth"] .v3-breadcrumb,
html[data-shell="v3"] body[data-mode="auth"] .v3-search { display: none; }
html[data-shell="v3"] body[data-mode="auth"] .v3-footer-main { justify-content: center; }
html[data-shell="v3"] body[data-mode="auth"] .v3-footer nav { display: none; }
html[data-shell="v3"] body[data-mode="auth"] .v3-footer-meta { margin-left: 0; }

/* ==========================================================================
   Shell states (#611) — empty / error cards in b)
   --------------------------------------------------------------------------
   Markup (demo.rs until real services): section.v3-state.v3-state-<kind> with
   .v3-state-icon (decorative disc glyph), h1, copy, optional .v3-state-code,
   .v3-state-points and .v3-state-actions (primary .v3-login + secondary
   .v3-link). Same material system as the shell: panel surface, one hairline,
   10px radius, inset accent (gold-empty / rose-error) and no layout shift.
   ========================================================================== */
.v3-state {
  --state-accent: var(--gold);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 60ch;
  margin: clamp(16px, 5vh, 60px) auto;
  padding: clamp(22px, 4vw, 38px) clamp(18px, 4vw, 36px);
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 3px 0 var(--state-accent);
  animation: v3-state-in 240ms var(--ease);
}
.v3-state-empty { --state-accent: var(--green); }
.v3-state-error { --state-accent: var(--rose); }
.v3-state-icon {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0;
  border-radius: 50%;
  border: 1px solid var(--control-line);
  background: var(--panel-2);
  color: var(--state-accent);
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
}
.v3-state h1 { margin: 0; font-size: clamp(22px, 2.4vw, 27px); line-height: 1.2; }
.v3-state :is(.v3-lede, .v3-ledge) {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.6;
  max-width: 54ch;
}
.v3-state-code {
  margin: 0;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.v3-state-points {
  margin: 2px 0 0;
  padding: 0 0 0 1.1em;
  width: 100%;
  max-width: 46ch;
  text-align: left;
  color: var(--ink-2);
  font-size: var(--fs-meta);
  line-height: 1.55;
}
.v3-state-points li { margin: 0 0 6px; }
.v3-state-points li::marker { color: var(--state-accent); }
.v3-state-points li:last-child { margin-bottom: 0; }
.v3-state-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 8px 0 0;
}
.v3-state-actions .v3-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
}
/* Secondary action: a real link styled as a control; --control-line keeps the
   boundary WCAG 1.4.11-legible (see the token block note). */
.v3-state-actions .v3-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--control-line);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: var(--fs-body);
  font-weight: 600;
}
.v3-state-actions .v3-link:hover {
  color: var(--gold-bright);
  border-color: var(--gold);
  text-decoration: none;
}
@keyframes v3-state-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Footer (c) — compact status-bar grammar, real links
   ========================================================================== */
.v3-footer { margin-top: auto; background: var(--bg-deep); border-top: 1px solid var(--line); }
.v3-footer-main {
  max-width: 1580px;
  margin: 0 auto;
  padding: 10px 20px;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.v3-footer nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.v3-footer nav a {
  display: inline-block;
  padding: 5px 8px;
  border-radius: var(--radius-xs);
  color: var(--ink-3);
  font-size: var(--fs-meta);
}
.v3-footer nav a:hover { color: var(--gold); background: var(--panel-2); text-decoration: none; }
.v3-footer-meta { margin: 0 0 0 auto; color: var(--faint); font-size: var(--fs-micro); letter-spacing: 0.02em; }
.v3-footer-extra { max-width: 1580px; margin: 0 auto; padding: 0 20px 10px; }
.v3-footer-extra:empty { display: none; }
.v3-footer-extra .v3-hint { margin: 0; padding: 0 8px; color: var(--faint); font-size: var(--fs-meta); }

/* ==========================================================================
   Fragment busy states (aria-busy set by the optional enhancer)
   ========================================================================== */
.v3-content, .v3-explorer { position: relative; }
.v3-content[aria-busy="true"], .v3-explorer[aria-busy="true"] { cursor: progress; }
.v3-content[aria-busy="true"]::before,
.v3-explorer[aria-busy="true"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 5;
  background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold) 80%, transparent);
  transform-origin: left center;
  animation: v3-busy 1.1s var(--ease) infinite;
}
.v3-explorer[aria-busy="true"]::before { left: 12px; right: 12px; }
@keyframes v3-busy {
  from { transform: translateX(-40%) scaleX(0.42); }
  to { transform: translateX(140%) scaleX(0.42); }
}
@keyframes v3-pop {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Optional-enhancer opt-ins: only applied once v3-shell.js took over. */
html[data-v3-enhanced="true"] #v3-content { scroll-margin-top: calc(var(--topbar-h) + 12px); }

/* ==========================================================================
   Mobile a) explorer sheet (docs/V3-DESIGN-SPEC.md §1/§4)
   --------------------------------------------------------------------------
   Enhanced-only. The toggle + backdrop + close + tabs are SSR markup, always
   hidden until `v3-shell.js` decides the sheet is usable (<=900px) and sets
   `data-v3-sheet-ready` on <html>; the enhancer also relocates the backdrop to
   <body> and the bar into #v3-explorer before it can open. With no JS nothing
   here can be focus/clicked: a) stays the stacked server-rendered block.
   Desktop (>900px) never sees the sheet.
   ========================================================================== */
.v3-sheet-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--control-line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.v3-sheet-toggle:hover { border-color: var(--gold); background: var(--panel-2); color: var(--gold); }
.v3-sheet-toggle .v3-icon { width: 16px; height: 16px; }
.v3-sheet-toggle[hidden] { display: none; }
.v3-sheet-layer { display: none; }
html[data-shell="v3"] .v3-sheet-backdrop,
html[data-shell="v3"] .v3-sheet-bar { display: none; }
html[data-shell="v3"][data-v3-sheet-open="true"] .v3-sheet-backdrop { display: block; }
html[data-shell="v3"][data-v3-sheet-open="true"] .v3-sheet-bar { display: flex; }

/* ==========================================================================
   Responsive
   Breakpoints (docs/V3-DESIGN-SPEC.md §1, sheet boundary per live audit):
   >=1180 desktop rail 300 · 901-1179 rail 260 · <=900 one column + sheet
   ========================================================================== */
@media (max-width: 1179px) {
  .v3-shell > .v3-body { grid-template-columns: 260px minmax(0, 1fr); }
  .v3-content { padding: 24px 24px 56px; }
  .v3-search { flex-basis: 300px; }
}

@media (max-width: 1080px) {
  .v3-topbar-main { gap: 10px; padding: 0 16px; }
  .v3-crumb a { max-width: 130px; }
  .v3-search { flex-basis: 240px; }
}

@media (max-width: 900px) {
  /* One column. JS-ready: a) is the sheet below; no-JS: a) is this stacked
     block above b) (never a client-only surface). */
  .v3-shell > .v3-body { grid-template-columns: minmax(0, 1fr); min-width: 0; }
  .v3-shell > .v3-body > #v3-content:first-child { max-width: none; }
  .v3-explorer {
    position: static;
    height: auto;
    max-height: none;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px 14px 10px;
  }
  .v3-explorer-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 0 2px 4px; min-width: 0; }
  .v3-explorer-head h2 { margin: 0; font-size: var(--fs-title); }
  .v3-explorer-head .v3-hint,
  .v3-explorer-search { display: none; }
  /* Internal scroll region: the strip must never widen the page (live audit:
     horizontal overflow at 768/360). */
  .v3-tiles {
    flex-direction: row;
    gap: 6px;
    margin: 8px 0 0;
    padding: 0 0 3px;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
  }
  .v3-tile { flex: 0 0 auto; scroll-snap-align: start; }
  .v3-tile a {
    min-height: 44px;
    padding: 5px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    white-space: nowrap;
  }
  .v3-tile a:hover { border-color: var(--gold-line); border-left-color: var(--gold-line); }
  .v3-tile-title { gap: 0; }
  .v3-tile-title::before { display: none; }
  .v3-explorer-more { margin: 8px 2px 0; border-top: 0; padding-top: 0; }
  .v3-explorer-more summary { min-height: 44px; padding: 4px 2px; }
  .v3-explorer-more ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1px 8px; max-width: 100%; }

  /* Topbar wraps: logo + actions (toggle/theme/login), then search. The sheet
     toggle never pushes search off its row. */
  .v3-topbar-main { flex-wrap: wrap; align-items: center; padding: 7px 14px 8px; gap: 6px 8px; min-height: 0; min-width: 0; }
  .v3-logo { order: 1; min-height: 44px; }
  .v3-actions { order: 2; margin-left: auto; gap: 4px; flex-wrap: nowrap; }
  .v3-search { order: 3; flex: 1 0 100%; max-width: none; height: 48px; padding: 0 2px 0 10px; }
  .v3-breadcrumb ol { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .v3-breadcrumb ol::-webkit-scrollbar { display: none; }
  .v3-crumb a { min-height: 44px; padding: 0 4px; display: inline-flex; align-items: center; }

  /* Touch targets >=44px (WCAG 2.5.8 / design spec §1). */
  .v3-icon-btn { width: 44px; height: 44px; }
  .v3-search-go { height: 44px; min-width: 44px; padding: 0 10px; }
  .v3-login { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; }
  .v3-avatar { width: 44px; height: 44px; }
  .v3-footer nav a { min-height: 44px; display: inline-flex; align-items: center; }
  .v3-state-actions .v3-login,
  .v3-state-actions .v3-link { min-height: 44px; }
  .v3-sheet-toggle[hidden] { display: inline-flex; visibility: hidden; }

  .v3-content { padding: 20px 16px 44px; min-width: 0; }
  .v3-content-head h1 { font-size: var(--fs-h1); }
  .v3-lede { font-size: var(--fs-body); }
  .v3-cards { grid-template-columns: 1fr; }
  .v3-banner-inner { padding: 16px; gap: 14px; }
  .v3-banner-copy { font-size: 15px; }
  .v3-footer-main { padding: 10px 14px; gap: 8px; }
  .v3-footer-meta { margin-left: 0; }
  .v3-footer-extra { padding: 0 14px 10px; }
}

/* Sheet open/closed (<=900, enhanced only). */
@media (max-width: 900px) {
  html[data-shell="v3"][data-v3-sheet-ready="true"] .v3-sheet-toggle {
    display: inline-flex;
    visibility: visible;
  }
  /* Closed: off-canvas, out of the a11y tree, no pointer access. */
  html[data-shell="v3"][data-v3-sheet-ready="true"] .v3-explorer {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 90;
    width: min(92vw, 420px);
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 0 14px calc(20px + env(safe-area-inset-bottom));
    background: var(--bg-rail);
    border-right: 1px solid var(--line-2);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-103%);
    visibility: hidden;
    pointer-events: none;
    transition: transform var(--slow) var(--ease), visibility 0s linear var(--slow);
  }
  html[data-shell="v3"][data-v3-sheet-ready="true"][data-v3-sheet-open="true"] .v3-explorer {
    transform: none;
    visibility: visible;
    pointer-events: auto;
    transition: transform var(--slow) var(--ease), visibility 0s linear 0s;
  }
  /* Scroll lock while the sheet owns the viewport. */
  html[data-shell="v3"][data-v3-sheet-open="true"],
  html[data-shell="v3"][data-v3-sheet-open="true"] body { overflow: hidden; }

  /* Backdrop: tap to close; dim only, never blocks the sheet itself. */
  html[data-shell="v3"] .v3-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 85;
    background: rgba(4, 5, 6, 0.62);
  }
  html[data-shell="v3"][data-theme="light"] .v3-sheet-backdrop { background: rgba(24, 20, 12, 0.42); }

  /* Bar inside the sheet: close button + tab strip. Sticks while a) scrolls. */
  html[data-shell="v3"][data-v3-sheet-ready="true"] .v3-sheet-bar {
    position: sticky;
    top: 0;
    z-index: 2;
    align-items: center;
    gap: 10px;
    margin: 0 -14px 8px;
    padding: 10px 14px;
    padding-top: max(10px, env(safe-area-inset-top));
    background: var(--bg-deep);
    border-bottom: 1px solid var(--line);
  }
  .v3-sheet-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .v3-sheet-tabs::-webkit-scrollbar { display: none; }
  .v3-sheet-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink-3);
    font: inherit;
    font-size: var(--fs-meta);
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
  }
  .v3-sheet-tab.is-current {
    color: var(--gold);
    background: var(--gold-bg);
    border-color: var(--gold-line);
  }
  .v3-sheet-tab:disabled { color: var(--faint); cursor: default; }
  .v3-sheet-close {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--control-line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--ink-2);
    cursor: pointer;
  }
  .v3-sheet-close:hover { color: var(--ink); border-color: var(--gold); }
  .v3-sheet-close .v3-icon { width: 18px; height: 18px; }

  /* Open sheet shows real rows (not the collapsed chip strip above). */
  html[data-shell="v3"][data-v3-sheet-ready="true"][data-v3-sheet-open="true"] .v3-explorer-head { display: block; padding: 4px 2px 6px; }
  html[data-shell="v3"][data-v3-sheet-ready="true"][data-v3-sheet-open="true"] .v3-explorer-head h2 { margin-bottom: 4px; font-size: var(--fs-h2); }
  html[data-shell="v3"][data-v3-sheet-ready="true"][data-v3-sheet-open="true"] .v3-tiles {
    flex-direction: column;
    gap: 4px;
    margin: 10px 0 12px;
    padding: 0;
    overflow: visible;
  }
  html[data-shell="v3"][data-v3-sheet-ready="true"][data-v3-sheet-open="true"] .v3-tile { flex: 1 1 auto; }
  html[data-shell="v3"][data-v3-sheet-ready="true"][data-v3-sheet-open="true"] .v3-tile a {
    min-height: 44px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-left: 2px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--panel);
    white-space: normal;
  }
  html[data-shell="v3"][data-v3-sheet-ready="true"][data-v3-sheet-open="true"] .v3-tile a:hover {
    background: var(--panel-2);
    border-color: var(--line-2);
    border-left-color: var(--gold-line);
  }
  html[data-shell="v3"][data-v3-sheet-ready="true"][data-v3-sheet-open="true"] .v3-tile-title::before { display: block; }
  html[data-shell="v3"][data-v3-sheet-ready="true"][data-v3-sheet-open="true"] .v3-explorer-more {
    margin: 8px 0 0;
    border-top: 1px solid var(--line);
    padding-top: 6px;
  }
  html[data-shell="v3"][data-v3-sheet-ready="true"][data-v3-sheet-open="true"] .v3-explorer-more ul { display: flex; flex-direction: column; }
}

/* Phone: keep the topbar to compact rows, drop the middle crumbs. */
@media (max-width: 640px) {
  .v3-crumb.is-current span { padding: 2px 2px; }
  .v3-sheet-toggle { padding: 0 10px; }
  .v3-search-go { padding: 0 10px; }
  .v3-content { padding: 16px 14px 40px; }
  .v3-content-head h1 { font-size: 25px; }
  .v3-prose { font-size: var(--fs-body); }
  .v3-banner-inner { padding: 14px; }
  .v3-banner-copy { font-size: 14px; line-height: 1.55; }
  .v3-banner-more { padding: 8px 12px; min-height: 44px; display: inline-flex; align-items: center; }
  .v3-state { margin: 12px auto; padding: 22px 16px; gap: 10px; }
  .v3-state-actions { flex-direction: column; align-items: stretch; width: 100%; }
  .v3-state-actions > * { width: 100%; }
}

/* Narrowest supported width (360): no horizontal scroll, readable banner. */
@media (max-width: 380px) {
  .v3-topbar-main { padding: 6px 10px 8px; gap: 6px; }
  .v3-logo { letter-spacing: 0.13em; font-size: 13px; }
  .v3-logo-mark { width: 9px; height: 9px; }
  .v3-actions { gap: 2px; }
  .v3-sheet-toggle-label { display: none; }  /* icon-only toggle at 360 */
  .v3-sheet-toggle { width: 44px; padding: 0; }
  .v3-content { padding: 14px 12px 36px; }
  .v3-banner-copy { font-size: 13.5px; }
  .v3-cards { grid-template-columns: minmax(0, 1fr); }
  .v3-sheet-tab { padding: 0 9px; }
}


/* Reduced motion: no transitions/animations/smooth scrolling anywhere. */
@media (prefers-reduced-motion: reduce) {
  html[data-shell="v3"] *,
  html[data-shell="v3"] *::before,
  html[data-shell="v3"] *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
  .v3-content[aria-busy="true"]::before,
  .v3-explorer[aria-busy="true"]::before { transform: scaleX(0.42); }
}

/* Windows high-contrast: keep structure, let the system pick colours. */
@media (forced-colors: active) {
  html[data-shell="v3"] .v3-logo-mark,
  html[data-shell="v3"] .v3-tile-title::before,
  html[data-shell="v3"] .v3-dot,
  html[data-shell="v3"] .v3-crumb.is-current span::after { forced-color-adjust: none; }
  html[data-shell="v3"] .v3-topbar,
  html[data-shell="v3"] .v3-footer,
  html[data-shell="v3"] .v3-explorer,
  html[data-shell="v3"] .v3-banner { border-color: CanvasText; }
  html[data-shell="v3"] .v3-content[aria-busy="true"]::before,
  html[data-shell="v3"] .v3-explorer[aria-busy="true"]::before { background: Highlight; }
}

/* ==========================================================================
   a) Realms Explorer band (docs/VISION-3.0-ARCHITECTURE.md §6, #646):
   full-width, collapsible band ABOVE b) on desktop (>=901px), max 50vh,
   not sticky. The whole band is a native <details open> disclosure rendered by
   `templates/v3/explorer.rs`; this file only lays it out.
   Body areas: on a realm's page Back with the path beside it, then the search
   row with the toolbar, the folder tiles, the pagination. <=900px keeps the
   stacked block / sheet.
   ========================================================================== */

/* Custom thin scroll indicator: shows only while the explorer band body is
   being scrolled, then fades. Native scrollbars stay hidden so it is the one
   affordance and the layout stays exact. */
.v3-scroll-hint {
  position: absolute;
  right: 3px;
  width: 4px;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.v3-scroll-hint.is-visible { opacity: 1; }
.v3-scroll-hint-thumb {
  position: absolute;
  left: 0;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gold), var(--gold-dim));
  box-shadow: 0 0 0 1px rgba(4, 7, 11, 0.65), 0 0 8px rgba(232, 201, 135, 0.22);
  will-change: transform, height;
}

/* --- band frame: summary header (all breakpoints) ------------------------ */
.v3-explorer-band { min-width: 0; }
.v3-explorer-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 2px 2px 6px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  list-style: none;
}
.v3-explorer-summary::-webkit-details-marker { display: none; }
.v3-explorer-summary::marker { content: ""; }
.v3-explorer-summary-main { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; min-width: 0; }
.v3-explorer-summary h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.v3-explorer-summary h2::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: var(--gold);
  transform: rotate(45deg);
}
.v3-explorer-blurb { margin: 0; padding: 0; font-size: var(--fs-meta); line-height: 1.5; color: var(--ink-3); }
.v3-explorer-summary-toggle {
  margin-left: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.v3-explorer-summary:hover .v3-explorer-summary-toggle { color: var(--ink); border-color: var(--line-2); }
.v3-explorer-chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--fast) var(--ease);
}
.v3-explorer-band:not([open]) .v3-explorer-chevron { transform: rotate(-45deg); }
.v3-explorer-toggle-label { display: none; }
.v3-explorer-band[open] .v3-explorer-toggle-hide { display: inline; }
.v3-explorer-band:not([open]) .v3-explorer-toggle-show { display: inline; }

/* Collapsed: the native details hides the body, but this stylesheet sets a
   display value on it, so restate the collapsed contract explicitly. */
.v3-explorer-band > .v3-explorer-band-body { display: block; min-width: 0; }
.v3-explorer-band:not([open]) > .v3-explorer-band-body { display: none; }

/* --- filter rail (right): sort · kind · per page ------------------------ */
.v3-explorer-filters { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.v3-explorer-filter-label {
  display: block;
  margin: 0 0 5px;
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--faint);
}
.v3-explorer-filter-list { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.v3-explorer-sort,
.v3-explorer-kind,
.v3-explorer-per {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink-3);
  font-size: var(--fs-meta);
  line-height: 1.3;
  white-space: nowrap;
}
.v3-explorer-sort:hover,
.v3-explorer-kind:hover,
.v3-explorer-per:hover { border-color: var(--gold-line); color: var(--ink); text-decoration: none; }
.v3-explorer-sort[aria-current="true"],
.v3-explorer-kind[aria-current="true"],
.v3-explorer-per[aria-current="true"] {
  border-color: var(--gold-line);
  background: var(--gold-bg);
  color: var(--gold);
  font-weight: 600;
}
.v3-explorer-kind-count { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--faint); }
.v3-explorer-kind[aria-current="true"] .v3-explorer-kind-count { color: var(--gold-dim); }

/* --- tiles + pagination ------------------------------------------------- */
.v3-explorer-tiles { min-width: 0; }
.v3-explorer-pagination { min-width: 0; }
.v3-explorer-pages { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.v3-explorer-page,
.v3-explorer-page-gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--panel);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
}
.v3-explorer-page:hover { border-color: var(--gold-line); color: var(--ink); text-decoration: none; }
.v3-explorer-page.is-current { border-color: var(--gold-line); background: var(--gold-bg); color: var(--gold); font-weight: 600; }
.v3-explorer-page-gap { border-color: transparent; background: transparent; color: var(--faint); }

/* --- desktop: full-width band above b), max 50vh, not sticky ------------- */
@media (min-width: 901px) {
  .v3-shell > .v3-body { grid-template-columns: minmax(0, 1fr); }
  .v3-shell > .v3-body > #v3-explorer {
    position: static;
    align-self: stretch;
    height: auto;
    max-height: 50vh;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px clamp(16px, 2.4vw, 34px) 10px;
    display: block;
    background: linear-gradient(180deg, var(--gold-bg) 0%, transparent 62%);
  }
  #v3-explorer .v3-explorer-band {
    display: flex;
    flex-direction: column;
    max-height: calc(50vh - 20px);
    min-height: 0;
    overflow: hidden;
  }
  #v3-explorer .v3-explorer-band-body {
    flex: 1 1 0;
    min-height: 0;
    /* Chrome wraps <details> content in an anonymous slot, so the flex child
       does not reliably shrink to the band max-height; cap it explicitly. */
    max-height: calc(50vh - 56px);
  }
  #v3-explorer .v3-explorer-summary { padding: 2px 2px 8px; }
  #v3-explorer .v3-explorer-band-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "back back"
      "search filters"
      "tiles tiles"
      "pagination pagination";
    column-gap: 20px;
    row-gap: 10px;
    align-items: start;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    padding: 2px 2px 14px;
    -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 26px), transparent 100%);
    mask-image: linear-gradient(180deg, #000 calc(100% - 26px), transparent 100%);
  }
  #v3-explorer .v3-explorer-band:not([open]) > .v3-explorer-band-body { display: none; }
  #v3-explorer .v3-explorer-band-body {
    scrollbar-width: none;
  }
  #v3-explorer .v3-explorer-band-body::-webkit-scrollbar { width: 0; height: 0; }
  #v3-explorer .v3-explorer-search { grid-area: search; margin: 0; }
  #v3-explorer .v3-explorer-tiles { grid-area: tiles; }
  #v3-explorer .v3-explorer-pagination { grid-area: pagination; margin: 0; }
  #v3-explorer .v3-explorer-filters { grid-area: filters; }
  .v3-shell > .v3-body > #v3-content { grid-column: 1 / -1; }
}

@media (min-width: 901px) and (max-width: 1179px) {
  #v3-explorer .v3-explorer-band-body { column-gap: 16px; }
}

/* --- <=900px: stacked no-JS block, and the full-screen sheet ------------- */
@media (max-width: 900px) {
  #v3-explorer .v3-explorer-band { display: block; max-height: none; }
  #v3-explorer .v3-explorer-summary { min-height: 44px; padding: 2px; }
  #v3-explorer .v3-explorer-summary h2 { font-size: var(--fs-title); }
  #v3-explorer .v3-explorer-blurb { display: none; }
  #v3-explorer .v3-explorer-band-body { display: block; padding: 2px 0 6px; }
  #v3-explorer .v3-explorer-band:not([open]) > .v3-explorer-band-body { display: none; }
  #v3-explorer .v3-explorer-way { margin: 0 0 10px; }
  #v3-explorer .v3-explorer-filters { margin-top: 10px; }
  #v3-explorer .v3-explorer-pagination { margin-top: 8px; }
}

/* --- open mobile sheet: tabs replace the summary, all sections reachable -- */
@media (max-width: 900px) {
  html[data-shell="v3"][data-v3-sheet-ready="true"][data-v3-sheet-open="true"] #v3-explorer .v3-explorer-summary { display: none; }
  html[data-shell="v3"][data-v3-sheet-ready="true"][data-v3-sheet-open="true"] #v3-explorer .v3-explorer-band > .v3-explorer-band-body {
    display: block;
  }
  /* A remembered collapse must not hide the sheet's only content: the sheet is
     opened deliberately, and the tab strip is the sheet's own control. */
  html[data-shell="v3"][data-v3-sheet-ready="true"][data-v3-sheet-open="true"] #v3-explorer .v3-explorer-band:not([open]) > .v3-explorer-band-body {
    display: block;
  }
  html[data-shell="v3"][data-v3-sheet-ready="true"][data-v3-sheet-open="true"] .v3-explorer-search { display: block; margin: 4px 0 10px; }
}

/* ==========================================================================
   Operator corrections (#663): painterly art behind the page and banner.
   ========================================================================== */
html[data-shell="v3"] { background: var(--bg); }
html[data-shell="v3"] body { background: transparent; }
.v3-shell > .v3-body { background: linear-gradient(180deg, rgba(4, 7, 11, .84), rgba(4, 7, 11, .92)); }
.v3-page-art {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("/static/scenes/tree-return-desktop-4k.webp") center / cover no-repeat;
  opacity: .38;
  filter: brightness(.75) saturate(.85);
}
/* Page-wide mask: same parameters as the former a) Realms band mask. */
.v3-page-mask {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: rgba(10, 13, 16, .145);
}
html[data-shell="v3"] .v3-banner {
  background:
    linear-gradient(180deg, rgba(5, 8, 12, .80), rgba(5, 8, 12, .92)),
    url("/static/scenes/tree-return-desktop-4k.webp") center 38% / cover no-repeat,
    var(--bg-rail);
}
@media (prefers-contrast: more), (forced-colors: active) {
  .v3-page-art { display: none; }
  html[data-shell="v3"] .v3-banner { background: var(--bg-rail); }
}

/* Operator corrections (#663): art-cast easter eggs in a few page corners. */
.v3-eggs { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.v3-egg { position: fixed; width: 46px; height: auto; opacity: .55; filter: saturate(.9); }
.v3-egg--herald { left: 12px; bottom: 16%; width: 34px; opacity: .42; }
.v3-egg--lantern { right: 12px; top: 42%; width: 32px; opacity: .38; }
.v3-egg--nib { left: 16px; top: 48%; width: 30px; opacity: .35; }
.v3-egg--wai { right: 16px; bottom: 10px; width: 38px; opacity: .42; }
@media (max-width: 720px) {
  .v3-eggs { display: none; }
  .v3-page-art { background-image: url("/static/scenes/tree-return-phone-hi.webp"); opacity: .52; }
}
@media (prefers-reduced-motion: no-preference) {
  .v3-egg--lantern { animation: v3-egg-bob 6s ease-in-out infinite; }
  .v3-egg--wai { animation: v3-egg-bob 7.5s ease-in-out infinite; }
}
@keyframes v3-egg-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@media (prefers-contrast: more), (forced-colors: active) { .v3-eggs { display: none; } }
/* On a realm's page: Back, and beside it the path to the realm. The top bar
   carries no path, so it is the same on every page. */
.v3-explorer-way {
  grid-area: back;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin: 0 0 6px;
}
.v3-explorer-back {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink-2);
  font-size: 11px;
}
.v3-explorer-back:hover { color: var(--gold-bright); border-color: var(--line-2); text-decoration: none; }

/* The top bar is the same on every page (the operator, #663 follow-up and
   2026-11-15): logo left, search centred, account right. Nothing in it says
   where you are; a realm's path sits beside Back in the Realms band. Each part
   names its column, so the account links stay right where the search is
   hidden (sign-in pages). */
/* A short page has no scrollbar and a long one has: without a reserved gutter
   the account links sit 15px further right on the short one. */
html[data-shell="v3"] { scrollbar-gutter: stable; }
html[data-shell="v3"] .v3-topbar-main {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 420px) 1fr;
  gap: 16px;
}
html[data-shell="v3"] .v3-logo { grid-column: 1; justify-self: start; }
html[data-shell="v3"] .v3-search { grid-column: 2; justify-self: center; width: 100%; flex: none; }
html[data-shell="v3"] .v3-actions { grid-column: 3; justify-self: end; margin-left: 0; }
/* Below 900px the shell's own topbar takes over again: logo and actions on one
   row, search on the next. The three-column grid above cannot coexist with the
   mobile `order` values (logo 1, actions 2, search 3): the actions fell into
   the collapsing middle column, landed on top of the logo and pushed the
   "Browse realms" toggle off the left edge of the screen. */
@media (max-width: 900px) {
  html[data-shell="v3"] .v3-topbar-main { display: flex; }
  html[data-shell="v3"] .v3-search { width: auto; flex: 1 0 100%; }
  html[data-shell="v3"] .v3-actions { margin-left: auto; }
}

/* ==========================================================================
   Stage proposal (#663 follow-up): brighter scene, bottom banner, chevron
   expand handle at the bottom of the Realms band. (Its hero is gone: the
   operator, 2026-11-15.)
   ========================================================================== */

/* Banner lives at the bottom of the page now, just above the footer. */
html[data-shell="v3"] .v3-banner { border-top: 1px solid var(--line); border-bottom: 0; }

/* Realms band: no top toggle text, chevron handle at the bottom centre. */
.v3-explorer-band { position: relative; }
.v3-explorer-band[open] > .v3-explorer-band-body { padding-bottom: 34px; }
.v3-explorer-band[open] .v3-explorer-summary-toggle {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  z-index: 4;
  width: 44px;
  height: 24px;
  padding: 0;
  justify-content: center;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(7, 11, 16, .72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.v3-explorer-band:not([open]) .v3-explorer-summary-toggle { margin-left: auto; }

/* Scene is brighter; surfaces are semi-transparent so the tree reads through. */
.v3-page-art { opacity: .52; filter: brightness(.86) saturate(.9); }
.v3-shell > .v3-body { background: linear-gradient(180deg, rgba(4, 7, 11, .68), rgba(4, 7, 11, .84)); }
.v3-pane .v3-card { background: rgba(10, 16, 22, .82); }


.v3-explorer-toggle-label { display: none !important; }

/* Light theme parity for the stage home: light paper background, readable
   featured card, and light controls. The dark reference remains the default. */
html[data-theme="light"] .v3-page-art { opacity: .20; filter: brightness(1.15) saturate(.82); }
html[data-theme="light"] .v3-shell > .v3-body {
  background: linear-gradient(180deg, rgba(245, 243, 238, .80), rgba(245, 243, 238, .94));
}
html[data-theme="light"] .v3-banner {
  background:
    linear-gradient(180deg, rgba(245, 243, 238, .83), rgba(239, 237, 231, .94)),
    url("/static/scenes/tree-return-desktop-4k.webp") center 38% / cover no-repeat,
    var(--bg-rail);
}
html[data-theme="light"] .v3-explorer-band[open] .v3-explorer-summary-toggle { background: rgba(255, 255, 255, .7); }

/* Reference parity: the display face is the warm serif, not Space Grotesk. */
html[data-shell="v3"] {
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}
/* Dark reference keeps the scene subdued behind the page. */
html[data-shell="v3"]:not([data-theme="light"]) .v3-page-art { opacity: .42; filter: brightness(.82) saturate(.86); }
html[data-shell="v3"]:not([data-theme="light"]) .v3-shell > .v3-body {
  background: linear-gradient(180deg, rgba(4, 7, 11, .78), rgba(4, 7, 11, .90));
}

/* Light profile in the operator references is "lighter scene, dark surfaces",
   not an inverted paper theme. Scope this to the home page. */
html[data-theme="light"] body[data-mode="explore-home"] {
  --bg: #0a0d12;
  --bg-deep: #05080c;
  --bg-rail: #0b0f14;
  --panel: #10151b;
  --panel-2: #141a21;
  --panel-3: #1a2129;
  --panel-4: #202832;
  --line: #26313b;
  --line-2: #33404b;
  --line-3: #424f5a;
  --ink: #e9edf1;
  --ink-2: #c2ccd4;
  --ink-3: #8c99a4;
  --faint: #798691;
  --gold: #d8bd83;
  --gold-bright: #ead3a2;
  --gold-dim: #a98c4e;
  --gold-line: #5a4a2b;
  --gold-bg: #1a160e;
  --accent: #9fc7e6;
  background: transparent;
}
html[data-theme="light"] body[data-mode="explore-home"] .v3-banner { border-top-color: var(--line); }
html[data-theme="light"] body[data-mode="explore-home"] .v3-explorer-band[open] .v3-explorer-summary-toggle { background: rgba(7, 11, 16, .72); }
html[data-theme="light"] body[data-mode="explore-home"] {
  --bg: #171c21;
  --bg-deep: #0f1317;
  --bg-rail: #171b20;
}

/* Warm reference palette for the home surface (both profiles). */
html[data-shell="v3"] body[data-mode="explore-home"] {
  --bg: #070a0d;
  --bg-deep: #040608;
  --bg-rail: #080b0e;
  --panel: #0f1216;
  --panel-2: #14181d;
  --panel-3: #1a1f25;
  --panel-4: #20262d;
  --line: #232b33;
  --line-2: #303944;
  --line-3: #3f4a55;
  --ink: #f0e9dd;
  --ink-2: #c9c2b7;
  --ink-3: #948e83;
  --faint: #878178; /* 4.9 to 1 on --panel, 4.6 on --panel-2; #7e786f measured 4.3 and 4.1 */
  --gold: #d8bd83;
  --gold-bright: #ead3a2;
  --gold-dim: #a98c4e;
  --gold-line: #5a4a2b;
  --gold-bg: #1a160e;
  --accent: #9fc7e6;
}
html[data-theme="light"] body[data-mode="explore-home"] .v3-pane-head,
html[data-theme="light"] body[data-mode="explore-home"] .v3-pane-rail,
html[data-theme="light"] body[data-mode="explore-home"] .v3-pane-side {
  text-shadow: 0 1px 2px rgba(0, 0, 0, .55);
}

/* ==========================================================================
   Home backdrop: the contour-first tree (scripts/gen-contour-art.py).

   The scene is drawn from the tree's vector source as glass panes with lit
   rims, so it is authored at its final strength: no opacity or filter here,
   and the surfaces above it stay translucent enough for the rims to read.
   Two layers: the scene, and a "second exposure" of the canopy on ::after
   that drifts very slowly against it (compositor-only transform).
   Profiles: dark = night, transparent sky over the page colour; the home
   "light" profile = grey daylight haze with its own painted sky.
   Scoped to the home page; other v3 pages keep the raster scene above.
   ========================================================================== */
html[data-shell="v3"] body[data-mode="explore-home"] .v3-page-art {
  background: url("/static/art/contour/tree-dark.svg") center top / cover no-repeat;
  opacity: 1;
  filter: none;
}
html[data-shell="v3"] body[data-mode="explore-home"] .v3-page-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/static/art/contour/tree-dark-ghost.svg") center top / cover no-repeat;
  transform-origin: 50% 30%;
}
html[data-theme="light"] body[data-mode="explore-home"] .v3-page-art {
  background-color: #7a828b;
  background-image: url("/static/art/contour/tree-mist.svg");
}
html[data-theme="light"] body[data-mode="explore-home"] .v3-page-art::after {
  background-image: url("/static/art/contour/tree-mist-ghost.svg");
}
@media (prefers-reduced-motion: no-preference) {
  html[data-shell="v3"] body[data-mode="explore-home"] .v3-page-art::after {
    will-change: transform;
    animation: v3-art-exposure 70s ease-in-out infinite alternate;
  }
}
@keyframes v3-art-exposure {
  from { transform: scale(.985) translate3d(-.3%, .15%, 0); }
  to { transform: scale(1.03) translate3d(.35%, -.25%, 0); }
}
/* Phones crop to the centre of the frame; nudge the tree back under it. The
   large-viewport unit stops the scene rescaling when mobile browser chrome
   slides away. */
@media (max-width: 720px) {
  html[data-shell="v3"] body[data-mode="explore-home"] .v3-page-art,
  html[data-shell="v3"] body[data-mode="explore-home"] .v3-page-art::after { background-position: 38% top; }
}
@supports (height: 100lvh) {
  html[data-shell="v3"] body[data-mode="explore-home"] .v3-page-art { bottom: auto; height: 100lvh; }
}

/* Surfaces fade in over the scene instead of cutting it off at the hero's
   lower edge, and settle at a density where the rims still read in the
   gutters between panels.
   The main scrim is a full-bleed layer behind the body column (the column is
   capped at 1580px; a scrim clipped to it left bright gutters on wide
   screens). It has two parts: a corner glow that carries the hero's
   left-weighted veil across the boundary and lets it die away downward (its
   stops are the veil's stops rescaled to the 64% radius, and both are
   measured against the viewport, so the two meet without a seam at any
   width), and a vertical ramp that starts from nothing.
   The Realms band and the content pane then add only a light tint of their
   own: the pane a little more, because that is where lists are read and the
   moon should not glow through the toolbar's small type. */
html[data-shell="v3"] body[data-mode="explore-home"] .v3-shell > .v3-body { position: relative; }
html[data-shell="v3"]:not([data-theme="light"]) body[data-mode="explore-home"] .v3-shell > .v3-body,
html[data-theme="light"] body[data-mode="explore-home"] .v3-shell > .v3-body { background: none; }
html[data-shell="v3"] body[data-mode="explore-home"] .v3-shell > .v3-body::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 50vw);
  width: 100vw;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(64% 130px at 0 0, rgba(5, 7, 10, .88) 0, rgba(5, 7, 10, .78) 40.6%, rgba(5, 7, 10, .46) 72%, rgba(5, 7, 10, 0) 100%) no-repeat,
    linear-gradient(180deg, rgba(4, 6, 9, 0) 0, rgba(4, 6, 9, .48) 70px, rgba(4, 6, 9, .70) 260px, rgba(4, 6, 9, .74) 100%);
}
html[data-theme="light"] body[data-mode="explore-home"] .v3-shell > .v3-body::before {
  background:
    radial-gradient(64% 130px at 0 0, rgba(16, 21, 27, .80) 0, rgba(16, 21, 27, .70) 40.6%, rgba(16, 21, 27, .50) 72%, rgba(16, 21, 27, 0) 100%) no-repeat,
    linear-gradient(180deg, rgba(24, 30, 36, 0) 0, rgba(24, 30, 36, .46) 70px, rgba(22, 28, 34, .66) 260px, rgba(18, 23, 28, .72) 100%);
}
html[data-shell="v3"] body[data-mode="explore-home"] #v3-explorer {
  background: linear-gradient(180deg, rgba(10, 13, 16, 0) 0, rgba(10, 13, 16, .10) 70px, rgba(10, 13, 16, .16) 170px);
}
html[data-theme="light"] body[data-mode="explore-home"] #v3-explorer {
  background: linear-gradient(180deg, rgba(18, 23, 28, 0) 0, rgba(18, 23, 28, .12) 70px, rgba(18, 23, 28, .20) 170px);
}
html[data-shell="v3"] body[data-mode="explore-home"] #v3-content { background: rgba(5, 8, 11, .28); }
html[data-theme="light"] body[data-mode="explore-home"] #v3-content { background: rgba(10, 14, 18, .34); }
@media (prefers-contrast: more), (forced-colors: active) {
  html[data-shell="v3"] body[data-mode="explore-home"] .v3-shell > .v3-body::before { background: var(--bg); }
}
/* The closing banner used its own crop of the raster scene. It is now a
   window onto the fixed backdrop, like every other surface on the page. */
html[data-shell="v3"] body[data-mode="explore-home"] .v3-banner {
  background: linear-gradient(180deg, rgba(5, 8, 12, .74), rgba(5, 8, 12, .88));
}
html[data-theme="light"] body[data-mode="explore-home"] .v3-banner {
  background: linear-gradient(180deg, rgba(14, 18, 23, .74), rgba(10, 14, 18, .88));
}
@media (prefers-contrast: more), (forced-colors: active) {
  html[data-shell="v3"] body[data-mode="explore-home"] .v3-banner { background: var(--bg-rail); }
}

/* Realms band layout (desktop): one row of controls, then the tiles.

     [ back ] path / to / this realm          (a realm's page only)
     [ search ]                  [ sort | kind | per page ]
     [ tiles .............................................. ]

   The filters were a 250px rail on the right. They are now a toolbar on the
   search row, drawn like the content pane's toolbar, and the tiles take the
   width the rail used. The toolbar's column is `auto`, so it claims one line
   whenever one line fits and the search field gives way first.
   There is no side column: the path it held sits beside Back. The ordered
   love/hate list is meant to live at the side of the tiles and brings its
   column with it when it is built.
   The tile minimum is a little lower than elsewhere so the width becomes
   more tiles per row rather than taller tiles: the band is capped at 50vh,
   and taller tiles push its second row into an internal scroll on laptops.
   The toolbar still follows the tiles in the markup. `reading-flow` makes
   keyboard order follow the visual rows where it is supported. */
@media (min-width: 901px) {
  #v3-explorer .v3-explorer-band-body { reading-flow: grid-rows; }
  #v3-explorer .v3-explorer-search { max-width: 360px; }
  #v3-explorer .v3-explorer-band-body .v3-folder-grid { --v3-folder-min: 124px; }

  #v3-explorer .v3-explorer-filters {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    align-self: center;
    justify-content: flex-end;
    gap: 6px 16px;
  }
  #v3-explorer .v3-explorer-filters > nav { display: flex; align-items: center; gap: 7px; min-width: 0; }
  #v3-explorer .v3-explorer-filter-label {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 8.5px;
    font-weight: 400;
    letter-spacing: .14em;
    color: var(--ink); /* over the brightest part of the scene, 8.5px in the next ink down measured 4.3:1 */
    white-space: nowrap;
  }
  #v3-explorer .v3-explorer-filter-list {
    gap: 1px;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel);
  }
  #v3-explorer .v3-explorer-sort,
  #v3-explorer .v3-explorer-kind,
  #v3-explorer .v3-explorer-per {
    padding: 3px 8px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    font-size: 11px;
  }
  #v3-explorer .v3-explorer-per { min-width: 29px; justify-content: center; padding: 3px 6px; font-family: var(--font-mono); font-size: 10.5px; }
  #v3-explorer .v3-explorer-sort:hover,
  #v3-explorer .v3-explorer-kind:hover,
  #v3-explorer .v3-explorer-per:hover { background: var(--panel-2); color: var(--ink); }
  #v3-explorer .v3-explorer-sort[aria-current="true"] {
    background: var(--gold-bg);
    color: var(--gold);
    box-shadow: inset 0 0 0 1px var(--gold-line);
  }
  #v3-explorer .v3-explorer-kind[aria-current="true"],
  #v3-explorer .v3-explorer-per[aria-current="true"] {
    background: var(--panel-3);
    color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--line-2);
  }

  /* The scroll indicator is appended to #v3-explorer and positioned from its
     top edge, but the band was `position: static` here, so the indicator was
     anchored to the whole shell and drew beside the topbar instead of beside
     the tiles. `top: auto` cancels the sticky rail's offset, which `static`
     had been ignoring and `relative` would apply as a 56px shift. */
  .v3-shell > .v3-body > #v3-explorer { position: relative; top: auto; }
}
@media (min-width: 901px) and (max-width: 1179px) {
  /* a little tighter, so the toolbar still fits on one line at 1024 */
  #v3-explorer .v3-explorer-filters { gap: 6px 12px; }
  #v3-explorer .v3-explorer-sort,
  #v3-explorer .v3-explorer-kind { padding: 3px 7px; }
  /* eight tiles per row at 1024, so two rows fit under the 50vh cap */
  #v3-explorer .v3-explorer-band-body .v3-folder-grid { --v3-folder-min: 108px; }
}

/* Corner sprites: their files carry an opaque near-black tile, which showed as
   a box on the lighter profile and, sitting above the content, covered text
   (the banner's first word, the footer's last). A lighten blend drops the tile
   on any backdrop (it keeps whichever of sprite and page is brighter, so a
   near-black tile never wins; screen would lift it into a faint box), and the
   sprites move behind the content so one can only ever peek out of a gutter.
   The wrapper stops being a stacking context so each sprite blends with the
   page over its own few pixels, not as one viewport-sized group. Brighter to
   compensate for the surfaces above. */
html[data-shell="v3"] body[data-mode="explore-home"] .v3-eggs { position: static; z-index: auto; }
html[data-shell="v3"] body[data-mode="explore-home"] .v3-egg {
  z-index: -1;
  mix-blend-mode: lighten;
  opacity: .9;
  filter: none;
}


/* Stage experiment: ?clear=1 — remove page-wide dark scrims.
   Keeps the shell/forms readable; only full-page shade layers are removed. */
html[data-v3-clear-mask="1"] .v3-page-art {
  opacity: 1 !important;
  filter: none !important;
  background-image: url("/static/scenes/tree-return-desktop-4k.webp") !important;
}
html[data-v3-clear-mask="1"] .v3-shell > .v3-body {
  background: transparent !important;
}
html[data-v3-clear-mask="1"] .v3-banner {
  background:
    url("/static/scenes/tree-return-desktop-4k.webp") center 38% / cover no-repeat,
    var(--bg-rail) !important;
}
@media (max-width: 720px) {
  html[data-v3-clear-mask="1"] .v3-page-art {
    background-image: url("/static/scenes/tree-return-phone-hi.webp") !important;
  }
}

/* ?clear=1 on the home page. Two things the rules above get wrong there:
   they force the raster tree back onto .v3-page-art and the banner, and they
   do not reach the contour scene's veils and tints, which live on
   pseudo-elements and on the band/pane/banner themselves. Keep the contour
   scene and remove its veils, so it is the home scene that is inspected bare.
   `!important` only because the rules above use it. */
html[data-v3-clear-mask="1"] body[data-mode="explore-home"] .v3-page-art {
  background-image: url("/static/art/contour/tree-dark.svg") !important;
}
html[data-v3-clear-mask="1"][data-theme="light"] body[data-mode="explore-home"] .v3-page-art {
  background-image: url("/static/art/contour/tree-mist.svg") !important;
}

html[data-v3-clear-mask="1"] body[data-mode="explore-home"] .v3-shell > .v3-body::before { display: none; }
html[data-v3-clear-mask="1"] body[data-mode="explore-home"] #v3-explorer,
html[data-v3-clear-mask="1"] body[data-mode="explore-home"] #v3-content { background: transparent; }
html[data-v3-clear-mask="1"] body[data-mode="explore-home"] .v3-banner { background: transparent !important; }

/* Page-wide replacement for the a) Realms band mask (same flat black params). */
html[data-shell="v3"] body[data-mode="explore-home"] .v3-page-mask {
  background: rgba(10, 13, 16, .145) !important;
}
html[data-shell="v3"] body[data-mode="explore-home"] .v3-shell > .v3-body::before {
  display: none !important;
}
html[data-shell="v3"] body[data-mode="explore-home"] #v3-explorer,
html[data-theme="light"] body[data-mode="explore-home"] #v3-explorer {
  background: transparent !important;
}
html[data-v3-clear-mask="1"] .v3-page-mask { display: none !important; }

/* Restore the raster scene on the home backdrop (the contour-first backdrop
   experiment is opt-out here), then keep the flat page-wide mask on top. */
html[data-shell="v3"] body[data-mode="explore-home"] .v3-page-art {
  background-image: url("/static/scenes/tree-return-desktop-4k.webp") !important;
  background-position: center top !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  opacity: .34 !important;
  filter: brightness(.64) saturate(.68) sepia(.10) !important;
}
html[data-shell="v3"] body[data-mode="explore-home"] .v3-page-art::after {
  display: none !important;
}
html[data-shell="v3"] body[data-mode="explore-home"] .v3-banner {
  background:
    linear-gradient(180deg, rgba(5, 8, 12, .80), rgba(5, 8, 12, .92)),
    url("/static/scenes/tree-return-desktop-4k.webp") center 38% / cover no-repeat,
    var(--bg-rail) !important;
}
@media (max-width: 720px) {
  html[data-shell="v3"] body[data-mode="explore-home"] .v3-page-art {
    background-image: url("/static/scenes/tree-return-phone-hi.webp") !important;
  }
}

/* The visible shade was mostly the page-art opacity/filter, not the mask.
   Raise the art so a lightened page mask actually reads. */
html[data-shell="v3"] body[data-mode="explore-home"] .v3-page-art {
  opacity: .60 !important;
  filter: brightness(.90) saturate(.85) !important;
}

/* Remove the decorative Realms expand/collapse handle. The summary row stays
   natively clickable, so keyboard/mouse disclosure still works without it. */
html[data-shell="v3"] .v3-explorer-band[open] .v3-explorer-summary-toggle,
html[data-shell="v3"] .v3-explorer-band:not([open]) .v3-explorer-summary-toggle {
  display: none !important;
}
html[data-shell="v3"] .v3-explorer-band[open] > .v3-explorer-band-body {
  padding-bottom: 14px;
}

/* ==========================================================================
   The main page's hero: "Make a wish on anything" and the way to do it
   (official/site/structure.md). Only on `/`, between the top bar and the realms.
   ========================================================================== */
html[data-shell="v3"] .v3-hero {
  position: relative;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(900px 220px at 18% 0%, rgba(232, 201, 135, 0.14), transparent 70%),
    linear-gradient(180deg, rgba(6, 8, 11, 0.86), rgba(6, 8, 11, 0.72));
}
html[data-shell="v3"] .v3-hero-inner {
  max-width: 1580px;
  margin: 0 auto;
  padding: 26px 32px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  flex-wrap: wrap;
}
html[data-shell="v3"] .v3-hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
}
html[data-shell="v3"] .v3-hero-go { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
html[data-shell="v3"] .v3-hero-button {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 26px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: var(--gold);
  color: #17130A;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}
html[data-shell="v3"] .v3-hero-button:hover { border-color: var(--gold-bright); background: var(--gold-bright); color: #17130A; text-decoration: none; }
html[data-shell="v3"] .v3-hero-button:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; }
html[data-shell="v3"] .v3-hero-note { font-size: 13px; color: var(--ink-2); }
html[data-theme="light"] body[data-mode="explore-home"] .v3-hero { background: linear-gradient(180deg, rgba(10, 13, 18, 0.88), rgba(10, 13, 18, 0.76)); }
@media (max-width: 640px) {
  html[data-shell="v3"] .v3-hero-inner { padding: 18px 16px 16px; }
  html[data-shell="v3"] .v3-hero-title { font-size: 26px; }
  html[data-shell="v3"] .v3-hero-go { width: 100%; }
}
