/* ── FONTS — VENDORED woff2 (public/fonts/, latin incl. accents FR), zero npm
   dependency, CSP font-src 'self'. M5 direction (validated 2026-07-17, option A):
   Archivo = body (signage DNA — drunk-proof), Archivo Black = signature display,
   Martian Mono = the measured voice (codes/times/offsets). OFL licensed. */
@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo-vf-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Archivo Black';
  src: url('/fonts/archivo-black-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Martian Mono';
  src: url('/fonts/martian-mono-vf-latin.woff2') format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* SURFACES — glass on night (premium redesign 2026-07-13): the page is a deep
     gradient, surfaces are translucent VEILS (blur), no flat grey boxes. */
  /* M5 (2026-07-17): the night turns VIOLET — no factory grey left, every
     neutral is biased toward Majorelle. The radio lives at night. */
  --bg:        #0e0d16;   /* broadcast night — violet bias */
  --bg-elev:   #131020;
  --paper:     rgb(255 255 255 / 4%);   /* glass: a light veil over the night */
  --card:      rgb(255 255 255 / 4%);
  --field-bg:  rgb(255 255 255 / 6%);
  --voile-2:   rgb(255 255 255 / 6.5%);   /* one step more visible (neutral control grounds) */
  /* TEXT — violet-biased inks, contrast held on the new night */
  --fg:        #f2f0fa;
  --muted:     #b9b4d6;   /* 9.3:1 on --bg — AAA */
  /* --muted-2: the 4.5:1 floor for every quiet text (hints, queue labels,
     placeholders, sub-items). */
  --muted-2:   #918bb0;   /* 5.2:1 on --bg — AA */
  /* BORDERS — luminous hairlines, not grey strokes */
  --border:       1px solid rgb(255 255 255 / 9%);
  --border-soft:  1px solid rgb(255 255 255 / 6%);
  --hairline:     rgb(255 255 255 / 9%);
  /* ACCENT — the signature Majorelle blue (the live, the Wave). The one color
     that carries the brand. `-bright` is LIGHTENED (periwinkle) so small
     text/icons hold contrast on night; `-ink` (near-white) is the readable
     ink ON a solid accent ground. */
  --accent:        #6050dc;   /* accent CTA grounds / fills */
  --accent-bright: #8b7cff;   /* 7.4:1 on --bg — accent text/icon */
  --accent-dim:    #4c3fbf;
  --accent-soft:   rgb(96 80 220 / 22%);
  --accent-ink:    #f4f2ff;   /* 8.9:1 on --accent — text on accent ground */
  /* Primary PILL: pure white on night — the premium CTA */
  --pill:     #fafafa;
  --pill-fg:  #09090b;
  /* SEMANTIC STATE */
  --ok:    #4ade80;
  --warn:  #fbbf24;
  --err:   #f87171;
  --red:   #7f1d1d;
  /* Remaining CONSTANTS: every literal outside :root joined the source.
     Alpha of a token = color-mix, never a raw rgba. */
  --ink:        #000;      /* black of veils/shadows (color-mix) */
  --qr-bg:      #ffffff;   /* QR quiet-zone: scanner white, not themable */
  --bg-vault:   #171425;   /* vault of the body gradient — night violet */
  --bg-sheet:   #141221;   /* dialogs / menus ground */
  /* Disabled = a LIGHT state, not an invisible one (#737373/#262626 = 3.1:1 failed). */
  --disabled-bg: #2b2838;
  --disabled-fg: #9d97ba;   /* 5.2:1 on --disabled-bg — AA */
  --danger-fg:  #fecaca;   /* danger button ink (on --danger-bg) */
  --danger-bg:  #4c1420;   /* danger button ground (on violet night) */
  --track-bg:   #262336;   /* progress track */
  --dot-idle:   #3d3950;
  --hairline-strong: #3a3650;
  /* ON AIR — the system's ONLY broadcast red (D2): the lamp and its pulsing
     ring. Semantic, never decorative — do not reuse elsewhere. */
  --onair: #ff5a60;
  /* Nickname chip palette (identity.ts consumes it via var(--nick-N)) */
  --nick-0: #ec4899;
  --nick-1: #a5f3fc;
  --nick-2: #86efac;
  --nick-3: #fdba74;
  /* RADII — the artifact scale: s=8 (chips, QR), m=14 (tiles, fields, CTA),
     l=22 (cards/screens). Generous, broadcast-console round. */
  --radius:      22px;
  --radius-sm:   14px;
  --radius-xs:   8px;
  --radius-pill: 999px;
  /* SHADOWS + GLOW */
  --shadow:         0 24px 60px -18px rgb(0 0 0 / 70%), 0 6px 18px -6px rgb(0 0 0 / 50%);
  --shadow-sm:      0 6px 20px -8px rgb(0 0 0 / 55%);
  --shadow-pressed: 0 1px 4px rgb(0 0 0 / 60%);
  --glow:           0 10px 32px -6px rgb(250 250 250 / 22%);
  --glow-accent:    0 0 0 5px rgb(96 80 220 / 34%);
  /* FOCUS — a visible ring, lifted off the ground, on EVERYTHING that takes
     keyboard focus. No `outline:none` without a replacement. */
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-bright);
  --scheme: dark;
  /* Tactile SPRING (control transforms) */
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  /* FONTS — self-hosted (fontsource, imported by Layout.astro). M5 direction
     (validated 2026-07-17, option A): Archivo = body (signage DNA — open counters,
     tall x-height, unambiguous I/l/1: drunk-proof), Archivo Black = the signature
     display voice (broadcast cartouche), Martian Mono = the "measured" voice
     (codes, times, offsets — a tuner frequency readout). */
  --font-sans: 'Archivo', -apple-system, system-ui, sans-serif;
  --font-mono: 'Martian Mono', ui-monospace, SFMono-Regular, monospace;
  --font-display: 'Archivo Black', 'Archivo', system-ui, sans-serif;

  /* Spacing scale (steady vertical rhythm) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  /* Type scale — the artifact's compact measure: notes 14, body 15, CTA 16,
     np-title 22, display 28. Compact, not squinting. */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 15px;
  --text-lg: 16px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --text-code: 26px;
}


/* ── DAY THEME (M5/D4) — "cold paper": a deliberate DAY counterpart (bike in
   full sun), not a naive inversion. The glass flips: INK veils on paper; the
   premium CTA goes from white-on-night to ink-on-paper; semantics darken to
   hold AA on light. Night stays the default; a light OS switches it (media
   query), the toggle (data-theme) has the last word. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:        #f7f6fb;
    --bg-elev:   #ffffff;
    --paper:     rgb(26 24 48 / 4%);
    --card:      rgb(26 24 48 / 4%);
    --field-bg:  rgb(26 24 48 / 5%);
    --voile-2:   rgb(26 24 48 / 6.5%);
    --fg:        #1a1830;
    --muted:     #4a4766;   /* 8.9:1 — AAA */
    --muted-2:   #706c8f;   /* 4.6:1 — AA */
    --border:       1px solid rgb(26 24 48 / 12%);
    --border-soft:  1px solid rgb(26 24 48 / 8%);
    --hairline:     rgb(26 24 48 / 12%);
    --accent-bright: #4f41c6;  /* accent ink: 6.8:1 on paper */
    --accent-soft:   rgb(96 80 220 / 14%);
    --pill:     #1a1830;
    --pill-fg:  #f7f6fb;
    --ok:    #1f8a55;
    --warn:  #a16207;
    --err:   #dc2626;
    --bg-vault:   #efedf8;
    --bg-sheet:   #ffffff;
    --disabled-bg: #e4e1f0;
    --disabled-fg: #5d5880;
    --danger-fg:  #7f1d1d;
    --danger-bg:  #fee2e2;
    --track-bg:   #ddd9ec;
    --dot-idle:   #c4c0d8;
    --hairline-strong: #c9c5de;
    --onair: #e5484d;
    --shadow:         0 12px 32px -12px rgb(26 24 48 / 18%), 0 3px 10px -4px rgb(26 24 48 / 10%);
    --shadow-sm:      0 4px 14px -6px rgb(26 24 48 / 14%);
    --shadow-pressed: 0 1px 3px rgb(26 24 48 / 18%);
    --glow:           0 10px 32px -6px rgb(26 24 48 / 14%);
    --glow-accent:    0 0 0 5px rgb(96 80 220 / 22%);
    --scheme: light;
  }
}
:root[data-theme="light"] {
  --bg:        #f7f6fb;
  --bg-elev:   #ffffff;
  --paper:     rgb(26 24 48 / 4%);
  --card:      rgb(26 24 48 / 4%);
  --field-bg:  rgb(26 24 48 / 5%);
  --voile-2:   rgb(26 24 48 / 6.5%);
  --fg:        #1a1830;
  --muted:     #4a4766;
  --muted-2:   #706c8f;
  --border:       1px solid rgb(26 24 48 / 12%);
  --border-soft:  1px solid rgb(26 24 48 / 8%);
  --hairline:     rgb(26 24 48 / 12%);
  --accent-bright: #4f41c6;
  --accent-soft:   rgb(96 80 220 / 14%);
  --pill:     #1a1830;
  --pill-fg:  #f7f6fb;
  --ok:    #1f8a55;
  --warn:  #a16207;
  --err:   #dc2626;
  --bg-vault:   #efedf8;
  --bg-sheet:   #ffffff;
  --disabled-bg: #e4e1f0;
  --disabled-fg: #5d5880;
  --danger-fg:  #7f1d1d;
  --danger-bg:  #fee2e2;
  --track-bg:   #ddd9ec;
  --dot-idle:   #c4c0d8;
  --hairline-strong: #c9c5de;
  --onair: #e5484d;
  --shadow:         0 12px 32px -12px rgb(26 24 48 / 18%), 0 3px 10px -4px rgb(26 24 48 / 10%);
  --shadow-sm:      0 4px 14px -6px rgb(26 24 48 / 14%);
  --shadow-pressed: 0 1px 3px rgb(26 24 48 / 18%);
  --glow:           0 10px 32px -6px rgb(26 24 48 / 14%);
  --glow-accent:    0 0 0 5px rgb(96 80 220 / 22%);
  --scheme: light;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  /* Depth: neutral halo + a whisper of accent in the vault — never a flat ground. */
  background:
    radial-gradient(90% 55% at 50% -12%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%),
    radial-gradient(130% 90% at 50% -10%, var(--bg-vault) 0%, var(--bg) 58%) no-repeat fixed;
  background-color: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  min-height: 100dvh;             /* mobile: the real height, browser bar included */
  color-scheme: var(--scheme);   /* native widgets follow the theme */
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
}
/* "Infinite" scroll: the window scrolls but shows no scrollbar — an
   overflowing console never shows an elevator. */
html { scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }

.container {
  max-width: 30rem;
  margin: 0 auto;
  /* Touch-first: breathing room + iOS safe areas (notch, home bar). */
  padding: var(--space-4)
           max(var(--space-4), env(safe-area-inset-right))
           calc(var(--space-5) + env(safe-area-inset-bottom))
           max(var(--space-4), env(safe-area-inset-left));
}

/* Vertical rhythm: direct children evenly spaced */
.stack > * + * { margin-top: var(--space-4); }
.stack-sm > * + * { margin-top: var(--space-2); }
.stack-lg > * + * { margin-top: var(--space-6); }
.center { text-align: center; }
.row { display: flex; gap: var(--space-2); align-items: center; }
/* A .row built only from .appears controls (e.g. the URL transport row:
   broadcast/order/next) still reports its tallest child's height even when
   every control is .off — max-width:0 hides the width, not the vertical
   padding/line-height, so an all-off row held ~45px of silent void above
   the status line. Collapse the row itself once nothing in it is showing;
   :has() makes this purely derived from live child state, so any control
   turning back on (one .appears child stops matching :not(.off)) restores
   the row instantly, no JS. Rows without .appears children never match. */
.row:has(> .appears.off):not(:has(> .appears:not(.off))) { min-height: 0; height: 0; margin: 0; overflow: hidden; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.grow { flex: 1; }
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); }
.pointer { cursor: pointer; }

/* Utilities: the recipes behind the former ~85 inline style= attributes. A
   remaining style= is a one-off, justified by a comment next to it. */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.hint { font-size: var(--text-sm); color: var(--muted); }
.faint { color: var(--muted-2); }
.lead { font-size: var(--text-md); font-weight: 600; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.sep { border-top: var(--border); margin: var(--space-4) 0; }
.ellipsis { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

h1 {
  /* The signature display voice (M5): Archivo Black carries titles like a
     broadcast cartouche — single weight, so no synthetic bolding. */
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.015em;
  line-height: 1.12;
  text-wrap: balance;
}
/* Label: a quiet (ghost) section title, not a shouting block. */
.label {
  display: inline-block;
  background: color-mix(in srgb, var(--fg) 6%, transparent);
  color: var(--muted);
  padding: 0.25rem 0.6rem;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
}

.room-code { font-family: var(--font-mono); letter-spacing: 0.18em; font-weight: 600; }

/* Fullscreen QR veil (enlarging in-flow deformed the card): QR centered big,
   tap anywhere to close. The QR ground must stay light — scanners need a
   bright quiet-zone (the one always-light surface). */
.qr-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  cursor: pointer;
}
.qr-overlay img {
  width: min(80vw, 80vh, 420px); height: auto;
  background: var(--qr-bg); padding: 14px; border-radius: var(--radius);
}

/* Host source tiles: a strict radio group, readable WITHOUT text. One class,
   one meaning: .active = this tile holds the antenna (zero lit = test card);
   the active tile shows the stop square because a re-tap releases the antenna. */
.tile {
  /* M5 artifact: compact rectangular source tiles, icon centered, quiet ground. */
  flex: none; width: 64px; height: 48px;
  font-size: 20px; line-height: 1; padding: var(--space-2);
  display: flex; align-items: center; justify-content: center;
  background: var(--field-bg); color: var(--muted);
  border: var(--border); border-radius: var(--radius-sm);
  box-shadow: none;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
/* Chosen tile (artifact .active): the Majorelle veil, not just a hairline. */
.tile.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-bright); box-shadow: none; }
.tile:disabled { opacity: .35; }
/* Tiles as SVG icons: mode icon by default, ■ while the tile emits (.active,
   set by refreshControls) — no emoji in textContent. `.icon.tile-*` selectors
   (specificity 0,3,0) beat Astro's scoped `.icon` style. */
.tile { display: inline-flex; align-items: center; justify-content: center; }
.tile .icon { width: 22px; height: 22px; }
.tile .icon.tile-stop { display: none; }
.tile.active .icon.tile-icon { display: none; }
.tile.active .icon.tile-stop { display: inline-flex; }

/* Health logo: the brand's tuning fork — pulsing = healthy room, red steady =
   ailing room (replaced the old "live" dot). */
.badge-logo { color: var(--accent); flex: none; animation: badge-pulse 2.2s ease-in-out infinite; }
.badge-logo.bad { color: var(--err); animation: none; }
/* The health logo IS the header's: these rules beat `.brand svg` (specificity)
   — outside a room no class is set, the mark stays static. */
.brand svg.badge-logo { color: var(--accent); }
.brand svg.badge-logo.bad { color: var(--err); }
@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

/* ONE button system (spec ui-morph 10, review follow-up): .btn ground +
   data-variant role is the SINGLE, unscoped source of truth for EVERY
   button — hand-authored markup, TS-created buttons, and Button.astro's own
   <Button> component all render through these exact rules (a plain
   stylesheet reaches every element regardless of which Astro component drew
   it; Button.astro used to carry a second, scoped copy of this table that
   silently drifted — font-size 16 vs 19, gap 8px vs 10px, padding 0 1.15rem
   vs 14px 18px, hover 88/12 vs 86/14 — caught in review). Button.astro now
   only emits `class="btn ..."` + `data-variant`/`data-size` and defers all
   visual declarations here; it keeps no CSS of its own beyond what this
   table doesn't cover (the size/block/icon shape modifiers just below). The
   brand color IS the CTA, day and night: the white pill is retired as an
   action button. --pill/--pill-fg stay declared in :root (no live reference
   left after this sweep; kept as reserved theme tokens, not deleted here).
   Default ground = neutral voile. */
button, .btn {
  display: inline-block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: none;
  border-radius: var(--radius-pill);
  background: var(--voile-2);
  color: var(--fg);
  font-family: inherit;
  font-weight: 600;
  font-size: var(--text-md);
  letter-spacing: 0.01em;
  box-shadow: none;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, color 150ms ease;
  min-height: 48px;
}
/* Touch-first: the press is FELT (spring); hover is a desktop bonus only. */
button, .btn { transition: transform 260ms var(--spring), background 200ms ease, color 200ms ease; }
button:active, .btn:active { transform: scale(.96); }
/* Size + shape modifiers (Button.astro's `size`/`block`/`icon` props feed
   these; a raw <button class="btn" data-size="sm"> gets the same recipe).
   No color here — declared before the variant blocks below so a variant's
   own padding/font-size (accent, chip) still wins where they collide,
   matching Button.astro's former internal order. */
.btn.block { width: 100%; }
.btn.icon { width: 48px; min-width: 48px; padding: 0; }
.btn[data-size='sm'] { min-height: 44px; padding: 0 0.9rem; font-size: var(--text-sm); }
.btn[data-size='sm'].icon { width: 44px; min-width: 44px; padding: 0; }
.btn[data-size='lg'] { min-height: 56px; padding: 0 1.5rem; font-size: var(--text-lg); }
/* ghost = quiet, transparent, thin border — one step lighter than the
   ground (formerly the hand-rolled .secondary / .button classes). */
button[data-variant='ghost'], .btn[data-variant='ghost'] {
  background: transparent;
  color: var(--muted);
  border: var(--border);
  box-shadow: none;
}
button[data-variant='danger'], .btn[data-variant='danger'] { background: var(--danger-bg); color: var(--danger-fg); }
/* accent = THE CTA (artifact .cta): the display voice on a full Majorelle
   ground — the act button of a screen (Broadcast / Listen / Submit).
   Squared-off (radius-sm), not a pill: it reads as a console key, not a
   chip. Artifact measure: 16px, 14/18 padding. Formerly .hero. */
button[data-variant='accent'], .btn[data-variant='accent'] {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-display); font-weight: 400; letter-spacing: .01em;
  font-size: var(--text-lg);
  background: var(--accent); color: var(--accent-ink);
  border-radius: var(--radius-sm);
  padding: 14px 18px; min-height: 48px;
}
button[data-variant='accent']:hover:not(:disabled), .btn[data-variant='accent']:hover:not(.disabled) {
  background: color-mix(in srgb, var(--accent) 86%, var(--fg) 14%);
  box-shadow: none;
}
/* chip = compact secondary action (invite/QR): a comfortable pill (mockup v6),
   the hit area still tops 44px via an invisible pseudo-element. Horizontal
   inset stays 0 so joined .chip-group neighbors never steal each other's
   taps. Formerly .chip-sm (T5/T6). */
.btn[data-variant='chip'] {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: auto; min-height: 36px; gap: 7px;
  border: var(--border); border-radius: var(--radius-pill);
  background: var(--bg-elev); color: var(--accent-bright);
  font: 600 var(--text-sm) var(--font-sans); padding: 6px 13px;
}
.btn[data-variant='chip']::after { content: ""; position: absolute; inset: -5px 0; }
/* disabled LAST among the color rules above: same specificity as every
   variant selector (class + attribute/pseudo-class, 0-2-0), so being later
   in source order is what makes a disabled accent/ghost/chip/danger button
   actually grey out instead of keeping its variant color (a real bug this
   review follow-up fixed: it was declared BEFORE the variants until now). */
button:disabled, .btn:disabled, .btn[aria-disabled="true"] {
  background: var(--disabled-bg);
  color: var(--disabled-fg);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}
/* These two size utilities must win the same-specificity tie against the
   .btn ground above: declared after it, they take the later-wins slot. */
.w-auto { width: auto; }
.btn-compact { width: auto; min-height: 44px; }

/* ONE input skin (spec ui-morph 10): .field-input is the single opt-in ground
   for every text-like input — hand-authored markup (#source-url, chat,
   #room-password, #gov-url, #suggest-url) and Field.astro's own <input> both
   wear it. Field.astro layers its OWN differentiators (min-height, padding,
   font, the code variant) on top via its scoped .field class, kept local
   because they are Field-specific, not shared ground. */
.field-input {
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: var(--field-bg);
  color: var(--fg);
  font-family: inherit;
  font-weight: 400;
  font-size: 16px; /* inputs stay at 16px: below that iOS zooms on focus */
  box-shadow: none;
}
.field-input::placeholder { color: var(--muted-2); }
/* Field focus is INSET: fields live inside overflow-clipped folds
   (.fold > * { overflow: hidden }) and on card surfaces, where an outer ring
   gets cut by the clip and its bg-colored gap reads as a misplaced halo
   (terrain 2026-07-29). Inset never clips and works on any surface. */
.field-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: none;
}
.field-input:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: inset 0 0 0 1px var(--accent-bright);
}
/* Sliders (seek / volume): dark track + native accent fill. */
input[type="range"] { accent-color: var(--accent); }

/* VISIBLE FOCUS (a11y): a crisp keyboard ring on EVERYTHING interactive.
   Placed AFTER the historical weak :focus rules → wins (same specificity,
   later). :focus-visible only fires on keyboard: the mouse keeps soft focus. */
button:focus-visible, .btn:focus-visible, a:focus-visible,
select:focus-visible,
[tabindex]:focus-visible, .menu-item:focus-visible, .menu-btn:focus-visible,
.tile:focus-visible, .pill:focus-visible,
.skip-pill:focus-visible, .live-row:focus-visible, .lrow:focus-visible,
.me-edit:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

/* Pill row (artifact .pillrow/.pill): the listener's action chips under the
   Wave — Skip · n/m (hot on hover, accent when voted) and Propose. */
.pillrow { display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: center; }
.pill, .skip-pill {
  width: auto; min-height: 44px; padding: var(--space-1) var(--space-4);
  background: none; color: var(--muted); border: 1px solid var(--hairline);
  border-radius: var(--radius-pill); font-size: var(--text-sm); font-weight: 600;
  font-variant-numeric: tabular-nums; box-shadow: none;
}
.pill:hover:not(:disabled), .skip-pill:hover {
  border-color: var(--accent); color: var(--accent-bright);
  transform: none; box-shadow: none; background: none;
}
.pill.hot { border-color: var(--accent); color: var(--accent-bright); }
/* Leave pill: danger accent on hover only (quiet at rest, it is a rare act). */
.pill.danger:hover:not(:disabled) { border-color: var(--err); color: var(--err); background: var(--danger-bg); }
/* Mute pill carries only its icon: keep it square-ish, glyph centered. */
.pill[aria-pressed] { display: inline-flex; align-items: center; justify-content: center; }
.pill[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-bright); }
.skip-pill.voted { color: var(--accent-bright); border-color: var(--accent); background: var(--accent-soft); }
/* An expanded fold-pill (Propose open) reads as engaged. */
.pill[aria-expanded="true"] { border-color: var(--accent); color: var(--accent-bright); }
/* The propose group melts into the pill row: the pill sits inline, its revealed
   field wraps to a full-width line below. .hidden (display:none) still wins. */
.suggest-inline { display: contents; }
.pillrow .row { width: 100%; }

/* Listener count (now in the footer, next to the nickname) hides while empty
   (before the first poll). */
.who:has(#participants:empty) { display: none; }

/* Bar chips (invite, QR, air pill): even spacing. */
.bar-chips { gap: var(--space-2); }

/* Tuning-in line: the broadcast ping next to the live status text. */
.syncing-head { display: flex; gap: 10px; align-items: center; justify-content: center; }

/* Queue section label: measured voice, uppercase, very quiet. */
.q-label {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted-2);
}

/* Listener footer: tappable nickname (✎), centered. */
.me-edit {
  width: auto; min-height: 44px; padding: var(--space-1) var(--space-2);
  display: inline-flex; align-items: center; gap: var(--space-1);
  background: none; border: none; box-shadow: none;
  color: var(--muted); font-size: var(--text-sm);
}
.me-edit:hover { color: var(--fg); transform: none; box-shadow: none; }
.me-input { width: 12ch; padding: var(--space-1) var(--space-2); font-size: var(--text-sm); }

/* Site footer: every page, pinned to the very bottom (main is a min-height
   column, margin-top:auto does the pinning). Measured voice, quiet. */
.container { display: flex; flex-direction: column; min-height: 100dvh; }
.site-footer { margin-top: auto; padding-top: var(--space-6); display: flex; justify-content: center; }
.site-footer a {
  display: inline-flex; align-items: center; gap: var(--space-2);
  color: var(--muted-2); font-family: var(--font-mono); font-size: var(--text-xs);
  text-decoration: none; transition: color .2s;
}
.site-footer a:hover { color: var(--fg); }

/* Global header IN FLOW: brand left, ⋯ menu right. (A fixed one used to
   cover the listener page's topbar.) */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-2) 0 var(--space-4);
  position: relative; /* anchor of the ⋯ menu */
}

/* ⋯ menu: the header's only meta door. */
.menu-btn {
  width: 40px; min-height: 40px; padding: 0; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); border: var(--border); border-radius: 50%;
  color: var(--muted); font-weight: 700; font-size: var(--text-lg); line-height: 1;
  box-shadow: none;
}
.menu-btn:hover { color: var(--fg); background: var(--voile-2); transform: none; box-shadow: none; }
.menu {
  position: absolute; top: calc(100% - var(--space-2)); right: 0; z-index: 70;
  min-width: 15.5rem; padding: var(--space-2);
  background: var(--bg-sheet); border: var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); display: grid; gap: 2px;
  animation: enter .18s ease both;
}
/* The sheet header names the station: same mono voice as the console's code line. */
.menu-head {
  font: 500 10px var(--font-mono); letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); padding: var(--space-2) var(--space-2) 9px;
  border-bottom: 1px solid var(--hairline); margin-bottom: 3px;
}
.menu-head b { color: var(--accent-bright); font-weight: 500; }
/* Row anatomy (mockup v3): pastille · label · state value. */
.menu-item {
  width: 100%; min-height: 48px; padding: var(--space-2);
  display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 11px;
  background: none; border: none; box-shadow: none; border-radius: 10px;
  color: var(--fg); font-size: var(--text-sm); font-weight: 500; text-align: left;
}
.menu-item:hover { background: var(--field-bg); transform: none; box-shadow: none; }
.menu-item .ic {
  width: 30px; height: 30px; border-radius: 9px; background: var(--field-bg);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted);
}
/* An iconless row (page items in transition) keeps its text on the label column. */
.menu-item .menu-label:first-child { grid-column: 1 / 3; }
.menu-item .val {
  font: 500 10.5px var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); display: inline-flex; align-items: center; gap: 4px;
}
.menu-item .val .icon { transform: rotate(90deg); }
/* A live state (the mire actually sounding): pastille + value take the accent. */
.menu-item.live .ic { background: var(--accent-soft); color: var(--accent-bright); }
.menu-item.live .val { color: var(--accent-bright); }
.menu-item.danger { color: var(--err); }
.menu-item.danger .ic { background: var(--danger-bg); color: var(--err); }
/* Armed confirm (two-tap in place): the same row, now unmistakably the act. */
.menu-item.armed { background: var(--danger-bg); color: var(--danger-fg); }
.menu-item.armed .ic { background: color-mix(in srgb, var(--danger-fg) 14%, transparent); color: var(--danger-fg); }
.menu-item.sub { padding-left: var(--space-6); color: var(--muted); }
/* Inline rename morph (station name → input, same shape as the confirm swap):
   sized like the row it replaces, skinned by the shared .field-input ground. */
.menu-edit { width: 100%; min-height: 48px; }
/* The governance segment aligns under the label, past the pastille column. */
.menu > .seg { margin: 2px var(--space-2) var(--space-2) 49px; }
.menu .seg-btn { white-space: nowrap; padding: 0 0.7rem; }
.menu hr { border: none; border-top: 1px solid var(--hairline); margin: 4px var(--space-2); }
/* Segmented control (artifact .seg/.seg-btn): the ONE implementation, shared by
   Segment.astro (landing gov/visibility select, design showcase) and the
   meta menu's hand-rolled governance sub-choice (meta-menu.ts, seg: true
   children) — a 2-3 item exclusive-state group, selected = aria-pressed. */
.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--field-bg);
  border: 1px solid var(--hairline); border-radius: var(--radius-pill);
}
.seg-btn {
  min-height: 40px; padding: 0 0.9rem; border: 0; background: transparent;
  color: var(--muted); border-radius: var(--radius-pill);
  font: 600 13px var(--font-sans); cursor: pointer; transition: color 140ms, background 140ms;
}
.seg-btn:hover { color: var(--fg); }
.seg-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.seg-btn[aria-pressed='true'] {
  background: var(--accent-soft); color: var(--accent-bright);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}
/* ⋯ menu veil: the page steps back while the meta layer is open. */
.veil { position: fixed; inset: 0; z-index: 65; background: color-mix(in srgb, var(--ink) 55%, transparent); }
.brand {
  display: inline-flex; align-items: center; gap: var(--space-2);
  color: var(--fg); font-family: var(--font-display); font-weight: 400; font-size: 17px; letter-spacing: -0.005em;
  text-decoration: none;
}
.brand svg { color: var(--accent-bright); flex: none; }
.brand:hover .brand-name { color: var(--accent-bright); transition: color .2s; }
/* On the landing the wordmark IS the brand — the header name would duplicate
   it. It returns as soon as the landing yields (console open, listener page). */
main:has(#landing:not(.hidden)) .brand-name { display: none; }

/* MIRE: a Philips PM5544-style test card in pure CSS — central circle (ring +
   crosshair) holding color bars, greyscale steps and a pluge, over a dark
   gridded surround — desaturated for the dark theme. The listener SEES the
   room is waiting for its DJ (the sound itself is very soft/absent). */
.mire-visual {
  position: relative;
  height: 140px; border-radius: var(--radius); margin-bottom: var(--space-4);
  overflow: hidden;
  background:
    /* center crosshair */
    linear-gradient(to bottom,
      transparent calc(50% - 1px), #e8e8e8 calc(50% - 1px) calc(50% + 1px), transparent 0),
    linear-gradient(to right,
      transparent calc(50% - 1px), #e8e8e8 calc(50% - 1px) calc(50% + 1px), transparent 0),
    /* the circle ring (the PM5544 signature) */
    radial-gradient(circle at 50% 50%, transparent 0 44.5%, #e8e8e8 44.5% 46.5%, transparent 46.5%),
    /* white grid, crossing card and surround alike */
    repeating-linear-gradient(to right, #dfdfdf59 0 1px, transparent 1px 12.5%),
    repeating-linear-gradient(to bottom, #dfdfdf59 0 1px, transparent 1px 25%),
    /* outside the circle: dark surround */
    radial-gradient(circle at 50% 50%, transparent 0 45.5%, #14171c 45.5%),
    /* pluge (bottom): stepped blacks */
    linear-gradient(to right,
      #0a0a0a 0 25%, #000 25% 50%, #1a1a1a 50% 75%, #0a0a0a 75% 100%
    ) 0 100% / 100% 18% no-repeat,
    /* greyscale steps */
    linear-gradient(to right,
      #111 0 16.6%, #3a3a3a 16.6% 33.3%, #6f6f6f 33.3% 50%,
      #a0a0a0 50% 66.6%, #cfcfcf 66.6% 83.3%, #f2f2f2 83.3% 100%
    ) 0 75.3% / 100% 27% no-repeat,
    /* color bars */
    linear-gradient(to right,
      #b8b8b8 0 14.3%, #b8b800 14.3% 28.6%, #00b8b8 28.6% 42.9%,
      #00b800 42.9% 57.2%, #b800b8 57.2% 71.5%, #b80000 71.5% 85.8%, #0000b8 85.8% 100%
    ) 0 28.6% / 100% 37% no-repeat,
    /* header band behind the circle top */
    #23272e;
  filter: saturate(.7) brightness(.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
/* Tappable (listener): the card explains itself (#mire-note). */
.mire-visual[role="button"] { cursor: pointer; }
/* Slow scanline: the card reads as a live signal, not a frozen image.
   Reduced-motion's blanket rule (later) kills it. */
.mire-visual::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    transparent, color-mix(in srgb, var(--fg) 8%, transparent), transparent)
    0 -40% / 100% 34% no-repeat;
  animation: mire-scan 7s linear infinite;
}
@keyframes mire-scan { from { background-position: 0 -40%; } to { background-position: 0 140%; } }

.mire-mini { height: 72px; margin: var(--space-3) 0 0; }

dialog {
  background: var(--bg-sheet); color: var(--fg); border: var(--border);
  border-radius: var(--radius); padding: var(--space-5);
  max-width: 28rem; width: calc(100% - 2 * var(--space-5));
  box-shadow: var(--shadow);
  animation: enter .3s var(--spring) both;
}
dialog::backdrop { background: color-mix(in srgb, var(--ink) 62%, transparent); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
/* Mobile: dialogs become BOTTOM SHEETS (the thumb, not the center). */
@media (max-width: 540px) {
  dialog {
    margin: auto 0 0; width: 100%; max-width: none;
    border-radius: 24px 24px 0 0; border-bottom: none;
    padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom));
    animation: sheet-up .34s var(--spring) both;
  }
}
@keyframes sheet-up { from { opacity: .6; transform: translateY(40px); } to { opacity: 1; transform: none; } }
.help-body h3 { font-size: var(--text-sm); margin: var(--space-4) 0 var(--space-1); }
.help-body p { font-size: var(--text-sm); margin: 0; }

/* FAQ (spec ui-morph 11): flat hairline-separated rows (no box-in-box), the
   chevron rotates open via the shared .fold contract: text never pops. */
[data-help-faq] { margin-top: var(--space-2); }
.faq-q {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  width: 100%; background: none; border: none; border-top: var(--border-soft);
  border-radius: 0; box-shadow: none; padding: var(--space-3) 0;
  color: var(--fg); font-size: var(--text-sm); font-weight: 600; text-align: left;
}
.faq-q:hover { color: var(--accent-bright); transform: none; box-shadow: none; background: none; }
.faq-chev { flex: none; color: var(--muted); transition: transform 260ms var(--spring); }
.faq-q[aria-expanded="true"] .faq-chev { transform: rotate(90deg); color: var(--accent-bright); }
[data-help-faq] .fold p { padding-bottom: var(--space-3); }

.card {
  background: var(--card);
  border: var(--border);
  /* GLASS: translucent veil + blur — the ground's depth shows through. */
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  backdrop-filter: blur(22px) saturate(1.15);
  /* Deep shadow + thin light hairline on top = relief. */
  box-shadow: var(--shadow), inset 0 1px 0 color-mix(in srgb, var(--fg) 6%, transparent);
  padding: var(--space-4);
  border-radius: var(--radius);
}

/* ── SCREEN FRAME (artifact .screen) — a card with a header bar. The bar names
   the surface in the measured voice and carries live chips (air pill, counter);
   the body stacks the content with a steady rhythm. */
.card.screen { padding: 0; overflow: hidden; }
.screen > .bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: 10px 16px; border-bottom: var(--border-soft);
}
/* .t — the measured voice as a surface label (screen bars, section heads). */
.t {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Named station (#station-name): the name leads the bar; the /j/CODE chip demotes
   to a smaller aside (it stays the identifier you say out loud, just not the title). */
#station-name:not(.hidden) + #room-path { font-size: var(--text-xs); color: var(--muted); margin-left: 0.4rem; }
/* …and the /j/ prefix retires with it: the bare code stays as the copy tap. */
#station-name:not(.hidden) + #room-path .jpfx { display: none; }
.screen > .body {
  padding: 20px 16px;
  display: flex; flex-direction: column; gap: 14px;
}

/* Station line (artifact .station-code): fork mark + big measured code +
   inline listener count. The identity line at the top of the console body. */
.station-code { display: flex; align-items: center; gap: 10px; min-width: 0; }
.station-code svg { color: var(--accent-bright); flex: none; }
.station-code .code {
  font-family: var(--font-mono); font-size: 26px; font-weight: 600;
  letter-spacing: .1em; cursor: pointer;
}
.station-code .aside {
  color: var(--muted); font-size: var(--text-sm); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Source tiles (artifact .tiles): fixed compact rectangles, CENTERED as a row — a browser
   without mic/tab capture (they're REMOVED, not greyed) shows its two tiles
   centered, never two stretched slabs or empty sockets. */
.tiles { display: flex; justify-content: center; gap: var(--space-2); }

/* Now playing (artifact): title in the display voice, artist muted under it,
   the progress thread with the measured times right below. */
.np-title {
  font-family: var(--font-display); font-weight: 400;
  font-size: var(--text-xl); line-height: 1.15; text-wrap: balance;
}
.np-artist { color: var(--muted); font-size: var(--text-sm); margin-top: 2px; }
.times {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--muted-2);
  font-variant-numeric: tabular-nums; margin-top: var(--space-2);
}

/* Share surface (artifact "Partage · lien + QR"): the QR large and scannable,
   the exact link in the measured voice (key part accented), one copy CTA. */
.qr-big {
  display: block; width: 168px; height: 168px; margin: 0 auto;
  background: var(--qr-bg); padding: 8px; border-radius: var(--radius-xs);
}
.sharelink {
  font-family: var(--font-mono); font-size: 11px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--voile-2); border-radius: var(--radius-xs);
  padding: 10px 12px; color: var(--muted); text-align: left;
}
.sharelink b { color: var(--accent-bright); font-weight: 600; }
.share-fold-body { display: flex; flex-direction: column; gap: var(--space-3);
  align-items: center; padding-top: var(--space-3); }

/* Invite + QR ride the code line as ONE joined pill (mockup v6), not two
   floating crumbs: segments share a hairline, only the ends keep the pill
   radius. Logical-property radii so RTL keeps the right ends round. */
.code-chips { margin-left: auto; }
.chip-group { display: inline-flex; gap: 0; }
.chip-group .btn[data-variant='chip'] { border-radius: 0; }
.chip-group .btn[data-variant='chip']:first-child {
  border-start-start-radius: var(--radius-pill); border-end-start-radius: var(--radius-pill);
}
.chip-group .btn[data-variant='chip']:last-child {
  border-start-end-radius: var(--radius-pill); border-end-end-radius: var(--radius-pill);
  margin-inline-start: -1px;
}

/* Landing hero (artifact header): the wordmark with the tuned "o", the thesis
   line under it. The product's voice, full volume, only on the landing. */
.hero-head { display: flex; flex-direction: column; gap: var(--space-2); align-items: center; padding: var(--space-3) 0 var(--space-4); }
.wordmark {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(36px, 10vw, 52px); letter-spacing: -0.015em; line-height: .95;
}
.wordmark .tune { color: var(--accent-bright); }
.thesis { font-size: var(--text-sm); color: var(--muted); text-align: center; max-width: 34ch; margin: 0; text-wrap: balance; }
#carrier { width: 100%; height: 72px; display: block; }

/* ── First-run tutorial, act 1: the slides (full-screen over the landing).
   One signature beat: the synchronized 3-bar pulse lives in every slide and
   the halo behind each slide breathes on the same tempo. */
#intro { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-vault) 100%); }
#intro.hidden { display: none; }
.intro-top { display: flex; justify-content: space-between; align-items: center;
  padding: 16px 16px 0; min-height: 40px; }
.intro-brand { font: 800 14px var(--font-sans); gap: 8px; color: var(--fg); }
.intro-brand svg { color: var(--accent-bright); }
.intro-skip { width: auto; background: none; border: none; color: var(--muted-2);
  font: 600 var(--text-sm) var(--font-sans); cursor: pointer; padding: 8px 4px; }
.intro-clip { flex: 1; overflow: hidden; touch-action: pan-y; }
.intro-slides { display: flex; height: 100%; transition: transform 420ms var(--spring); }
.intro-slide { flex: 0 0 100%; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; padding: 8px 26px 12px; text-align: center;
  box-sizing: border-box; position: relative; }
.intro-slide::before { content: ""; position: absolute; top: 12%; left: 50%;
  width: 240px; height: 240px; transform: translateX(-50%); border-radius: 50%;
  pointer-events: none; background: radial-gradient(circle, var(--accent-soft) 0%, transparent 68%);
  animation: intro-breathe 2.2s ease-in-out infinite; }
@keyframes intro-breathe {
  0%, 100% { opacity: .5; transform: translateX(-50%) scale(.92); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.04); }
}
.intro-eyebrow { font: 500 10px var(--font-mono); letter-spacing: .22em;
  text-transform: uppercase; color: var(--muted-2); }
.intro-slide h3 { font-family: var(--font-display); font-weight: 400; font-size: 24px;
  line-height: 1.22; margin: 2px 0 0; text-wrap: balance; letter-spacing: -.01em; }
.intro-slide h3 em { font-style: normal; color: var(--accent-bright); }
.intro-slide p { margin: 0; color: var(--muted); font-size: var(--text-sm); max-width: 30ch; }
.intro-slide #intro-launch { margin-top: var(--space-2); }
.intro-ill { height: 200px; display: flex; align-items: center; justify-content: center;
  width: 100%; position: relative; }
/* Orchestrated entrance: illustration, eyebrow, title, body. */
.intro-slide > * { opacity: 0; transform: translateY(14px); }
.intro-slide.on > * { animation: intro-rise .55s var(--spring) forwards; }
.intro-slide.on > .intro-ill { animation-delay: .05s; }
.intro-slide.on > .intro-eyebrow { animation-delay: .16s; }
.intro-slide.on > h3 { animation-delay: .24s; }
.intro-slide.on > p { animation-delay: .34s; }
.intro-slide.on > #intro-launch { animation-delay: .42s; }
@keyframes intro-rise { to { opacity: 1; transform: none; } }
/* Slide 1: three speakers thump on the very same instant, the lead one emits,
   all linked by the carrier - a scatter of small speakers playing as one big
   system with no echo. (No per-speaker delay: unison IS the point.) */
.intro-trio { display: flex; align-items: flex-end; gap: 18px; position: relative; }
.intro-spk { width: 58px; height: 92px; border-radius: 12px; box-sizing: border-box;
  background: linear-gradient(180deg, var(--bg-elev), var(--bg)); position: relative;
  border: 1.5px solid var(--hairline-strong); display: flex; align-items: center;
  justify-content: center; box-shadow: var(--shadow-sm); }
.intro-spk::before { content: ""; position: absolute; top: 11px; left: 50%; width: 9px; height: 9px;
  margin-left: -4.5px; border-radius: 50%; background: var(--field-bg);
  border: 1px solid var(--hairline-strong); }
.intro-spk.lead { width: 68px; height: 108px; border-color: var(--accent-bright);
  background: linear-gradient(180deg, var(--bg-elev) 50%, var(--accent-soft) 175%); }
.intro-cone { width: 34px; height: 34px; margin-top: 10px; border-radius: 50%; position: relative;
  background: radial-gradient(circle at 50% 42%, var(--accent-soft) 0%, var(--field-bg) 62%);
  border: 1.5px solid var(--hairline-strong); animation: intro-thump 1.1s ease-in-out infinite; }
.intro-cone::before { content: ""; position: absolute; inset: 34%; border-radius: 50%;
  background: var(--accent-bright); opacity: .85; }
.intro-spk.lead .intro-cone { width: 42px; height: 42px; border-color: var(--accent-bright); }
.intro-spk.lead .intro-cone::after { content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 1.5px solid var(--accent-bright); opacity: 0; animation: intro-ring 2.2s ease-out infinite; }
@keyframes intro-thump { 0%, 100% { transform: scale(.9); } 30% { transform: scale(1.06); } }
@keyframes intro-ring {
  0% { transform: scale(.5); opacity: .8; }
  80%, 100% { transform: scale(2.4); opacity: 0; }
}
.intro-carrier { position: absolute; left: -12px; right: -12px; bottom: 30px; height: 22px;
  width: calc(100% + 24px); pointer-events: none; }
.intro-carrier path { stroke: var(--accent-bright); stroke-width: 1.5; fill: none; opacity: .5;
  stroke-dasharray: 6 5; animation: intro-flow 1.1s linear infinite; }
@keyframes intro-flow { to { stroke-dashoffset: -11; } }
/* Slide 2: everyone in tune. A ring of peer phones around the central
   speaker+phone, links contouring it, the signal flowing along the ring. */
.intro-mesh { position: relative; width: 200px; height: 150px; }
.intro-mesh-halo { position: absolute; left: 50%; top: 50%; width: 188px; height: 128px;
  transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 68%);
  animation: intro-mesh-breathe 2.6s ease-in-out infinite; }
@keyframes intro-mesh-breathe {
  0%, 100% { opacity: .4; transform: translate(-50%, -50%) scale(.92); }
  50% { opacity: .7; transform: translate(-50%, -50%) scale(1.05); }
}
.intro-mesh-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.intro-mesh-ring path { fill: none; stroke: var(--accent-bright); stroke-width: 1.5; opacity: .5;
  stroke-dasharray: 5 6; animation: intro-flow 1.1s linear infinite; }
.intro-peer { position: absolute; width: 22px; height: 34px; border-radius: 6px;
  background: var(--bg-elev); border: 1.5px solid var(--hairline-strong); box-shadow: var(--shadow-sm);
  opacity: 0; animation: intro-peer-in .5s var(--spring) forwards,
  intro-peer-pulse 1.1s ease-in-out infinite; }
/* Earpiece slit at the bottom: each peer is a phone playing in the ring. */
.intro-peer::before { content: ""; position: absolute; left: 50%; bottom: 5px;
  transform: translateX(-50%); width: 8px; height: 2px; border-radius: 2px;
  background: var(--hairline-strong); }
.intro-peer.pTL { left: 30px; top: 8px; animation-delay: .12s; }
.intro-peer.pTR { right: 30px; top: 8px; animation-delay: .24s; }
.intro-peer.pML { left: 2px; top: 58px; animation-delay: .36s; }
.intro-peer.pMR { right: 2px; top: 58px; animation-delay: .48s; }
@keyframes intro-peer-in { to { opacity: 1; } }
/* The four phones pulse together — same note, same instant. */
@keyframes intro-peer-pulse {
  0%, 100% { box-shadow: var(--shadow-sm); }
  50% { box-shadow: 0 0 9px 1px var(--accent-soft); }
}
/* Two signal dots ride the ring: the sound hopping phone to phone in P2P. */
.intro-sig { position: absolute; top: 0; left: 0; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-bright); box-shadow: 0 0 8px 2px var(--accent-soft); opacity: 0;
  offset-path: path("M100 128 C 56 128, 28 106, 28 76 C 28 46, 58 26, 100 26 C 142 26, 172 46, 172 76 C 172 106, 144 128, 100 128 Z");
  offset-rotate: 0deg; animation: intro-sig-travel 3.4s linear infinite; }
.intro-sig.b { animation-delay: -1.7s; }
@keyframes intro-sig-travel {
  0% { offset-distance: 0%; opacity: 0; }
  8%, 92% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}
/* The hub: slide 1's lead speaker VERBATIM (field 2026-07-29: the shrunken
   hub variant read as a different object, off the ring's center, halo
   adrift). The speaker alone is what translate() centers — the jack source
   hangs below it OUT OF FLOW so it cannot drag the speaker off center. */
.intro-hub { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 2; }
.intro-src { position: absolute; top: calc(100% + 3px); left: 50%;
  transform: translateX(-50%); display: flex; flex-direction: column;
  align-items: center; gap: 2px; }
.intro-wire { width: 1.5px; height: 8px; background: var(--hairline-strong); }
.intro-chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px;
  border: 1px solid var(--hairline-strong); border-radius: var(--radius-pill); background: var(--bg-elev); }
.intro-chip svg { width: 9px; height: 11px; }
.intro-chip .ph { color: var(--muted); }
.intro-chip .jk { color: var(--accent-bright); }
.intro-chip-lbl { font: 600 7px var(--font-mono); letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted-2); }
.intro-badges { display: inline-flex; gap: 6px; }
.intro-badges b, .intro-badges span { font: 600 10px var(--font-mono); letter-spacing: .08em;
  border-radius: var(--radius-pill); padding: 4px 10px; border: 1px solid var(--hairline-strong);
  color: var(--muted-2); background: var(--bg-elev); }
.intro-badges b { color: var(--accent-bright); border-color: var(--accent-bright);
  background: var(--accent-soft); }
.intro-slide.on > .intro-badges { animation-delay: .12s; }
/* Slide 4: a link lands, the antenna lights up. */
.intro-cast { display: flex; flex-direction: column; gap: 12px; align-items: center;
  width: 100%; max-width: 240px; }
.intro-field { width: 100%; box-sizing: border-box; text-align: left;
  font: 500 12px var(--font-mono); color: var(--muted-2); background: var(--field-bg);
  border: 1px solid var(--hairline); border-radius: var(--radius-sm); padding: 11px 13px;
  white-space: nowrap; overflow: hidden; animation: intro-fieldarm 3.2s ease infinite; }
@keyframes intro-fieldarm {
  0%, 40% { border-color: var(--hairline); }
  55%, 100% { border-color: var(--accent-bright); }
}
.intro-field b { color: var(--accent-bright); font-weight: 600; display: inline-block;
  overflow: hidden; vertical-align: bottom; white-space: nowrap; max-width: 100%;
  animation: intro-typein 3.2s steps(24) infinite; }
@keyframes intro-typein { 0% { max-width: 0; } 45%, 100% { max-width: 100%; } }
.intro-tiles { gap: 9px; }
.intro-tile { width: 58px; height: 44px; border-radius: var(--radius-sm);
  background: var(--field-bg); border: 1px solid var(--hairline); display: flex;
  align-items: center; justify-content: center; color: var(--muted); }
.intro-tile.open { border-color: var(--accent-bright); background: var(--accent-soft);
  color: var(--accent-bright); }
.intro-onair { display: inline-flex; align-items: center; gap: 7px;
  font: 600 10.5px var(--font-mono); letter-spacing: .14em; border: 1px solid var(--hairline);
  border-radius: var(--radius-pill); padding: 6px 13px; color: var(--muted-2);
  background: var(--bg-elev); animation: intro-lightup 3.2s ease infinite; }
.intro-onair .lamp { width: 8px; height: 8px; border-radius: 50%; background: var(--dot-idle);
  animation: intro-lampup 3.2s ease infinite; }
@keyframes intro-lightup {
  0%, 40% { color: var(--muted-2); border-color: var(--hairline); }
  60%, 100% { color: var(--onair); border-color: var(--onair); }
}
@keyframes intro-lampup {
  0%, 40% { background: var(--dot-idle); box-shadow: none; }
  60%, 100% { background: var(--onair); box-shadow: 0 0 0 4px color-mix(in srgb, var(--onair) 18%, transparent); }
}
/* Slide 3: the room is its key — QR + code + public/private + a joiner. */
.intro-room { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.intro-qr { width: 104px; height: 104px; border-radius: var(--radius-xs);
  background: conic-gradient(var(--fg) 25%, transparent 0 50%, var(--fg) 0 75%, transparent 0) 0 0 / 13px 13px;
  outline: 7px solid var(--bg-elev); box-shadow: var(--shadow-sm); opacity: .85; }
.intro-qr.sm { width: 76px; height: 76px; outline-width: 6px; }
.intro-code { font: 700 17px var(--font-mono); letter-spacing: .3em; color: var(--accent-bright);
  border: 1px solid var(--accent-bright); border-radius: var(--radius-sm);
  padding: 6px 9px 6px 17px; background: var(--accent-soft); }
.intro-vis { display: inline-flex; gap: 3px; padding: 3px; border-radius: var(--radius-pill);
  background: var(--bg-elev); border: 1px solid var(--hairline-strong); }
.intro-vis b, .intro-vis span { font: 600 10.5px var(--font-mono); letter-spacing: .04em;
  border-radius: var(--radius-pill); padding: 4px 12px; color: var(--muted-2); }
.intro-vis b.on { background: var(--accent-soft); color: var(--accent-bright); }
.intro-joinpill { display: inline-flex; align-items: center; gap: 6px; font: 600 10.5px var(--font-mono);
  letter-spacing: .05em; color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 55%, transparent);
  border-radius: var(--radius-pill); padding: 5px 12px; animation: intro-pop 2.8s var(--spring) infinite; }
.intro-joinpill .d { width: 6px; height: 6px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 6px color-mix(in srgb, var(--ok) 60%, transparent); }
@keyframes intro-pop {
  0%, 30% { transform: scale(0); opacity: 0; }
  45%, 100% { transform: scale(1); opacity: 1; }
}
/* Slide 5: the launch. */
.intro-go { position: relative; display: flex; align-items: center; justify-content: center; }
.intro-go-fork { width: 68px; height: 68px; border-radius: 21px; background: var(--accent);
  color: var(--accent-ink); display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm); position: relative; z-index: 1; }
.intro-halo { position: absolute; width: 68px; height: 68px; border-radius: 21px;
  border: 1.5px solid var(--accent-bright); opacity: 0;
  animation: intro-halo 2.2s ease-out infinite; }
.intro-halo.late { animation-delay: 1.1s; }
@keyframes intro-halo {
  0% { transform: scale(1); opacity: .7; }
  85%, 100% { transform: scale(1.9); opacity: 0; }
}
.intro-bottom { display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px 18px; min-height: 46px; }
.intro-dots { display: flex; gap: 7px; align-items: center; }
.intro-dots i { width: 7px; height: 7px; border-radius: var(--radius-pill);
  background: var(--dot-idle); cursor: pointer;
  transition: background .25s, width .3s var(--spring); }
.intro-dots i.on { background: var(--accent-bright); width: 22px; }
.intro-next { width: auto; background: var(--field-bg); border: var(--border); color: var(--fg);
  font: 600 var(--text-sm) var(--font-sans); border-radius: var(--radius-pill);
  padding: 9px 18px; cursor: pointer; }

/* Act 2: the guide over the real console. The overlay never eats taps (the
   veil is the cutout's shadow); the target rises above it via .lit. */
#coach { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
#coach.hidden { display: none; }
#coach-cut { position: absolute; border-radius: 16px;
  box-shadow: 0 0 0 200vmax color-mix(in srgb, var(--ink) 45%, transparent); transition: all .55s var(--spring); }
#coach-cut::after { content: ""; position: absolute; inset: -4px;
  border: 2px solid var(--accent-bright); border-radius: inherit;
  animation: coach-pulse 1.6s ease-in-out infinite; }
@keyframes coach-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); }
  50% { box-shadow: 0 0 0 7px var(--accent-soft); }
}
#coach-bubble { position: absolute; background: var(--bg-sheet); border: var(--border);
  border-radius: 14px; box-shadow: var(--shadow-sm); padding: 11px 14px 12px;
  width: 205px; box-sizing: border-box; transition: all .55s var(--spring); }
#coach-bubble .intro-eyebrow { color: var(--accent-bright); }
#coach-bubble p { margin: 3px 0 0; font-size: 13px; line-height: 1.45; color: var(--fg); }
.coach-skip { position: absolute; bottom: 12px; right: 14px; width: auto; pointer-events: auto;
  background: none; border: none; color: color-mix(in srgb, var(--accent-ink) 75%, transparent);
  font: 600 var(--text-xs) var(--font-sans); cursor: pointer; padding: 8px; }
.lit { position: relative; z-index: 61; }

/* The finale: a real station, on air. */
#intro-done { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center;
  justify-content: center; background: color-mix(in srgb, var(--ink) 32%, transparent); }
#intro-done.hidden { display: none; }
.intro-done-card { background: var(--bg-sheet); border: var(--border); border-radius: 18px;
  box-shadow: var(--shadow-sm); padding: 22px 20px 18px; text-align: center; max-width: 240px;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  animation: intro-rise .5s var(--spring); }
.intro-done-ic { width: 46px; height: 46px; border-radius: 50%; background: var(--accent);
  color: var(--accent-ink); display: flex; align-items: center; justify-content: center; }
.intro-done-card h3 { font-family: var(--font-display); font-weight: 400;
  font-size: var(--text-lg); margin: 2px 0 0; }
.intro-done-card p { margin: 0; font-size: var(--text-xs); color: var(--muted); }
.intro-done-card .btn { width: 100%; margin-top: var(--space-2); }

/* Generic list (room listeners, remote results) */
.list { list-style: none; padding: 0; margin: 0; }

/* Chip: nickname badge (auto color via inline --chip-accent) */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  color: var(--fg);
}

/* State dot: a small colored disc (green/orange/red) */
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  background: var(--dot-idle);
  flex: none;
}
.dot.ready { background: var(--accent); }
.dot.calibrating { background: var(--warn); }
.dot.error { background: var(--err); }

/* THE PING (M5/D2) — the red broadcast dot with its propagating ring. One
   recipe, reused wherever something is genuinely live: the antenna pill, the
   Live-now rows, the listener tuning in. --onair only, never decorative. */
.ping { position: relative; width: 12px; height: 12px; flex: none; display: inline-block; }
.ping::before {
  content: ''; position: absolute; inset: 2px; border-radius: 50%;
  background: var(--onair); box-shadow: 0 0 8px var(--onair);
}
.ping::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid var(--onair);
  animation: air-ping 1.8s cubic-bezier(0, 0, .35, 1) infinite;
}
@keyframes air-ping {
  0% { transform: scale(.6); opacity: .9; }
  80%, 100% { transform: scale(2.1); opacity: 0; }
}
/* Reduced motion: the ring vanishes, the dot stays (state remains readable). */
@media (prefers-reduced-motion: reduce) {
  .ping::after { animation: none; opacity: 0; }
}

/* "Live now" showcase (artifact .live-row): ping + station name in the display
   voice + current track muted + listener count in the measured voice. Shared by
   the landing and the in-room explore overlay. */
.live-row {
  display: flex; align-items: center; gap: var(--space-3); width: 100%;
  background: var(--paper); border: var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; color: var(--fg); font-size: var(--text-sm);
  text-decoration: none; transition: border-color .15s, transform .15s;
}
.live-row:hover, .live-row:focus-visible {
  border-color: var(--hairline-strong); outline: none;
}
.live-row + .live-row { margin-top: var(--space-2); }
.live-row .rowmain { flex: 1; min-width: 0; }
.live-row .name {
  display: block; font-family: var(--font-mono); font-size: var(--text-sm);
  font-weight: 600; letter-spacing: .08em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Named station: the mono/measured treatment above is the CODE's voice, not
   the slot's; a human name takes the ordinary body voice instead. */
.live-row .name.named { font-family: var(--font-sans); letter-spacing: normal; }
.live-row .code-tag {
  display: block; font-family: var(--font-mono); font-size: var(--text-xs);
  font-weight: 600; letter-spacing: .08em; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.live-row .track {
  display: block; color: var(--muted-2); font-size: var(--text-xs);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Host opt-in geo: flag + city, quiet under the title. */
.live-row .geo {
  display: block; color: var(--muted-2); font-size: var(--text-xs);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.live-row .count {
  color: var(--muted); font-family: var(--font-mono); font-size: var(--text-xs);
  flex: none; white-space: nowrap; font-variant-numeric: tabular-nums;
}

/* Lost WS connection: animated feedback (host + listener via WsClient onClose). */
.loading { position: relative; opacity: 0.7; }
.loading::after {
  content: '';
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-left: var(--space-2);
  vertical-align: -0.1em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.muted { color: var(--muted); font-weight: 400; }
/* Console status line: the "on air" word lights up in accent. */
.live-word { color: var(--accent-bright); }

/* Console transport: ROUND 44px buttons, icon only. */
.ctl-round {
  width: 44px; min-width: 44px; min-height: 44px; padding: 0; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill); font-size: var(--text-md);
  background: var(--field-bg); color: var(--fg); border: var(--border); box-shadow: none;
}
.ctl-round:hover:not(:disabled) { border-color: var(--hairline-strong); transform: none; box-shadow: none; }

/* Mode chip: the label says the state, the dots say the position. */
.mode-chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  width: auto; min-height: 44px; padding: 0 var(--space-4); flex: none;
  border-radius: var(--radius-pill); font-size: var(--text-xs);
  background: var(--field-bg); color: var(--fg); border: var(--border); box-shadow: none;
}
.mode-chip:hover:not(:disabled) { border-color: var(--hairline-strong); transform: none; box-shadow: none; }
.mode-chip.active { border-color: var(--accent-bright); color: var(--accent-bright); }
/* Icon-only chip as a DIRECT column child (monitor toggle): the card's
   align-items:stretch would blow it up to full width (field 2026-07-23). */
.mode-chip.center { align-self: center; }
/* Monitor chip is BI-STABLE (field 2026-07-23: outline-only read as dead):
   ON stands on the solid accent ground, the label says the state. */
#monitor-toggle.active {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
}
.mode-chip .dots { display: flex; gap: 3px; }
.mode-chip .dots i { width: 4px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--fg) 18%, transparent); }
.mode-chip .dots i.on { background: var(--accent-bright); }

/* Console now-playing line: one clamped line, the program row stays the list's job. */
.np-line { text-align: center; font-weight: 600; font-size: var(--text-md);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Section head (Program · n tracks) — shared console/listener. */
.q-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: var(--muted-2); text-transform: uppercase;
  letter-spacing: .1em; padding: 0 var(--space-1);
}

/* The program LIST: vertical and VIRTUALIZED (queue-ribbon.ts owns the row
   window; its ROW_PITCH == cell height + gap here). ZERO scrollbar, vertical
   fade at both edges. Posters are gone (2026-07-19): rows are text-only. */
.ribbon {
  position: relative; overflow-y: auto; overscroll-behavior: contain;
  max-height: 312px; /* 6 rows of pitch 52 */
  scrollbar-width: none; margin-top: var(--space-2);
  /* Fixed-px fade, matched by the canvas' LIST_PAD (queue-ribbon.ts): at rest
     the first/last rows clear it entirely — nothing looks truncated. */
  -webkit-mask-image: linear-gradient(180deg, transparent, var(--ink) 12px, var(--ink) calc(100% - 12px), transparent);
  mask-image: linear-gradient(180deg, transparent, var(--ink) 12px, var(--ink) calc(100% - 12px), transparent);
}
.ribbon::-webkit-scrollbar { display: none; }
/* The canvas gives the scrollbar the full program height; each CELL is an
   absolutely-positioned 44px row on the 52px pitch grid. The "…" action sits
   as an overlay at the row's right edge. */
.ribbon-canvas { position: relative; }
.ribbon-cell { position: absolute; left: 2px; right: 2px; height: 44px; }
.ribbon-card {
  width: 100%; min-height: 44px; position: relative;
  display: flex; align-items: center; gap: var(--space-2);
  border: var(--border); background: var(--paper); border-radius: var(--radius-sm);
  padding: 0 var(--space-3); color: var(--fg); text-align: left; box-shadow: none;
}
.ribbon-cell .ribbon-card { height: 100%; }
/* A row with a "…" overlay keeps its tail clear of it. */
.ribbon-cell:has(.rc-menu) .ribbon-card { padding-right: 40px; }
/* M5 artifact: the ON-AIR row wears the Majorelle veil — one glance says "this plays". */
.ribbon-card.now, .ribbon-card.playing, .ribbon-card[aria-current] {
  border-color: var(--accent); background: var(--accent-soft);
}
/* Actions "…" (DJ console): a small quiet disc, top-right. Its dimensions
   RESET the base pill (width:100%, min-height:48px…). */
.rc-menu {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%); z-index: 1;
  width: 26px; height: 26px; min-height: 0; padding: 0; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  border: var(--border); border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--ink) 62%, transparent);
  color: var(--fg); font-size: 16px; font-weight: 400; letter-spacing: 0;
  backdrop-filter: blur(4px); cursor: pointer;
}
.rc-menu:hover { border-color: var(--hairline-strong); background: var(--ink); }
.rc-actions {
  position: absolute; top: 50%; right: 42px; transform: translateY(-50%); z-index: 2;
  display: flex; flex-direction: column; gap: var(--space-1);
  padding: var(--space-1); border: var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev); box-shadow: var(--shadow-sm);
}
.rc-actions.hidden { display: none; }
/* Always-visible row actions (suggestions accept/reject): in the flex flow,
   not the overlay popover. */
.rc-actions.rc-inline {
  position: static; transform: none; flex-direction: row;
  border: none; background: none; box-shadow: none; padding: 0;
}
/* Non-virtualized sibling of .ribbon (suggestions): same rows, plain flow. */
.ribbon-flow {
  display: flex; flex-direction: column; gap: 8px; margin-top: var(--space-2);
}
.ribbon-flow .ribbon-card { min-height: 44px; }
.rc-remove {
  width: auto; min-height: 0; margin: 0;
  border: var(--border); border-radius: var(--radius-sm);
  background: var(--danger-bg); color: var(--danger-fg);
  padding: 6px 10px; font-size: var(--text-xs); font-weight: 500;
  letter-spacing: 0; cursor: pointer; white-space: nowrap;
}
.rc-remove:hover { border-color: var(--danger-fg); }
button.ribbon-card { cursor: pointer; }
button.ribbon-card:hover { border-color: var(--hairline-strong); transform: none; box-shadow: none; }
.rc-title {
  flex: 1; min-width: 0; font-size: var(--text-sm); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rc-sub {
  flex: none; font-family: var(--font-mono); font-size: 11px;
  color: var(--muted-2); font-variant-numeric: tabular-nums;
}
.ribbon-card.on-air { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }
.ribbon-card.on-air .rc-sub { color: var(--accent-bright); }
/* Track change (skip/jump/natural advance): the list snaps to the new on-air
   row and it flashes once (field 2026-07-23: skip left the eye lost). */
.ribbon-card.on-air.pulse { animation: onair-pulse 1.2s ease-out 1; }
@keyframes onair-pulse {
  0%   { background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent); }
  100% { background: var(--paper); box-shadow: 0 0 0 1px var(--accent-soft); }
}
/* Armed jump (2nd tap within 4s): the card arms in accent. */
.ribbon-card.confirm { box-shadow: inset 0 0 0 1px var(--accent); }
.ribbon-card.confirm .rc-sub { color: var(--accent-bright); }
/* Democracy: vote count inline at the row's tail, MY vote in accent. */
.vote-badge {
  flex: none; font-size: 10px; font-family: var(--font-mono);
  background: color-mix(in srgb, var(--ink) 55%, transparent);
  color: var(--fg); border: var(--border); border-radius: var(--radius-pill);
  padding: 2px 7px;
}
.ribbon-card.voted .vote-badge {
  background: var(--accent-soft); color: var(--accent-bright); border-color: var(--accent);
}

.ok   { color: var(--ok);   font-weight: 600; }
.warn { color: var(--warn); font-weight: 600; }
.err  { color: var(--err);  font-weight: 600; }

.progress-track {
  background: var(--track-bg);
  border: none;
  height: 4px; /* a thread, not a bar */
  box-shadow: none;
  border-radius: var(--radius-pill);
  position: relative;
  overflow: hidden;
}
.progress-fill {
  background: var(--accent);
  height: 100%;
  width: 0;
  transition: width 0.3s;
}

a { color: inherit; text-decoration: underline 2px; text-decoration-color: var(--accent); text-underline-offset: 4px; }

/* NO elevation games on hover (no lift, no glow, no raised cards): hover is a
   gentle brightness step that respects EVERY recipe's own ground — a global
   background here would beat the restyled buttons (menu, tiles) and wash
   their light ink illegible. Flat is the design. */
.card { transition: border-color 150ms ease; }
button:hover:not(:disabled), .btn:hover:not(.disabled) {
  filter: brightness(1.06);
}
button[data-variant='ghost']:hover:not(:disabled), .btn[data-variant='ghost']:hover:not(.disabled) {
  box-shadow: none;
  color: var(--fg);
  background: color-mix(in srgb, var(--fg) 5%, transparent);
}

/* Micro buttons (votes, ✓/✗ suggestions): a vote is a micro-gesture, not a
   big pill — one place for the recipe (was: inline styles copied ×3). */
button.btn-micro { width: auto; padding: 4px 12px; font-size: var(--text-xs); min-height: 32px; }

/* Live "now-playing" dot : doux pouls + anneau qui se propage (beatsync animate-ping). */
@keyframes pulse-dot { 0%,100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); } }
.dot.live { position: relative; animation: pulse-dot 1.8s ease-in-out infinite; }
.dot.live::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: var(--accent); opacity: 0;
  animation: ping 1.8s cubic-bezier(0,0,.2,1) infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: .4; } 70%,100% { transform: scale(2); opacity: 0; } }

/* Soft entrance for list items / cards revealed dynamically. */
@keyframes fade-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fade-rise { animation: fade-rise 260ms ease both; }

/* Entrance: fade + slight translate/scale, soft curve. On a card (.enter) or
   staggered on its children (.enter-stagger). */
@keyframes enter { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.enter { animation: enter .5s cubic-bezier(.22,1,.36,1) both; }
.enter-stagger > * { animation: enter .5s cubic-bezier(.22,1,.36,1) both; }
.enter-stagger > *:nth-child(1) { animation-delay: .04s; }
.enter-stagger > *:nth-child(2) { animation-delay: .10s; }
.enter-stagger > *:nth-child(3) { animation-delay: .16s; }
.enter-stagger > *:nth-child(4) { animation-delay: .22s; }
.enter-stagger > *:nth-child(5) { animation-delay: .28s; }
.enter-stagger > *:nth-child(6) { animation-delay: .34s; }
.enter-stagger > *:nth-child(7) { animation-delay: .40s; }
.enter-stagger > *:nth-child(8) { animation-delay: .46s; }

/* The Wave — 8 VERTICAL bars whose HEIGHT tells the state. Flat = stopped;
   L→R sweep = syncing ("the clocks are tuning"); breathing from the center
   outward = on air. The state-bar.ts contract is unchanged: ONE state class
   set by the single writer (playing / paused / seeking / syncing / lost),
   default with no class = flat. */
.sync-bar { display: flex; gap: 5px; justify-content: center; align-items: center; height: 24px; }
.sync-bar i {
  width: 4px; height: 12%; border-radius: 2px;
  background: var(--accent-bright);
  transition: height .4s, background .4s;
}
/* on air: breathing, lighting from the center outward. */
@keyframes onde-breathe { 0%, 100% { height: 18%; } 50% { height: 92%; } }
.sync-bar.playing i, .sync-bar.seeking i { animation: onde-breathe 1.15s ease-in-out infinite; }
/* fast-forward / re-anchor: the same breathing, twice as fast. */
.sync-bar.seeking i { animation-duration: .55s; }
.sync-bar.playing i:nth-child(4), .sync-bar.playing i:nth-child(5),
.sync-bar.seeking i:nth-child(4), .sync-bar.seeking i:nth-child(5) { animation-delay: 0s; }
.sync-bar.playing i:nth-child(3), .sync-bar.playing i:nth-child(6),
.sync-bar.seeking i:nth-child(3), .sync-bar.seeking i:nth-child(6) { animation-delay: .2s; }
.sync-bar.playing i:nth-child(2), .sync-bar.playing i:nth-child(7),
.sync-bar.seeking i:nth-child(2), .sync-bar.seeking i:nth-child(7) { animation-delay: .4s; }
.sync-bar.playing i:nth-child(1), .sync-bar.playing i:nth-child(8),
.sync-bar.seeking i:nth-child(1), .sync-bar.seeking i:nth-child(8) { animation-delay: .6s; }
/* join/sync: left→right sweep, opacity follows the crest. */
@keyframes onde-sweep { 0%, 30%, 100% { height: 14%; opacity: .45; } 12% { height: 85%; opacity: 1; } }
.sync-bar.syncing i { animation: onde-sweep 1.1s linear infinite; }
.sync-bar.syncing i:nth-child(1) { animation-delay: 0s; }
.sync-bar.syncing i:nth-child(2) { animation-delay: .11s; }
.sync-bar.syncing i:nth-child(3) { animation-delay: .22s; }
.sync-bar.syncing i:nth-child(4) { animation-delay: .33s; }
.sync-bar.syncing i:nth-child(5) { animation-delay: .44s; }
.sync-bar.syncing i:nth-child(6) { animation-delay: .55s; }
.sync-bar.syncing i:nth-child(7) { animation-delay: .66s; }
.sync-bar.syncing i:nth-child(8) { animation-delay: .77s; }
/* user pause: solid accent at half height, still. */
.sync-bar.paused i { animation: none; height: 45%; background: var(--accent); }
/* dead stream: flat and red. */
.sync-bar.lost i { animation: none; background: var(--err); }
/* Hero: the wide variant of the Wave. */
.sync-bar.lg { height: 30px; }

/* ── ANTENNA STATE (M5/D2) — one component, two states. Live: the broadcast
   ping (shared .ping recipe above). Standby: static mire bars in system tones.
   Written solely by setAirState() (room-badge.ts). */
.air {
  position: relative; /* anchors the SR-only standby label */
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: .16em;
  padding: 6px 13px 6px 9px; border-radius: var(--radius-pill);
  border: var(--border); color: var(--muted-2);
  flex: none; user-select: none;
}
.air .mire-chip { display: inline-flex; gap: 2px; height: 12px; width: 18px; flex: none; }
.air .mire-chip i { flex: 1; border-radius: 1px; background: var(--muted-2); }
.air .mire-chip i:nth-child(1) { background: var(--accent-bright); }
.air .mire-chip i:nth-child(2) { opacity: .7; }
.air .mire-chip i:nth-child(3) { background: var(--accent-bright); opacity: .45; }
.air .mire-chip i:nth-child(4) { opacity: .35; }
/* State switch: each state shows ITS icon and ITS label, nothing else.
   Paused ≠ standby (field 2026-07-23: the standby face read as a full stop):
   the hold keeps the mire bars but takes the accent + its own label. */
.air.live { color: var(--onair); border-color: color-mix(in srgb, var(--onair) 45%, transparent); }
.air.live .mire-chip, .air.live .air-label.off, .air.live .air-label.hold { display: none; }
.air.standby .ping, .air.standby .air-label.on, .air.standby .air-label.hold { display: none; }
/* Standby face: the idling bars ARE the state (a MIRE word next to them said
   nothing, TODO 2026-07-29) — the label stays for screen readers only. */
.air.standby .air-label.off {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.air.standby .mire-chip i { animation: mire-idle 2.8s ease-in-out infinite; }
.air.standby .mire-chip i:nth-child(2) { animation-delay: .7s; }
.air.standby .mire-chip i:nth-child(3) { animation-delay: 1.4s; }
.air.standby .mire-chip i:nth-child(4) { animation-delay: 2.1s; }
@keyframes mire-idle { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.55); } }
.air.paused { color: var(--accent-bright); border-color: color-mix(in srgb, var(--accent-bright) 45%, transparent); }
.air.paused .ping, .air.paused .air-label.on, .air.paused .air-label.off { display: none; }

@media (max-width: 480px) {
  body { font-size: 16px; }
}

/* ── Morph primitives (spec 2026-07-23 §3) : states MUTATE, they don't pop.
   .fold: vertical unfold; the single child wraps the content (overflow
   hidden). Closed = height 0 + opacity 0 -> Playwright sees it hidden.
   visibility is delayed to the end of the collapse transition: a grandchild
   of a closed .fold (e.g. a button inside the wrapped content) keeps a
   non-zero bounding box under overflow:hidden clipping alone (clipping the
   parent does not zero a descendant's own box) -> Playwright's toBeHidden
   only clears once visibility:hidden lands on the ancestor. It also drops
   folded controls out of the tab order (visibility:hidden is not
   focusable), a real a11y win: closed content can no longer eat a Tab
   stop. */
.fold { display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden;
  transition: grid-template-rows .38s var(--spring), opacity .28s, visibility 0s .38s; }
.fold.open { grid-template-rows: 1fr; opacity: 1; visibility: visible;
  transition: grid-template-rows .38s var(--spring), opacity .28s, visibility 0s 0s; }
.fold > * { overflow: hidden; min-height: 0; }
/* .appears: a control grows into an existing flex row instead of popping.
   .off = width 0 + opacity 0 (hidden for Playwright), border collapsed.
   min-width/min-height reset to 0: a host recipe like .ctl-round sets
   min-width:44px, which beats max-width:0 in the cascade (min-* always wins
   over max-* per spec) and left the "hidden" control with a 44px box.
   visibility follows the same delayed-on-close / instant-on-open contract
   as .fold above, for the same Playwright + a11y reasons. */
.appears { transition: max-width .38s var(--spring), opacity .26s .06s,
  transform .38s var(--spring), visibility 0s 0s;
  max-width: 20rem; opacity: 1; overflow: hidden; visibility: visible; }
.appears.off { max-width: 0; min-width: 0; min-height: 0; opacity: 0; transform: scale(.85);
  padding-left: 0; padding-right: 0; border-width: 0; visibility: hidden;
  transition: max-width .38s var(--spring), opacity .18s,
  transform .38s var(--spring), visibility 0s .38s; }
/* Screen entry (listener state screens replace each other; display:none ->
   block restarts the animation, zero JS). */
.screen-enter:not(.hidden) { animation: screen-enter .32s var(--spring) both; }
@keyframes screen-enter { from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: none; } }
/* Console + governance surfaces take the same entry: state changes mutate,
   they don't pop (spec 2026-07-23 §3). .hidden removal restarts it. */
#station-card:not(.hidden),
#gov-controls:not(.hidden), #gov-vote:not(.hidden),
#suggestions-panel:not(.hidden), #host-vote:not(.hidden),
#host-suggestions:not(.hidden), #gov-participants:not(.hidden) {
  animation: screen-enter .32s var(--spring) both;
}
/* Theme swap crossfade: colors transition ONLY while .theme-switching is
   stamped (theme.ts setTheme) — a permanent color transition would lag every
   hover. Reduced-motion still wins: its blanket rule comes later. */
html.theme-switching, html.theme-switching *,
html.theme-switching *::before, html.theme-switching *::after {
  transition: background-color .35s ease, color .35s ease,
    border-color .35s ease, fill .35s ease, box-shadow .35s ease !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  /* Exception: the .loading spinner is a functional status indicator, not
     decoration. Killing it under reduced-motion makes "connecting…" look
     frozen/broken — keep it spinning. */
  .loading::after { animation: spin 0.7s linear infinite !important; }
  /* The press-scale isn't just de-animated above (transition:none already
     makes it instant) — it's removed outright, formerly a Button.astro-only
     behavior, now part of the one .btn table. */
  button:active, .btn:active { transform: none; }
  /* The intro slides reveal their content via animation (opacity 0 -> in).
     With animation killed above, that content would stay invisible — reveal
     it outright so reduced-motion users still see every slide. */
  .intro-slide > *, .intro-peer { opacity: 1; transform: none; }
}

/* /app download rows: platform mark + OS/format + filename, size and the
   ship-time SHA-512 as a tap-to-copy chip. The page wrapper is a flex-column
   item (.container): without min-width:0 its min-content (nowrap mono
   filenames) forces the page wider than the viewport (terrain 2026-07-18:
   435px on a 390px phone — horizontal drift read as vertical overflow). */
[data-app-page] { width: 100%; min-width: 0; }
/* Flat list INSIDE the card (no box-in-box, Leonard 2026-07-18): rows are
   hairline-separated, never individually boxed. */
.dl-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-1);
  min-width: 0;
  text-decoration: none;
  color: inherit;
  text-align: left;
}
.dl-row + .dl-row { border-top: var(--border-soft); }
.dl-row:hover { filter: brightness(1.12); }
.dl-icon { display: flex; opacity: 0.85; }
.dl-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dl-title { font-size: var(--text-sm); }
.dl-file {
  font-size: var(--text-xs);
  opacity: 0.55;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dl-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.dl-size { font-size: var(--text-xs); opacity: 0.7; }
.dl-sha {
  font-size: 10px;
  opacity: 0.6;
  background: none;
  border: var(--border-soft);
  border-radius: 8px;
  padding: 2px 6px;
  color: inherit;
  cursor: pointer;
}
.dl-sha:hover { opacity: 1; }

/* Task 11 (inline style= purge): the remaining recipes, same rule as above
   (token values only). One-off composites with no reusable shape (raw px/vw,
   used exactly once) stay as component-scoped <style> blocks instead.
   Placed at the END of the file (review follow-up): these are single-class
   utilities meant to WIN every same-specificity tie against earlier rules
   that also touch these properties (.card padding, .label display, .muted
   font-weight, etc.) the way the inline style= they replace always did —
   inline style always outranks a class regardless of source order, so the
   only way a class can reproduce that is to be declared last in the cascade. */
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-left { text-align: left; }
.m-0 { margin: 0; }
.block { display: block; }
.fg { color: var(--fg); }
.strong { font-weight: 600; }
.min-line { min-height: 1.2em; } /* status/countdown lines: reserve one text-row so layout doesn't jump when text appears */
.pt-2 { padding-top: var(--space-2); }
.pt-4 { padding-top: var(--space-4); }
.pad-5 { padding: var(--space-5); }
.pad-y-2 { padding: var(--space-2) 0; }
.pad-y-4 { padding: var(--space-4) 0; }
.pad-y-5 { padding: var(--space-5) 0; }
.mx-auto-28 { max-width: 28rem; margin-left: auto; margin-right: auto; }
.p-lead { margin: 0 0 var(--space-3); } /* intro paragraph before a CTA: zero the default p margin, keep only the bottom gap */
