/* The Station — 00-base: the music-app token contract (DARK-FIRST), the shell,
   the stations home (Daily Mix + list + domain grid), the toast and the
   persistent mini-player.

   Dark is the DEFAULT (:root) — a near-black ground, one vivid iris accent, big
   type. A light theme is fully designed under @media (prefers-color-scheme:
   light). The accent evokes a music player's mechanics without borrowing any
   streaming brand's trade-dress colours; each domain station carries its OWN
   hue (set inline via --hue) so the home grid reads like a wall of records. */

:root {
  color-scheme: dark;
  --bg: #0b0b0f;
  --bg-2: #101017;
  --panel: #16161e;
  --panel-2: #1d1d27;
  --elev: #24242f;
  --ink: #f5f5f8;
  --ink-2: #b6b6c4;
  --ink-3: #8a8a98; /* rebased 2026-07-21 (AIL r2 sol Major #2 / fable F2,
    Iris-dark): was #7c7c8c, 3.74:1 on --elev (the theme-sheet/audio-sheet
    ground, the worst-case surface) -> 4.51:1. Same hue, lighter only. */
  --line: #262631;
  --line-strong: #3a3a48;
  --accent: #8f7bff;
  --accent-ink: #0b0b0f;
  --accent-soft: rgba(143, 123, 255, 0.16);
  --danger: #ff6b6b;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 26px 70px rgba(0, 0, 0, 0.62);
  --content-max: 860px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #faf9f7;
    --bg-2: #f2f1ee;
    --panel: #ffffff;
    --panel-2: #f6f5f2;
    --elev: #ffffff;
    --ink: #17171c;
    --ink-2: #55555f;
    --ink-3: #6f6f7a; /* rebased 2026-07-21 (AIL r2 sol Major #2 / fable
      F2, Iris-light): was #8a8a94, 3.42:1 on --elev (white — the
      theme-sheet/audio-sheet ground) -> 4.96:1 (also 4.55 on --panel-2).
      Same hue, darker only (a light ground needs a DARKER foreground). */
    --line: #e8e7e3;
    --line-strong: #d2d0ca;
    --accent: #5b46e0;
    --accent-ink: #ffffff;
    --accent-soft: rgba(91, 70, 224, 0.12);
    --shadow-sm: 0 1px 2px rgba(20, 20, 30, 0.06);
    --shadow-md: 0 8px 26px rgba(20, 20, 40, 0.1);
    --shadow-lg: 0 22px 60px rgba(15, 15, 35, 0.2);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--bg-2), transparent 70%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

/* ---------------- shell ---------------- */

#st-app {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 20px 140px;
}

#st-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  padding: 18px 2px 14px;
  background: linear-gradient(var(--bg), color-mix(in srgb, var(--bg) 82%, transparent));
  backdrop-filter: blur(8px);
}

.st-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.st-logo {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 16px;
  box-shadow: var(--shadow-sm);
}

#st-view { display: block; outline: none; }
#st-view:focus-visible { outline: none; }

/* ---------------- headings ---------------- */

.st-home-head { margin: 8px 0 22px; }
.st-eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--ink-2);
  letter-spacing: 0.01em;
}
.st-home-title {
  margin: 0;
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.st-h2 {
  margin: 30px 0 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------------- feature row (Daily Mix + Resume) ---------------- */

.st-feature {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 620px) {
  .st-feature { grid-template-columns: 1.4fr 1fr; }
  .st-card-hero { grid-row: span 1; }
}

/* ---------------- quick + grid ---------------- */

.st-quick {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.st-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

/* ---------------- station card ---------------- */

.st-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
  overflow: hidden;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.st-card:hover { transform: translateY(-2px); border-color: var(--line-strong); background: var(--panel-2); }
.st-card:active { transform: translateY(0) scale(0.99); }
.st-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.st-card-art {
  flex: none;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 12px;
  font-size: 24px;
  color: #fff;
  background:
    linear-gradient(140deg,
      hsl(var(--hue, 268) 72% 52%),
      hsl(calc(var(--hue, 268) + 24) 64% 34%));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.st-card-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.st-card-label {
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.st-card-sub {
  font-size: 12.5px; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.st-card-play {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.st-card:hover .st-card-play,
.st-card:focus-visible .st-card-play { opacity: 1; transform: translateX(0); }

/* the hero card (Daily Mix) is taller with a big art panel */
.st-card-hero {
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  min-height: 168px;
  background:
    radial-gradient(120% 120% at 100% 0%, hsl(var(--hue, 268) 60% 24% / 0.9), transparent 60%),
    var(--panel);
}
.st-card-hero .st-card-art { width: 66px; height: 66px; font-size: 30px; border-radius: 16px; }
.st-card-hero .st-card-label { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; white-space: normal; }
.st-card-hero .st-card-sub { font-size: 13.5px; white-space: normal; }
.st-card-hero .st-card-play { position: absolute; right: 20px; bottom: 20px; width: 44px; height: 44px; }

@media (prefers-reduced-motion: reduce) {
  .st-card, .st-card-play { transition: none; }
  .st-card:hover { transform: none; }
}

/* ---------------- empty states ---------------- */

.st-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-2);
}
.st-empty-title { font-size: 18px; font-weight: 700; color: var(--ink); margin: 0 0 8px; }
.st-empty a { color: var(--accent); }

/* ---------------- toast ---------------- */

.st-toast {
  position: fixed;
  left: 50%; bottom: 92px;
  transform: translateX(-50%) translateY(12px);
  background: var(--elev);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  padding: 10px 18px;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 60;
}
.st-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (prefers-reduced-motion: reduce) { .st-toast { transition: opacity 0.2s ease; } }

/* ---------------- mini player (off the /play screen) ---------------- */

#st-mini[hidden] { display: none; }
#st-mini {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  width: min(560px, calc(100vw - 24px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 16px;
  background: var(--elev);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
}
.st-mini-open { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.st-mini-title {
  font-size: 14px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.st-mini-src {
  font-size: 12px; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.st-mini-btn {
  position: relative; /* anchors the coarse-pointer hit-slop below */
  flex: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  cursor: pointer;
  display: grid; place-items: center;
}
.st-mini-btn:last-child { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line-strong); }
.st-mini-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* finding #17: mini-player Play/Next are 40x40, below the 44x44 floor.
   Coarse-pointer hit-slop, drawn disc unchanged. */
@media (pointer: coarse) {
  .st-mini-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
  }
}

/* The Station — 05-themes: the THEME WARDROBE (6 dark-native packs), the
   theme-picker chrome, and the Spotify-feel pass (heavier type, hue-bleed
   page headers, art-first domain shelves with a play FAB, and a Spotify-style
   mini bar). Loads AFTER 00-base (globbed 05- sorts between 00- and 10-), so a
   pack's token overrides win the equal-specificity tie against the :root /
   prefers-color-scheme defaults purely by source order.

   Mechanism: documentElement carries data-st-theme, stamped at boot from the
   DEVICE-LOCAL localStorage key wv:st:theme (Store prefix "wv:" + "st:theme").
   That key is deliberately ABSENT from ST_SYNC_KEYS (70-sync.js) — the theme
   is per-device, never a synced preference, never in a PUT body. Default when
   unset is "encore" (the dark Spotify pack). "iris" is the ONE id with no
   block here on purpose: data-st-theme="iris" matches nothing, so the original
   auto light/dark :root wardrobe stays byte-for-byte intact — the pixel-parity
   contract, exactly like tenet's "standard" skin.

   Each pack overrides the FULL colour-token contract coherently (bg through
   accent), keeps body ink at or above 4.5:1 on its ground, and declares
   color-scheme: dark so native form controls follow. Shadows, radii, fonts and
   measures are inherited from :root and never re-declared. */

/* ---------------- encore (DEFAULT) — the dark Spotify pack ---------------- */

[data-st-theme="encore"] {
  color-scheme: dark;
  --bg: #121212;
  --bg-2: #161616;
  --panel: #181818;
  --panel-2: #202020;
  --elev: #282828;
  --ink: #ffffff;
  --ink-2: #b3b3b3;
  --ink-3: #8e8e8e; /* rebased 2026-07-21 (AIL r1 code-lane #16): was
    #7a7a7a, 3.43:1 on --elev (the theme-sheet/audio-sheet background —
    the worst-case surface; queue-position/progress/rate labels sit as
    low as 4.14:1 on --panel) -> 4.50:1 on --elev. Same hue (neutral
    gray), lighter only. */
  --line: #2a2a2a;
  --line-strong: #3a3a3a;
  --accent: #1db954;
  --accent-ink: #121212;
  --accent-soft: rgba(29, 185, 84, 0.16);
  --danger: #f0616b;
}

/* ---------------- neon — hot-pink over near-black violet ---------------- */

[data-st-theme="neon"] {
  color-scheme: dark;
  --bg: #0e0d12;
  --bg-2: #131118;
  --panel: #17151d;
  --panel-2: #1e1b26;
  --elev: #262230;
  --ink: #ffffff;
  --ink-2: #b3a9b0;
  --ink-3: #908895; /* rebased 2026-07-21 (AIL r2 sol Major #2 / fable
    F2): was #7d7482, 3.47:1 on --elev (worst-case surface) -> 4.54:1.
    Same hue, lighter only. */
  --line: #241f2b;
  --line-strong: #363040;
  --accent: #ff375f;
  --accent-ink: #1a0208;
  --accent-soft: rgba(255, 55, 95, 0.16);
  --danger: #ff6b6b;
}

/* ---------------- cobalt — bright azure over deep navy ---------------- */

[data-st-theme="cobalt"] {
  color-scheme: dark;
  --bg: #0a0f1a;
  --bg-2: #0d1420;
  --panel: #121a29;
  --panel-2: #182236;
  --elev: #1f2c44;
  --ink: #f2f6fc;
  --ink-2: #93a4bd;
  --ink-3: #8694a7; /* rebased 2026-07-21 (AIL r2 sol Major #2 / fable
    F2): was #647389, 2.90:1 on --elev (worst-case surface) -> 4.53:1.
    Same hue, lighter only. */
  --line: #1c2740;
  --line-strong: #2c3b58;
  --accent: #3da5ff;
  --accent-ink: #071019;
  --accent-soft: rgba(61, 165, 255, 0.16);
  --danger: #ff6b6b;
}

/* ---------------- amber — warm gold over roasted brown-black ---------------- */

[data-st-theme="amber"] {
  color-scheme: dark;
  --bg: #151110;
  --bg-2: #1a1513;
  --panel: #1d1714;
  --panel-2: #251d18;
  --elev: #2d231c;
  --ink: #faf4ee;
  --ink-2: #b3a396;
  --ink-3: #96897d; /* rebased 2026-07-21 (AIL r2 sol Major #2 / fable
    F2): was #7f7266, 3.29:1 on --elev (worst-case surface) -> 4.51:1.
    Same hue, lighter only. */
  --line: #29201b;
  --line-strong: #3a2e26;
  --accent: #ffa028;
  --accent-ink: #151110;
  --accent-soft: rgba(255, 160, 40, 0.16);
  --danger: #ff6b6b;
}

/* ---------------- ultraviolet — orchid over ink-violet ---------------- */

[data-st-theme="ultraviolet"] {
  color-scheme: dark;
  --bg: #120a18;
  --bg-2: #17101f;
  --panel: #1b1324;
  --panel-2: #23192f;
  --elev: #2c2038;
  --ink: #f8f2fc;
  --ink-2: #a996b3;
  --ink-3: #95869e; /* rebased 2026-07-21 (AIL r2 sol Major #2 / fable
    F2): was #7a6a84, 3.08:1 on --elev (worst-case surface) -> 4.51:1.
    Same hue, lighter only. */
  --line: #261b32;
  --line-strong: #382a47;
  --accent: #d65bff;
  --accent-ink: #14061c;
  --accent-soft: rgba(214, 91, 255, 0.16);
  --danger: #ff6b6b;
}

/* iris has NO block on purpose — data-st-theme="iris" matches nothing and the
   original :root (auto light/dark iris purple) stays exactly as-is. */

/* ==========================================================================
   Spotify-feel pass — visual only. No data or logic contract changes; the
   shelf/FAB/mini markup hooks are cosmetic wrappers the JS already emits.
   ========================================================================== */

/* ---------------- type: heavier, tighter headings + titles ---------------- */

.st-home-title { font-weight: 800; letter-spacing: -0.03em; }
.st-h2 {
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-transform: none;
  font-size: 20px;
}
.st-card-label { font-weight: 700; letter-spacing: -0.01em; }
.st-now-title { font-weight: 800; letter-spacing: -0.02em; }

/* ---------------- page headers: a hue bleed into the ground ---------------- */

/* the home header washes the accent down behind the greeting. */
.st-home-head {
  position: relative;
  margin-top: 0;
  padding: 22px 20px 8px;
  margin-left: -20px;
  margin-right: -20px;
}
.st-home-head::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 26%, transparent),
    transparent 82%);
  pointer-events: none;
}

/* the now-playing screen bleeds the station's own --hue behind the header. */
.st-now { position: relative; }
.st-now::before {
  content: "";
  position: absolute;
  top: 0; left: -20px; right: -20px;
  height: 340px;
  z-index: -1;
  background: linear-gradient(
    180deg,
    hsl(var(--hue, 268) 62% 46% / 0.38),
    hsl(var(--hue, 268) 62% 40% / 0.12) 42%,
    transparent 78%);
  pointer-events: none;
}

/* ---------------- home: domain grid becomes horizontal shelf rails --------
   .st-grid keeps its class (the shell + tests key off it) but reflows into a
   scroll-snapping rail of art-first cards. The scrollbar is hidden for the
   Spotify aesthetic; keyboard focus still scrolls cards into view. */

.st-grid {
  display: flex;
  grid-template-columns: none;
  gap: 14px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 4px 20px 12px;
  margin: 0 -20px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.st-grid::-webkit-scrollbar { display: none; }

.st-card-shelf {
  flex: 0 0 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 150px;
  padding: 10px;
  scroll-snap-align: start;
}
.st-card-shelf:hover { transform: translateY(-2px); }
.st-card-shelf .st-card-art {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  font-size: 34px;
}
.st-card-shelf .st-card-text {
  flex: none;
  width: 100%;
  gap: 2px;
}
.st-card-shelf .st-card-label {
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.25;
}
/* the full count reads on its own line — no more mid-word "350 at…" clip. */
.st-card-shelf .st-card-sub {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

/* the round accent play FAB, pinned to the art's bottom-right. */
.st-card-shelf .st-card-play {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 40px;
  height: 40px;
  transform: translateY(6px);
  box-shadow: var(--shadow-md);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
/* pointer devices: the FAB fades in on hover/focus-within. */
@media (hover: hover) {
  .st-card-shelf .st-card-play { opacity: 0; }
  .st-card-shelf:hover .st-card-play,
  .st-card-shelf:focus-within .st-card-play {
    opacity: 1;
    transform: translateY(0);
  }
}
/* touch devices: the FAB is always visible (there is no hover to reveal it). */
@media (hover: none) {
  .st-card-shelf .st-card-play { opacity: 1; transform: none; }
}

/* ---------------- mini player: the Spotify bottom bar ---------------- */

#st-mini {
  border-radius: var(--radius);
  padding: 8px 12px;
  gap: 12px;
  overflow: hidden;
}
/* a thin accent hairline rides the top edge, clipped to the radius. */
#st-mini::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
}
.st-mini-art {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  font-size: 18px;
  background: linear-gradient(
    140deg,
    var(--accent),
    color-mix(in srgb, var(--accent) 55%, #000));
}

/* ---------------- theme picker: topbar button + swatch sheet ---------------- */

.st-theme-btn {
  position: relative; /* anchors the coarse-pointer hit-slop below */
  margin-left: auto;
  flex: none;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink-2);
  font-size: 16px;
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.st-theme-btn:hover { color: var(--ink); border-color: var(--accent); }
.st-theme-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* finding #17: topbar theme/audio/app-switch buttons are 38x38, below
   the 44x44 touch-target floor. Coarse-pointer hit-slop, drawn disc
   unchanged (mirrors .brief-toggle/.rail-btn/.dk-check elsewhere). */
@media (pointer: coarse) {
  .st-theme-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
  }
}

#st-theme-pop[hidden] { display: none; }
#st-theme-pop { position: fixed; inset: 0; z-index: 70; }
.st-theme-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.34); }
.st-theme-sheet {
  position: fixed;
  top: 64px;
  right: 12px;
  z-index: 71;
  width: min(280px, calc(100vw - 24px));
  padding: 8px;
  background: var(--elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.st-theme-title {
  margin: 4px 8px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.st-swatch {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.st-swatch:hover { background: var(--panel-2); }
.st-swatch[aria-pressed="true"] { background: var(--accent-soft); }
.st-swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.st-swatch-dot {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.st-swatch-name { flex: 1; min-width: 0; }
.st-swatch-check { flex: none; color: var(--accent); opacity: 0; font-size: 14px; }
.st-swatch[aria-pressed="true"] .st-swatch-check { opacity: 1; }

/* ---------------- audio panel: topbar button + generation sheet ------------- */

.st-audio-btn { margin-left: 8px; font-size: 15px; } /* sits right of the theme dot */
.st-audio-btn[hidden] { display: none; }

#st-audio-pop[hidden] { display: none; }
#st-audio-pop { position: fixed; inset: 0; z-index: 70; }
.st-audio-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.34); }
.st-audio-sheet {
  position: fixed;
  top: 64px;
  right: 12px;
  z-index: 71;
  width: min(300px, calc(100vw - 24px));
  padding: 10px;
  background: var(--elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.st-audio-title {
  margin: 4px 8px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.st-audio-status { margin: 0 8px 8px; }
.st-audio-line {
  margin: 2px 0;
  font-size: 13px;
  color: var(--ink-2);
}
.st-audio-err { color: var(--accent); font-weight: 600; }
.st-audio-act {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 12px;
  margin-top: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.st-audio-act:hover { background: var(--panel-2); border-color: var(--accent); }
.st-audio-act:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.st-audio-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  justify-content: center;
}
.st-audio-primary:hover { filter: brightness(1.05); background: var(--accent); }
.st-audio-toggle.on { background: var(--accent-soft); border-color: var(--accent); }

/* ---------------- reduced motion: drop the new opacity/transform easings --- */

@media (prefers-reduced-motion: reduce) {
  .st-card-shelf .st-card-play,
  .st-theme-btn { transition: none; }
  .st-card-shelf:hover { transform: none; }
}

/* The Station — 10-player: the now-playing screen. Big art, big title, a
   boundary-driven progress bar, the transport, rate + sleep chips, the up-next
   list, and the text fallback (the atom's own HTML, scrollable — the screen
   works muted). All motion is reduced-motion-guarded. */

.st-now {
  padding-top: 6px;
}

.st-now-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.st-back { color: var(--accent); font-size: 14px; font-weight: 600; }
.st-now-count { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.st-now-art {
  width: min(320px, 62vw);
  aspect-ratio: 1;
  margin: 4px auto 24px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-lg);
  font-size: clamp(64px, 18vw, 120px);
  color: #fff;
  background:
    radial-gradient(120% 120% at 20% 10%, hsl(calc(var(--hue, 268) + 30) 78% 58%), transparent 55%),
    linear-gradient(150deg, hsl(var(--hue, 268) 72% 48%), hsl(calc(var(--hue, 268) + 18) 60% 26%));
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.st-now-meta { text-align: center; margin-bottom: 18px; }
.st-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: hsl(var(--hue, 268) 60% 42%);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.st-now-title {
  margin: 0 0 6px;
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.st-now-src { margin: 0; color: var(--ink-2); font-size: 14px; }

/* ---------------- progress ---------------- */

.st-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 2px 20px;
}
.st-progress-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--line-strong);
  overflow: hidden;
}
.st-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.2s linear;
}
.st-progress-pct {
  flex: none;
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  min-width: 34px;
  text-align: right;
}
@media (prefers-reduced-motion: reduce) { .st-progress-fill { transition: none; } }

/* ---------------- transport ---------------- */

.st-controls { display: flex; flex-direction: column; align-items: center; gap: 16px; }

.st-transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}
.st-tbtn {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: transform 0.1s ease, background 0.14s ease, border-color 0.14s ease;
}
.st-tbtn:hover { border-color: var(--accent); }
.st-tbtn:active { transform: scale(0.92); }
.st-tbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.st-tbtn-main {
  width: 72px; height: 72px;
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-size: 22px;
  box-shadow: 0 8px 24px var(--accent-soft);
}
@media (prefers-reduced-motion: reduce) { .st-tbtn { transition: background 0.14s ease; } .st-tbtn:active { transform: none; } }

/* ---------------- control groups (rate / sleep / mark) ---------------- */

.st-ctl-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.st-ctl-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-right: 4px;
}
.st-chip {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 6px 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.st-chip:hover { border-color: var(--accent); color: var(--ink); }
.st-chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.st-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.st-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.st-mark:hover { border-color: var(--accent); }
.st-mark.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.st-mark:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .st-chip, .st-mark { transition: none; } }

/* ---------------- up next ---------------- */

.st-upnext { margin-top: 10px; }
.st-up-list { display: flex; flex-direction: column; }
.st-up-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 12px 10px;
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.12s ease;
}
.st-up-row:hover { background: var(--panel); }
.st-up-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.st-up-title {
  font-size: 14.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.st-up-src { font-size: 12.5px; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-up-empty { color: var(--ink-3); font-size: 14px; padding: 8px 10px; }
@media (prefers-reduced-motion: reduce) { .st-up-row { transition: none; } }

/* ---------------- text fallback (read along / muted) ---------------- */

.st-text { margin-top: 12px; }
.st-text-body {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  max-height: 60vh;
  overflow-y: auto;
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--ink);
}
.st-text-body h2, .st-text-body h3, .st-text-body h4 {
  font-weight: 700; letter-spacing: -0.01em; margin: 1.3em 0 0.4em;
}
.st-text-body h2 { font-size: 18px; }
.st-text-body h3 { font-size: 16px; }
.st-text-body p { margin: 0 0 1em; }
.st-text-body ul, .st-text-body ol { margin: 0 0 1em; padding-left: 1.3em; }
.st-text-body li { margin: 0.25em 0; }
.st-text-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.st-text-body code {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.9em;
}
.st-text-body blockquote {
  margin: 1em 0;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--accent);
  color: var(--ink-2);
}
.st-text-body .wl { color: var(--accent); }
.st-text-body .wl-dead { color: var(--ink-3); }

@media (max-width: 620px) {
  .st-text-body { padding: 16px; font-size: 16px; }
  .st-transport { gap: 16px; }
}
