/* ── riptide design system ────────────────────────────────
 *   Progressive enhancement — all pages work without CSS
 *   (CLI browsers, curl, etc). This file is the full design.
 *   layout.html contains minimal inline fallback styles.
 *
 *   Theme architecture (rev 1.6):
 *   ┌─────────────────────────────────────────────────────────┐
 *   │  :root                    structural vars, no colors    │
 *   │  [data-theme="dark"]      the default palette           │
 *   │  [data-theme="light"]     light mode overrides           │
 *   │  [data-accent="..."]      flavor override for accent     │
 *   └─────────────────────────────────────────────────────────┘
 *
 *   The theme is driven by `data-theme` on <html>, which core.js
 *   sets from localStorage (or prefers-color-scheme on first
 *   visit). The default [data-theme="dark"] cascade under :root
 *   remains in effect for no-JS / curl / CLI clients, so the
 *   dark look stays untouched for those. Light mode applies
 *   every surface/text/border token — semantic colors
 *   (--green, --red, etc.) are re-pointed to slightly
 *   desaturated variants for legibility on paper-white.
 *
 *   **Adding a new accent flavor (e.g. "purple", "green", "teal")**
 *   Drop a new block:
 *     [data-accent="rose"] { --accent:#fb7185; --accent-hover:#fda4b4; --accent-dim:#4c0519; --border-focus:#fb7185; }
 *   Then ship a picker that sets both `data-theme` and
 *   `data-accent`. Nothing else in the file needs editing —
 *   gradients, badges, focus rings all reference --accent /
 *   --accent-hover / --accent-dim / --border-focus.
 *
 *   Current flavors: blue (default), purple, green, teal, rose, amber.
 *   Tag accent flavors with a friendly name & add the corresponding
 *   <option> to the theme picker (see core.js initAccentPicker).
 * ---------------------------------------------------------------- */
:root {
  /* Structural — never theme-aware, never overridden */
  --radius: 8px;
  --radius-sm: 4px;
  --nav-height: 52px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Noto Sans', 'Liberation Sans', Helvetica, Arial, sans-serif;
  --font-display: system-ui, -apple-system, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Noto Sans', 'Liberation Sans', Helvetica, Arial, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'JetBrains Mono', 'Fira Code', monospace;

  /* Accent defaults (cyan/blue identity). Override via [data-accent="..."]. */
  --accent: #4a7abf;
  --accent-hover: #5a8acf;
  --accent-dim: #1e3a5f;
  --border-focus: #4a7abf;

  /* Hero gradient endpoints — defined once so both modes stay in sync. */
  --cyan: #06b6d4;
  --blue: #3b82f6;

  /* Semantic colors default to dark-mode-appropriate values. */
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;
  --orange: #f97316;
}

/* ── Dark theme (default) ─────────────────────────────────── */
:root, [data-theme="dark"] {
  /* Surfaces */
  --bg: #0d0d0d;
  --bg-card: #151515;
  --bg-hover: #1a1a2e;
  --bg-input: #1a1a1a;
  --bg-elev: #1c1c1c;        /* elevated panels (mono code blocks, menus) */
  --border: #2a2a2a;
  --text: #e0e0e0;
  --text-dim: #999;
  --text-muted: #888;
  --shadow: 0 1px 3px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 22px rgba(0,0,0,.45);
  --shadow-card-hover: 0 8px 24px rgba(0,0,0,.6);
  --noise-opacity: .02;
  --row-stripe: rgba(255,255,255,.015);
  --border-row: rgba(42,42,42,.5);
  /* Nav surface: dark glass over --bg */
  --nav-bg: rgba(13,13,13,.92);
  /* Accent-tinted overlays — used for focus rings, hover halos, glows. */
  --accent-soft: rgba(74,122,191,.1);
  --accent-soft-strong: rgba(74,122,191,.15);
  --accent-ring: rgba(74,122,191,.15);
  --accent-ring-strong: rgba(74,122,191,.25);
  --accent-glow: rgba(74,122,191,.25);
  /* Subtle toplight/highlight that makes buttons feel fizzy in dark mode.
     In light mode this becomes a soft cool edge instead of a highlight. */
  --toplight: rgba(255,255,255,.03);
  --toplight-faint: rgba(255,255,255,.02);
  color-scheme: dark;
  /* Semantic colors (dark-mode-appropriate values) */
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;
  --orange: #f97316;
}

/* ── Light theme ───────────────────────────────────────────── */
[data-theme="light"] {
  --bg: #f4f1ea;             /* warm paper-white, not pure white */
  --bg-card: #fffdf8;         /* card surface lifts above paper */
  --bg-hover: #ebe6db;        /* hover state on paper */
  --bg-input: #fffdf8;
  --bg-elev: #efeae0;         /* elevated panel sits just below paper */
  --border: #cfc7b8;          /* lower-contrast borders */
  --text: #1a1a1f;            /* near-black, never pure #000 */
  --text-dim: #5a5550;        /* WCAG AA on paper: ~7.4:1 */
  --text-muted: #7a7468;      /* still passes 4.5:1 on bg at ~4.6:1 */
  --shadow: 0 1px 3px rgba(60,50,30,.12);
  --shadow-lg: 0 8px 22px rgba(60,50,30,.15);
  --shadow-card-hover: 0 12px 28px rgba(60,50,30,.18);
  --noise-opacity: .025;
  --row-stripe: rgba(0,0,0,.018);
  --border-row: rgba(0,0,0,.08);
  /* Nav surface: warm-tinted glass over paper */
  --nav-bg: rgba(244,241,234,.9);
  /* Accent-tinted overlays — accent is darker on paper, halos softer */
  --accent-soft: rgba(44,93,157,.08);
  --accent-soft-strong: rgba(44,93,157,.14);
  --accent-ring: rgba(44,93,157,.18);
  --accent-ring-strong: rgba(44,93,157,.3);
  --accent-glow: rgba(44,93,157,.22);
  /* On paper-white, a "highlight" would be invisible. Use a cool tint edge
     instead, so flat buttons still feel tiered without darkening the surface.
     The upshot: in light mode, buttons rely on shadow for depth
     (no toplight needed), so both toplight tokens resolve to transparent. */
  --toplight: transparent;
  --toplight-faint: transparent;
  color-scheme: light;
  /* Slightly desaturated semantics — easier on the eye on white */
  --green: #15803d;
  --red: #c0322b;
  --yellow: #a07c10;
  --orange: #c2570b;
  /* Accent stays cyan/blue identity, but darkened for paper contrast. */
  --accent: #2c5d9d;
  --accent-hover: #1f4e85;
  --accent-dim: #d6e3f2;
  --border-focus: #2c5d9d;
}

/* ── Accent flavor overrides ─────────────────────────────────
 *   Apply these on top of a theme (dark or light). Each flavor
 *   overrides only the accent-related tokens. They work in BOTH
 *   dark and light themes (the variation is in which hue, not
 *   light/dark adaptation).                                     */
[data-accent="purple"] {
  --accent: #a855f7;
  --accent-hover: #c084fc;
  --accent-dim: #2d1a4f;
  --border-focus: #a855f7;
  --accent-soft: rgba(168,85,247,.12);
  --accent-ring: rgba(168,85,247,.25);
  --accent-glow: rgba(168,85,247,.22);
}

[data-accent="green"] {
  --accent: #22c55e;
  --accent-hover: #4ade80;
  --accent-dim: #14532d;
  --border-focus: #22c55e;
  --accent-soft: rgba(34,197,94,.12);
  --accent-ring: rgba(34,197,94,.25);
  --accent-glow: rgba(34,197,94,.22);
}

[data-accent="teal"] {
  --accent: #14b8a6;
  --accent-hover: #2dd4bf;
  --accent-dim: #134e4a;
  --border-focus: #14b8a6;
  --accent-soft: rgba(20,184,166,.12);
  --accent-ring: rgba(20,184,166,.25);
  --accent-glow: rgba(20,184,166,.22);
}
[data-accent="rose"] {
  --accent: #fb7185;
  --accent-hover: #fda4b4;
  --accent-dim: #4c0519;
  --border-focus: #fb7185;
  --accent-soft: rgba(251,113,133,.12);
  --accent-ring: rgba(251,113,133,.25);
  --accent-glow: rgba(251,113,133,.22);
}
[data-accent="amber"] {
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --accent-dim: #451a03;
  --border-focus: #f59e0b;
  --accent-soft: rgba(245,158,11,.12);
  --accent-ring: rgba(245,158,11,.25);
  --accent-glow: rgba(245,158,11,.22);
}
*, *::before, *::after  { box-sizing: border-box; }
html  { scroll-behavior: smooth; }
/* Subtle grain — same inline SVG in both modes. Opacity 0.02 reads as
   barely-there texture on light paper too; the rect color is neutral so
   it darkens grain slightly on white (which still feels premium). */
body  { margin: 0; position: relative; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 64 64' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='64' height='64' filter='url(%23n)' opacity='0.02'/%3E%3C/svg%3E"); }

/* ── Layout ──────────────────────────────────────────────── */
.container  { max-width: 1100px; margin: 0 auto; padding: 0 1em; }

/* ── Navigation ──────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 1em;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  gap: .25em;
}
nav a {
  color: var(--text-dim);
  text-decoration: none;
  padding: .35em .75em;
  border-radius: var(--radius-sm);
  font-size: .9em;
  font-weight: 500;
  transition: color .15s, background .15s;
}
nav a:hover, nav a:focus  { color: var(--text); background: var(--bg-hover); }
nav a.nav-active  { color: var(--accent); background: var(--accent-soft); }
nav a.nav-active:hover  { color: var(--accent-hover); background: var(--accent-soft-strong); }
nav .nav-brand  { color: var(--text); font-weight: 700; font-size: 1em; margin-right: auto; padding-left: 0; display: inline-flex; align-items: baseline; }
nav .nav-brand:hover  { background: transparent; }
nav .nav-brand.nav-active  { background: transparent; color: var(--accent); }
.nav-logo  { width: 24px; height: 20px; vertical-align: -4px; margin-right: .4em; flex: 0 0 auto; color: var(--accent); stroke: var(--accent); }
a.nav-brand:hover .nav-logo  { color: var(--accent-hover); stroke: var(--accent-hover); }
nav .nav-warning  { color: var(--red); font-size: .8em; margin-left: .5em; }

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, .hero h1, .album-title, .artist-name, nav .nav-brand { font-family: var(--font-display); }
h1  { font-size: 1.5em; margin: .75em 0 .5em; font-weight: 700; letter-spacing: -.02em; }
h2  { font-size: 1.2em; margin: 1em 0 .4em; font-weight: 600; }
h3  { font-size: 1.05em; margin: .75em 0 .3em; font-weight: 600; }
a  { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover  { color: var(--accent-hover); text-decoration: underline; }
.meta  { color: var(--text-dim); font-size: .88em; }
.muted  { color: var(--text-muted); }

/* ── Search Form ─────────────────────────────────────────── */
.search-form  { display: flex; gap: .5em; margin: 1.5em 0; }
.search-form input[type="text"] {
  flex: 1;
  padding: .65em 1em;
  font-size: 1em;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  font-family: var(--font);
}
.search-form input[type="text"]:focus  { border-color: var(--border-focus); box-shadow: 0 0 0 4px var(--accent-ring); transform: translateY(-1px); }
.search-form input[type="text"], .search-form button  { transition: border-color .2s, box-shadow .2s, transform .15s; }
.search-form button  { padding: .65em 1.2em; font-size: 1em; font-weight: 600; }
.search-form button:hover  { transform: translateY(-1px); box-shadow: 0 2px 8px var(--accent-glow); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  padding: .5em 1em;
  font-size: .9em;
  font-weight: 500;
  font-family: var(--font);
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 1px 0 var(--toplight-faint), var(--shadow);
}
.btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-focus);
  color: var(--text);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
button:active, .btn:active  { transform: translateY(0) scale(.98); }
button:focus-visible, .btn:focus-visible, a:focus-visible  { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip:focus-visible  { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn-primary {
  background: linear-gradient(180deg, var(--accent-hover) 0%, var(--accent) 100%);
  border-color: var(--accent-hover);
  box-shadow: 0 10px 24px var(--accent-glow), 0 1px 0 var(--toplight);
}
.btn-primary:hover {
  background: linear-gradient(180deg, var(--accent-hover) 0%, var(--accent) 100%);
  border-color: var(--accent-hover);
  box-shadow: 0 12px 28px var(--accent-glow);
}
.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-dim);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-focus);
  color: var(--text);
}
.btn-sm  { padding: .3em .6em; font-size: .82em; }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap  { overflow-x: auto; margin: .75em 0; }
table  { width: 100%; border-collapse: collapse; font-size: .92em; }
th {
  text-align: left;
  padding: .55em .65em;
  font-weight: 600;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  font-size: .85em;
  text-transform: uppercase;
  letter-spacing: .04em;
}
td  { padding: .5em .65em; border-bottom: 1px solid var(--border-row); vertical-align: middle; }
tr:nth-child(odd) td  { background: var(--row-stripe); }
tr:nth-child(even) td  { background: transparent; }
tr:hover td  { background: var(--bg-hover); }
tr td:first-child  { padding-left: .4em; }
tr:last-child td  { border-bottom: none; }
tr:hover td  { scale: 1.002; }
td:first-child  { border-left: 2px solid transparent; transition: border-color .15s; }
tr:hover td:first-child  { border-left-color: var(--accent); }
td.actions  { text-align: right; white-space: nowrap; }

/* ── Cards ───────────────────────────────────────────────── */
.card  { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1em; margin: .75em 0; }
.card-header {
  font-weight: 600;
  margin-bottom: .5em;
  color: var(--text);
  font-size: .85em;
  text-transform: uppercase;
  letter-spacing: .05em;
  opacity: .7;
}

/* ── Status Badges ────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3em;
  padding: .15em .5em;
  border-radius: 3px;
  font-size: .78em;
  font-weight: 600;
  line-height: 1.5;
}
/* ── Badge links (provider source link) ────────────────── */
a.badge-link,
a.badge {
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.12s ease;
}
a.badge-link:hover,
a.badge:hover,
a.badge-link:focus {
  opacity: 0.85;
  transform: scale(1.04);
  outline: none;
}
a.badge-link-disabled {
  cursor: default;
  opacity: 0.5;
  text-decoration: none;
  pointer-events: none;
}
.badge-tidal  { background: rgba(0,255,255,.12); color: var(--cyan); border: 1px solid rgba(0,255,255,.4); box-shadow: 0 0 4px rgba(0,255,255,.15); }
.badge-qobuz  { background: rgba(59,130,246,.12); color: var(--blue); border: 1px solid rgba(59,130,246,.4); box-shadow: 0 0 4px rgba(59,130,246,.15); }
.badge-deezer  { background: rgba(160,0,255,.12); color: #a855f7; border: 1px solid rgba(160,0,255,.4); box-shadow: 0 0 4px rgba(160,0,255,.15); }
.badge-bandcamp  { background: rgba(97,146,156,.12); color: var(--cyan); border: 1px solid rgba(97,146,156,.4); box-shadow: 0 0 4px rgba(97,146,156,.15); }
.badge-soundcloud  { background: rgba(255,136,0,.12); color: var(--orange); border: 1px solid rgba(255,136,0,.4); box-shadow: 0 0 4px rgba(255,136,0,.15); }
.badge-youtube_music  { background: rgba(255,68,68,.12); color: var(--red); border: 1px solid rgba(255,68,68,.4); box-shadow: 0 0 4px rgba(255,68,68,.15); }
.badge-explicit  { background: rgba(34,197,94,.12); color: var(--green); border: 1px solid rgba(34,197,94,.4); box-shadow: 0 0 4px rgba(34,197,94,.15); }
.badge-clean  { background: rgba(234,179,8,.12); color: var(--yellow); border: 1px solid rgba(234,179,8,.4); box-shadow: 0 0 4px rgba(234,179,8,.15); }
.badge-version  { background: rgba(168,85,247,.12); color: #a855f7; border: 1px solid rgba(168,85,247,.4); box-shadow: 0 0 4px rgba(168,85,247,.15); }
.badge-library  { background: rgba(34,197,94,.12); color: var(--green); border: 1px solid rgba(34,197,94,.4); box-shadow: 0 0 4px rgba(34,197,94,.15); }
.status-queued, .status-cancelled  { color: var(--text-dim); }
.status-running, .status-paused  { color: var(--yellow); }
.status-processing  { color: var(--orange); }
.status-completed  { color: var(--green); }
.status-error, .status-failed  { color: var(--red); }
.status-failed  { color: var(--red); }

/* ── Flash Messages ──────────────────────────────────────── */
.flash-container  { position: relative; }
.flash {
  padding: .65em 1em;
  background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.25);
  border-left: 3px solid var(--green);
  border-radius: var(--radius-sm);
  margin: .5em 0;
  font-size: .9em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  animation: fadeIn .25s ease;
  box-shadow: var(--shadow);
}
.flash-error  { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.25); border-left-color: var(--red); }
.flash .dismiss {
  cursor: pointer;
  opacity: .5;
  font-size: 1.2em;
  line-height: 1;
  background: none;
  border: none;
  color: inherit;
  padding: 0 .2em;
}
.flash .dismiss:hover  { opacity: 1; }
@keyframes fadeIn { from  { opacity: 0; transform: translateY(-4px); }
  to  { opacity: 1; transform: translateY(0); }
}

/* ── Job Status Page ─────────────────────────────────────── */
.status-bar {
  display: flex;
  align-items: center;
  gap: .75em;
  padding: .75em 1em;
  border-radius: var(--radius);
  margin: .5em 0;
  font-weight: 600;
  font-size: .95em;
}
.status-bar.active  { background: rgba(234,179,8,.08); border: 1px solid rgba(234,179,8,.2); }
.status-bar.done  { background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.2); }
.status-bar.fail  { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.2); }

/* ── Success micro-interaction (download complete) ─────────
 *   Brief green glow pulse + checkmark reveal when the SSE
 *   `done` event fires. Tasteful — no confetti, no shake.
 *   Respects prefers-reduced-motion.                      */
@keyframes successPulse {
  0%   { box-shadow: 0 0 0 0   rgba(34, 197, 94, 0.6); }
  70%  { box-shadow: 0 0 0 12px rgba(34, 197, 94, 0);  }
  100% { box-shadow: 0 0 0 0   rgba(34, 197, 94, 0);  }
}
.status-bar.success-glow {
  animation: successPulse 1.5s ease-out;
  border-color: var(--green);
}
.status-bar.success-glow .success-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--green);
  animation: successCheck 1.5s ease-out;
}
.status-bar.success-glow .success-check svg {
  width: 100%;
  height: 100%;
}
@keyframes successCheck {
  0%        { opacity: 0; transform: scale(0.6); }
  20%       { opacity: 1; transform: scale(1.15); }
  40%       { transform: scale(1); }
  85%       { opacity: 1; transform: scale(1); }
  100%      { opacity: 0.7; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .status-bar.success-glow        { animation: none; }
  .status-bar.success-glow .success-check { animation: none; opacity: 1; }
}
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--cyan);
  border-right-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner-lg {
  display: inline-block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--cyan);
  border-bottom-color: var(--blue);
  animation: spin .7s linear infinite, spinner-pulse 2s ease-in-out infinite;
}
@keyframes spinner-pulse { 0%, 100% { box-shadow: 0 0 8px rgba(6,182,212,.3); } 50% { box-shadow: 0 0 16px rgba(6,182,212,.5); } }
@keyframes spin { to  { transform: rotate(360deg); } }

/* ── Progress Bar ─────────────────────────────────────────── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin: .5em 0;
}
.progress-bar-fill  { height: 100%; background: var(--accent); border-radius: 2px; transition: width .5s ease; width: 0%; }
@keyframes progress-shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.progress-bar-fill.active { background: linear-gradient(90deg, var(--accent-dim), var(--accent), var(--accent-dim)); background-size: 200% 100%; animation: progress-shimmer 2s infinite; }

/* ── Checkbox Grid ───────────────────────────────────────── */
.checkbox-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .4em; margin: .5em 0; }
.checkbox-item {
  display: flex;
  align-items: center;
  gap: .5em;
  padding: .3em .5em;
  border-radius: var(--radius-sm);
  transition: background .1s;
}
.checkbox-item:hover  { background: var(--bg-hover); }
.checkbox-item input[type="checkbox"]  { accent-color: var(--accent); width: 16px; height: 16px; }

/* ── Pre / Log Output ────────────────────────────────────── */
pre {
  background: #000;
  padding: .75em;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: .82em;
  line-height: 1.5;
  font-family: var(--font-mono);
  max-height: 400px;
  border: 1px solid var(--border);
}

/* ── Footer ───────────────────────────────────────────────── */
footer  { margin-top: 2em; padding: 2em 0 1em; color: var(--text-muted); font-size: .82em; position: relative; background: linear-gradient(to top, transparent, var(--toplight-faint)); }
footer::before { content: ''; position: absolute; top: 0; left: 10%; right: 10%; height: 1px; background: linear-gradient(90deg, transparent, var(--border), transparent); }
.footer-disclaimer  { margin-top: .3em; font-size: .78em; color: var(--text-dim); opacity: .5; }

/* ── Breadcrumbs ─────────────────────────────────────────── */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: .4em;
  font-size: .85em;
  color: var(--text-dim);
  margin: .5em 0;
  flex-wrap: wrap;
}
.breadcrumbs a  { color: var(--accent); transition: transform .15s, color .15s; display: inline-block; }
.breadcrumbs a:hover  { transform: translateX(2px); }
.breadcrumbs .sep  { color: var(--text-muted); user-select: none; transition: opacity .2s; }
.breadcrumbs:hover .sep  { opacity: .6; }

/* ── Hero / Home page ────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  text-align: center;
  padding: 4.25em 1.5em 2.5em;
  margin: 0 -1em;
  background:
    radial-gradient(ellipse at 50% 10%, rgba(6,182,212,.16) 0%, rgba(6,182,212,.05) 28%, transparent 60%),
    radial-gradient(ellipse at 18% 18%, rgba(74,122,191,.18) 0%, rgba(74,122,191,.05) 26%, transparent 58%),
    radial-gradient(ellipse at 82% 20%, rgba(59,130,246,.14) 0%, rgba(59,130,246,.04) 24%, transparent 55%),
    linear-gradient(180deg, var(--toplight-faint) 0%, transparent 100%);
  border-bottom: 1px solid var(--border-row);
}
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  inset: auto;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(22px);
  opacity: .75;
  z-index: -1;
}
.hero::before {
  width: 18rem;
  height: 18rem;
  left: -4rem;
  top: -3rem;
  background: radial-gradient(circle, rgba(6,182,212,.16) 0%, rgba(6,182,212,0) 70%);
}
.hero::after {
  width: 22rem;
  height: 22rem;
  right: -6rem;
  top: -4rem;
  background: radial-gradient(circle, rgba(74,122,191,.14) 0%, rgba(74,122,191,0) 68%);
}

/* Waveform motif (#37): a quiet repeating-trough line beneath the hero text.
   Sits beneath the content (z-index:0) with low opacity so the gradient
   headline still leads. Uses the existing cyan→blue palette.            */
.hero-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1.5em;
  width: 100%;
  height: 64px;
  margin: 0 auto;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
[data-theme="light"] .hero-wave { opacity: 0.22; }
@media (max-width: 768px) { .hero-wave { bottom: 0.6em; height: 40px; } }
.hero h1 {
  font-size: clamp(2.5em, 5vw, 3em);
  margin: 0 0 .35em;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: .95;
  background: linear-gradient(135deg, #8ff7ff 0%, var(--cyan) 30%, var(--blue) 72%, #2f5fd8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 32px rgba(6,182,212,.12);
}
.hero p  { color: var(--text-dim); font-size: 1.05em; margin: 0 auto 1.5em; max-width: 480px; }
.hero .provider-toggle-row { margin-top: .9em; }

/* ── Provider toggle chips ──────────────────────────────────── */
.provider-toggle-row  { display: flex; flex-wrap: wrap; gap: .35em; justify-content: center; margin: .25em 0 .5em; }
.provider-toggle-row .provider-toggle {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: .3em;
  padding: .2em .6em;
  font-size: .78em;
  font-weight: 500;
  font-family: var(--font);
  background: var(--bg-card);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: transform .18s ease, color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.provider-toggle-row .provider-toggle::before {
  content: '';
  position: absolute;
  inset: -35%;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.12) 0%, rgba(255,255,255,0) 58%);
  opacity: 0;
  transform: scale(.85);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.provider-toggle-row .provider-toggle:hover {
  color: var(--text);
  border-color: var(--border-focus);
  transform: translateY(-1px) scale(1.05);
  box-shadow: var(--shadow-lg);
}
.provider-toggle-row .provider-toggle:hover::before { opacity: 1; transform: scale(1); }
.provider-toggle-row .provider-toggle.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); box-shadow: 0 8px 18px var(--accent-glow); }
.provider-toggle-row .provider-toggle.active::before { opacity: .85; background: radial-gradient(circle at 50% 50%, rgba(122,201,255,.2) 0%, rgba(122,201,255,0) 62%); }
.provider-toggle-row .provider-toggle.active.status-ok::after {
  content: "";
}
.provider-toggle-row .provider-toggle.active.status-error {
  background: rgba(239,68,68,.12);
  color: var(--red);
  border-color: var(--red);
  box-shadow: 0 8px 18px rgba(239,68,68,.25);
}
.provider-toggle-row .provider-toggle.active.status-error::before {
  opacity: .85;
  background: radial-gradient(circle at 50% 50%, rgba(239,68,68,.2) 0%, rgba(239,68,68,0) 62%);
}
.provider-toggle-row .provider-toggle.active.status-error::after {
  content: "";
  position: relative;
  z-index: 1;
  font-size: .85em;
}
.provider-toggle-row .provider-toggle.active.status-unknown::after {
  content: "";
}
.provider-toggle-row .provider-toggle.inactive::after {
  content: "";
}
.provider-toggle-row .provider-toggle.inactive::before {
  opacity: 0;
}

/* ── Status Cards (home page) ──────────────────────────────── */
.stats-grid  { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75em; margin: 1em 0; }
.stat-card  { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1em; text-align: center; }
.stat-card .stat-value  { font-size: 1.5em; font-weight: 700; display: block; }
.stat-card .stat-label  { font-size: .82em; color: var(--text-dim); margin-top: .2em; }
.stat-card.stat-ok .stat-value  { color: var(--green); }
.stat-card.stat-warn .stat-value  { color: var(--yellow); }
.stat-card.stat-err .stat-value  { color: var(--red); }
.stat-card  { transition: border-color .15s, transform .15s, box-shadow .15s; }
.stat-card:hover  { border-color: var(--border-focus); transform: translateY(-1px); box-shadow: var(--shadow-lg); }

/* ── Service indicators ──────────────────────────────────── */
.service-row {
  display: flex;
  align-items: center;
  gap: .75em;
  padding: .65em .85em;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: .4em 0;
}
.service-row .dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.service-row .dot.on  { background: var(--green); box-shadow: 0 0 6px rgba(34,197,94,.4); }
.service-row .dot.off  { background: var(--text-muted); }
.service-row .dot.err  { background: var(--red); }

/* ── Album Cards ───────────────────────────────────────── */
.album-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .75em; margin: .75em 0; }
.album-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1em;
  transition: border-color .15s, box-shadow .15s;
}
.album-card:hover  { border-color: var(--border-focus); box-shadow: var(--shadow-card-hover); transform: translateY(-2px) scale(1.02); }
.album-card .album-title  { font-weight: 600; font-size: 1em; margin-bottom: .2em; }
.album-card .album-artist  { font-size: .88em; color: var(--text-dim); margin-bottom: .4em; }
.album-card .album-meta {
  display: flex;
  align-items: center;
  gap: .5em;
  font-size: .82em;
  color: var(--text-muted);
  margin-bottom: .6em;
}
.album-card .album-actions  { display: flex; align-items: center; gap: .5em; flex-wrap: wrap; }
.album-card-art {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  background: var(--bg-inset);
  margin-bottom: .65em;
}
.album-card-art img  { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.8em;
  font-weight: 700;
  color: var(--text-muted);
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-hover) 100%);
  border-radius: calc(var(--radius) - 2px);
}
.album-card-body  { display: flex; flex-direction: column; gap: .5em; }
.album-card-actions  { margin-top: .2em; }
.card-tracks-fold  { margin-top: .5em; border-top: 1px solid var(--border); padding-top: .5em; }
.card-tracks-summary {
  cursor: pointer;
  font-size: .85em;
  font-weight: 500;
  color: var(--text-dim);
  padding: .35em .5em;
  border-radius: var(--radius-sm);
  transition: background .15s;
  user-select: none;
}
.card-tracks-summary:hover  { background: var(--bg-hover); color: var(--text); }
.card-tracks-fold[open] .card-tracks-summary  { margin-bottom: .5em; color: var(--text); }

/* ── Album card color extraction ───────────────────────────
 *   Extracted dominant color from cover art used as accent border
 *   and subtle glow effect. Uses CSS custom properties set by JS. */
.album-card,
.album-card-compact {
  --art-color: var(--border-focus);
  --art-color-text: var(--bg);
}
.album-card-art .album-art-glow,
.album-card-art-compact .album-art-glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
  background: linear-gradient(180deg, transparent 60%, var(--art-color) 100%);
  z-index: 0;
}
.album-card.has-art-color .album-art-glow,
.album-card-compact.has-art-color .album-art-glow {
  opacity: 0.5;
}
.album-card.has-art-color {
  border-bottom: 2px solid var(--art-color);
}
.album-card-compact.has-art-color {
  border-bottom: 2px solid var(--art-color);
}

/* ── Filter Bar ──────────────────────────────────────────── */
.filter-bar  { display: flex; flex-direction: column; gap: .5em; margin: 0 0 .75em; }
.filter-input {
  width: 100%;
  padding: .6em .75em;
  font-size: .9em;
  font-family: var(--font);
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s;
  box-sizing: border-box;
}
.filter-input:focus  { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(74,122,191,.15); }
.filter-chips-divider  { width: 1px; background: var(--border); margin: 0 .2em; }

/* ── Filter result animations ─────────────────────────────── */
@keyframes filter-appear { from  { opacity: 0; transform: translateY(-3px); }
  to    { opacity: 1; transform: translateY(0); }
}
.filters-active .album-card-compact:not([hidden]),
.filters-active .artist-section:not([hidden])  { animation: filter-appear .2s ease-out; }

/* ── Compact tracks responsive ───────────────────────────── */
@media(max-width:768px) { .compact-track-row  { flex-wrap: wrap; gap: .2em .35em; }
  .compact-track-title  { min-width: 0; }
}

/* ── Quick Actions ────────────────────────────────────────── */
.quick-actions  { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .5em; margin: 1em 0; }
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3em;
  padding: 1em .5em;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, transform .1s;
  font-size: .9em;
}
.quick-action:hover  { border-color: var(--border-focus); transform: translateY(-1px); text-decoration: none; color: var(--text); }
.quick-action .qa-icon  { font-size: 1.5em; }
.quick-action .qa-label  { font-weight: 500; }

/* ── Search Results Toolbar ──────────────────────────────── */
.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  margin: 1em 0 .75em;
  flex-wrap: wrap;
}
.filter-chips  { display: flex; gap: .4em; flex-wrap: wrap; }
.sort-control select {
  padding: .35em .6em;
  font-size: .85em;
  font-family: var(--font);
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* ── Track List (column layout) ──────────────────────────── */
.track-list  { margin: .5em 0; }
.track-list-header {
  display: grid;
  grid-template-columns: 40px 40px 1fr 1fr auto 80px 90px;
  gap: .5em;
  padding: .4em .6em;
  font-size: .78em;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
}
.track-row {
  display: grid;
  grid-template-columns: 40px 40px 1fr 1fr auto 80px 90px;
  gap: .5em;
  padding: .5em .6em;
  align-items: center;
  border-bottom: 1px solid var(--border-row);
  transition: background .1s;
}
.track-row:hover  { background: var(--bg-hover); }
.track-row:nth-child(odd)  { background: var(--row-stripe); }
.track-row:nth-child(even)  { background: transparent; }
.track-row:hover  { background: var(--bg-hover); }
.col-check  { display: flex; align-items: center; justify-content: center; }
.col-check input[type="checkbox"]  { accent-color: var(--accent); width: 16px; height: 16px; }
.col-num  { text-align: right; color: var(--text-muted); font-size: .88em; }
.col-info  { display: flex; flex-direction: column; gap: .1em; min-width: 0; }
.track-title  { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-artist  { font-size: .88em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-album  { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-source  { display: flex; gap: .3em; }
.col-duration  { text-align: right; font-variant-numeric: tabular-nums; }
.col-action  { text-align: right; }

/* ── Bulk Action Bar ─────────────────────────────────────── */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: .75em;
  padding: .6em 1em;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: .5em;
  position: sticky;
  bottom: 1em;
  z-index: 50;
}
.bulk-count  { font-size: .88em; font-weight: 500; color: var(--text-dim); }
.bulk-count span  { color: var(--accent); font-weight: 600; }

/* ── Empty states ─────────────────────────────────────────── */
.empty-state  { text-align: center; padding: 2em 1em; color: var(--text-dim); max-width: 360px; margin: 0 auto; position: relative; border-radius: var(--radius); border: 1px solid transparent; background-clip: padding-box; }
.empty-state::before { content: ''; position: absolute; inset: -1px; border-radius: var(--radius); padding: 1px; background: linear-gradient(135deg, transparent 40%, var(--border-focus) 100%); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
@keyframes empty-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.empty-state .empty-icon  { font-size: 3.5em; margin-bottom: .5em; opacity: .3; display: block; animation: empty-float 3s ease-in-out infinite; }
.empty-state h3  { color: var(--text-dim); margin: .5em 0; }
.empty-state p  { font-size: .9em; }

/* ── Skip to content (a11y) ──────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 200;
  padding: .5em 1em;
  background: var(--accent);
  color: var(--text);
  font-weight: 600;
  font-size: .88em;
  text-decoration: none;
  transition: top .15s;
}
.skip-link:focus  { top: 0; outline: none; box-shadow: 0 2px 8px rgba(0,0,0,.4); }

/* ── Search hint / keyboard ───────────────────────────────── */
.search-hint  { font-size: .78em; color: var(--text-muted); margin-top: .3em; text-align: center; }
kbd {
  display: inline-block;
  padding: .15em .45em;
  font-size: .85em;
  font-family: var(--font-mono);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  box-shadow: 0 2px 0 var(--border), 0 1px 2px rgba(0,0,0,.3);
}

/* ── Utility ─────────────────────────────────────────────── */
.flex  { display: flex; align-items: center; gap: .5em; }
.flex-wrap  { flex-wrap: wrap; }
.gap-sm  { gap: .3em; }
.gap-md  { gap: .75em; }
.gap-lg  { gap: 1.25em; }
.mt-sm  { margin-top: .5em; }
.mt-md  { margin-top: 1em; }
.mb-sm  { margin-bottom: .5em; }
.mb-md  { margin-bottom: 1em; }
.truncate  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.text-center  { text-align: center; }
.text-right  { text-align: right; }
.hidden  { display: none !important; }

/* ── Search Loading State ─────────────────────── */
.search-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25em;
  padding: 4em 1em;
  text-align: center;
}
.search-loading .loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.search-loading .loading-text  { font-size: .95em; color: var(--text-dim); font-weight: 500; }
.search-loading .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin: 0 1px;
  vertical-align: middle;
  animation: pulse-dot 1.5s ease-in-out infinite;
}
.search-loading .dot:nth-child(1)  { animation-delay: 0s; }
.search-loading .dot:nth-child(2)  { animation-delay: .3s; }
.search-loading .dot:nth-child(3)  { animation-delay: .6s; }
@keyframes pulse-dot { 0%, 80%, 100%  { opacity: .25; transform: scale(.75); }
  40%  { opacity: 1; transform: scale(1.1); }
}

/* ── Player page — REMOVED (broken, unused) ──────────────── */

/* ── Auto-refresh toggle ──────────────────────────────────── */
.toggle-refresh {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  cursor: pointer;
  user-select: none;
  padding: .2em .4em;
  border-radius: var(--radius-sm);
  transition: background .15s;
  margin-left: .25em;
  flex-shrink: 0;
}
.toggle-refresh:hover  { background: var(--bg-hover); }
.toggle-refresh input  { display: none; }
.toggle-refresh-track {
  position: relative;
  width: 32px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 10px;
  transition: background .2s;
}
.toggle-refresh-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: var(--text);
  border-radius: 50%;
  transition: transform .2s;
}
.toggle-refresh input:checked + .toggle-refresh-track  { background: var(--accent); }
.toggle-refresh input:checked + .toggle-refresh-track .toggle-refresh-thumb  { transform: translateX(16px); }
.toggle-refresh-label  { font-size: .78em; font-weight: 500; color: var(--text-dim); transition: color .2s; }
.toggle-refresh input:checked ~ .toggle-refresh-label  { color: var(--accent); }
/* Toggle off state for the nav item */
.toggle-refresh.off .toggle-refresh-label  { color: var(--text-muted); }
.toggle-refresh.off input:checked ~ .toggle-refresh-label  { color: var(--text-muted); }

/* ── Theme picker (nav) ────────────────────────────────────
 *   A segmented tertiary control with three segments: Auto,
 *   Dark, Light. Defaults to Auto (follows prefers-color-scheme).
 *   Persists via localStorage (see core.js). Hidden entirely
 *   when JS is unavailable — the critical CSS keeps the dark
 *   look as the no-JS default.
 * ────────────────────────────────────────────────────────── */
.theme-picker {
  display: inline-flex;
  align-items: center;
  gap: .15em;
  margin-left: .25em;
  padding: .15em;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  flex-shrink: 0;
  --tp-inset: .55em;       /* horizontal padding for each segment */
  --tp-icon: 14px;         /* icon size (sun/moon/auto glyphs) */
}
/* Each segment is a radio button + its styled label-bopest. */
.theme-picker input[type="radio"]  { position: absolute; opacity: 0; width: 1px; clip: rect(0 0 0 0); }
/* Shared segment look */
.theme-picker .tp-seg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  min-width: 26px;
  padding: 0 var(--tp-inset);
  border-radius: 999px;
  color: var(--text-dim);
  background: transparent;
  cursor: pointer;
  user-select: none;
  font-size: .78em;
  font-weight: 500;
  line-height: 1;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.theme-picker .tp-seg svg  { width: var(--tp-icon); height: var(--tp-icon); display: block; }
/* Active segment */
.theme-picker input[type="radio"]:checked + .tp-seg {
  background: var(--accent);
  color: var(--bg-card);
  box-shadow: var(--accent-glow);
}
.theme-picker input[type="radio"]:focus-visible + .tp-seg {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
/* Hover on inactive segments */
.theme-picker .tp-seg:hover { color: var(--text); }
/* `Auto` segment shows both icons stacked so it reads as "let the OS decide" */
.theme-picker .tp-auto-glyph {
  position: relative;
  width: var(--tp-icon); height: var(--tp-icon);
  display: inline-block;
}
.theme-picker .tp-auto-glyph svg  { position: absolute; top: 0; left: 0; }
.theme-picker .tp-auto-glyph svg:first-child  { opacity: 1; }
.theme-picker .tp-auto-glyph svg:last-child   { opacity: 0; transform: scale(.65) translateY(1px); }
.theme-picker input[type="radio"]:checked + .tp-seg .tp-auto-glyph {
  /* keep auto glyph legible on accent fill */
}
/* Match the toggle-refresh label scaling on small screens */
@media (max-width: 640px) {
  .theme-picker { --tp-icon: 13px; }
  .theme-picker .tp-seg { min-width: 24px; padding: 0 .4em; }
}

/* ── Accent picker ───────────────────────────────────────────
 *   Small segmented-pill picker for accent flavors, placed
 *   left of the theme picker. Swatches show 12px circles in
 *   the accent color. Selected state gets an outline ring.   */
.accent-picker {
  display: inline-flex;
  align-items: center;
  gap: .15em;
  margin-left: .25em;
  padding: .15em;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  flex-shrink: 0;
}
.accent-picker input[type="radio"]  { position: absolute; opacity: 0; width: 1px; clip: rect(0 0 0 0); }
.accent-picker .ap-seg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: var(--text-dim);
  background: transparent;
  cursor: pointer;
  user-select: none;
  font-size: 0;
  transition: box-shadow .15s ease, color .15s ease;
}
.accent-picker .ap-seg .ap-swatch {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--swatch);
}
/* Active segment - outline ring in accent color */
.accent-picker input[type="radio"]:checked + .ap-seg {
  box-shadow: 0 0 0 2px var(--accent);
  background: var(--accent-soft);
}
.accent-picker input[type="radio"]:focus-visible + .ap-seg {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}
.accent-picker .ap-seg:hover { color: var(--text); }
/* Hide when JS unavailable */
.accent-picker.js-only { display: none; }

/* ── Nav active job indicator (download progress) ──────────
 *   Subtle progress widget in nav bar for active downloads.
 *   Visible only when JS is enabled and there's an active job.
 *   Clicking goes to the job's status page.                   */
.nav-active-job {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  margin-left: .25em;
  padding: .2em .6em;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .78em;
  font-family: var(--font);
  color: var(--text-dim);
  text-decoration: none;
  max-width: 180px;
  flex-shrink: 0;
  transition: border-color .15s ease, color .15s ease;
}
.nav-active-job:hover, .nav-active-job:focus {
  border-color: var(--border-focus);
  color: var(--text);
  text-decoration: none;
}
.nav-active-job-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}
.nav-active-job-bar {
  flex: 1;
  width: 0;
  min-width: 60px;
  background: var(--bg-input);
  height: 2px;
  border-radius: 2px;
  overflow: hidden;
}
.nav-active-job-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  width: 0;
  border-radius: 2px;
  transition: width .25s ease;
}
/* Pulse animation for processing status */
@keyframes pulse {
  0% { opacity: .6; }
  50% { opacity: 1; }
  100% { opacity: .6; }
}
.nav-active-job-fill.processing {
  animation: pulse 1.5s ease infinite;
}
/* Indeterminate (queued) state - striped bar */
.nav-active-job-fill.queued {
  background-image: linear-gradient(
    -45deg,
    var(--accent) 25%,
    transparent 25%,
    transparent 50%,
    var(--accent) 50%,
    var(--accent) 75%,
    transparent 75%,
    transparent 100%
  );
  background-size: 8px 8px;
  animation: stripemove 1s linear infinite;
}
@keyframes stripemove {
  from { background-position: 0 0; }
  to { background-position: 8px 0; }
}
/* Hide when JS unavailable */
.nav-active-job.js-only { display: none; }

/* ── Transition between modes (cross-fade, no flash) ──────
 *   When the html[data-theme] attribute flips, the body
 *   does a soft cross-fade rather than snapping. We limit
 *   the transition to a curated set of properties so the
 *   animation never feels laggy. Reduced-motion users get
 *   an instant swap. */
@media (prefers-reduced-motion: no-preference) {
  html[data-theme-transitioning] *, html[data-theme-transitioning] *::before, html[data-theme-transitioning] *::after {
    transition: background-color .3s ease, border-color .3s ease, color .3s ease, box-shadow .3s ease, fill .3s ease, stroke .3s ease;
  }
}

/* ── Responsive ──────────────────────────────────────────── */
@media(max-width:640px) { .container  { padding: 0 .6em; }
  nav  { gap: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  nav::-webkit-scrollbar  { display: none; }
  nav a  { font-size: .82em; padding: .3em .5em; }
  h1  { font-size: 1.25em; }
  .hero h1  { font-size: 1.45em; }
  .hero p  { font-size: .92em; }
  table  { font-size: .82em; }
  th, td  { padding: .35em .35em; }
  td.actions  { white-space: normal; }
  td.actions .btn  { white-space: nowrap; }
  .search-form  { flex-direction: column; }
  .search-form input[type="text"]  { width: 100%; }
  .search-form button  { width: 100%; justify-content: center; padding: .75em 1.2em; }
  .checkbox-grid  { grid-template-columns: 1fr; }
  .checkbox-item  { padding: .5em .5em; min-height: 44px; }
  .truncate  { max-width: 160px; }
  .stats-grid  { grid-template-columns: repeat(2, 1fr); gap: .5em; }
  .stat-card  { padding: .75em; }
  .stat-card .stat-value  { font-size: 1.2em; }
  .album-grid  { grid-template-columns: 1fr; }
  .album-grid-compact  { grid-template-columns: repeat(2, 1fr); gap: .4em; }
  .quick-actions  { grid-template-columns: repeat(2, 1fr); gap: .4em; }
  .quick-action  { padding: .75em .4em; font-size: .85em; }
  .service-row  { padding: .5em .65em; }
  pre  { font-size: .75em; max-height: 300px; }
  .breadcrumbs  { font-size: .8em; }
  .flash  { font-size: .82em; padding: .5em .75em; }
  .status-bar  { font-size: .88em; padding: .6em .75em; }
  .btn  { min-height: 44px; padding: .6em 1em; }
  .btn-sm  { min-height: auto; padding: .35em .6em; }
  .results-toolbar  { flex-direction: column; align-items: flex-start; gap: .5em; }
  .track-list-header  { display: none; }
  .track-row  { display: flex; flex-wrap: wrap; gap: .25em .5em; padding: .6em; }
  .track-row .col-check  { order: -1; }
  .track-row .col-num  { display: none; }
  .track-row .col-info  { flex: 1; min-width: 120px; order: 1; }
  .track-row .col-source  { order: 2; }
  .track-row .col-duration  { order: 3; }
  .track-row .col-album  { display: none; }
  .track-row .col-action  { order: 4; }
  .bulk-bar  { flex-wrap: wrap; gap: .5em; }
  .search-loading  { padding: 2.5em .6em; }
  .search-loading .loading-spinner  { width: 28px; height: 28px; border-width: 2px; }
  /* Jobs table mobile card layout */
  #jobs-list-page table  { font-size: .82em; }
  #jobs-list-page th  { display: none; }
  #jobs-list-page .job-row  { display: grid; grid-template-columns: 1fr auto; gap: .3em .5em; padding: .6em .4em; border-bottom: 1px solid var(--border); }
  #jobs-list-page .job-row td  { border-bottom: none; padding: .15em 0; }
  #jobs-list-page .job-row td:nth-child(1)  { grid-column: 1 / -1; }
  #jobs-list-page .job-row td:nth-child(2)  { grid-column: 1; }
  #jobs-list-page .job-row td:nth-child(3)  { grid-column: 2; }
  #jobs-list-page .job-row td:nth-child(4)  { grid-column: 1 / -1; }
  #jobs-list-page .job-row td:nth-child(5)  { grid-column: 1 / -1; font-size: .82em; }
  #jobs-list-page .job-row td:nth-child(6)  { grid-column: 1 / -1; }
}
@media(max-width:480px) { .container  { padding: 0 .4em; }
  nav a  { font-size: .78em; padding: .25em .4em; }
  h1  { font-size: 1.1em; }
  .hero h1  { font-size: 1.25em; }
  .hero  { padding: 1.25em 0 1em; }
  .stats-grid  { grid-template-columns: 1fr; gap: .35em; }
  .stat-card  { padding: .6em .4em; }
  .stat-card .stat-value  { font-size: 1.1em; }
  .album-grid  { gap: .5em; }
  .album-card  { padding: .75em; }
  .album-grid-compact  { grid-template-columns: repeat(2, 1fr); gap: .35em; }
  .album-card-compact  { padding: .45em; }
  .album-card-art-compact  { max-width: 160px; max-height: 160px; }
  .quick-actions  { grid-template-columns: 1fr 1fr; gap: .35em; }
  td.actions  { display: flex; flex-wrap: wrap; gap: .25em; }
  td.actions .btn  { font-size: .78em; padding: .35em .5em; min-height: auto; }
  .table-wrap  { margin: .5em -0.4em; border-radius: 0; }
  .service-row  { font-size: .88em; }
  footer  { font-size: .75em; }
}

/* ── Filter chips ──────────────────────────────────────────── */
.filter-chips  { margin: .5em 0; }
.chip {
  display: inline-flex; align-items: center; gap: .35em;
  padding: .25em .65em; border-radius: 999px;
  font-size: .82em; font-weight: 500; text-decoration: none;
  background: var(--bg-card); color: var(--text-dim);
  border: 1px solid var(--border);
  transition: background .15s, color .15s, border-color .15s, transform .15s, box-shadow .15s;
  cursor: pointer;
}
.chip:hover  { background: var(--bg-hover); color: var(--text); border-color: var(--accent); transform: translateY(-1px); }
.chip-active  { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 2px rgba(74,122,191,.2); }
.chip-active .chip-count  { background: rgba(74,122,191,.25); transform: scale(1.1); }
.chip-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.35em; height: 1.35em; border-radius: 999px;
  font-size: .78em; font-weight: 600;
  background: var(--bg-elev); padding: 0 .3em;
}
.chip-active .chip-count  { background: var(--accent-soft-strong); }

/* ── Pagination ────────────────────────────────────────────── */
.pagination  { align-items: center; gap: .5em; }
.pagination .meta  { font-size: .85em; }
.justify-center  { justify-content: center; }

/* ── Utility extras ────────────────────────────────────────── */
.gap-xs  { gap: .3em; }
.self-center  { align-self: center; }

/* ── Artist Sections (compact flat grid) ──────────────────── */
.artist-grid  { margin: .75em 0; }
.artist-section  { margin-bottom: 2.5em; }
.artist-section-header {
  display: flex;
  align-items: center;
  gap: .6em;
  padding: .55em .85em;
  margin-bottom: .8em;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  position: sticky;
  top: var(--nav-height);
  z-index: 10;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.artist-section-header h2 {
  margin: 0;
  font-size: 1.1em;
  font-weight: 700;
  letter-spacing: -.02em;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
}
.artist-section-meta  { font-size: .82em; color: var(--text-dim); white-space: nowrap; flex-shrink: 0; }
.artist-section-tags  { display: flex; gap: .3em; flex-shrink: 0; }

/* ── Compact Card Grid ───────────────────────────────────── */
.album-grid-compact  { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .65em; }
@keyframes result-card-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.album-card-compact { animation: result-card-in .45s ease both; }
.album-card-compact:nth-child(1)  { animation-delay: .00s; }
.album-card-compact:nth-child(2)  { animation-delay: .03s; }
.album-card-compact:nth-child(3)  { animation-delay: .06s; }
.album-card-compact:nth-child(4)  { animation-delay: .09s; }
.album-card-compact:nth-child(5)  { animation-delay: .12s; }
.album-card-compact:nth-child(6)  { animation-delay: .15s; }
.album-card-compact:nth-child(7)  { animation-delay: .18s; }
.album-card-compact:nth-child(8)  { animation-delay: .21s; }
.album-card-compact:nth-child(9)  { animation-delay: .24s; }
.album-card-compact:nth-child(10) { animation-delay: .27s; }
.album-card-compact {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .65em;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  display: flex;
  flex-direction: column;
  max-width: 280px;
}
.album-card-compact:hover  { border-color: var(--border-focus); box-shadow: 0 8px 24px rgba(0,0,0,.6); transform: translateY(-2px) scale(1.02); }
.album-card-art-compact {
  position: relative;
  position: relative;
  width: 100%;
  max-width: 256px;
  max-height: 256px;
  aspect-ratio: 1;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  background: var(--bg-hover);
  margin: 0 auto .5em;
}
.album-card-art-compact img  { display: block; width: 100%; height: 100%; object-fit: cover; }
.album-card-art-compact img.album-art-errored { display: none; }
.album-card-art-compact img.album-art-errored + .card-placeholder-compact { display: flex; }
.album-card-art-compact::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(74,122,191,.2), transparent); opacity: 0; transition: opacity .2s; border-radius: inherit; }
.album-card-compact:hover .album-card-art-compact::after { opacity: 1; }
.card-placeholder-compact {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.4em;
  font-weight: 700;
  color: var(--text-muted);
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-hover) 100%);
  border-radius: calc(var(--radius) - 2px);
}
.album-card-title-compact {
  font-weight: 600;
  font-size: .88em;
  line-height: 1.3;
  margin-bottom: .15em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.album-card-meta-compact {
  display: flex;
  align-items: center;
  gap: .35em;
  font-size: .75em;
  color: var(--text-muted);
  margin-bottom: .4em;
  flex-wrap: wrap;
}
.album-card-meta-compact .badge  { font-size: .7em; padding: .05em .35em; }
.album-card-actions-compact  { margin-top: auto; padding-top: .3em; }
.album-card-actions-compact .btn-block  { width: 100%; justify-content: center; font-size: .82em; padding: .35em .5em; min-height: auto; }

/* ── Compact Track List (inside card) ────────────────────── */
.compact-track-list  { margin: .3em 0 0; border-top: 1px solid var(--border); padding-top: .3em; }
.compact-track-row {
  display: flex;
  align-items: center;
  gap: .35em;
  padding: .25em 0;
  font-size: .75em;
  border-bottom: 1px solid var(--border-row);
}
.compact-track-row:last-child  { border-bottom: none; }
.compact-track-num {
  color: var(--text-muted);
  font-size: .9em;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 1.8em;
  text-align: right;
}
.compact-track-title  { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-track-badges  { display: flex; gap: .2em; flex-shrink: 0; }
.compact-track-badges .badge  { font-size: .65em; padding: .05em .3em; }
.compact-track-duration  { color: var(--text-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; font-size: .9em; }
.compact-track-dl-form  { flex-shrink: 0; }
.compact-dl-btn  { padding: .2em .5em; font-size: .75em; min-height: 28px; line-height: 1.4; }

/* ── Split Button Group ──────────────────────────────────── */
.split-btn-group  { display: inline-flex; position: relative; align-items: stretch; }
.split-btn-primary  { border-radius: var(--radius-sm) 0 0 var(--radius-sm); white-space: nowrap; }
.split-btn-toggle {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: .3em .4em;
  border-left: 0;
  font-size: .7em;
  line-height: 1;
  min-width: auto;
}
.split-btn-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 200;
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  margin-top: 2px;
  overflow: hidden;
}
.split-btn-menu-item {
  display: flex;
  align-items: center;
  gap: .4em;
  width: 100%;
  padding: .45em .7em;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: .85em;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.split-btn-menu-item:hover  { background: var(--bg-hover); }
.split-btn-menu-item .badge  { font-size: .75em; }

/* ── Multi-segment Progress Bar ──────────────────────────── */
.progress-bar-multi {
  display: flex;
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin: .75em 0;
}
.progress-segment  { flex: 1; position: relative; overflow: hidden; }
.progress-segment::after {
  content: '';
  display: block;
  width: var(--pct, 0%);
  height: 100%;
  background: var(--color);
  border-radius: 3px;
  transition: width .6s ease;
}
.progress-segment + .progress-segment  { border-left: 2px solid var(--bg); }

/* ── Service Result Cards (loading page) ─────────────────── */
.service-search-results  { display: flex; flex-direction: column; gap: .75em; margin: 1em 0; }
.service-result-card  { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: .6em 1em; transition: border-color .15s; }
.service-result-card[data-service="tidal"]  { border-left: 3px solid var(--cyan); }
.service-result-card[data-service="qobuz"]  { border-left: 3px solid var(--blue); }
.service-result-card[data-service="soundcloud"]  { border-left: 3px solid var(--orange); }
.service-result-card[data-service="youtube_music"]  { border-left: 3px solid var(--red); }
.service-result-card[data-service="bandcamp"]  { border-left: 3px solid var(--cyan); }
.service-result-header  { display: flex; align-items: center; gap: .75em; }
.service-result-header .service-badge  { font-size: .85em; font-weight: 700; letter-spacing: .03em; }
.service-result-header .service-status  { margin-left: auto; font-size: .85em; display: flex; align-items: center; gap: .35em; }
.service-result-body  { font-size: .9em; margin-top: .3em; }
.results-summary {
  text-align: center;
  padding: .75em;
  background: rgba(34,197,94,.08);
  border: 1px solid rgba(34,197,94,.2);
  border-radius: var(--radius);
  margin: .75em 0;
  font-weight: 500;
}

/* ── Discography Page ───────────────────────────────────────── */
.discog-actions {
  display: flex;
  gap: .5em;
  align-items: center;
  flex-wrap: wrap;
  margin: .75em 0;
  padding: .75em 1em;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.discog-actions .btn:last-child  { margin-left: auto; }
.discog-card  { position: relative; padding-top: 2em; }
.discog-check {
  position: absolute;
  top: .35em;
  right: .35em;
  z-index: 2;
  width: 20px;
  height: 20px;
  cursor: pointer;
}
.discog-check input  { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.btn-xs  { padding: .2em .5em; font-size: .75em; min-height: auto; line-height: 1.4; }
@media(max-width:640px) { .discog-actions .btn:last-child  { margin-left: 0; }
  .discog-actions  { flex-direction: column; }
  .discog-actions .btn  { width: 100%; justify-content: center; }
}

/* ── Responsive compact grid ───────────────────────────────── */
@media(max-width:640px) { .album-grid-compact  { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5em; }
  .album-card-compact  { padding: .5em; }
  .album-card-art-compact  { max-width: 200px; max-height: 200px; }
  .album-card-title-compact  { font-size: .82em; }
  .artist-section-header  { flex-wrap: wrap; gap: .35em; padding: .4em .5em; top: var(--nav-height); }
  .artist-section-header h2  { font-size: 1em; }
  .artist-section-tags  { display: none; }
  .split-btn-menu  { right: auto; left: 0; }
}
@media(prefers-reduced-motion:reduce) { *, *::before, *::after  { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── Post-2.0 UI: search history, modal, pulse ─── */
/* Search history */
.search-history { margin-top: 0.5em; }
.search-history-header {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 0.35em;
}
.search-history-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35em;
}
.search-history-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.2em 0.6em;
  font-size: 0.8em;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.search-history-chip:hover {
  background: var(--bg-card);
  border-color: var(--accent);
}
.search-history-chip .chip-x {
  font-size: 0.85em;
  opacity: 0.5;
  margin-left: 0.15em;
}
.search-history-chip .chip-x:hover { opacity: 1; }

/* Search history chips (legacy - kept for compatibility) */
.search-history-chip {
  padding: .15em .5em;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: .85em;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.search-history-chip:hover {
  border-color: var(--border-focus);
  background: var(--bg-hover);
}
.search-history-chip:focus {
  outline: none;
  border-color: var(--border-focus);
}
.clear-history {
  padding: .15em .4em;
  font-size: .75em;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  margin-left: auto;
}
.clear-history:hover { color: var(--text-dim); }

/* Inline code / kbd styling */
kbd {
  display: inline-block;
  padding: .1em .4em;
  font: .85em var(--font-mono);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 3px;
  color: var(--text);
}

/* Success pulse animation */
@keyframes navPulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
  100% { box-shadow: 0 0 0 18px rgba(34,197,94,0); }
}
.nav-pulse {
  animation: navPulse 1.2s ease-out;
}

/* ── Tidal OAuth inline banner ──────────────────────────── */
.tidal-banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .7em 1em;
  margin-bottom: 1rem;
}
.tidal-banner--waiting {
  border-color: var(--yellow);
  background: color-mix(in srgb, var(--yellow) 6%, var(--bg-card));
}
.tidal-banner--success {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 6%, var(--bg-card));
}
.tidal-banner--error {
  border-color: var(--red);
  background: color-mix(in srgb, var(--red) 6%, var(--bg-card));
}
.tidal-banner-body {
  display: flex;
  align-items: center;
  gap: .6em;
  flex-wrap: wrap;
  width: 100%;
}
.tidal-banner-state {
  display: flex;
  align-items: center;
  gap: .6em;
  flex-wrap: wrap;
  width: 100%;
}
.tidal-banner-state[hidden] {
  display: none !important;
}
.tidal-banner-icon {
  font-size: 1.1em;
  flex-shrink: 0;
}
.tidal-banner-text {
  font-size: .92em;
  color: var(--text-dim);
  flex-shrink: 0;
}
.tidal-banner-link {
  color: var(--accent);
  font-weight: 600;
}
.tidal-banner-link:hover {
  text-decoration: underline;
}
.tidal-banner-code {
  font-family: var(--font-mono);
  font-size: 1.4em;
  font-weight: 700;
  letter-spacing: .12em;
  padding: .15em .5em;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  user-select: all;
}
.tidal-banner-btn {
  flex-shrink: 0;
}
.tidal-banner-countdown {
  font-family: var(--font-mono);
  font-size: .85em;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.tidal-banner-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  background: var(--yellow);
  animation: tidalPulse 1.4s ease-in-out infinite;
}
.tidal-banner-dot--green {
  background: var(--green);
  animation: none;
}

@keyframes tidalPulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50%      { opacity: 1;   transform: scale(1.1); }
}
