/* ==========================================================================
   Sonava — soft-UI / neumorphic design system
   Two themes, one geometry. Light is a pale lavender-blue canvas with embossed
   white surfaces; dark is a deep indigo-slate canvas with the same emboss
   inverted (a near-black bottom-right shadow plus a faint top-left highlight —
   dark neumorphism fails if you simply reuse the light shadows). Every colour
   below is a token, so a theme swap is a variable swap, not a second stylesheet.

   Theme is selected by data-theme on <html>, set before first paint by an
   inline script in head.ejs — CSS alone can't read localStorage, and without
   that the page would flash the wrong theme on every load.

   Dense repeating lists (track grids, comment lists) intentionally use a
   lighter single-shadow variant instead of full double-emboss — applying the
   heavy raised/pressed treatment to every card in a 20-item grid reads as noise
   and kills text contrast, so the strong emboss is reserved for singular,
   important surfaces (auth card, modals, stat tiles, the player).
   ========================================================================== */

:root {
  /* canvas + surfaces */
  --bg: #e8edf6;
  --surface: #f3f6fb;
  --surface-strong: #ffffff;
  --border-hairline: rgba(255, 255, 255, 0.7);

  /* text */
  --text: #2b3245;
  --text-muted: #838fa6;
  --text-faint: #a8b1c4;

  /* brand gradient — blue → indigo. --accent-0 (cyan) is the extra stop that
     keeps large gradient fills (hero, gauge, brand mark) from reading flat;
     small controls stay on the two-stop version so the family holds together. */
  --accent-0: #38bdf8;
  --accent-1: #4f7dfb;
  --accent-2: #6a45f5;
  --gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  --gradient-rich: linear-gradient(120deg, var(--accent-0), var(--accent-1) 55%, #7c3aed);

  /* warm accent — reserved for money/support actions */
  --warm-1: #f5ab4c;
  --warm-2: #e8842f;
  --gradient-warm: linear-gradient(135deg, var(--warm-1), var(--warm-2));

  --success: #2fb37f;
  --error: #e5484d;

  --radius: 20px;
  --radius-sm: 12px;

  /* neumorphic shadows */
  --shadow-out: 9px 9px 18px rgba(163, 177, 198, 0.55), -9px -9px 18px rgba(255, 255, 255, 0.85);
  --shadow-out-lg: 14px 14px 28px rgba(163, 177, 198, 0.5), -14px -14px 28px rgba(255, 255, 255, 0.9);
  --shadow-out-sm: 5px 5px 10px rgba(163, 177, 198, 0.5), -5px -5px 10px rgba(255, 255, 255, 0.85);
  --shadow-soft: 0 6px 16px rgba(163, 177, 198, 0.35);
  --shadow-in: inset 5px 5px 10px rgba(163, 177, 198, 0.45), inset -5px -5px 10px rgba(255, 255, 255, 0.8);

  --font-display: 'Vazirmatn', 'Montserrat', Tahoma, sans-serif;
  --font-body: 'Vazirmatn', 'Montserrat', Tahoma, sans-serif;

  /* Ambient background blobs — dialled per theme so they glow in dark without
     washing the canvas out in light. */
  --blob-1: rgba(56, 189, 248, .5);
  --blob-2: rgba(124, 58, 237, .38);
  --blob-opacity: .5;
  --nav-bg: rgba(232, 237, 246, .88);
}

:root[data-theme="dark"] {
  --bg: #171b26;
  --surface: #1e2432;
  --surface-strong: #232939;
  --border-hairline: rgba(255, 255, 255, .06);

  --text: #e8ecf7;
  --text-muted: #949fba;
  --text-faint: #6f7a95;

  /* Accents lift slightly on a dark canvas — the light-theme blue reads muddy
     against #171b26 and fails contrast on body-sized text. */
  --accent-0: #4cc7ff;
  --accent-1: #6b93ff;
  --accent-2: #8b6bff;

  --warm-1: #ffbe6b;
  --warm-2: #ff9d47;

  --success: #45d39d;
  --error: #ff6b70;

  /* Inverted emboss: heavy near-black offset, faint white highlight. Reusing
     the light-theme alphas here produces flat grey mush. */
  --shadow-out: 9px 9px 20px rgba(0, 0, 0, .55), -9px -9px 20px rgba(255, 255, 255, .035);
  --shadow-out-lg: 14px 14px 30px rgba(0, 0, 0, .6), -14px -14px 30px rgba(255, 255, 255, .04);
  --shadow-out-sm: 5px 5px 12px rgba(0, 0, 0, .5), -5px -5px 12px rgba(255, 255, 255, .03);
  --shadow-soft: 0 6px 18px rgba(0, 0, 0, .45);
  --shadow-in: inset 5px 5px 11px rgba(0, 0, 0, .55), inset -5px -5px 11px rgba(255, 255, 255, .035);

  --blob-1: rgba(76, 199, 255, .30);
  --blob-2: rgba(139, 107, 255, .28);
  --blob-opacity: .65;
  --nav-bg: rgba(23, 27, 38, .88);
}

* { box-sizing: border-box; }

/* Theme swap should feel like a dimmer, not a hard cut — but only colour
   transitions, never layout, and never during the initial paint. */
body.theme-ready,
body.theme-ready .nav,
body.theme-ready .panel-card,
body.theme-ready .panel-head,
body.theme-ready .track-card,
body.theme-ready .tile,
body.theme-ready .auth-card,
body.theme-ready .stat-card,
body.theme-ready .comment,
body.theme-ready .playlist-card,
body.theme-ready .tier-card,
body.theme-ready input,
body.theme-ready textarea,
body.theme-ready select {
  transition: background-color .35s ease, color .35s ease, box-shadow .35s ease;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  direction: rtl;
  min-height: 100%;
}

/* Ambient colour field — two very soft, slowly drifting blobs behind the page.
   Fixed + blurred + transform-only animation so it stays on the compositor and
   costs no layout work; pointer-events:none keeps it non-interactive. */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(90px);
  opacity: var(--blob-opacity);
}

body::before {
  width: 46vmax; height: 46vmax;
  top: -14vmax; right: -10vmax;
  background: radial-gradient(circle, var(--blob-1), transparent 68%);
  animation: drift-a 26s ease-in-out infinite alternate;
}

body::after {
  width: 40vmax; height: 40vmax;
  bottom: -14vmax; left: -8vmax;
  background: radial-gradient(circle, var(--blob-2), transparent 68%);
  animation: drift-b 32s ease-in-out infinite alternate;
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-6vmax, 5vmax, 0) scale(1.12); }
}

@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(5vmax, -4vmax, 0) scale(1.1); }
}

/* Entrance motion — staggered by nth-child so a section resolves as one
   sequence rather than everything popping at once. */
.reveal {
  animation: rise .42s cubic-bezier(.22, .68, .36, 1) both;
}

.reveal:nth-child(2) { animation-delay: .04s; }
.reveal:nth-child(3) { animation-delay: .08s; }
.reveal:nth-child(4) { animation-delay: .12s; }
.reveal:nth-child(5) { animation-delay: .16s; }
.reveal:nth-child(6) { animation-delay: .20s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

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

/* The `hidden` attribute is only display:none in the UA stylesheet, so ANY
   class that sets `display` silently outranks it — .btn (inline-flex) and the
   session overlays (grid) both did, which meant JS setting el.hidden = true
   did nothing at all. Every dynamic show/hide on the site relies on `hidden`,
   so this is enforced once here rather than patched per component. */
[hidden] { display: none !important; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 .5rem;
}

::selection { background: var(--accent-1); color: #fff; }

:focus-visible {
  outline: 3px solid var(--accent-1);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Two selectors for one rule, and they are not redundant.
   `prefers-reduced-motion` is an OS setting a lot of people never find;
   [data-motion="reduced"] is the account switch in /settings, set on <html>
   before first paint by head.ejs. Either one alone should be enough to stop
   the site moving, so neither is allowed to depend on the other.
   CSS has no way to put an attribute condition in a media query, so the block
   is written twice rather than @media-nested. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
:root[data-motion="reduced"] *,
:root[data-motion="reduced"] *::before,
:root[data-motion="reduced"] *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.page-narrow {
  max-width: 640px;
}

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: .85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  margin-left: .5rem;
}

/* The mark is now artwork, not a letter in a box: no gradient tile, no shadow,
   no rounding. The tile treatment belongs to app icons, where the mark needs a
   ground of its own because it lands on somebody's wallpaper; inline beside the
   wordmark it sits directly on the page, which is how every lockup on the brand
   sheet does it. The negative space through the middle is transparent, so it
   picks up the nav's own background in either theme. */
.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  object-fit: contain;
}

.nav-search {
  flex: 1;
  min-width: 160px;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: .4rem;
  background: var(--surface);
  box-shadow: var(--shadow-in);
  border-radius: 999px;
  padding: .3rem .3rem .3rem 1rem;
}

.nav-search input {
  flex: 1;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: .35rem 0;
  color: var(--text);
  font-family: inherit;
}

.nav-search button {
  border: none;
  background: var(--gradient);
  color: #fff;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-wrap: wrap;
  font-size: .92rem;
}

.nav-links > a,
.nav-links > .link-btn {
  padding: .5rem .75rem;
  border-radius: 999px;
  transition: box-shadow .15s ease, background .15s ease;
}

.nav-links > a:hover,
.nav-links > .link-btn:hover {
  background: var(--surface);
  box-shadow: var(--shadow-out-sm);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-weight: 600;
}

.link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  cursor: pointer;
  font-size: .92rem;
}

.inline-form { display: inline; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border-radius: 999px;
  padding: .6rem 1.2rem;
  border: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .92rem;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  box-shadow: var(--shadow-out-sm);
}

.btn:active { transform: scale(.97); }

.btn-accent {
  background: var(--gradient);
  color: white;
}

.btn-accent:hover { box-shadow: var(--shadow-out); transform: translateY(-1px); }

/* Destructive action (delete account). Solid error colour so it never reads as a
   default/primary button. */
.btn-danger { background: var(--error); color: #fff; border: none; }
.btn-danger:hover { filter: brightness(1.06); transform: translateY(-1px); }
.panel-danger { border: 1px solid color-mix(in srgb, var(--error) 45%, transparent); }
.panel-danger .panel-card-title { color: var(--error); }

/* Persian (Jalali) date picker — age gate. */
.jdp { max-width: 340px; display: flex; flex-direction: column; }
.jdp-head { display: flex; gap: 10px; margin-bottom: 12px; }
.jdp-sel { flex: 1; padding: 9px 10px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--text) 14%, transparent); background: var(--surface); color: var(--text); font: inherit; font-size: .95rem; }
.jdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.jdp-wd { text-align: center; font-size: .72rem; color: var(--text-dim); padding: 4px 0; }
.jdp-blank { visibility: hidden; }
.jdp-day { aspect-ratio: 1 / 1; border: 1px solid transparent; border-radius: 10px; background: color-mix(in srgb, var(--text) 4%, transparent); color: var(--text); font: inherit; font-size: .9rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .12s, transform .12s; }
.jdp-day:hover { background: color-mix(in srgb, var(--accent-1) 22%, transparent); }
.jdp-day.jdp-on { background: var(--gradient); color: #fff; border-color: transparent; }
.jdp-out { order: 3; margin-top: 12px; font-weight: 600; color: var(--text); min-height: 1.2em; }
.jdp-out:empty::before { content: 'هنوز تاریخی انتخاب نشده'; color: var(--text-dim); font-weight: 400; }
.jdp-label { display: block; margin-bottom: 8px; font-size: .9rem; color: var(--text-dim); }
.jdp-submit { margin-top: 18px; }

.btn-gold {
  background: var(--gradient-warm);
  color: #2b1a05;
}

.btn-gold:hover { box-shadow: var(--shadow-out); transform: translateY(-1px); }

.btn-ghost {
  background: var(--surface);
  color: var(--text);
}

.btn-ghost:hover { box-shadow: var(--shadow-out); transform: translateY(-1px); }

.btn-lg { padding: .85rem 1.7rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- hero ---------- */

.hero {
  padding: 3rem 0 2rem;
  text-align: center;
}

/* The mark above the headline. Sized in clamp() rather than at a fixed 132px
   because it shares vertical space with the largest type on the site: on a
   short phone screen a fixed mark pushes the headline and the call to action
   below the fold, which is the one thing the hero exists to prevent.

   The gentle float is the only ambient motion on the page. It is suppressed
   under the reduced-motion preference by the global rule near the top of this
   file, and the transform origin stays put so nothing reflows around it. */
.hero-mark {
  display: block;
  width: clamp(76px, 13vw, 132px);
  height: auto;
  margin: 0 auto 1.2rem;
  animation: hero-mark-float 6s ease-in-out infinite;
}

@keyframes hero-mark-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.hero h1 {
  font-size: 2.3rem;
  line-height: 1.35;
  background: var(--gradient-rich);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 1.5rem;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: .75rem;
  flex-wrap: wrap;
}

/* ---------- filters ---------- */

.filters {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.chip {
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  border-radius: 999px;
  padding: .42rem .95rem;
  font-size: .85rem;
  color: var(--text-muted);
}

.chip-active {
  background: var(--gradient);
  color: white;
  box-shadow: var(--shadow-out-sm);
}

/* ---------- track grid / card ---------- */

.section-title { margin-top: 2rem; font-size: 1.15rem; }

.track-grid {
  display: grid;
  /* min(190px, 100%) rather than a bare 190px: in a container narrower than
     190px the fixed minimum wins and the grid pushes past its parent, which is
     what made the homepage scroll sideways by 30px on a phone. Clamping the
     minimum to the container makes the track collapse instead. */
  grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr));
  gap: 1.1rem;
}

.track-card {
  background: var(--surface-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: block;
  transition: box-shadow .15s ease, transform .15s ease;
}

.track-card:hover {
  box-shadow: var(--shadow-out);
  transform: translateY(-3px);
}

.cover { aspect-ratio: 1; background: var(--surface); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cover-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem;
  background: linear-gradient(135deg, rgba(79, 125, 251, .18), rgba(106, 69, 245, .18));
}

.cover-fallback-lg { font-size: 4rem; border-radius: var(--radius); }

.track-info { padding: .8rem .95rem 1.05rem; }
.track-title { font-weight: 700; margin-bottom: .2rem; }
.track-artist { color: var(--text-muted); font-size: .88rem; display: flex; align-items: center; gap: .25rem; }

.track-meta {
  display: flex;
  gap: .6rem;
  margin-top: .5rem;
  font-size: .8rem;
  color: var(--text-muted);
  align-items: center;
  flex-wrap: wrap;
}

.tag {
  background: var(--surface);
  box-shadow: var(--shadow-in);
  border-radius: 999px;
  padding: .15rem .65rem;
}

.badge-check {
  color: var(--accent-2);
  font-size: .85em;
}

.empty-state { color: var(--text-muted); padding: 2rem 0; }

/* ---------- track detail ---------- */

.track-detail {
  display: flex;
  gap: 1.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.track-detail-cover {
  width: 220px;
  height: 220px;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-out);
}

.track-detail-cover img { width: 100%; height: 100%; object-fit: cover; }

.track-detail-info { flex: 1; min-width: 240px; }

.track-artist-link {
  display: inline-flex;
  gap: .3rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
}

.track-desc { color: var(--text-muted); line-height: 1.8; margin: .75rem 0; }

/* ---------- player (signature element) ----------
   A functional neumorphic play control: the gradient ring is a REAL
   playback-progress indicator (0–100%, driven by the <audio> element's
   own timeupdate/duration), not decoration. Click the ring to toggle
   play/pause. The native <audio> element stays in the DOM for a11y and
   as a fallback (controls hidden visually only when JS + ring boot). */

.player-card {
  background: var(--surface-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-out);
  padding: 1.1rem 1.3rem;
  margin: 1.1rem 0;
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.player-ring-wrap {
  position: relative;
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  cursor: pointer;
}

/* width/height:100% (not the markup's fixed 76px) — the wrapper shrinks at the
   mobile breakpoint, and a fixed-size SVG kept overflowing it. Under RTL the
   overflow anchors to the right, so the ring drifted left of the centred
   button. Scaling off the viewBox keeps ring and button concentric at any size.
   Direct child (>) on purpose: the play/pause icons live inside
   .player-ring-btn, and a descendant selector rotated them -90° too, which laid
   the pause bars on their side. */
.player-ring-wrap > svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.player-ring-track { fill: none; stroke: var(--surface); stroke-width: 7; }

.player-ring-progress {
  fill: none;
  stroke: url(#sonava-ring-gradient);
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dashoffset .12s linear;
}

/* inset in % rather than a fixed 12px margin, so the knob keeps the same
   proportion to the ring when the wrapper resizes. */
.player-ring-btn {
  position: absolute;
  inset: 16%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-2);
  background: var(--surface-strong);
  border-radius: 50%;
  box-shadow: var(--shadow-out-sm);
}

/* Inline SVG icons, not ▶/⏸ characters: Android renders U+23F8 from its emoji
   font, which forces its own colour (the pause came out orange) and its own
   optical centring. currentColor keeps these on-brand in both themes. */
.player-ring-btn svg { width: 42%; height: 42%; display: block; }
.player-ring-btn .icon-pause { display: none; }
.player-ring-btn[data-state="playing"] .icon-play { display: none; }
.player-ring-btn[data-state="playing"] .icon-pause { display: block; }

.player-meta { flex: 1; min-width: 0; }
.player-time { color: var(--text-muted); font-size: .8rem; font-variant-numeric: tabular-nums; }

.player { width: 100%; margin: .25rem 0 0; }
.player.player-hidden { display: none; }

.track-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.plays-count { color: var(--text-muted); font-size: .85rem; }

/* ---------- modal ---------- */

.modal {
  border: none;
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--text);
  padding: 1.6rem;
  width: min(420px, 90vw);
  box-shadow: var(--shadow-out-lg);
}

.modal::backdrop { background: rgba(43, 50, 69, .35); backdrop-filter: blur(2px); }

.modal-sub { color: var(--text-muted); font-size: .88rem; margin-top: -.3rem; }

.modal-actions {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  margin-top: .5rem;
}

/* ---------- forms ---------- */

.form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin: 1rem 0;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  font-size: .9rem;
  color: var(--text-muted);
}

input, textarea, select {
  font-family: inherit;
  background: var(--surface);
  border: none;
  box-shadow: var(--shadow-in);
  border-radius: var(--radius-sm);
  padding: .75rem .9rem;
  color: var(--text);
  font-size: .95rem;
}

textarea { resize: vertical; }

input:focus, textarea:focus, select:focus {
  outline: none;
  box-shadow: var(--shadow-in), 0 0 0 2px var(--accent-1);
}

.role-choice {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

.role-card {
  flex: 1;
  min-width: 160px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius);
  padding: .9rem;
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  cursor: pointer;
  transition: box-shadow .15s ease;
}

.role-card:has(input:checked) { box-shadow: var(--shadow-out-sm), 0 0 0 2px var(--accent-1); }

.role-card div { display: flex; flex-direction: column; gap: .2rem; }
.role-card span { color: var(--text-muted); font-size: .82rem; }

.auth-card {
  background: var(--surface-strong);
  border-radius: 28px;
  box-shadow: var(--shadow-out-lg);
  padding: 2rem 1.9rem;
  margin-top: 2rem;
}

.auth-switch { color: var(--text-muted); font-size: .9rem; margin-top: .5rem; }

/* ---------- alerts ---------- */

.alert {
  padding: .8rem 1.05rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  margin-bottom: .5rem;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.alert-error { color: var(--error); }
.alert-success { color: var(--success); }
.alert-pending { color: var(--warm-2); }

/* ---------- comments ---------- */

.comments { margin-top: 2.5rem; }

.comment-form {
  display: flex;
  gap: .5rem;
  margin: 1rem 0;
}

.comment-form input { flex: 1; }

.comment-list { display: flex; flex-direction: column; gap: .9rem; }

.comment {
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius-sm);
  padding: .75rem .95rem;
}

.comment-author { font-weight: 700; font-size: .85rem; margin-bottom: .2rem; }
.comment-body { color: var(--text-muted); line-height: 1.7; }

/* ---------- avatars ---------- */

.avatar-sm {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-lg {
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: var(--shadow-out);
}

.avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient);
  color: white;
  font-weight: 700;
}

.avatar-preview-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: 1rem;
}

.avatar-preview-label {
  color: var(--text-muted);
  font-size: .85rem;
}

/* ---------- artist page ---------- */

.artist-header {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.artist-bio { color: var(--text-muted); line-height: 1.8; margin: .4rem 0; }

.artist-stats {
  display: flex;
  gap: 1.25rem;
  color: var(--text-muted);
  font-size: .9rem;
  margin: .5rem 0;
  flex-wrap: wrap;
}

/* ---------- dashboard ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.1rem;
  margin: 1.25rem 0 2rem;
}

.stat-card {
  background: var(--surface-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-out);
  padding: 1.2rem 1rem;
  text-align: center;
}

.stat-card-gold {
  background: var(--surface-strong);
  box-shadow: var(--shadow-out), inset 0 0 0 2px rgba(232, 132, 47, .18);
}

.stat-value { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; }
.stat-label { color: var(--text-muted); font-size: .8rem; margin-top: .3rem; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
}

@media (max-width: 800px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

.track-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .9rem;
  background: var(--surface-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.track-table th, .track-table td {
  text-align: right;
  padding: .7rem .85rem;
}

.track-table tbody tr:not(:last-child) td { border-bottom: 1px solid var(--bg); }

.track-table th { color: var(--text-muted); font-weight: 600; font-size: .8rem; }

.donation-list { display: flex; flex-direction: column; gap: .6rem; }

.donation-item {
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius-sm);
  padding: .7rem .9rem;
  font-size: .9rem;
}

.donation-msg { color: var(--text-muted); margin-top: .2rem; font-size: .85rem; }

/* ---------- verify box / admin ---------- */

.verify-box {
  border-top: 1px solid rgba(163, 177, 198, .3);
  padding-top: 1rem;
  margin-top: 1.5rem;
}

.admin-list { display: flex; flex-direction: column; gap: .6rem; margin-top: 1rem; }

.admin-item {
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius);
  padding: .85rem 1.05rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}

.admin-actions { display: flex; gap: .5rem; }
.muted { color: var(--text-muted); font-size: .85rem; margin-right: .5rem; }

/* ---------- footer ---------- */

.site-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: .82rem;
  padding: 2.5rem 1rem;
}

.site-footer p { margin: .3rem 0; }

.footer-link {
  text-decoration: underline;
  font-size: .82rem;
  padding: 0;
}

.footer-link:hover { color: var(--accent-2); }

/* ---------- presence + activity ---------- */

.presence-pill {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  background: var(--surface-strong);
  box-shadow: var(--shadow-out-sm);
  border-radius: 999px;
  padding: .5rem 1.1rem;
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.presence-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(47, 179, 127, .6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 179, 127, .5); }
  70% { box-shadow: 0 0 0 6px rgba(47, 179, 127, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 179, 127, 0); }
}

.home-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  align-items: start;
}

/* A grid item's default min-width is auto, i.e. its min-content size, so a wide
   child stretches the track instead of being constrained by it. Every grid/flex
   child on this page that contains a grid of its own needs this. */
.home-main { min-width: 0; }

@media (max-width: 900px) {
  .home-layout { grid-template-columns: 1fr; }
}

.home-sidebar {
  position: sticky;
  top: 96px;
}

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.activity-item {
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius-sm);
  padding: .6rem .8rem;
  font-size: .82rem;
  color: var(--text-muted);
  display: block;
}

.activity-like::before { content: "❤ "; }
.activity-comment::before { content: "💬 "; }
.activity-donate::before { content: "💰 "; }

/* ---------- AI assistant chat ---------- */

.ai-sub { color: var(--text-muted); margin-top: -.5rem; }

.chat-log {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  max-height: 55vh;
  overflow-y: auto;
  padding: .5rem .25rem;
  margin-bottom: .5rem;
}

.chat-msg { display: flex; }
.chat-user { justify-content: flex-start; }
.chat-assistant { justify-content: flex-end; }

.chat-bubble {
  max-width: 80%;
  padding: .65rem .95rem;
  border-radius: 16px;
  line-height: 1.7;
  font-size: .92rem;
}

.chat-user .chat-bubble {
  background: var(--surface);
  box-shadow: var(--shadow-in);
}

.chat-assistant .chat-bubble {
  background: var(--gradient);
  color: white;
  box-shadow: var(--shadow-out-sm);
}

.queue-status {
  color: var(--warm-2);
  font-size: .85rem;
  margin-bottom: .5rem;
}

.chat-track-links {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-top: .35rem;
  max-width: 80%;
}

.chat-track-link {
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
  font-size: .85rem;
  color: var(--text);
  transition: box-shadow .15s ease;
}

.chat-track-link:hover { box-shadow: var(--shadow-out-sm); }

/* ---------- playlists ---------- */

.playlist-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.1rem;
  margin-top: 1rem;
}

.playlist-card {
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius);
  padding: 1.1rem;
  transition: box-shadow .15s ease, transform .15s ease;
}

.playlist-card:hover { box-shadow: var(--shadow-out); transform: translateY(-2px); }

.playlist-name { font-weight: 700; margin-bottom: .3rem; }
.playlist-count { color: var(--text-muted); font-size: .82rem; }

.playlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.playlist-track-list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-top: 1rem;
}

.playlist-track-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius-sm);
  padding: .55rem .85rem;
}

.playlist-track-info {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex: 1;
  min-width: 0;
}

.playlist-track-info .cover {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

/* ---------- mobile ---------- */

@media (max-width: 640px) {
  .nav-inner { gap: .6rem; }
  .nav-search { order: 3; max-width: 100%; flex-basis: 100%; }
  .hero h1 { font-size: 1.7rem; }
  .track-detail { flex-direction: column; }
  .track-detail-cover { width: 100%; height: 220px; }
  .player-card { padding: 1rem; gap: .85rem; }
  .player-ring-wrap { width: 62px; height: 62px; }
  .auth-card { padding: 1.5rem 1.25rem; border-radius: var(--radius); }
  /* Full double-emboss shadows read as blurry smudges on small, dense
     screens — soften to the single-shadow variant below this breakpoint. */
  .stat-card, .track-detail-cover, .avatar-lg {
    box-shadow: var(--shadow-soft);
  }
}

/* ==========================================================================
   Account control panel
   ========================================================================== */

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--surface-strong);
  border-radius: 26px;
  box-shadow: var(--shadow-out);
  padding: 1.4rem 1.6rem;
  margin-top: 1rem;
}

.panel-identity { display: flex; align-items: center; gap: 1.1rem; }
.panel-name { font-size: 1.45rem; margin: 0; }
.panel-role { color: var(--text-muted); font-size: .87rem; margin: .25rem 0 0; }

.tier-badge {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .82rem;
  padding: .45rem 1.1rem;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-in);
  color: var(--text-muted);
}

.tier-badge.tier-plus,
.tier-badge.tier-pro {
  background: var(--gradient-rich);
  box-shadow: var(--shadow-out-sm);
  color: #fff;
}

/* ---- quick tiles ---- */

.tile-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.tile {
  background: var(--surface-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 1.1rem .8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  transition: box-shadow .16s ease, transform .16s ease;
}

.tile:hover { box-shadow: var(--shadow-out); transform: translateY(-3px); }

.tile-icon { font-size: 1.5rem; line-height: 1; }
.tile-label { font-size: .87rem; font-weight: 600; }
.tile-count { font-size: .78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.tile-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: var(--shadow-out-sm);
}

.tile-primary .tile-count { color: rgba(255, 255, 255, .8); }

/* ---- panel grid + cards ---- */

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: start;
}

.panel-card {
  background: var(--surface-strong);
  border-radius: 24px;
  box-shadow: var(--shadow-out);
  padding: 1.4rem 1.5rem;
}

.panel-card-wide { grid-column: 1 / -1; }
.panel-card-title { font-size: 1.02rem; margin: 0 0 1rem; }
/* The -.5rem top margin this used to carry unconditionally was a tweak for one
   situation — pulling the subtitle up under a .panel-card-title, which sets its
   own generous bottom margin. Everywhere else it dragged the paragraph UP into
   whatever preceded it: on the settings page the account-type caption came to
   rest on top of the chips it describes. Scoped to the adjacency it was written
   for, so it stops being a trap for every later use. */
.panel-card-sub { color: var(--text-muted); font-size: .86rem; margin: 0 0 1rem; line-height: 1.8; }
.panel-card-title + .panel-card-sub { margin-top: -.5rem; }
.type-caption { margin-top: .9rem; }

/* ---- completeness gauge ---- */

.gauge-row { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }

.gauge { position: relative; width: 132px; height: 132px; flex-shrink: 0; }
.gauge svg { transform: rotate(-90deg); }
.gauge-track { fill: none; stroke: var(--surface); stroke-width: 12; }

.gauge-fill {
  fill: none;
  stroke: url(#gauge-grad);
  stroke-width: 12;
  stroke-linecap: round;
}

.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
}

.gauge-value { font-size: 1.85rem; }
.gauge-pct { font-size: .95rem; color: var(--text-muted); margin-right: .1rem; }

.step-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; flex: 1; min-width: 150px; }

.step {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .88rem;
  color: var(--text-muted);
}

.step-mark {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
  background: var(--surface);
  box-shadow: var(--shadow-in);
  flex-shrink: 0;
}

.step-done { color: var(--text); font-weight: 600; }
.step-done .step-mark { background: var(--gradient); color: #fff; box-shadow: var(--shadow-out-sm); }

/* ---- mini stats ---- */

.mini-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }

.mini-stat {
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-in);
  padding: .85rem .7rem;
  text-align: center;
}

.mini-value { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; }
.mini-label { display: block; color: var(--text-muted); font-size: .76rem; margin-top: .2rem; }
.mini-stat-warm .mini-value { color: var(--warm-2); }

/* ---- preferences ---- */

.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--bg);
}

.pref-row:last-of-type { border-bottom: none; }
.pref-text { display: flex; flex-direction: column; gap: .18rem; }
.pref-text strong { font-size: .93rem; }
.pref-text span { color: var(--text-muted); font-size: .8rem; line-height: 1.7; }

.switch {
  position: relative;
  width: 62px;
  height: 34px;
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: var(--surface);
  box-shadow: var(--shadow-in);
  transition: background .22s ease;
}

.switch[aria-checked="true"] { background: var(--gradient); }

.switch-knob {
  position: absolute;
  top: 4px; right: 4px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface-strong);
  box-shadow: var(--shadow-out-sm);
  transition: transform .22s cubic-bezier(.34, 1.56, .64, 1);
}

/* RTL: "on" slides the knob to the left edge. */
.switch[aria-checked="true"] .switch-knob { transform: translateX(-28px); }

.pref-row-slider { flex-wrap: wrap; }
.slider-wrap { display: flex; align-items: center; gap: .8rem; flex: 1; min-width: 190px; }

.slider-wrap input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 12px;
  padding: 0;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-in);
  cursor: pointer;
}

.slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: var(--shadow-out-sm);
  border: 3px solid var(--surface-strong);
}

.slider-wrap input[type="range"]::-moz-range-thumb {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent-1);
  box-shadow: var(--shadow-out-sm);
  border: 3px solid var(--surface-strong);
}

#volume-out {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .9rem;
  min-width: 46px;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.pref-status { color: var(--success); font-size: .82rem; min-height: 1.2em; margin: .6rem 0 0; }

/* ---- subscription tiers ---- */

.tier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }

.tier-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 1.2rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  transition: box-shadow .16s ease, transform .16s ease;
}

.tier-card:hover { box-shadow: var(--shadow-out); transform: translateY(-2px); }
.tier-card-active { box-shadow: var(--shadow-out), inset 0 0 0 2px var(--accent-1); }

.tier-name { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.tier-price { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--accent-2); }
.tier-per { font-size: .74rem; color: var(--text-muted); font-weight: 500; }

.tier-perks {
  list-style: none;
  margin: .2rem 0 .8rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  flex: 1;
}

.tier-perks li { color: var(--text-muted); font-size: .82rem; line-height: 1.6; padding-right: 1.1rem; position: relative; }
.tier-perks li::before { content: "✓"; position: absolute; right: 0; color: var(--accent-1); font-weight: 700; }

.tier-current {
  text-align: center;
  font-size: .84rem;
  font-weight: 700;
  color: var(--accent-2);
  padding: .6rem;
}

@media (max-width: 780px) {
  .panel-grid { grid-template-columns: 1fr; }
  .panel-card { padding: 1.2rem 1.1rem; border-radius: var(--radius); box-shadow: var(--shadow-soft); }
  .panel-head { padding: 1.2rem; box-shadow: var(--shadow-soft); }
  .panel-identity { gap: .85rem; }
  .panel-name { font-size: 1.2rem; }
  .gauge-row { justify-content: center; }
  .pref-row-slider .slider-wrap { flex-basis: 100%; }
}

/* ==========================================================================
   Theme toggle + motion accents
   ========================================================================== */

.theme-toggle {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-out-sm);
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow .16s ease, transform .16s ease;
}

.theme-toggle:hover { box-shadow: var(--shadow-out); transform: translateY(-1px); }
.theme-toggle:active { box-shadow: var(--shadow-in); transform: none; }

/* The glyph swaps with the theme: a moon offers dark, a sun offers light. */
.theme-toggle .icon-dark { display: inline; }
.theme-toggle .icon-light { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-light { display: inline; }

/* ---- equalizer bars: the site's one music-native flourish ----
   Used in the live-listeners pill. Bars animate on independent durations so
   they never fall into visible lockstep. */

.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.eq span {
  width: 3px;
  border-radius: 2px;
  background: var(--gradient);
  animation: eq-bounce .9s ease-in-out infinite alternate;
}

.eq span:nth-child(1) { height: 40%; animation-duration: .78s; }
.eq span:nth-child(2) { height: 85%; animation-duration: 1.12s; }
.eq span:nth-child(3) { height: 60%; animation-duration: .64s; }
.eq span:nth-child(4) { height: 95%; animation-duration: .98s; }

@keyframes eq-bounce {
  from { transform: scaleY(.35); }
  to   { transform: scaleY(1); }
}

/* ---- track card: hover reveals a play affordance ----
   Pure CSS on ::after, so no markup change and nothing extra in the DOM for a
   grid that can hold dozens of cards. */

.cover { position: relative; overflow: hidden; }
.cover img { transition: transform .4s cubic-bezier(.2, .7, .3, 1); }
.track-card:hover .cover img { transform: scale(1.07); }

.cover::after {
  content: "▶";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #fff;
  background: rgba(30, 36, 58, .42);
  opacity: 0;
  transition: opacity .22s ease;
}

.track-card:hover .cover::after,
.track-card:focus-visible .cover::after { opacity: 1; }

/* ---- hero headline: slow gradient drift ---- */

.hero h1 {
  background-size: 220% 100%;
  animation: hero-shift 9s ease-in-out infinite alternate;
}

@keyframes hero-shift {
  from { background-position: 0% 50%; }
  to   { background-position: 100% 50%; }
}

/* ---- scroll reveal (applied by footer.ejs via IntersectionObserver) ---- */

/* Scoped to .js (set by head.ejs) so a JS-disabled browser never receives a
   page of permanently invisible sections. */
.js .on-scroll {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .5s ease, transform .5s cubic-bezier(.22, .68, .36, 1);
  will-change: opacity, transform;
}

.js .on-scroll.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .on-scroll { opacity: 1; transform: none; transition: none; }
  .eq span { animation: none; }
  .hero h1 { animation: none; }
}
/* The account switch, same rules. Crucially this also makes .on-scroll content
   visible outright — the global duration override above only makes the reveal
   instant, and an element that starts at opacity 0 waiting for an observer
   would otherwise stay invisible if that observer never fires. */
:root[data-motion="reduced"] .js .on-scroll,
:root[data-motion="reduced"].js .on-scroll { opacity: 1; transform: none; transition: none; }
:root[data-motion="reduced"] .eq span { animation: none; }
:root[data-motion="reduced"] .hero h1 { animation: none; }

/* ==========================================================================
   Home: curated shelf + discovery prompt
   ========================================================================== */

.section-sub {
  color: var(--text-muted);
  font-size: .88rem;
  line-height: 1.8;
  margin: -.35rem 0 1.1rem;
}

.result-count {
  font-family: var(--font-display);
  font-size: .74rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface);
  box-shadow: var(--shadow-in);
  border-radius: 999px;
  padding: .2rem .7rem;
  margin-right: .5rem;
  vertical-align: middle;
}

/* The full catalogue is reachable only from here, so this block has to read as
   a real next step rather than a footnote. */
.discover-cta {
  margin-top: 2.5rem;
  background: var(--surface-strong);
  border-radius: 24px;
  box-shadow: var(--shadow-out);
  padding: 1.6rem 1.5rem;
  text-align: center;
}

.discover-cta h3 { font-size: 1.05rem; margin: 0 0 .4rem; }
.discover-cta p { color: var(--text-muted); font-size: .87rem; line-height: 1.85; margin: 0 auto 1.1rem; max-width: 44ch; }

.discover-search {
  display: flex;
  gap: .5rem;
  max-width: 420px;
  margin: 0 auto;
}

.discover-search input { flex: 1; min-width: 0; }

/* ==========================================================================
   Artist directory (/artists)
   ========================================================================== */

.artist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.artist-card {
  background: var(--surface-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 1.1rem .8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  text-align: center;
  transition: box-shadow .15s ease, transform .15s ease;
}

.artist-card:hover { box-shadow: var(--shadow-out); transform: translateY(-3px); }

.artist-card-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  font-size: 1.4rem;
}

.artist-card-name { font-weight: 700; font-size: .9rem; }
.artist-card-count { color: var(--text-muted); font-size: .78rem; }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2rem 0 0;
}

.pager-status { color: var(--text-muted); font-size: .85rem; }

/* ==========================================================================
   Social sign-in buttons
   ========================================================================== */

.oauth-list { display: flex; flex-direction: column; gap: .6rem; margin: 1.2rem 0 .2rem; }

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .8rem 1.1rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .93rem;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-out-sm);
  transition: box-shadow .15s ease, transform .15s ease;
}

.oauth-btn:hover { box-shadow: var(--shadow-out); transform: translateY(-1px); }
.oauth-btn:active { box-shadow: var(--shadow-in); transform: none; }

.oauth-icon { display: flex; align-items: center; }
.oauth-icon svg { display: block; }

/* Apple's brand guidance is a black button in light contexts and white in
   dark; currentColor on the mark makes it invert with the surface. */
:root[data-theme="dark"] .oauth-apple { background: #ffffff; color: #111111; }
.oauth-apple { background: #111111; color: #ffffff; }

.oauth-note { color: var(--text-muted); font-size: .78rem; line-height: 1.75; margin: .6rem 0 0; text-align: center; }

.oauth-divider {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: 1.2rem 0 .2rem;
  color: var(--text-faint);
  font-size: .78rem;
}

.oauth-divider::before,
.oauth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(131, 143, 166, .35), transparent);
}

/* ==========================================================================
   Android app download page
   ========================================================================== */

.app-hero {
  text-align: center;
  background: var(--surface-strong);
  border-radius: 28px;
  box-shadow: var(--shadow-out-lg);
  padding: 2.4rem 1.6rem;
  margin-top: 1.5rem;
}

.app-mark {
  width: 72px; height: 72px;
  margin: 0 auto 1.1rem;
  border-radius: 22px;
  background: var(--gradient-rich);
  box-shadow: var(--shadow-out-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
}

.app-hero h1 { font-size: 1.7rem; }
.app-sub { color: var(--text-muted); line-height: 1.9; max-width: 42ch; margin: 0 auto 1.6rem; }
.app-download { min-width: 260px; justify-content: center; }
.app-meta { color: var(--text-faint); font-size: .8rem; margin-top: .9rem; }

.install-steps {
  list-style: none;
  counter-reset: step;
  margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 1rem;
}

/* Numbered because installing genuinely is a sequence — the order matters and
   step 2 is the one people get stuck on. */
.install-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: .8rem;
  align-items: start;
}

.install-steps li::before {
  content: counter(step);
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-out-sm);
}

.install-steps .step-body { min-width: 0; }
.install-steps strong { display: block; font-size: .95rem; margin-bottom: .2rem; }
.install-steps span { display: block; color: var(--text-muted); font-size: .86rem; line-height: 1.85; }

.app-notes { margin: 0; padding-right: 1.1rem; display: flex; flex-direction: column; gap: .8rem; }
.app-notes li { color: var(--text-muted); font-size: .86rem; line-height: 1.9; }
.app-notes strong { color: var(--text); }

.app-hash {
  display: block;
  margin-top: .5rem;
  padding: .55rem .7rem;
  background: var(--surface);
  box-shadow: var(--shadow-in);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .72rem;
  direction: ltr;
  text-align: left;
  word-break: break-all;
  color: var(--text-muted);
}

/* Compact promo used on the home page. */
.app-promo {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
  background: var(--surface-strong);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  padding: 1.1rem 1.3rem;
  margin-top: 1.25rem;
}

.app-promo-text { flex: 1; min-width: 200px; }
.app-promo-text strong { display: block; font-size: .98rem; margin-bottom: .15rem; }
.app-promo-text span { color: var(--text-muted); font-size: .84rem; }

@media (max-width: 560px) {
  .app-hero { padding: 1.8rem 1.1rem; border-radius: var(--radius); box-shadow: var(--shadow-soft); }
  .app-download { min-width: 100%; }
  .app-promo { flex-direction: column; }
  .app-promo .btn { width: 100%; justify-content: center; }
}

/* ==========================================================================
   Cookie consent
   ========================================================================== */

.cookie-bar {
  position: fixed;
  z-index: 60;
  inset-inline: 1rem;
  bottom: 1rem;
  max-width: 620px;
  margin-inline: auto;
  background: var(--surface-strong);
  border-radius: 22px;
  box-shadow: var(--shadow-out-lg);
  padding: 1.25rem 1.4rem;
  animation: cookie-in .45s cubic-bezier(.22, .68, .36, 1) both;
}

.cookie-bar[hidden] { display: none; }

@keyframes cookie-in {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

.cookie-title { font-family: var(--font-display); font-weight: 800; font-size: 1rem; margin: 0 0 .4rem; }
.cookie-text { color: var(--text-muted); font-size: .84rem; line-height: 1.85; margin: 0 0 .9rem; }
.cookie-text a { color: var(--accent-2); text-decoration: underline; }

.cookie-options { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }

.cookie-option {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  background: var(--surface);
  box-shadow: var(--shadow-in);
  border-radius: var(--radius-sm);
  padding: .6rem .75rem;
  font-size: .83rem;
}

.cookie-option input { margin: .15rem 0 0; box-shadow: none; padding: 0; }
.cookie-option input:disabled { opacity: .6; }
.cookie-option strong { display: block; font-size: .85rem; }
.cookie-option span { color: var(--text-muted); line-height: 1.7; }

.cookie-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.cookie-actions .btn { flex: 1; min-width: 130px; justify-content: center; }

@media (max-width: 560px) {
  .cookie-bar { inset-inline: .6rem; bottom: .6rem; padding: 1.1rem 1rem; }
  .cookie-actions .btn { min-width: 100%; }
}

/* ---------- small utility classes (kept out of inline style= for CSP) ---------- */

.link-gold { color: var(--warm-2); text-decoration: underline; }
.text-center { text-align: center; }

/* Unread-message badge in the nav. Positioned on the link rather than as a
   sibling so it travels with the text at every breakpoint. */
.nav-messages { position: relative; }
.nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.15rem;
  height: 1.15rem;
  margin-inline-start: .25rem;
  padding: 0 .3rem;
  border-radius: 999px;
  background: var(--gradient);
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  vertical-align: middle;
}

/* ---------------------------------------------------------------------------
   Nav on small screens.
   The links wrap, and each new destination adds a row: with groups and
   messages added the header grew to four rows and ate a third of a phone
   screen before any content appeared. Below 700px they become a single
   horizontally-scrollable row instead — everything stays reachable, the header
   stays one row tall, and nothing has to be hidden behind a hamburger.
   --------------------------------------------------------------------------- */
@media (max-width: 700px) {
  .nav-inner { padding: .6rem .75rem; gap: .6rem; }

  .nav-links {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    /* Momentum scrolling without a visible bar — the row is short enough that
       a scrollbar would be more chrome than content. */
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .15rem;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links > a,
  .nav-links > form,
  .nav-links > button { flex: none; white-space: nowrap; }

  /* The search field keeps the top row to itself alongside the brand. */
  .nav-search { order: 2; max-width: none; }
  .brand { order: 1; }

  /* The name is the least useful part of the chip at this width — the avatar
     already identifies the account, and the full name is what makes the row
     long enough to need scrolling in the first place. */
  .user-chip { max-width: 8.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ==========================================================================
   Account type — the first-visit prompt and the settings control
   ========================================================================== */

/* The prompt is wider than the confirm-style dialogs .modal was written for:
   it carries three side-by-side choices, not an OK/Cancel pair. */
.modal-wide { width: min(680px, 94vw); padding: 1.9rem; }

.modal-body { display: flex; flex-direction: column; gap: .9rem; }
.modal-eyebrow {
  margin: 0;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--accent-1);
}
.modal-title { margin: 0; font-size: 1.35rem; line-height: 1.55; }
.modal-body .modal-sub { margin: 0; font-size: .92rem; line-height: 1.9; }
.modal-foot { margin: 0; font-size: .82rem; color: var(--text-muted); }
.modal-foot a { color: var(--accent-1); }
.modal-defer {
  align-self: flex-start;
  font-size: .82rem;
  color: var(--text-faint);
}
.modal-defer:hover { color: var(--text-muted); }

.type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .8rem;
  margin: .3rem 0 .2rem;
}

/* Each option is the submit button itself rather than a radio plus a separate
   confirm. One tap answers, which is the difference between a prompt people
   clear and a prompt people dismiss. */
.type-card {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  text-align: start;
  padding: 1.05rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-out-sm);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: box-shadow .16s ease, transform .16s ease;
}
.type-card:hover { box-shadow: var(--shadow-out); transform: translateY(-2px); }
.type-card:focus-visible { outline: 2px solid var(--accent-1); outline-offset: 2px; }
.type-card-name { font-family: var(--font-display); font-weight: 700; font-size: .98rem; }
.type-card-sub { color: var(--text-muted); font-size: .8rem; line-height: 1.7; }

/* Settings version: the same three choices, but compact and showing which one
   is currently active. */
.type-choice { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }
.type-chip {
  padding: .45rem 1rem;
  border: none;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--shadow-in);
  color: var(--text-muted);
  font-family: inherit;
  font-size: .85rem;
  cursor: pointer;
}
.type-chip:hover { color: var(--text); }
.type-chip-on {
  background: var(--gradient);
  box-shadow: var(--shadow-out-sm);
  color: #fff;
  font-weight: 600;
}
.type-chip:focus-visible { outline: 2px solid var(--accent-1); outline-offset: 2px; }

/* Segmented control — three mutually exclusive options, presented as one
   object rather than three loose chips. Used for the theme picker, where the
   three choices are a scale (follow the device / force one / force the other)
   and reading them as a single control matters more than it does for the
   account-type chips above, which are three unrelated identities. */
.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--shadow-in);
  align-self: flex-start;
}
.seg-btn {
  padding: .4rem 1.05rem;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .84rem;
  cursor: pointer;
  transition: color .18s ease;
  white-space: nowrap;
}
.seg-btn:hover { color: var(--text); }
.seg-on {
  background: var(--gradient);
  box-shadow: var(--shadow-out-sm);
  color: #fff;
  font-weight: 600;
}
.seg-btn:focus-visible { outline: 2px solid var(--accent-1); outline-offset: 2px; }

@media (max-width: 420px) {
  /* Three labels plus padding stop fitting beside the label text; the control
     spreads across its own row rather than each option shrinking to four
     characters. */
  .seg { display: flex; width: 100%; }
  .seg-btn { flex: 1 1 0; padding-inline: .4rem; }
}

/* This row's control is a group of chips, not a single switch, so it needs the
   full width rather than being squeezed against the label. */
.pref-row-stack { flex-direction: column; align-items: stretch; gap: .7rem; }

.panel-card-note { color: var(--text-muted); font-weight: 400; font-size: .85rem; }

.notice {
  margin: 0 0 1rem;
  padding: .8rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .84rem;
  line-height: 1.85;
}
.notice-info {
  background: rgba(79, 125, 251, .1);
  color: var(--text);
  border-inline-start: 3px solid var(--accent-1);
}

@media (max-width: 620px) {
  /* Three cards side by side at phone width leaves about eight characters per
     line in the description. Stacked, each one is readable. */
  .type-grid { grid-template-columns: 1fr; }
  .modal-wide { padding: 1.3rem; }
  .modal-title { font-size: 1.15rem; }
}

/* A <dialog open> rendered by the server is NOT a modal: it sits in normal
   flow, gets no ::backdrop, and is not promoted to the top layer — so the
   prompt appeared at the bottom of the page, underneath the cookie bar. It is
   still rendered that way on purpose (a dialog only openable from script is
   invisible to anyone whose JS failed, and this is the one thing every
   returning account must see), so the overlay behaviour is done in CSS here
   and upgraded to a real modal by script in footer.ejs where possible.

   The huge spread box-shadow is the scrim: ::backdrop does not apply to a
   non-modal dialog, and this covers the viewport at any size without adding
   an element. */
#account-type-prompt[open] {
  position: fixed;
  /* `right`/`bottom` must be explicitly `auto`. The UA stylesheet sets all four
     insets on a modal <dialog>, and a box with left, right AND a width is
     over-constrained — in an RTL document the rule is that `left` loses. The
     dialog was landing 157px off the left edge with its text running off the
     screen, and it looked exactly like a width bug rather than a direction one. */
  top: 50%;
  bottom: auto;
  left: 50%;
  right: auto;
  transform: translate(-50%, -50%);
  margin: 0;
  z-index: 900;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-out-lg), 0 0 0 100vmax rgba(43, 50, 69, .45);
}

/* Once script promotes it with showModal() the real backdrop takes over, and
   the scrim above would double up into an almost-black screen. */
#account-type-prompt[open]::backdrop { background: rgba(43, 50, 69, .45); backdrop-filter: blur(2px); }
#account-type-prompt.is-modal { box-shadow: var(--shadow-out-lg); }

/* ==================== API keys panel ==================== */

/* Used by friends.ejs and the key-name field: a label a screen reader announces
   and sighted users do not need, because the placeholder and the button next to
   it already say what the field is. It was referenced before it existed, so the
   label was simply rendering as ordinary visible text. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.inline-link { color: var(--accent-1); text-decoration: underline; text-underline-offset: 3px; }

.notice-warn {
  background: rgba(229, 72, 77, .1);
  color: var(--text);
  border-inline-start: 3px solid var(--error);
}

.empty-note { color: var(--text-muted); font-size: .85rem; margin: .9rem 0 0; }

/* The one-time key reveal. Deliberately loud — this is the only moment the
   secret exists in a response, and a visitor who scrolls past it has to make a
   new key. */
.key-reveal {
  padding: 1rem 1.1rem;
  margin-bottom: 1.1rem;
  border-radius: var(--radius-sm);
  background: rgba(79, 125, 251, .1);
  border-inline-start: 3px solid var(--accent-1);
}
.key-reveal strong { display: block; margin-bottom: .35rem; }
.key-reveal p { margin: 0 0 .7rem; font-size: .82rem; color: var(--text-muted); line-height: 1.8; }

.key-value-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

/* direction: ltr because the key is a Latin token: in an RTL paragraph the
   bidi algorithm reorders its trailing punctuation and the string a visitor
   reads back to check is not the string they copied. break-all so a 60-character
   secret wraps inside the card instead of widening the page. */
.key-value {
  flex: 1 1 16rem;
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8rem;
  padding: .55rem .7rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  box-shadow: var(--shadow-in);
  word-break: break-all;
}

.api-quota { margin-bottom: 1.1rem; }
.api-quota-nums { display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.api-quota-used { font-size: 1.5rem; font-weight: 700; }
.api-quota-sep, .api-quota-cap { color: var(--text-muted); font-size: 1rem; }
.api-quota-label { color: var(--text-muted); font-size: .82rem; margin-inline-start: .3rem; }
.api-quota-bar {
  height: 9px;
  margin-top: .6rem;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--shadow-in);
  overflow: hidden;
}
/* width 0 by default and set by a nonce'd <style> block per render. The default
   matters: if that block ever goes missing the bar reads empty, which is
   obviously broken, rather than full, which looks like good news. */
.api-quota-fill { width: 0; height: 100%; border-radius: 999px; background: var(--gradient-rich); transition: width .4s ease; }
.api-quota-note { color: var(--text-muted); font-size: .8rem; margin: .6rem 0 0; }

.key-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .6rem; }
.key-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
  padding: .75rem .9rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-in);
}
.key-row-main { display: flex; align-items: baseline; gap: .6rem; flex: 1 1 12rem; min-width: 0; }
.key-row-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-row-prefix {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .76rem;
  color: var(--text-muted);
}
.key-row-meta { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; color: var(--text-muted); font-size: .78rem; }
.key-dot { opacity: .6; }
.key-row-dead { opacity: .55; }
.key-badge { padding: .1rem .5rem; border-radius: 999px; font-size: .72rem; }
.key-badge-dead { background: rgba(229, 72, 77, .12); color: var(--error); }

.key-create { display: flex; gap: .6rem; flex-wrap: wrap; }
.key-create input {
  flex: 1 1 14rem;
  padding: .7rem .9rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--bg);
  box-shadow: var(--shadow-in);
  color: var(--text);
  font: inherit;
}
.btn-sm { padding: .45rem 1rem; font-size: .8rem; }

@media (max-width: 620px) {
  /* The revoke button is a separate flex item; at phone width it would sit on
     the same line as a truncated name and steal the room the name needs. */
  .key-row { flex-direction: column; align-items: stretch; }
  /* flex-basis follows the main axis, so the `12rem` that reserves WIDTH in a
     row becomes 12rem of HEIGHT once the container turns vertical — a blank
     block under the key name. Reset it with the direction. */
  .key-row-main { flex: 0 0 auto; }
  .key-row form { align-self: flex-start; }
  .key-create button { width: 100%; }
}

/* ==================== API docs page ==================== */

/* Code samples are LTR inside an RTL document. Without the explicit direction
   the bidi algorithm moves leading punctuation to the wrong end of each line —
   a curl command reads as `\ curl` — and the sample stops being copy-pasteable,
   which is the only thing a sample is for. */
.code-block {
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
  margin: .9rem 0 0;
  padding: .9rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  box-shadow: var(--shadow-in);
  overflow-x: auto;
  font-size: .78rem;
  line-height: 1.9;
}
.code-block code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; }

.doc-list { margin: .8rem 0 0; padding-inline-start: 1.2rem; line-height: 2.1; font-size: .88rem; }
.doc-list code, .panel-card-sub code {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82em;
  padding: .1rem .35rem;
  border-radius: 6px;
  background: rgba(127, 143, 175, .14);
  /* Header names and endpoint paths have no spaces to break at, so a long one
     runs past the card edge instead of wrapping inside it. */
  overflow-wrap: anywhere;
}
.doc-h3 { margin: 1.4rem 0 0; font-size: .95rem; }

/* Four columns of numbers do not shrink below their content, so the table
   scrolls inside its own box rather than widening the page — the rule the rest
   of this stylesheet follows for wide content. */
.table-wrap { overflow-x: auto; margin: .9rem 0 1.2rem; }
.doc-table { width: 100%; border-collapse: collapse; font-size: .85rem; white-space: nowrap; }
.doc-table th, .doc-table td { padding: .55rem .8rem; text-align: start; }
.doc-table thead th { color: var(--text-muted); font-weight: 600; font-size: .8rem; }
.doc-table tbody tr { background: var(--surface); }
.doc-table tbody tr td:first-child { border-start-start-radius: 10px; border-end-start-radius: 10px; }
.doc-table tbody tr td:last-child { border-start-end-radius: 10px; border-end-end-radius: 10px; }

@media (max-width: 620px) {
  /* Four columns of plan limits do fit a 390px phone once the headings are
     allowed to wrap. Left as nowrap they scroll out of the container and the
     last column — the one saying how many keys you get — is the one that
     disappears, with nothing on screen to suggest it is there. */
  .doc-table { white-space: normal; font-size: .78rem; }
  .doc-table th, .doc-table td { padding: .5rem .45rem; }
}

/* ==================== Site-wide player bar ==================== */

/* Fixed to the bottom of the viewport, outside <main>, and never re-rendered:
   this element is the reason a page change no longer stops the music. */
.player-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 850;
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .6rem clamp(.7rem, 3vw, 1.4rem);
  background: var(--surface-strong);
  box-shadow: 0 -6px 24px rgba(43, 50, 69, .16);
  /* Safe-area inset so the bar clears the iOS home indicator rather than
     hiding its own controls behind it. */
  padding-bottom: calc(.6rem + env(safe-area-inset-bottom, 0px));
}
.player-bar[hidden] { display: none; }

/* The bar covers the last ~76px of every page, so the page has to end above
   it — otherwise the footer links and the last card are permanently
   unreachable. Applied unconditionally rather than only while the bar is
   visible, because toggling it would reflow the whole document mid-playback. */
body { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }

.pb-toggle {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--gradient); color: #fff;
  cursor: pointer;
}
.pb-toggle svg { width: 20px; height: 20px; }
.pb-toggle .icon-pause { display: none; }
.pb-toggle[data-state="playing"] .icon-play { display: none; }
.pb-toggle[data-state="playing"] .icon-pause { display: block; }

/* Skip buttons flank the play button. Smaller and unfilled: they are used far
   less often than play/pause, and three equally weighted circles in a row make
   it hard to hit the right one without looking. */
.pb-skip {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .18s ease, background .18s ease;
}
.pb-skip:hover { color: var(--text); background: var(--surface); }
.pb-skip svg { width: 19px; height: 19px; }

.pb-cover {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 10px;
  overflow: hidden;
  display: grid; place-items: center;
  background: var(--surface);
}
.pb-cover img { width: 100%; height: 100%; object-fit: cover; }

.pb-meta { flex: 1 1 8rem; min-width: 0; display: flex; flex-direction: column; }
.pb-title, .pb-artist {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pb-title { font-weight: 600; font-size: .88rem; color: var(--text); text-decoration: none; }
.pb-artist { font-size: .76rem; color: var(--text-muted); }

.pb-seek { flex: 2 1 12rem; display: flex; align-items: center; gap: .6rem; min-width: 0; }
.pb-seek input { flex: 1 1 auto; min-width: 0; }
.pb-time {
  flex: 0 0 auto;
  font-size: .74rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.pb-volume { flex: 0 0 8rem; display: flex; align-items: center; gap: .4rem; }
.pb-volume input { width: 100%; }

.pb-close {
  flex: 0 0 auto;
  border: 0; background: none; cursor: pointer;
  color: var(--text-muted); font-size: 1rem; line-height: 1;
  padding: .3rem;
}

@media (max-width: 860px) {
  /* Volume goes first: phones have hardware buttons for it, and the seek bar
     is the control that actually needs the width. */
  .pb-volume { display: none; }
}
@media (max-width: 560px) {
  /* Below this the seek bar, the title and the time cannot all be legible on
     one line. The scrubber moves to its own row spanning the full width, which
     is also the easier target for a thumb. */
  /* Previous is the least-used of the three controls and the first to go; next
     is what a queue actually needs. */
  #pb-prev { display: none; }
  .player-bar { flex-wrap: wrap; row-gap: .35rem; }
  .pb-seek { order: 3; flex: 1 0 100%; }
  .pb-meta { flex: 1 1 auto; }
  body { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
}

/* Play-in-place button on a discovery card. Sits over the cover art, which is
   why it needs the positioning context on .cover. */
.track-card .cover { position: relative; }
.card-play {
  position: absolute;
  inset-block-end: .5rem;
  inset-inline-end: .5rem;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(15, 20, 36, .62);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
  backdrop-filter: blur(4px);
}
.card-play svg { width: 17px; height: 17px; }
.card-play .icon-pause { display: none; }
.track-card:hover .card-play,
.track-card:focus-within .card-play { opacity: 1; transform: none; }

/* Touch has no hover, so a control revealed by hover is a control that does not
   exist. On a coarse pointer it is simply always visible. */
@media (hover: none) {
  .card-play { opacity: 1; transform: none; }
}

/* A soft navigation is fast enough that a spinner would flash; the cursor is
   enough of an acknowledgement that the click registered. */
body.is-navigating { cursor: progress; }


/* ==========================================================================
   Overlay menu
   ==========================================================================
   Modelled on the Codegrid "WeAreCasey" menu, adapted to Persian and to this
   site's palette. Two adaptations are not cosmetic:

   * the reference reveals text character by character. Arabic script is
     cursive — letters change shape according to what they join — so a per
     character split makes every Persian word fall apart into isolated
     letterforms. The split is by WORD here, and the timing is built around
     that. See public/js/menu.js.
   * the reference slides trailing text in from the right (translateX(125%)).
     Transforms are physical, not logical, so in an RTL document that is the
     wrong way: text would slide in against the reading direction. Negated.

   The overlay is a dark glass panel in BOTH themes rather than following the
   page. It sits over arbitrary content — cover art, a bright home page — and a
   scrim that changes contrast with the theme is a scrim that is sometimes
   unreadable. One treatment, always legible. */

.nav-slim .nav-inner { flex-wrap: nowrap; gap: .6rem; }
.nav-actions { display: flex; align-items: center; gap: .5rem; margin-inline-start: auto; }
.nav-publish { white-space: nowrap; }

.nav-toggler {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.1rem;
  border: none;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-out-sm);
  color: var(--text);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  /* The label swaps between منو and بستن, which are different widths. Without
     a floor the button resizes under the cursor mid-flicker. */
  min-width: 5.2rem;
  justify-content: center;
}
.nav-toggler:hover { box-shadow: var(--shadow-out); }
.nav-toggler[aria-expanded="true"] {
  /* Raised above the overlay so the button you pressed to open it is still the
     button you press to close it. */
  position: relative;
  z-index: 70;
  background: rgba(237, 233, 255, .14);
  box-shadow: none;
  color: #EDE9FF;
}
/* NOT monospaced. A monospace stack has no Persian glyphs, so منو fell back
   character by character to whatever the system offered — three letters in
   three different faces, next to a site set entirely in Vazirmatn. It inherits
   now, and the label cross-fades rather than being rebuilt character by
   character, which is what the monospace was propping up. */
.toggler-text {
  display: inline-block;
  letter-spacing: .02em;
  transition: opacity .18s ease;
}
.nav-toggler.is-swapping .toggler-text { opacity: 0; }
.toggler-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--error);
}

.menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.4rem;
  padding: 6.5rem clamp(1.25rem, 6vw, 5rem) 3rem;
  color: #EDE9FF;
  pointer-events: none;
  visibility: hidden;
  /* Delayed so the element stays visible for the whole close animation, then
     leaves the accessibility tree. */
  transition: visibility 0s linear .8s;
}
.menu.is-open { pointer-events: auto; visibility: visible; transition-delay: 0s; }

/* Closing is one quick, uniform fade rather than the opening choreography in
   reverse. Reversing it means waiting out the longest delay before the last row
   even starts to leave, which feels like the menu is reluctant to go. */
.menu:not(.is-open) .menu-item,
.menu:not(.is-open) .item-divider,
.menu:not(.is-open) .mask-up > span,
.menu:not(.is-open) .mask-in > span,
.menu:not(.is-open) .item-body,
.menu:not(.is-open) .menu-foot {
  transition-duration: .5s;
  transition-timing-function: cubic-bezier(.25, .9, .3, 1);
  transition-delay: 0s;
}
/* The backdrop leaves last, so the rows fade out against it rather than the
   page appearing underneath them mid-fade. */
.menu:not(.is-open) .menu-bg { transition-duration: .55s; transition-delay: .12s; }

.menu-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(18, 22, 38, .62);
  backdrop-filter: blur(34px);
  -webkit-backdrop-filter: blur(34px);
  opacity: 0;
  transition: opacity .9s cubic-bezier(.25, .9, .3, 1);
}
.menu.is-open .menu-bg { opacity: 1; }

/* The page behind must not scroll while the menu is over it. */
body.menu-open { overflow: hidden; }

.menu-inner {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-height: 100%;
  overflow-y: auto;
}

.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-row { display: block; }

.menu-item {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  font-size: clamp(2rem, 5.2vw, 4.2rem);
  font-weight: 700;
  line-height: 1.24;
  white-space: nowrap;
  cursor: pointer;
  /* Fade is the effect here; the movement inside each row is an accent on top
     of it. Sliding alone reads as mechanical — pieces arriving on rails — and
     it is what made closing feel abrupt, because a mask can only travel back to
     where it came from while opacity can simply ease away.
     Long and gentle on purpose: .8s on a curve that decelerates the whole way. */
  opacity: 0;
  transition: opacity .8s cubic-bezier(.25, .9, .3, 1), color .3s ease;
  transition-delay: calc(var(--i, 0) * .06s + .1s);
}
.menu.is-open .menu-item { opacity: 1; }
.menu-item:hover { color: #ffffff; }
/* Alternating weight is the stand-in for the reference's serif/sans
   alternation. Persian has no serif counterpart to DM Serif Display that is
   worth loading a second font file for, and rhythm was what the alternation
   was doing. */
.menu-row:nth-child(even) .menu-item { font-weight: 500; }
.menu-item.is-here { color: #A788FA; }

.item-divider {
  width: 2px;
  align-self: stretch;
  margin: 0 clamp(.7rem, 1.6vw, 1.25rem);
  background: currentColor;
  opacity: .55;
  transform: rotate(20deg) scaleY(0);
  transform-origin: center center;
  transition: transform 1.05s cubic-bezier(.33, 1, .68, 1);
  transition-delay: calc(var(--i, 0) * .07s + .22s);
  will-change: transform;
}
.menu.is-open .item-divider { transform: rotate(20deg) scaleY(1); }

/* A mask is the whole trick: overflow hidden on the outside, the word
   translated out of view on the inside, and the reveal is the inner span
   sliding home. */
.item-mask { display: inline-block; overflow: hidden; vertical-align: bottom; }
.item-mask > span { display: inline-block; will-change: transform; }

.mask-up > span {
  transform: translateY(110%);
  transition: transform .85s cubic-bezier(.33, 1, .68, 1);
  transition-delay: calc(var(--i, 0) * .07s + .18s);
}
.menu.is-open .mask-up > span { transform: none; }

.item-body {
  display: inline-block;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
  transition: width .95s cubic-bezier(.65, 0, .35, 1);
  transition-delay: calc(var(--i, 0) * .07s + .34s);
}
/* Negative, unlike the reference: transforms are physical, so in RTL the
   trailing words have to come from the left to arrive with the reading
   direction rather than against it. */
.mask-in > span {
  transform: translateX(-125%);
  transition: transform .85s cubic-bezier(.33, 1, .68, 1);
  transition-delay: calc(var(--i, 0) * .07s + .52s + var(--j, 0) * .05s);
}
.menu.is-open .mask-in > span { transform: none; }

.item-badge {
  margin-inline-start: .6rem;
  padding: .1em .55em;
  border-radius: 999px;
  background: var(--error);
  color: #fff;
  font-size: .28em;
  font-weight: 700;
  vertical-align: middle;
}

.menu-foot {
  display: flex;
  align-items: center;
  gap: .4rem 1.3rem;
  flex-wrap: wrap;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(237, 233, 255, .16);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.33, 1, .68, 1);
  /* Last, after the rows have finished arriving. */
  transition-delay: .78s;
}
.menu.is-open .menu-foot { opacity: 1; transform: none; }

.menu-sub {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .35rem 0;
  color: inherit;
  text-decoration: none;
  font-size: .92rem;
  opacity: .78;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .2s ease;
}
.menu-sub:hover { opacity: 1; }
.menu-sub-cta {
  padding: .4rem 1.1rem;
  border-radius: 999px;
  background: var(--gradient);
  color: #fff;
  opacity: 1;
  font-weight: 600;
}
.menu-foot .inline-form { display: inline-flex; }

@media (max-width: 700px) {
  /* The search box and a publish button and a theme toggle and a menu button do
     not fit one phone row. Search moves under the bar; it is the control most
     likely to be used, so it keeps the full width rather than shrinking. */
  .nav-slim .nav-inner { flex-wrap: wrap; }
  .nav-slim .nav-search { order: 3; flex-basis: 100%; max-width: none; }
  .nav-publish { display: none; }
  .menu { padding-top: 8.5rem; justify-content: flex-start; }
  .menu-item { font-size: 1.9rem; }
}

/* Reduced motion: the overlay still cross-fades, it just stops MOVING.
   The site-wide rule at the top of this file flattens every transition to
   .001ms, which for this menu means it teleports in and out — and a modal that
   appears with no transition at all is harder to follow, not easier. The
   guidance for prefers-reduced-motion is to substitute a fade for the
   movement, which is exactly what these two blocks do: opacity keeps a real
   duration, every transform is pinned to its final state, and the width reveal
   is skipped entirely. */
@media (prefers-reduced-motion: reduce) {
  .menu-bg, .menu-item, .menu-foot {
    transition-property: opacity !important;
    transition-duration: .45s !important;
    transition-timing-function: cubic-bezier(.25, .9, .3, 1) !important;
    transition-delay: 0s !important;
  }
  .item-divider { transform: rotate(20deg) scaleY(1) !important; }
  .mask-up > span, .mask-in > span { transform: none !important; }
  .item-body { width: auto !important; }
  .menu-foot { transform: none !important; }
}
:root[data-motion="reduced"] .menu-bg,
:root[data-motion="reduced"] .menu-item,
:root[data-motion="reduced"] .menu-foot {
  transition-property: opacity !important;
  transition-duration: .45s !important;
  transition-timing-function: cubic-bezier(.25, .9, .3, 1) !important;
  transition-delay: 0s !important;
}
:root[data-motion="reduced"] .item-divider { transform: rotate(20deg) scaleY(1) !important; }
:root[data-motion="reduced"] .mask-up > span,
:root[data-motion="reduced"] .mask-in > span { transform: none !important; }
:root[data-motion="reduced"] .item-body { width: auto !important; }
:root[data-motion="reduced"] .menu-foot { transform: none !important; }

/* ==========================================================================
   Ad break
   ==========================================================================
   A full-screen takeover rather than a banner, because that is what the
   product is: the music has stopped and the ad is the thing happening. A
   dismissible corner panel would be a promise that it can be dismissed, and
   for the پایه tier it cannot.

   Everything here is sized in relative units and the card is capped by both
   width and height, so the same markup is a centred card on a desktop and a
   near-full-bleed sheet on a phone with no separate mobile layout to keep in
   sync. */

.ad-break {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  /* Opaque enough that the page behind reads as suspended rather than merely
     dimmed — the break is modal in intent, so it should look it. */
  background: rgba(11, 15, 31, 0.82);
  backdrop-filter: blur(6px);
  animation: ad-break-in .28s ease-out;
}
.ad-break[hidden] { display: none; }

@keyframes ad-break-in { from { opacity: 0; } to { opacity: 1; } }

.ad-break-card {
  width: min(100%, 34rem);
  /* The cap that keeps a landscape phone usable: without it the 16:9 video
     plus copy plus buttons is taller than the viewport and the skip button —
     the one control that matters — ends up below the fold. */
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-out-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.ad-break-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

/* Labelled unambiguously and never styled to blend in. An ad that is not
   obviously an ad is the thing that destroys trust in a feed, and in most of
   the markets this would ever launch in it is also illegal. */
.ad-badge {
  font-family: var(--font-display);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: .25rem .6rem;
  border-radius: 999px;
  background: var(--gradient);
  color: #fff;
}

.ad-slot-count { font-size: .78rem; color: var(--text-muted); }

.ad-media-wrap {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #0b0f1f;
}

.ad-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  /* A creative that fails to load leaves the element at its aspect ratio
     rather than collapsing the card to nothing while the timeout runs. */
  background: #0b0f1f;
}

.ad-progress {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.22);
}

/* Width is set from JS as the ad plays. That is a CSSOM write, not a style=""
   attribute, so the nonce-based style-src does not touch it — unlike the
   server-rendered meters elsewhere in this file, which need a nonce'd <style>
   block because an inline attribute would be silently dropped. */
.ad-progress-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gradient-rich);
  transition: width .25s linear;
}

.ad-break-body { display: flex; flex-direction: column; gap: .3rem; }

.ad-headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  margin: 0;
}
.ad-copy { font-size: .9rem; color: var(--text-muted); margin: 0; line-height: 1.6; }
.ad-advertiser { font-size: .78rem; color: var(--text-faint); margin: 0; }

.ad-break-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}

.ad-foot-right { display: flex; align-items: center; gap: .6rem; }

.ad-countdown {
  font-size: .85rem;
  color: var(--text-muted);
  /* Tabular figures so the number does not jog the layout as it counts down
     from ۱۰ to ۹. */
  font-variant-numeric: tabular-nums;
}

.ad-cta { flex: 1 1 12rem; text-align: center; }

/* Visible but inert until the server-set threshold passes, rather than absent
   and then appearing. A control that materialises without warning gets missed;
   one that is there counting down is understood. */
.ad-skip:disabled { opacity: .5; cursor: default; }

.ad-upsell { font-size: .8rem; color: var(--text-muted); margin: 0; text-align: center; }
.ad-upsell a { color: var(--accent-2); }

/* The page underneath must not be operable during a break. `inert` would be
   better but is not universal, and this is the part that actually matters:
   scrolling away from a modal on iOS is otherwise trivial. */
body.ad-playing { overflow: hidden; }

@media (max-width: 560px) {
  .ad-break { padding: .5rem; }
  .ad-break-card { padding: .8rem; gap: .6rem; }
  .ad-headline { font-size: .98rem; }
  /* Stacked on a phone: side by side, the CTA and the skip button are each
     too narrow to hit reliably, and the skip button is the one people are
     aiming for under time pressure. */
  .ad-break-foot { flex-direction: column; align-items: stretch; }
  .ad-foot-right { justify-content: space-between; }
  .ad-cta { flex: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ad-break { animation: none; }
  .ad-progress-fill { transition: none; }
}
:root[data-motion="reduced"] .ad-break { animation: none; }
:root[data-motion="reduced"] .ad-progress-fill { transition: none; }

/* Ad-revenue figures on /monetization. A definition list in spirit, laid out
   as rows so the label and the number stay on one line at every width — a
   money figure that wraps away from its label is a money figure people
   misread. */
.earn-list { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-direction: column; gap: .1rem; }
.earn-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem .2rem;
  border-bottom: 1px solid rgba(131, 143, 166, 0.14);
}
.earn-list li:last-child { border-bottom: 0; }
.earn-list span { color: var(--text-muted); font-size: .9rem; }
.earn-list strong { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.earn-total strong { color: var(--accent-2); font-size: 1.05rem; }

/* ==========================================================================
   Share codes, the promo card, and the NFC screen
   ==========================================================================
   The promo card is the one page on this site designed to be PRINTED, which
   drives most of the decisions here: the QR is large and square, the code is
   legible at arm's length, and @media print strips everything that is not the
   card itself. */

.promo-card { display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: center; }

.promo-qr {
  /* The QR is an inline <svg> from qrencode with its own viewBox, so it scales
     to whatever box it is given. Capped rather than stretched: a QR larger
     than about 15cm gains nothing — readers focus on the finder patterns, not
     on total area — and it would push the name off a printed page. */
  width: clamp(9rem, 40vw, 13rem);
  aspect-ratio: 1;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: .5rem;
  box-shadow: var(--shadow-out-sm);
}
.promo-qr svg { width: 100%; height: auto; display: block; }

.promo-body h2 { font-family: var(--font-display); margin: 0 0 .3rem; }

/* Tabular figures and wide tracking: this string gets read aloud across a merch
   table and typed by somebody who is not looking carefully. */
.promo-code {
  /* letter-spacing adds a trailing space after the final character, which
     pushes a right-aligned string visibly off the edge it is aligned to. */
  margin-inline-end: -.18em;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 1.35rem;
  letter-spacing: .18em;
  color: var(--accent-2);
  margin: 0 0 .4rem;
}
.promo-url { font-size: .85rem; margin: 0 0 1rem; word-break: break-all; }
.promo-url a { color: var(--text-muted); }

.promo-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.promo-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: .8rem; margin-top: 1rem; }
.promo-stats div { text-align: center; padding: .9rem .5rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-in); }
.promo-stats strong { display: block; font-family: var(--font-display); font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.promo-stats span { font-size: .78rem; color: var(--text-muted); }

.promo-codes { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-direction: column; gap: .5rem; }
.promo-codes li {
  display: flex;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
  padding: .6rem .8rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-out-sm);
}
.promo-codes li.is-retired { opacity: .5; }
.promo-codes form { margin: 0; }
.pc-code { font-family: ui-monospace, monospace; letter-spacing: .1em; font-size: .9rem; }
.pc-label { flex: 1; font-size: .88rem; color: var(--text-muted); }
.pc-scans { font-size: .8rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.pc-retired { font-size: .78rem; color: var(--text-faint); }

.promo-new { display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.promo-new input { flex: 1 1 14rem; }

/* ------------------------------------------------------------------ NFC */

/* One surface, no roles. The rings are the only thing on screen that moves,
   and they are doing real work: until a phone is touched there is nothing else
   to report, and a completely still screen reads as a frozen one. */
.nfc-stage { text-align: center; padding-block: 2rem; }

/* Concentric rings that expand outward from a core. Only animated while the
   radio is genuinely cycling — a pulse that runs when nothing is listening is
   a lie told at exactly the moment somebody is deciding whether it works. */
.nfc-orb {
  position: relative;
  width: 8rem;
  height: 8rem;
  margin: 0 auto 1.2rem;
  display: grid;
  place-items: center;
}
.nfc-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent-1);
  opacity: 0;
}
.nfc-orb-core {
  position: relative;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  color: #fff;
  background: var(--gradient);
  box-shadow: var(--shadow-out);
}
.nfc-stage.is-live .nfc-orb-ring { animation: nfc-ring 2.2s ease-out infinite; }
.nfc-stage.is-live .nfc-orb-ring:nth-child(2) { animation-delay: 1.1s; }

@keyframes nfc-ring {
  0%   { transform: scale(.42); opacity: .55; }
  100% { transform: scale(1);   opacity: 0; }
}

.nfc-controls { margin-top: .8rem; }
.nfc-result { margin: .8rem 0; font-size: .92rem; min-height: 1.4em; }
.nfc-result.is-ok { color: var(--success); }
.nfc-result.is-bad { color: var(--error); }
.nfc-note { margin-top: 1rem; }

/* Three rings that only animate while the radio is actually live. Motion here
   is doing a job — it is the only feedback that the phone is listening, since
   nothing visible happens until the other device is touched. */
.nfc-alt { margin: .8rem 0 1rem; }

@media (max-width: 640px) {
  .promo-card { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .promo-actions { justify-content: center; }
  .promo-codes li { font-size: .85rem; }
}

/* The card, and nothing else. This page exists to come out of a printer, and
   a printed nav bar is a wasted third of the sheet. */
@media print {
  .site-header, .site-footer, .player-bar, .menu-toggle, .promo-actions,
  .promo-stats, .promo-new, .promo-codes, .page-sub, .flash { display: none !important; }
  body { background: #fff !important; }
  .promo-card { box-shadow: none !important; page-break-inside: avoid; }
  .promo-qr { box-shadow: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    /* The rings are status, not decoration, so reduced motion gets a static
     visible ring rather than nothing at all — otherwise the panel looks
     identical whether it is listening or dead. */
  .nfc-stage.is-live .nfc-orb-ring { animation: none; opacity: .35; transform: scale(1); }
}
:root[data-motion="reduced"] .nfc-stage.is-live .nfc-orb-ring {
  animation: none; opacity: .35; transform: scale(1);
}


/* ==========================================================================
   Share page spacing and the NFC status control
   ========================================================================== */

/* The sections were touching — measured gap between the NFC card and the QR
   card was exactly 0px. `.panel-card` carries no block margin of its own here,
   so two adjacent cards sat flush and their box-shadows bled into each other,
   which reads as the panels overlapping at the edges.

   A flex column with a gap fixes it at the container rather than by adding a
   margin to every card: the spacing then holds however many sections the page
   grows, and cannot be lost again by one card losing its margin. */
.share-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.share-page > .page-head { margin-bottom: 0; }

/* Shadows need room to fall. Without this the outer edge of a card's shadow is
   clipped by the viewport on a phone, which is the other half of "not fully
   shown". */
.share-page > .panel-card { margin-inline: 2px; }

.nfc-inline-note { font-size: .9rem; color: var(--text-muted); margin: .4rem 0 0; }

/* The status block is not just a message — it carries the button that
   re-checks. Somebody who reads "NFC is off", goes to settings, turns it on
   and comes back must not have to work out that the whole page needs
   reloading. */
.nfc-status-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin-top: .8rem;
}
.nfc-recheck { white-space: nowrap; }

/* A short line of machine detail, shown only when something failed. It is the
   difference between "it didn't work" and a report somebody can act on. */
.nfc-diag {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .72rem;
  color: var(--text-faint);
  margin: .6rem 0 0;
  word-break: break-word;
  direction: ltr;
  text-align: start;
}

/* ==========================================================================
   Shared playlists
   ========================================================================== */

.playlist-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.playlist-sub { color: var(--text-muted); font-size: .88rem; margin: .3rem 0 0; }
.playlist-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Not the same weight as an owner's controls: this tells a guest what they can
   do, it is not a thing they act on. */
.role-pill {
  display: inline-block;
  font-size: .72rem;
  padding: .1rem .55rem;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-in);
  color: var(--text-muted);
  margin-inline-start: .3rem;
}

.pl-share { margin-block: 1rem; }
.pl-share-form { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; margin-top: .8rem; }
.pl-share-form label { display: flex; flex-direction: column; gap: .3rem; font-size: .84rem; color: var(--text-muted); }
.pl-share-url { word-break: break-all; font-size: .9rem; margin: .6rem 0 .4rem; }
.pl-share-row { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.pl-share-row form { margin: 0; }

.pl-members { list-style: none; padding: 0; margin: .8rem 0 0; display: flex; flex-direction: column; gap: .4rem; }
.pl-members li {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .5rem .7rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-out-sm);
}
.pl-members form { margin: 0; }
.pl-member-name { flex: 1; font-size: .92rem; }
.pl-member-role { font-size: .78rem; color: var(--text-muted); }

.playlist-shared-by { font-size: .76rem; color: var(--text-faint); margin-top: .2rem; }

/* The per-row play button. Round, thumb-sized, and first in the row — in a car
   this is the only control anybody is trying to hit. */
.pl-play-btn {
  flex: none;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-size: .9rem;
  cursor: pointer;
  box-shadow: var(--shadow-out-sm);
}
.pl-play-btn:active { box-shadow: var(--shadow-in); }
.playlist-track-row { display: flex; align-items: center; gap: .7rem; }

@media (max-width: 560px) {
  .playlist-header { flex-direction: column; }
  .playlist-actions { width: 100%; }
  .playlist-actions .btn { flex: 1; }
}

/* --- Cloudflare Turnstile ------------------------------------------------
   The widget is an iframe Cloudflare styles itself, so we can only control
   the box around it. Centred, with the same rhythm as the form fields above
   it, so it reads as part of the form rather than bolted on. */
.turnstile-wrap {
  display: flex;
  justify-content: center;
  margin: 1.1rem 0 0.35rem;
  min-height: 65px; /* reserve the row so the button doesn't jump on load */
}
.turnstile-wrap .cf-turnstile { max-width: 100%; }

/* ============================================================= share page
   Two problems on a wide screen: the column ran edge-to-edge (a flex column
   with no ceiling), and the identity card read as a plain box. This centres
   the page and turns the card into something worth handing to someone —
   without touching print, which this page still has to do: the name stays a
   solid colour and the screen-only flourishes are dropped in @media print. */
.share-page {
  width: 100%;
  max-width: 44rem;
  margin-inline: auto;
}

/* The identity card is the hero. A slim brand-gradient ribbon along the top,
   the QR framed in white, the name and the read-aloud code beneath it. */
.promo-card {
  position: relative;
  overflow: hidden;
  padding-top: 1.6rem;
  gap: 1.75rem;
}
.promo-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: var(--gradient-rich);
}
.promo-qr {
  border: 1px solid rgba(0, 0, 0, .06);
}
.promo-body h2 {
  font-size: 1.5rem;
  line-height: 1.2;
}
/* The code is what gets said across a table or typed off a screen — give it a
   pill so it reads as one tappable unit, not loose text. */
.promo-code {
  display: inline-block;
  padding: .3rem .8rem;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-in);
}
.promo-url a { text-decoration: none; }
.promo-url a:hover { color: var(--accent-1); }

@media (min-width: 641px) {
  .promo-card { align-items: center; }
}

/* Print takes the poster, not the chrome: keep the ribbon and pill off the
   page and let the name fall back to ink so nothing prints as invisible
   gradient text. */
@media print {
  .promo-card::before { display: none; }
  .promo-code { box-shadow: none; background: none; padding: 0; }
}

/* ===================================================== legal / policy pages */
.legal-page { max-width: 46rem; margin-inline: auto; width: 100%; padding-block: 1.5rem 3rem; }
.legal-head { margin-bottom: 1.5rem; }
.legal-eyebrow { color: var(--accent-2); font-weight: 700; font-size: .8rem; letter-spacing: .08em; margin: 0 0 .3rem; }
.legal-head h1 { font-family: var(--font-display, inherit); font-size: 1.85rem; margin: 0 0 .4rem; line-height: 1.25; }
.legal-meta { color: var(--text-muted); font-size: .85rem; margin: 0; }
.legal-body h2 { font-size: 1.15rem; margin: 1.8rem 0 .6rem; }
.legal-body p, .legal-body li { line-height: 2; }
.legal-body ul { padding-inline-start: 1.2rem; margin: .4rem 0 1rem; }
.legal-body li { margin-bottom: .5rem; }
.legal-body a { color: var(--accent-1); }
.legal-agree-bar {
  position: sticky; bottom: 0; margin-top: 2rem; padding: 1rem;
  display: flex; justify-content: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(6px); border-radius: var(--radius);
}

/* ===================================================== FAQ */
.faq-page { max-width: 46rem; margin-inline: auto; width: 100%; }
.faq-section { max-width: 46rem; margin-inline: auto; padding-block: 2.5rem 1rem; }
.faq-head { text-align: center; margin-bottom: 1.4rem; }
.faq-eyebrow { color: var(--accent-2); font-weight: 700; font-size: .8rem; letter-spacing: .08em; margin: 0 0 .3rem; }
.faq-head h2 { font-family: var(--font-display, inherit); font-size: 1.5rem; margin: 0; }
.faq-list { display: flex; flex-direction: column; gap: .7rem; }
.faq-item { border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-out-sm); overflow: hidden; }
.faq-item summary {
  cursor: pointer; padding: 1rem 1.1rem; font-weight: 700; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--accent-1); font-size: 1.35rem; font-weight: 700; line-height: 1; }
.faq-item[open] summary::after { content: '\2212'; }
.faq-answer { padding: 0 1.1rem 1.1rem; color: var(--text-muted); line-height: 2; }
.faq-answer a { color: var(--accent-1); }

/* ===================================================== consent modal (blocking) */
.consent-modal { border: 0; padding: 0; background: transparent; max-width: 30rem; width: calc(100% - 2rem); color: var(--text); }
.consent-modal::backdrop { background: rgba(10, 14, 25, .62); backdrop-filter: blur(4px); }
.consent-modal:not([open]) { display: none; }
.consent-modal[open]:not(.is-modal) { position: fixed; inset: 0; margin: auto; z-index: 1000; }
.consent-card {
  position: relative; overflow: hidden;
  background: var(--surface-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-out-lg); padding: 2rem 1.6rem; text-align: center;
}
.consent-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--gradient-rich); }
.consent-icon { font-size: 2.2rem; margin-bottom: .3rem; }
.consent-card h2 { font-family: var(--font-display, inherit); font-size: 1.25rem; margin: 0 0 .6rem; }
.consent-text { color: var(--text-muted); line-height: 2; margin: 0 0 1.4rem; font-size: .95rem; }
.consent-actions { display: flex; flex-direction: column; gap: .6rem; align-items: stretch; }
.consent-agree-form { margin: 0; }
.consent-agree-form .btn, .consent-actions .btn { width: 100%; justify-content: center; }

/* ===================================================== nav bell */
.nav-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; text-decoration: none; font-size: 1.12rem; }
.nav-bell:hover { background: var(--surface); }
.bell-badge {
  position: absolute; top: -2px; inset-inline-end: -2px; min-width: 1.05rem; height: 1.05rem;
  padding: 0 .22rem; border-radius: 999px; background: #e5484d; color: #fff;
  font-size: .66rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}

/* ===================================================== notification centre */
.notif-page { max-width: 44rem; margin-inline: auto; width: 100%; }
.notif-list { list-style: none; padding: 0; margin: 1.2rem 0 0; display: flex; flex-direction: column; gap: .6rem; }
.notif-item { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem 1.1rem; border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-out-sm); }
.notif-item.is-unread { border-inline-start: 4px solid var(--accent-1); }
.notif-icon { font-size: 1.4rem; flex-shrink: 0; line-height: 1.4; }
.notif-main { flex: 1; min-width: 0; }
.notif-title { font-size: 1rem; margin: 0 0 .3rem; font-weight: 700; }
.notif-item.is-read .notif-title { font-weight: 600; color: var(--text-muted); }
.notif-text { color: var(--text-muted); line-height: 1.9; margin: 0 0 .4rem; font-size: .92rem; }
.notif-cta { color: var(--accent-1); font-weight: 700; font-size: .88rem; text-decoration: none; }
.notif-time { color: var(--text-faint); font-size: .78rem; flex-shrink: 0; white-space: nowrap; }
.notif-empty { text-align: center; padding: 3rem 1rem; }
.notif-empty-icon { font-size: 2.5rem; display: block; margin-bottom: .6rem; opacity: .55; }

/* ===================================================== desktop download page */
.desktop-page { max-width: 52rem; margin-inline: auto; width: 100%; padding-block: 1rem 3rem; }
.desktop-hero { text-align: center; margin-bottom: 2rem; }
.desktop-hero h1 { font-family: var(--font-display, inherit); font-size: 1.9rem; margin: .2rem 0 .5rem; }
.desktop-sub { color: var(--text-muted); line-height: 1.9; max-width: 34ch; margin: 0 auto; }
/* Flex, not grid: with five platforms a grid strands the odd card left-aligned
   on its own row (the "Linux eyesore"). Wrapping flexbox with centered
   justification keeps every row — full or not — centered, and the basis lets
   all five sit on one row on a wide screen and rebalance as it narrows. */
.desktop-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; margin-bottom: 2.5rem; }
.desktop-card { flex: 1 1 8.5rem; max-width: 10.5rem; min-width: 8rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-out-sm); padding: 1.5rem 1rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.desktop-card.is-soon { opacity: .72; }
.desktop-os { font-size: 2rem; line-height: 1; }
.desktop-os-name { font-size: 1.05rem; margin: .3rem 0 0; font-weight: 700; }
.desktop-os-note { color: var(--text-muted); font-size: .82rem; margin: 0 0 .6rem; line-height: 1.7; min-height: 2.4em; }
.desktop-dl { width: 100%; justify-content: center; }
.desktop-dl.is-disabled { pointer-events: none; opacity: .6; }
.desktop-meta { color: var(--text-faint); font-size: .76rem; margin: .5rem 0 0; word-break: break-word; }
.desktop-mac-note { margin-bottom: 1.5rem; }
.desktop-steps { padding-inline-start: 1.3rem; margin: .5rem 0 1rem; line-height: 2.1; }
.desktop-steps li { margin-bottom: .3rem; }
.desktop-cmd { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; background: var(--surface-strong); box-shadow: var(--shadow-in); border-radius: var(--radius-sm); padding: .7rem .9rem; }
.desktop-cmd code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92rem; color: var(--accent-2); direction: ltr; unicode-bidi: plaintext; flex: 1; min-width: 12rem; word-break: break-all; }
.desktop-cmd-after { margin-top: 1rem; }
.desktop-why { margin-top: 1rem; }
.desktop-why summary { cursor: pointer; font-weight: 700; color: var(--accent-1); }
.desktop-why summary::-webkit-details-marker { display: none; }
.desktop-android-x { text-align: center; color: var(--text-muted); margin-top: 1.5rem; }
.desktop-android-x a { color: var(--accent-1); }
.gn-inline-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88em; background: var(--surface); box-shadow: var(--shadow-in); border-radius: 6px; padding: .1em .4em; direction: ltr; unicode-bidi: plaintext; }

/* real platform logos on the downloads page (replaces the emoji) */
.desktop-os { display: flex; align-items: center; justify-content: center; min-height: 2.9rem; }
.plat-logo { width: 2.7rem; height: 2.7rem; display: block; }
.desktop-card.is-soon .plat-logo { opacity: .5; }

/* ==========================================================================
   The native Android beta — liquid glass
   ==========================================================================
   The whole card is the brand gradient with slow-drifting light blooms; the
   content rides on a frosted-glass panel (backdrop-filter) so it reads as glass
   laid over colour, carrying the signature Sonava swirl. Logical properties
   throughout so the same rules survive an LTR locale. */
.beta-band {
  position: relative;
  margin-bottom: 1.5rem;
  border-radius: 26px;
  overflow: hidden;                    /* clip gradient + blooms to the corner */
  background: var(--gradient-rich);
  color: #fff;
  box-shadow: 0 22px 48px -22px rgba(58, 42, 122, .7), var(--shadow-out);
  isolation: isolate;                  /* keep the blur backdrop to this card */
}

/* drifting light blooms — the "liquid" in liquid glass */
.beta-bloom {
  position: absolute; z-index: 0; border-radius: 50%;
  filter: blur(46px); opacity: .55; pointer-events: none;
}
.beta-bloom-1 {
  width: 20rem; height: 20rem; inset-block-start: -8rem; inset-inline-end: -6rem;
  background: radial-gradient(circle, #8fb0ff, transparent 68%);
  animation: beta-drift-1 16s ease-in-out infinite alternate;
}
.beta-bloom-2 {
  width: 17rem; height: 17rem; inset-block-end: -7rem; inset-inline-start: -5rem;
  background: radial-gradient(circle, #b98cff, transparent 68%);
  animation: beta-drift-2 20s ease-in-out infinite alternate;
}
@keyframes beta-drift-1 { to { transform: translate3d(-2.5rem, 1.8rem, 0) scale(1.12); } }
@keyframes beta-drift-2 { to { transform: translate3d(2rem, -1.6rem, 0) scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .beta-bloom { animation: none; } }

.beta-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 13.5rem 1fr;
  gap: 1rem; padding: 1rem;
  align-items: stretch;
}

/* identity side — the swirl on the open gradient */
.beta-showcase {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: .6rem; padding: 1.4rem .8rem;
}
.beta-mark {
  width: 6.2rem; height: 6.2rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3), 0 10px 30px -8px rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.beta-mark-img { width: 3.6rem; height: 3.6rem; display: block;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .35)); }
.beta-badge {
  background: rgba(255, 255, 255, .2); color: #fff;
  font-size: .7rem; font-weight: 700; letter-spacing: .04em;
  padding: .24rem .8rem; border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .32);
}
.beta-showcase-name { font-weight: 700; font-size: 1.05rem; margin: .1rem 0 0; }
.beta-showcase-ver { font-size: .78rem; opacity: .85; margin: 0; }

/* the frosted-glass content panel */
.glass-panel {
  background: rgba(255, 255, 255, .1);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 10px 30px -14px rgba(0, 0, 0, .5);
}
.beta-content { padding: 1.5rem 1.5rem 1.3rem; min-width: 0; }
.beta-title { font-family: var(--font-display, inherit); font-size: 1.35rem; margin: 0 0 .5rem; font-weight: 700; color: #fff; }
.beta-sub { color: rgba(255, 255, 255, .82); font-size: .89rem; line-height: 1.95; margin: 0 0 1.2rem; }

/* feature rows — glass medallions, white on the glass */
.beta-feats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .85rem; }
.beta-feats li { display: flex; align-items: center; gap: .8rem; }
.beta-feat-ico {
  flex-shrink: 0; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(255, 255, 255, .16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}
.beta-feats strong { display: block; font-size: .9rem; margin-bottom: .1rem; color: #fff; }
.beta-feats li span:not(.beta-feat-ico) { display: block; color: rgba(255, 255, 255, .72); font-size: .8rem; line-height: 1.7; }

.beta-actions { margin-top: 1.4rem; display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1rem; }
/* a glass button, not the neomorphic accent one — it sits ON the gradient */
.beta-dl {
  display: inline-flex; align-items: center; gap: .5rem; padding: .7rem 1.5rem;
  background: rgba(255, 255, 255, .92); color: #3a2a7a; font-weight: 700;
  border-radius: 999px; border: none;
  box-shadow: 0 8px 22px -8px rgba(0, 0, 0, .5);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.beta-dl:hover { transform: translateY(-1px); background: #fff; box-shadow: 0 12px 26px -8px rgba(0, 0, 0, .55); }
.beta-dl .ico { color: #5b3ad0; }
.beta-meta { color: rgba(255, 255, 255, .68); font-size: .76rem; margin: 0; line-height: 1.8; }

.beta-why { margin-top: 1.1rem; }
.beta-why summary { cursor: pointer; font-weight: 700; color: #fff; font-size: .88rem; opacity: .92; }
.beta-why summary::-webkit-details-marker { display: none; }
.beta-why .faq-answer { padding: .6rem 0 0; }
.beta-notes { margin: 0; padding-inline-start: 1.1rem; display: flex; flex-direction: column; gap: .7rem; }
.beta-notes li { color: rgba(255, 255, 255, .78); font-size: .84rem; line-height: 1.95; }
.beta-notes strong { color: #fff; }
.beta-notes .app-hash { color: rgba(255, 255, 255, .9); background: rgba(0, 0, 0, .22); box-shadow: none; }
.beta-notes .gn-inline-code { color: #fff; background: rgba(255, 255, 255, .18); box-shadow: none; }

@media (max-width: 640px) {
  /* showcase becomes a banner across the top, glass panel below */
  .beta-inner { grid-template-columns: 1fr; gap: .8rem; }
  .beta-showcase { padding: 1.4rem .8rem .4rem; }
  .beta-mark { width: 5rem; height: 5rem; }
  .beta-mark-img { width: 3rem; height: 3rem; }
  .beta-content { padding: 1.3rem; }
  .beta-dl { width: 100%; justify-content: center; }
}

/* the mac-command popup: reuses the consent-modal card, but closable with a
   row of actions rather than the consent modal's single full-width button */
.mac-help-modal .consent-icon { display: flex; justify-content: center; margin-bottom: .4rem; }
.mac-help-icon .plat-logo { width: 2rem; height: 2rem; }
.mac-help-modal .consent-text { text-align: center; }
.mac-help-modal .desktop-cmd { margin-top: .2rem; }
.mac-help-modal .consent-actions { flex-direction: row; justify-content: center; gap: .6rem; margin-top: 1rem; }
.mac-help-modal .consent-actions .btn { width: auto; }

/* ==========================================================================
   Passkeys — sign-in with Face ID, Touch ID and Android biometrics
   ==========================================================================
   Lives in the site-wide stylesheet rather than a page-specific one because
   the feature appears on two screens that are on different designs: /login
   carries the v2 editorial layer, /settings does not. Styling it here means
   one set of rules serves both and neither has to know about the other.
   ========================================================================== */

/* The sign-in button. Shaped as an .oauth-btn so it sits in the same visual
   row as "continue with Google" — it is the same kind of choice — but tinted
   with the brand accent, because it is the one option that is ours. */
/* Full width, because it sits OUTSIDE .oauth-list (which is the flex column
   that stretches its children) and would otherwise shrink to its own text —
   a narrower button above two wide ones reads as a different kind of control
   when it is the same kind, and the most important one. */
.passkey-btn {
  width: 100%;
  margin-bottom: .6rem;
  border: 1px solid var(--accent-1);
  color: var(--text);
  background: var(--surface);
}

.passkey-btn:hover { border-color: var(--accent-2); }
.passkey-btn .ico { color: var(--accent-1); }
.passkey-btn[disabled] { opacity: .6; cursor: progress; }

.passkey-status {
  min-height: 1.1rem;
  margin: .5rem 0 0;
  color: var(--text-muted);
  font-size: .78rem;
  text-align: center;
}

.passkey-status:empty { min-height: 0; margin: 0; }
.passkey-status.is-error { color: var(--error); }

/* ---- the management list in /settings ---- */

.passkey-list { margin: 1rem 0 0; }

.passkey-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .9rem 0;
  border-bottom: 1px solid var(--border-hairline);
}

.passkey-row:last-child { border-bottom: 0; }

.passkey-main { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.passkey-main b { font-size: .95rem; }

.passkey-main span {
  color: var(--text-muted);
  font-size: .78rem;
  line-height: 1.6;
}

.passkey-actions { display: flex; gap: .5rem; flex-shrink: 0; }

/* Destructive, so it reads as destructive on hover and only on hover — a
   permanently red button in a list of two is a list that looks alarming. */
.passkey-remove:hover { color: var(--error); }

.passkey-empty { color: var(--text-muted); font-size: .85rem; margin: .5rem 0; }

.passkey-add-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.passkey-add-row .passkey-status { text-align: start; margin: 0; }

.passkey-hint {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-hairline);
  color: var(--text-faint);
  font-size: .76rem;
  line-height: 1.8;
}

@media (max-width: 560px) {
  .passkey-row { align-items: flex-start; }
  .passkey-actions { width: 100%; }
  .passkey-actions .btn { flex: 1; justify-content: center; }
}

/* ---- the passkey offer + the security page ---- */

/* The dialog renders hidden and is revealed by passkey.js, so [hidden] has to
   actually win. A <dialog> carries display:block from the UA stylesheet, which
   beats the `hidden` attribute on specificity — this is the same trap the
   player bar hit, and the reason style.css already forces [hidden] elsewhere. */
#passkey-prompt[hidden] { display: none !important; }

.passkey-prompt-art {
  display: grid;
  place-items: center;
  width: 3.6rem;
  height: 3.6rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  color: #fff;
  background: var(--gradient);
}

.passkey-prompt-actions {
  display: flex;
  gap: .6rem;
  margin-top: 1.4rem;
}

.passkey-prompt-actions .btn { flex: 1; justify-content: center; }

.passkey-prompt-foot {
  margin-top: 1rem;
  color: var(--text-faint);
  font-size: .78rem;
  text-align: center;
}

.passkey-prompt-foot a { color: var(--accent-1); }

.security-ok {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--success);
  font-size: .88rem;
}

.security-ways {
  margin: .5rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  font-size: .9rem;
}

.security-ways li { color: var(--text-muted); }

.page-title { margin-bottom: .4rem; }
.page-sub { color: var(--text-muted); font-size: .9rem; line-height: 1.9; margin-bottom: 1.5rem; max-width: 40rem; }

/* ==========================================================================
   Overlay menu — light theme
   ==========================================================================
   The menu was built dark-only: pale lavender text on a rgba(18,22,38,.62)
   scrim, with no theme-aware rule anywhere in its block. In light theme that
   meant switching to light and then opening the menu showed a full-screen dark
   panel — which reads, correctly, as the theme having reverted.

   Everything below is scoped to :root[data-theme="light"] so the dark theme,
   which these colours were designed for, is untouched. It is written as a small
   set of overrides rather than a rewrite of the block for the same reason: the
   dark values are the reference, not the bug.
   ========================================================================== */

:root[data-theme="light"] .menu { color: #1d2333; }

/* A light scrim of the page's own canvas rather than white: pure white behind a
   34px blur loses the sense of anything being behind it at all. */
:root[data-theme="light"] .menu-bg { background: rgba(232, 237, 246, .72); }

:root[data-theme="light"] .menu-item:hover { color: #000; }

/* The "you are here" marker. The dark theme's #A788FA is a light violet meant
   to glow on near-black; on a pale ground it is barely a colour at all, so the
   light theme takes the brand accent at full strength instead. */
:root[data-theme="light"] .menu-item.is-here { color: var(--accent-2); }

:root[data-theme="light"] .menu-foot { border-top-color: rgba(43, 50, 69, .16); }

/* The toggler label sits in the nav bar, not the overlay, but it is part of the
   same dark-only set and had the same problem. */
:root[data-theme="light"] .toggler-text { color: var(--text); }

/* Cards that are direct children of the page, i.e. NOT inside .panel-grid.
   .panel-card carries no margin of its own — the space between cards comes from
   the grid's gap — so a page that lays its sections out directly renders them
   flush, rounded corners butting together into one mushed column. That was the
   security page and the API reference, and it would be the next page written
   the same way, so it is fixed here rather than by wrapping each one.
   Scoped with `>` so cards inside .panel-grid keep using the gap and do not get
   both. */
.page > .panel-card { margin-bottom: 1.25rem; }
.page > .panel-card:last-of-type { margin-bottom: 0; }

/* ==========================================================================
   API reference (/docs/api)
   ==========================================================================
   The page opens with what the API contains rather than a paragraph about it,
   carries a live request and a live embed, and lists routes as scannable rows.
   ========================================================================== */

.api-hero { padding: 1rem 0 2.4rem; }

.api-eyebrow {
  color: var(--accent-1);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .1em;
  margin: 0 0 .8rem;
}

.api-hero h1 {
  font-size: clamp(1.9rem, 4.6vw, 3rem);
  line-height: 1.35;
  margin: 0 0 1rem;
  background: var(--gradient-rich);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.api-lede { max-width: 38rem; color: var(--text-muted); font-size: .96rem; line-height: 1.9; margin: 0 0 1.8rem; }

/* auto-fit rather than a fixed four columns: the numbers vary in width between
   locales and the row should reflow rather than squeeze.

   130px, not 150: this page uses the narrow measure (640px), and at 150 the
   four tiles needed 648px with the gaps — eight pixels too many. They wrapped
   3 + 1 and left an orphan sitting on its own line. */
.api-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr));
  gap: .8rem;
  margin-bottom: 1.8rem;
}

.api-stat {
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.api-stat b {
  display: block;
  font-size: 1.5rem;
  line-height: 1.2;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.api-stat span { display: block; margin-top: .3rem; color: var(--text-muted); font-size: .76rem; line-height: 1.5; }

.api-hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; }

/* ---- try it ---- */

.api-try-bar {
  display: flex;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
  margin-bottom: .9rem;
}

.api-try-url {
  flex: 1;
  min-width: 0;
  padding: .6rem .8rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-in);
  font-size: .8rem;
  overflow-x: auto;
  white-space: nowrap;
}

/* Tall enough that a response does not make the page jump when it arrives, and
   capped so a long one scrolls inside itself rather than burying the page. */
.api-try-out { min-height: 7rem; max-height: 22rem; overflow: auto; }

/* ---- embed demo ---- */

.api-embed-demo { margin: 1.2rem 0; }

.api-embed-frame {
  display: block;
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  /* The frame is a different document with its own background, so it needs a
     visible edge or it reads as part of this card. */
  box-shadow: var(--shadow-soft);
}

/* ---- snippets with a copy button ---- */

.api-snippet { position: relative; }

.api-copy {
  position: absolute;
  top: .6rem;
  inset-inline-end: .6rem;
  z-index: 1;
  padding: .3rem .7rem;
  border: 1px solid var(--border-hairline);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text-muted);
  font: inherit;
  font-size: .7rem;
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}

.api-copy:hover { color: var(--text); }
.api-copy.is-done { color: var(--success); }

/* The clipboard fallback's textarea. Off-screen rather than display:none —
   a hidden element cannot be selected, so execCommand('copy') would copy
   nothing at all. */
.api-copy-shim { position: fixed; top: -1000px; inset-inline-start: -1000px; opacity: 0; }

.api-snippet .code-block { padding-top: 2.4rem; }

/* ---- route rows ---- */

.api-routes { display: flex; flex-direction: column; }

.api-route {
  display: flex;
  align-items: baseline;
  gap: .8rem;
  flex-wrap: wrap;
  padding: .75rem 0;
  border-bottom: 1px solid var(--border-hairline);
}

.api-route:last-child { border-bottom: 0; }

.api-verb {
  flex: 0 0 auto;
  padding: .12rem .5rem;
  border-radius: 4px;
  background: rgba(79, 140, 255, .14);
  color: var(--accent-1);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.api-path { font-size: .84rem; font-weight: 600; }
.api-route-note { flex: 1 1 12rem; color: var(--text-muted); font-size: .8rem; }

/* A rule that has legal consequences deserves to look different from a tip. */
.api-note {
  margin-top: 1.2rem;
  padding: .9rem 1.1rem;
  border-inline-start: 3px solid var(--warm-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-size: .82rem;
  line-height: 1.9;
}

@media (max-width: 560px) {
  .api-try-bar .btn { width: 100%; justify-content: center; }
  .api-route { gap: .5rem; }
}

/* ---- the ambient bed's stop control ----
   Required by WCAG 1.4.2 for anything that plays automatically for more than
   three seconds. Placed opposite the player bar's own controls so the two never
   overlap, and hidden until the bed is actually audible — a stop button for
   silence is clutter. */

.ambient-toggle {
  position: fixed;
  z-index: 25;
  inset-inline-start: 1.1rem;
  bottom: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .9rem;
  border: 1px solid var(--border-hairline);
  border-radius: 999px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-out-sm);
  color: var(--text-muted);
  font: inherit;
  font-size: .74rem;
  cursor: pointer;
  opacity: .85;
  transition: opacity .2s ease, color .2s ease;
}

.ambient-toggle:hover { opacity: 1; color: var(--text); }
.ambient-toggle[hidden] { display: none !important; }

.ambient-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }

.ambient-eq i {
  display: block;
  width: 2px;
  border-radius: 2px;
  background: var(--accent-1);
  animation: ambient-eq 1.6s ease-in-out infinite;
}

.ambient-eq i:nth-child(1) { height: 45%; animation-delay: 0s; }
.ambient-eq i:nth-child(2) { height: 100%; animation-delay: .25s; }
.ambient-eq i:nth-child(3) { height: 65%; animation-delay: .5s; }

@keyframes ambient-eq {
  0%, 100% { transform: scaleY(.4); }
  50%      { transform: scaleY(1); }
}

.ambient-off { color: var(--text-faint); }

/* The bars are the one thing on screen moving purely for decoration, so they
   are the first thing reduced motion should stop. */
:root[data-motion="reduced"] .ambient-eq i { animation: none; }
@media (prefers-reduced-motion: reduce) { .ambient-eq i { animation: none; } }

/* On a phone the player bar spans the full width; the control sits above it. */
@media (max-width: 680px) {
  .ambient-toggle { bottom: 5.2rem; inset-inline-start: .7rem; font-size: .7rem; }
}

/* ==========================================================================
   Developer console — console.thedihmaster.lol
   ==========================================================================
   Its own header, because the console is a separate site from the music
   platform and borrowing Sonava's menu would blur which product you are in.
   Everything else on the page reuses the site's tokens, so the two still
   look like one family. */
.cns-nav {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .9rem 1.2rem; margin: 0 0 1.5rem;
  background: var(--surface-strong);
  box-shadow: 0 6px 16px rgba(163, 177, 198, .35);
  border-radius: 0 0 var(--radius) var(--radius);
}
[data-theme="dark"] .cns-nav { box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.cns-brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); font-size: 1.05rem; }
.cns-brand b { font-weight: 800; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cns-links { display: flex; align-items: center; gap: .3rem; margin-inline-start: auto; flex-wrap: wrap; }
.cns-links a { color: var(--text-muted); text-decoration: none; font-size: .88rem; padding: .45rem .8rem; border-radius: 999px; }
.cns-links a:hover { color: var(--text); background: var(--surface); }
.cns-signin { color: #fff !important; background: var(--gradient); font-weight: 700; }
.cns-signin:hover { color: #fff !important; }
.cns-block { margin-bottom: 1.1rem; }
.cns-code { background: var(--surface); box-shadow: var(--shadow-in); border-radius: var(--radius-sm);
  padding: .9rem 1rem; overflow-x: auto; font-size: .82rem; line-height: 1.8; margin: .2rem 0 .9rem; }
.cns-code code { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--text); white-space: pre; }
.cns-table-wrap { overflow-x: auto; }
.cns-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.cns-table th, .cns-table td { text-align: start; padding: .6rem .5rem; border-bottom: 1px solid var(--surface); }
.cns-table th { color: var(--text-muted); font-weight: 700; font-size: .8rem; }
.cns-m { font-family: ui-monospace, monospace; font-size: .72rem; font-weight: 700;
  padding: .15rem .5rem; border-radius: 999px; color: #fff; }
.cns-m.get { background: #2f8f5b; } .cns-m.post { background: #4f7dfb; } .cns-m.patch { background: #b8860b; }
.cns-head { margin-bottom: 1.2rem; }
.cns-h1 { font-size: 1.7rem; margin: .2rem 0 .3rem; }
.cns-sub { margin: 0; }
.cns-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .7rem; margin-bottom: 1.1rem; }
.cns-stat { background: var(--surface-strong); box-shadow: 0 6px 16px rgba(163,177,198,.35);
  border-radius: var(--radius); padding: 1rem .9rem; display: flex; flex-direction: column; gap: .2rem; }
[data-theme="dark"] .cns-stat { box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.cns-stat-n { font-size: 1.5rem; font-weight: 800; }
.cns-stat-l { font-size: .78rem; color: var(--text-muted); }
.cns-dev { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; color: var(--text-muted); }
.cns-m.del { background: #b4453c; } .cns-m.put { background: #7c3aed; }
/* The developer console sits on another host, so it is marked in the menu
   rather than looking like one more internal page. */
.menu-sub-console { font-weight: 700; }
.menu-sub-console::after { content: "↗"; margin-inline-start: .35rem; font-size: .8em; opacity: .6; }

/* The developer console uses much more of the width than the music site's
   reading pages do — it is a dashboard of tables and stat cards, not an
   article, so the 52rem column left most of a desktop screen empty. Scoped to
   .cns-page and appended last so it overrides .page/.desktop-page by source
   order (all single-class, so no specificity hack needed) WITHOUT touching the
   music site. min() keeps a gutter on ultrawide and never overflows a phone. */
.cns-page { max-width: min(1500px, 94vw); }
/* With the extra room, the docs read better as two columns of independent
   sections than one tall ribbon; each .cns-block is self-contained. Falls back
   to one column below 900px. */
@media (min-width: 900px) {
  /* A grid, not column-count: multicolumn would slice the hero heading down one
     side. Here the hero/header spans the full width and only the content blocks
     share the two columns. align-items:start so a short block does not stretch
     to match a tall neighbour. */
    /* minmax(0,1fr), not 1fr: a bare 1fr has an auto minimum, so one wide code
     block widens its column and the two stop matching. */
  .cns-page.cns-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; align-items: start; }
  .cns-page.cns-cols > header,
  .cns-page.cns-cols > .desktop-hero,
  .cns-page.cns-cols > .cns-head { grid-column: 1 / -1; }
  /* .panel-card-wide means "span the account page's grid" on the music site.
     Inside the console grid it silently made every section full width, so the
     two columns had no effect. Neutralised here rather than stripped from the
     markup, which is shared with /docs/api. */
  .cns-page.cns-cols > .panel-card-wide { grid-column: auto; }
  /* the interactive request box earns the full width — it holds a URL field
     and a response pane side by side */
  .cns-page.cns-cols > .api-try { grid-column: 1 / -1; }
}
.cns-fresh { border-inline-start: 3px solid var(--accent-1); }
.cns-keyform { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.cns-input { flex: 1; min-width: 12rem; padding: .7rem .9rem; border-radius: var(--radius-sm);
  border: none; background: var(--surface); box-shadow: var(--shadow-in); color: var(--text); font: inherit; }
.cns-inline-form { display: inline; }

/* ==========================================================================
   Developer console — the look
   ==========================================================================
   A confident gradient landing, then a calm body. The hero can be loud because
   it is read once; the docs underneath are read for minutes, so they stay on
   the site's own quiet surfaces with accents rather than colour washes. */

.cns-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 26px;
  background: var(--gradient-rich);
  color: #fff;
  padding: 2.6rem 2rem 2.2rem;
  margin-bottom: 1.4rem;
  box-shadow: 0 22px 48px -24px rgba(58, 42, 122, .65);
}
.cns-hero-inner { position: relative; z-index: 1; max-width: 46rem; }

/* slow light blooms — the "alive" part, and the only motion on the page */
.cns-bloom { position: absolute; z-index: 0; border-radius: 50%; filter: blur(52px); opacity: .5; pointer-events: none; }
.cns-bloom-1 { width: 22rem; height: 22rem; inset-block-start: -9rem; inset-inline-end: -7rem;
  background: radial-gradient(circle, #8fb0ff, transparent 68%); animation: cns-drift-a 18s ease-in-out infinite alternate; }
.cns-bloom-2 { width: 18rem; height: 18rem; inset-block-end: -8rem; inset-inline-start: -6rem;
  background: radial-gradient(circle, #b98cff, transparent 68%); animation: cns-drift-b 22s ease-in-out infinite alternate; }
@keyframes cns-drift-a { to { transform: translate3d(-2.5rem, 2rem, 0) scale(1.12); } }
@keyframes cns-drift-b { to { transform: translate3d(2rem, -1.8rem, 0) scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .cns-bloom { animation: none; } }

.cns-hero-mark { width: 3rem; height: 3rem; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; background: rgba(255,255,255,.14);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); margin-bottom: 1rem; }
.cns-hero-mark img { width: 1.8rem; height: 1.8rem; display: block; }
.cns-eyebrow { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  opacity: .8; margin: 0 0 .5rem; }
.cns-title { font-family: var(--font-display, inherit); font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  line-height: 1.35; font-weight: 800; margin: 0 0 .7rem; color: #fff; }
.cns-lede { font-size: .97rem; line-height: 2; color: rgba(255,255,255,.84); margin: 0; }

/* glass figures on the gradient */
.cns-chips { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }
.cns-chip { background: rgba(255,255,255,.12); border-radius: 16px; padding: .7rem 1rem; min-width: 7rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.cns-chip b { display: block; font-size: 1.35rem; font-weight: 800; line-height: 1.2; }
.cns-chip span { display: block; font-size: .72rem; opacity: .82; margin-top: .15rem; }

.cns-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }
.cns-btn { display: inline-flex; align-items: center; gap: .45rem; padding: .72rem 1.4rem; border-radius: 999px;
  font-weight: 700; font-size: .9rem; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.cns-btn-solid { background: #fff; color: #3a2a7a; box-shadow: 0 8px 22px -8px rgba(0,0,0,.5); }
.cns-btn-solid:hover { transform: translateY(-1px); color: #3a2a7a; }
.cns-btn-ghost { color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); }
.cns-btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ---- body: quiet surfaces, livelier detail ---- */
.cns-block { transition: transform .16s ease, box-shadow .16s ease; }
.cns-block:hover { transform: translateY(-2px); }
/* numbered sections get a gradient chip instead of a bare digit */
.cns-step { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem;
  border-radius: 50%; background: var(--gradient); color: #fff; font-size: .78rem; font-weight: 800;
  margin-inline-end: .5rem; flex-shrink: 0; }
.cns-block .panel-card-title { display: flex; align-items: center; }
/* code blocks read as terminals, with a gradient hairline on top */
.cns-code { position: relative; border-top: 2px solid transparent;
  background-image: linear-gradient(var(--surface), var(--surface)), var(--gradient);
  background-origin: border-box; background-clip: padding-box, border-box; }

/* ---- track page: licence + credit ----
   The landing spot for the embed's © button. :target does the highlight with
   no script: the browser scrolls here and the animation plays, so somebody
   arriving from a widget on another site can see at once what they were sent
   to read. */
.credit-card { scroll-margin-top: 5rem; }
.credit-line {
  font-size: .95rem; line-height: 2; margin: 0 0 .6rem;
  padding: .7rem .9rem; border-radius: var(--radius-sm);
  background: var(--surface); box-shadow: var(--shadow-in);
}
.credit-card:target { animation: credit-land 2.4s cubic-bezier(.22,.9,.3,1); }
@keyframes credit-land {
  0%   { box-shadow: var(--shadow-out); }
  12%  { box-shadow: 0 0 0 3px var(--accent-1), 0 14px 34px -14px var(--accent-1); transform: translateY(-2px); }
  55%  { box-shadow: 0 0 0 3px var(--accent-1), 0 14px 34px -14px var(--accent-1); transform: none; }
  100% { box-shadow: var(--shadow-out); }
}
.credit-card:target .credit-line { animation: credit-flash 2.4s ease; }
@keyframes credit-flash {
  0%, 100% { background: var(--surface); }
  18%, 55% { background: color-mix(in srgb, var(--accent-1) 16%, var(--surface)); }
}
@media (prefers-reduced-motion: reduce) {
  .credit-card:target, .credit-card:target .credit-line { animation: none; }
  .credit-card:target { box-shadow: 0 0 0 3px var(--accent-1), var(--shadow-out); }
}

/* ==========================================================================
   Production-status notice
   ==========================================================================
   Prefixed prelaunch-, not beta-: the downloads band already owns .beta-*.
   Informational, so it is allowed to be inviting rather than severe. The
   policy-consent modal next door is the opposite on purpose: that one blocks
   because consent must be recorded, this one closes on Esc or the backdrop
   because it only has something to say. */
.prelaunch-modal { border: none; padding: 0; background: transparent; max-width: 32rem; width: calc(100% - 2rem); }
.prelaunch-modal::backdrop { background: rgba(15, 20, 36, .55); backdrop-filter: blur(3px); }
.prelaunch-card {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: 26px; color: #fff; background: var(--gradient-rich);
  box-shadow: 0 26px 60px -24px rgba(0, 0, 0, .6);
}
.prelaunch-bloom-a, .prelaunch-bloom-b { position: absolute; z-index: 0; border-radius: 50%; filter: blur(46px); opacity: .5; pointer-events: none; }
.prelaunch-bloom-a { width: 17rem; height: 17rem; inset-block-start: -7rem; inset-inline-end: -5rem; background: radial-gradient(circle, #8fb0ff, transparent 68%); }
.prelaunch-bloom-b { width: 14rem; height: 14rem; inset-block-end: -6rem; inset-inline-start: -4rem; background: radial-gradient(circle, #b98cff, transparent 68%); }
.prelaunch-inner { position: relative; z-index: 1; padding: 1.8rem 1.7rem 1.5rem; }
.prelaunch-mark { width: 3rem; height: 3rem; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); margin-bottom: .9rem; }
.prelaunch-eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .06em; opacity: .8; margin: 0 0 .35rem; }
.prelaunch-card h2 { font-size: 1.3rem; line-height: 1.6; margin: 0 0 .7rem; color: #fff; }
.prelaunch-text { font-size: .9rem; line-height: 2; color: rgba(255,255,255,.85); margin: 0 0 .9rem; }
/* the one thing they must actually take away gets its own frame */
.prelaunch-point {
  display: flex; gap: .7rem; align-items: flex-start; margin: 0 0 1rem;
  background: rgba(255,255,255,.12); border-radius: 16px; padding: .9rem 1rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.prelaunch-point-ico { flex-shrink: 0; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.18); font-weight: 800; font-size: .95rem; }
.prelaunch-point p { margin: 0; font-size: .87rem; line-height: 1.95; color: rgba(255,255,255,.92); }
.prelaunch-point strong { color: #fff; }
.prelaunch-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .3rem; }
.prelaunch-form { margin: 0; }
.prelaunch-btn { display: inline-flex; align-items: center; justify-content: center; padding: .7rem 1.5rem;
  border-radius: 999px; font: inherit; font-weight: 700; font-size: .9rem; border: none; cursor: pointer;
  text-decoration: none; transition: transform .15s ease; }
.prelaunch-btn:hover { transform: translateY(-1px); }
.prelaunch-btn-solid { background: #fff; color: #3a2a7a; box-shadow: 0 8px 22px -8px rgba(0,0,0,.5); }
.prelaunch-btn-ghost { color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.42); }
.prelaunch-btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
@media (prefers-reduced-motion: reduce) { .prelaunch-btn:hover { transform: none; } }

/* The pre-launch callout at the top of the terms. Given its own surface so it
   is read rather than scrolled past — a disclaimer nobody sees is a disclaimer
   that gets argued about later. */
.legal-callout {
  background: var(--surface-strong); border-radius: var(--radius);
  box-shadow: 0 6px 16px rgba(163, 177, 198, .35);
  border-inline-start: 4px solid var(--accent-1);
  padding: 1.3rem 1.5rem; margin-bottom: 1.6rem;
}
[data-theme="dark"] .legal-callout { box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.legal-callout h2 { margin-top: 0; font-size: 1.05rem; }
.legal-callout p { line-height: 2.05; margin-bottom: .8rem; }
.legal-callout p:last-child { margin-bottom: 0; }
.legal-note { font-size: .86rem; color: var(--text-muted); line-height: 1.95; }
/* The pre-launch flag inside an FAQ answer. Tinted so it is not mistaken for
   part of the answer it qualifies. */
.faq-flag {
  background: color-mix(in srgb, var(--accent-1) 10%, var(--surface));
  border-inline-start: 3px solid var(--accent-1);
  border-radius: var(--radius-sm); padding: .7rem .9rem; margin-top: .6rem;
  font-size: .88rem; line-height: 1.95;
}

/* ---- period switcher: the sliding indicator ----------------------------
   Shared by /analytics and /finances (public/js/periodswitch.js).

   This lives in style.css, NOT v2.css. v2.css is loaded only on the pages in
   V2_PATHS and neither of those two is in it, so the first version of this
   block was served but never applied — the pill computed to position:static
   with no background and was invisible. If a shared component needs styling on
   an arbitrary page, it belongs here.

   The pill is ONE element that moves between buttons rather than each button
   painting its own background: you cannot transition a background from one
   element to another, so per-button backgrounds can only blink. */
.an-periods, .fin-periods, .an-metric-switch { position: relative; }

.period-ind {
  position: absolute;
  top: 50%;
  left: 0;
  translate: 0 -50%;
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
  background: var(--gradient);
  box-shadow: 0 6px 16px -8px rgba(79, 125, 251, .9);
  /* Only the travel is driven from JS; the look change is a class, so the two
     can run on different curves. */
  transition:
    background-color .22s ease,
    box-shadow .22s ease,
    backdrop-filter .22s ease;
}

/* In flight: the pill drops its gradient and becomes liquid glass, then picks
   the gradient back up on arrival. The gradient is a background-IMAGE, so it
   has to be set to none explicitly — a background-color underneath it would
   otherwise never be visible. */
.period-ind.is-travel {
  /* A BUBBLE, not frosted glass. Frosting hides what is behind it, and over a
     near-white surface that reads as a stale white overlay — which is exactly
     what the first two attempts looked like. A soap bubble is almost perfectly
     clear: you read it from its RIM and its specular catch, never from a fill.

     On a LIGHT surface the rim cannot be white, or there is nothing to see: a
     white edge on a white background is invisible, and all that is left is the
     highlight, which then looks like a solid white pill. So the edge is tinted
     cool blue-violet — the faint iridescence a real bubble has — and only the
     small specular catch stays white. */
  background-image:
    /* the tight specular catch, top-left, where a light would hit the curve */
    radial-gradient(ellipse 30% 42% at 24% 16%,
      rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, 0) 70%),
    /* a soft counter-bounce from below */
    radial-gradient(ellipse 70% 55% at 76% 92%,
      rgba(255, 255, 255, .45) 0%, rgba(255, 255, 255, 0) 72%),
    /* the iridescent film: barely-there colour across the curve */
    linear-gradient(135deg,
      rgba(120, 160, 255, .13) 0%,
      rgba(255, 255, 255, 0) 40%,
      rgba(170, 130, 255, .11) 100%);
  background-color: rgba(255, 255, 255, .02);
  /* A touch of blur only: a bubble distorts what is behind it, never hides it. */
  -webkit-backdrop-filter: blur(1.5px) saturate(155%);
  backdrop-filter: blur(1.5px) saturate(155%);
  border: 1px solid rgba(125, 145, 205, .42);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, .95),
    inset 0 -2px 4px rgba(150, 170, 220, .30),
    inset 2px 0 4px rgba(255, 255, 255, .55),
    0 3px 10px -5px rgba(60, 80, 160, .28);
}
:root[data-theme="dark"] .period-ind.is-travel,
html.dark .period-ind.is-travel {
  background-image:
    radial-gradient(ellipse 42% 58% at 26% 18%,
      rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(ellipse 80% 70% at 72% 88%,
      rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(140deg,
      rgba(255, 255, 255, .08) 0%,
      rgba(255, 255, 255, 0) 38%,
      rgba(255, 255, 255, .05) 100%);
  background-color: rgba(255, 255, 255, .02);
  -webkit-backdrop-filter: blur(1.5px) saturate(140%) brightness(1.12);
  backdrop-filter: blur(1.5px) saturate(140%) brightness(1.12);
  border-color: rgba(255, 255, 255, .5);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, .6),
    inset 0 -2px 3px rgba(255, 255, 255, .22),
    0 4px 12px -6px rgba(0, 0, 0, .7);
}
/* While it is glass the label beneath must stay legible — a white-on-gradient
   label goes invisible the moment the gradient is gone. */
.an-periods.has-ind.is-glass .an-period.is-on,
.fin-periods.has-ind.is-glass .fin-period.is-on { color: var(--text); }

/* While the pill carries the fill, the buttons must not paint one of their own
   or two things would look active mid-slide. */
.an-periods.has-ind .an-period,
.fin-periods.has-ind .fin-period,
.an-metric-switch.has-ind .an-metric {
  position: relative;
  z-index: 1;
  background: transparent;
  box-shadow: none;
}
.an-periods.has-ind .an-period.is-on,
.fin-periods.has-ind .fin-period.is-on,
.an-metric-switch.has-ind .an-metric.is-on {
  background: transparent;
  box-shadow: none;
}
.an-periods.has-ind .an-period.is-on,
.fin-periods.has-ind .fin-period.is-on { color: #fff; }
/* The metric switch sits on a light card, so its active label stays dark. */
.an-metric-switch.has-ind .an-metric.is-on { color: var(--text); }

/* ---- no blue box on tap or click ----
   Two different things draw it: Chrome's tap highlight on touch, and the focus
   ring on a mouse click. The ring is KEPT for :focus-visible — that is what a
   keyboard user relies on, and removing it outright makes the control
   unnavigable without a pointer. */
.an-period, .fin-period, .an-metric {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.an-period:focus:not(:focus-visible),
.fin-period:focus:not(:focus-visible),
.an-metric:focus:not(:focus-visible) { outline: none; box-shadow: none; }
.an-period:focus-visible,
.fin-period:focus-visible,
.an-metric:focus-visible { outline: 2px solid var(--accent-1); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .period-ind { transition: none; }
}

/* Shuffle / repeat. Off is quiet, on is the accent — the same language the rest
   of the bar already uses, so no new vocabulary to learn. */
.pb-mode { font-size: 15px; line-height: 1; opacity: .55; transition: opacity .15s ease, color .15s ease; }
.pb-mode:hover { opacity: .9; }
.pb-mode.is-on { opacity: 1; color: var(--accent-1); }
.pb-seek:disabled { opacity: .4; cursor: not-allowed; }


/* ---------------------------------------------------------------------------
   The player as a bubble that opens on hover.

   It used to be a full-width fixed bar at z-index 850, which put it on top of
   anything anchored to the bottom of the screen — menus included. Shrinking it
   to a bubble when it is not being used gives that space back without taking
   the player away.

   Collapsed it is a circle showing the cover art. Open it is the bar it always
   was. The transition is width/opacity on the parts that disappear, so nothing
   reflows the page underneath.

   GLASS, not frosting: a low fill, a light blur and a lit rim. A heavy blur
   over a near-white page reads as a solid panel — the thing it is trying not
   to be.
--------------------------------------------------------------------------- */
.player-bar {
  /* No longer edge-to-edge. Anchored to the inline-start corner so it sits
     away from the menu button, which is at the other end. */
  inset-inline: auto;
  inset-inline-start: clamp(.6rem, 2vw, 1.2rem);
  bottom: clamp(.6rem, 2vw, 1.2rem);
  padding-bottom: calc(.6rem + env(safe-area-inset-bottom, 0px));
  border-radius: 999px;
  max-width: min(680px, calc(100vw - 2 * clamp(.6rem, 2vw, 1.2rem)));
  overflow: hidden;
  transition:
    max-width .42s cubic-bezier(.22,.9,.3,1),
    padding .42s cubic-bezier(.22,.9,.3,1),
    gap .42s cubic-bezier(.22,.9,.3,1),
    box-shadow .3s ease,
    background-color .3s ease;

  background-color: color-mix(in srgb, var(--surface-strong) 72%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  backdrop-filter: blur(14px) saturate(170%);
  border: 1px solid color-mix(in srgb, #fff 55%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.85),
    0 10px 30px -12px rgba(43,50,69,.45);
}
:root[data-theme="dark"] .player-bar,
html.dark .player-bar {
  background-color: color-mix(in srgb, var(--surface-strong) 66%, transparent);
  border-color: rgba(255,255,255,.16);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22),
    0 10px 30px -12px rgba(0,0,0,.7);
}

/* ---- collapsed ---- */
.player-bar.pb-bubble {
  max-width: 64px;
  padding-inline: 8px;
  gap: 0;
  cursor: pointer;
}
/* Everything except the cover folds away. Width+opacity rather than display,
   so the transition has something to animate and the buttons stay in the
   accessibility tree for a screen reader that is reading linearly. */
.player-bar.pb-bubble > *:not(.pb-cover) {
  max-width: 0;
  opacity: 0;
  padding-inline: 0;
  margin-inline: 0;
  border: 0;
  pointer-events: none;
  transition: max-width .3s ease, opacity .18s ease;
}
.player-bar > *:not(.pb-cover) {
  max-width: 260px;
  opacity: 1;
  transition: max-width .42s cubic-bezier(.22,.9,.3,1), opacity .3s ease .08s;
}
.player-bar.pb-bubble .pb-cover {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 50%;
}
.player-bar .pb-cover { transition: width .42s cubic-bezier(.22,.9,.3,1), height .42s, border-radius .42s; }

/* A bubble with nothing moving on it looks broken rather than idle, so a
   playing track gets a slow ring. Purely decorative and switched off for
   anyone who asked for less motion. */
.player-bar.pb-bubble.is-playing::after {
  content: '';
  position: absolute; inset: 3px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent-1);
  animation: pb-spin 2.6s linear infinite;
  pointer-events: none;
}
@keyframes pb-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .player-bar,
  .player-bar > *:not(.pb-cover),
  .player-bar .pb-cover { transition: none; }
  .player-bar.pb-bubble.is-playing::after { animation: none; }
}

/* On a narrow screen the open bar takes the full width it always did — a
   680px bar on a 390px phone is just a bar with things cut off. */
@media (max-width: 720px) {
  .player-bar:not(.pb-bubble) {
    inset-inline: clamp(.5rem, 2vw, 1rem);
    max-width: none;
    border-radius: 22px;
  }
}


/* The player as glass.
   Appended to style.css by changes3.py — kept as its own source file so it can
   be read and reverted on its own.

   WHAT "LIKE ACTUAL GLASS" MEANS HERE, and what CSS can and cannot do:

   CSS cannot magnify a backdrop. backdrop-filter has blur, saturate, brightness
   and contrast — there is no scale. So a literal lens that enlarges the page
   behind it is not available, and anything claiming to be one is faking it.

   What IS available, and what real glass actually looks like:
     · the backdrop blurred and slightly over-saturated, because glass scatters
       and concentrates colour
     · a bright rim where light catches the curved edge
     · a specular highlight that MOVES with the light source — here, the pointer
     · edge darkening, since a curved edge bends light away from the viewer
     · and the element itself scaling on approach, which is the zoom: the lens
       coming toward you rather than the page growing behind it

   The last one is the honest version of the request and the one that reads. */

/* ---- the pane ----------------------------------------------------------- */
.player-bar {
  position: fixed;
  isolation: isolate;
  overflow: hidden;                 /* clips the sheen to the rounded shape */

  background: color-mix(in srgb, var(--surface-strong) 46%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(190%) brightness(1.04);
  backdrop-filter: blur(20px) saturate(190%) brightness(1.04);
  border: 1px solid rgba(255, 255, 255, .5);

  box-shadow:
    /* the lit top edge */
    inset 0 1px 0 rgba(255, 255, 255, .9),
    /* the curved edge bending light away at the bottom */
    inset 0 -14px 22px -18px rgba(31, 38, 135, .5),
    /* thickness: glass sits above the page, it is not painted on it */
    0 14px 40px -14px rgba(31, 38, 135, .42),
    0 2px 6px -2px rgba(31, 38, 135, .22);

  transition:
    transform .34s cubic-bezier(.22,.9,.3,1),
    box-shadow .34s ease,
    backdrop-filter .34s ease,
    border-color .34s ease;
}

:root[data-theme="dark"] .player-bar,
html.dark .player-bar {
  background: color-mix(in srgb, var(--surface-strong) 38%, transparent);
  border-color: rgba(255, 255, 255, .14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .2),
    inset 0 -14px 22px -18px rgba(0, 0, 0, .6),
    0 14px 40px -14px rgba(0, 0, 0, .7);
}

/* ---- the zoom ----------------------------------------------------------- */
/* The lens comes toward you. transform-origin sits at the bottom so it grows
   upward off the edge of the screen instead of pushing itself out of view, and
   the blur deepens as it approaches — glass further from the page behind it
   scatters more. */
.player-bar:hover,
.player-bar:focus-within {
  transform: scale(1.035);
  -webkit-backdrop-filter: blur(26px) saturate(210%) brightness(1.06);
  backdrop-filter: blur(26px) saturate(210%) brightness(1.06);
  border-color: rgba(255, 255, 255, .7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -16px 26px -18px rgba(31, 38, 135, .55),
    0 22px 56px -16px rgba(31, 38, 135, .5);
}
.player-bar { transform-origin: bottom center; }

/* ---- the specular sheen ------------------------------------------------- */
/* Positioned from the pointer by player-glass.js. Default is a static
   top-left catch, so it still reads as glass on a touchscreen where there is no
   pointer to follow. */
.pb-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .9;
  background:
    radial-gradient(160px 90px at var(--pb-mx, 22%) var(--pb-my, 0%),
      rgba(255, 255, 255, .55) 0%,
      rgba(255, 255, 255, .14) 42%,
      rgba(255, 255, 255, 0) 72%);
  transition: opacity .3s ease;
}
:root[data-theme="dark"] .pb-sheen,
html.dark .pb-sheen {
  background:
    radial-gradient(160px 90px at var(--pb-mx, 22%) var(--pb-my, 0%),
      rgba(255, 255, 255, .17) 0%,
      rgba(255, 255, 255, .05) 42%,
      rgba(255, 255, 255, 0) 72%);
}
/* Everything else has to sit above the sheen. */
.player-bar > *:not(.pb-sheen) { position: relative; z-index: 1; }

/* ---- controls ----------------------------------------------------------- */
/* Each control is its own small lens: it lifts toward the pointer on hover.
   The scale is larger than the pane's because a 34px button needs more
   movement than a 600px bar to register the same amount of "closer". */
.pb-skip, .pb-toggle, .pb-close {
  transition: transform .18s cubic-bezier(.22,.9,.3,1),
              color .18s ease, background-color .18s ease;
}
.pb-skip:hover, .pb-close:hover { transform: scale(1.18); }
.pb-toggle:hover { transform: scale(1.09); }
.pb-skip:active, .pb-toggle:active, .pb-close:active { transform: scale(.93); }

/* Sizing the SVGs. They replaced emoji, which had been carrying their own
   size — an unsized <svg> defaults to 300×150 and would blow the bar apart. */
.pb-skip svg, .pb-close svg { width: 17px; height: 17px; display: block; }
.pb-toggle svg { width: 19px; height: 19px; }
.pb-mode svg { width: 16px; height: 16px; }
.pb-vol-icon { width: 16px; height: 16px; flex: 0 0 16px; opacity: .75; }
.cover-fallback svg { width: 18px; height: 18px; }

/* Repeat-one: the digit overlays the loop, and only in that mode. */
.pb-repeat { position: relative; }
.pb-repeat-one { display: none; position: absolute; inset: 0; place-items: center; }
.pb-repeat-one svg { width: 11px; height: 11px; }
.pb-mode[data-mode="one"] .pb-repeat-one { display: grid; }
.pb-mode[data-mode="one"] > svg:first-of-type { opacity: .45; }

@media (prefers-reduced-motion: reduce) {
  .player-bar,
  .pb-skip, .pb-toggle, .pb-close { transition: none; }
  .player-bar:hover, .player-bar:focus-within { transform: none; }
  .pb-skip:hover, .pb-close:hover, .pb-toggle:hover { transform: none; }
}

/* A phone has no pointer to catch a highlight, and a bar that scales on tap
   just looks unstable. The glass stays; the movement does not. */
@media (pointer: coarse) {
  .player-bar:hover, .player-bar:focus-within { transform: none; }
  .pb-sheen { opacity: .5; }
}

/* Optional province picker (settings). */
.province-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.province-select { flex: 1; min-width: 200px; padding: 11px 12px; border-radius: 11px; font: inherit;
  font-size: .9rem; background: var(--bg); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent); }
.province-select:focus-visible { outline: 2px solid var(--accent-1); outline-offset: 1px; }

/* ---- track tags -------------------------------------------------------------
   Artist-applied tags on the track page. Bucket classes only — CSP drops
   inline styles, so nothing here may rely on a style="" attribute. */
.track-tags { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0 0; padding: 0; }
.track-tags .tag-link { display: inline-block; text-decoration: none; font-size: .86rem; transition: transform .12s, box-shadow .12s; }
.track-tags .tag-link:hover { transform: translateY(-1px); box-shadow: var(--shadow-out, 0 2px 8px rgba(0,0,0,.18)); }

.tag-edit { margin: .8rem 0 0; }
.tag-edit > summary { cursor: pointer; font-size: .9rem; opacity: .8; }
.tag-edit > summary:hover { opacity: 1; }
.tag-edit-form { margin-top: .6rem; display: grid; gap: .45rem; max-width: 30rem; }
.tag-edit-form label { font-size: .85rem; opacity: .8; }
.tag-edit-form input[type="text"] {
  width: 100%; padding: .55rem .8rem; border-radius: 10px;
  border: 1px solid var(--line, rgba(128,128,128,.3));
  background: var(--surface); color: inherit; font: inherit;
}
.tag-hint { font-size: .8rem; opacity: .65; margin: 0; line-height: 1.6; }
.tag-saved { font-size: .85rem; color: var(--accent-2); margin: .5rem 0 0; }

@media (max-width: 640px) {
  .tag-edit-form { max-width: 100%; }
  .tag-edit-form input[type="text"] { font-size: 16px; } /* < 16px makes iOS zoom on focus */
}
