/* ==========================================================================
   Vincennes Worship Team — polish.css
   Borders · radii · shadows · focus · states · motion
   Load LAST (after style.css). Pure CSS; optional JS hooks are documented in
   /workspace/worship-app-design/POLISH-NOTES.md. Everything degrades
   gracefully if a hook is missing.
   Rules of the road:
     • animate transform / opacity (and the individual `scale` property) only;
       paint-only properties (color, background, box-shadow) get short fades.
     • press feedback uses the `scale` property so it never clobbers a
       component's own `transform` (e.g. .pw button, inline drag transforms).
     • entrance animations use fill-mode `backwards`, so nothing lingers after
       they finish (important for the drag-reorder inline transform).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
@property --pct { syntax: '<percentage>'; inherits: true; initial-value: 0%; }

:root {
  /* radius scale */
  --r-xs: 6px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px; --r-full: 999px;
  --radius: var(--r-lg);

  /* hairlines: 1px on 1x screens, true 0.5px on retina */
  --hair: 1px;
  --hair-scale: 1;                                   /* for 1px pseudo-element hairlines */
  --sep: color-mix(in srgb, var(--ink) 11%, transparent);          /* list separators */
  --line-soft: color-mix(in srgb, var(--ink) 9%, transparent);     /* card edges */
  --line-gold: color-mix(in srgb, var(--gold) 34%, var(--line));   /* warm card edges */
  --line-input: color-mix(in srgb, var(--ink-soft) 60%, var(--line)); /* ≥3:1 on white (WCAG 1.4.11) */
  --line-input-hover: color-mix(in srgb, var(--ink-soft) 80%, var(--line));
  --art-edge: rgba(15, 42, 68, .10);                 /* hairline on artwork */

  /* inner highlights */
  --hi: inset 0 1px 0 rgba(255, 255, 255, .72);
  --hi-soft: inset 0 1px 0 rgba(255, 255, 255, .45);

  /* layered, navy-tinted shadows (never pure black in light mode) */
  --sh-1: 0 .5px 1px rgba(15, 42, 68, .05), 0 1px 3px rgba(15, 42, 68, .05);
  --sh-2: 0 1px 2px rgba(15, 42, 68, .05), 0 4px 12px -2px rgba(15, 42, 68, .08), 0 10px 24px -12px rgba(15, 42, 68, .10);
  --sh-3: 0 2px 4px rgba(15, 42, 68, .05), 0 10px 24px -6px rgba(15, 42, 68, .14), 0 24px 48px -24px rgba(15, 42, 68, .22);
  --sh-4: 0 4px 10px rgba(15, 42, 68, .07), 0 18px 40px -10px rgba(15, 42, 68, .24), 0 40px 80px -30px rgba(15, 42, 68, .30);
  --sh-up: 0 -1px 0 var(--line-soft), 0 -10px 30px -8px rgba(15, 42, 68, .16);
  --shadow: var(--sh-2);

  /* focus ring — golden; dark gold on light screens for contrast (WCAG 2.4.13) */
  --focus: #7A5A00;   /* dark gold: 6.4:1 on white, 5.8:1 on sky bg */
  --focus-on-dark: #FFD84D;
  --focus-w: 2px;
  --focus-off: 2px;
  --halo: color-mix(in srgb, var(--gold) 24%, transparent);

  /* skeleton */
  --sk: color-mix(in srgb, var(--ink) 7%, transparent);
  --sk-sheen: rgba(255, 255, 255, .55);

  /* motion — durations */
  --dur-instant: 90ms;
  --dur-fast: 160ms;
  --dur-base: 240ms;
  --dur-slow: 380ms;
  --dur-sheet: 520ms;
  --dur-exit: 180ms;      /* MUST equal the setTimeout in app.js sheetCloser (see notes) */
  --stagger: 38ms;

  /* motion — easings */
  --ease-standard: cubic-bezier(.2, 0, 0, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);          /* expo-out: arrivals */
  --ease-in: cubic-bezier(.4, 0, 1, 1);             /* exits */
  --ease-sheet: cubic-bezier(.32, .72, 0, 1);       /* iOS sheet curve */
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);    /* fallback overshoot */
  --ease-spring-soft: cubic-bezier(.3, 1.15, .55, 1);

  --press-scale: .97;
  --press-scale-round: .92;
}

/* true physics springs where linear() is supported (Chrome 113+, Safari 17.2+, FF 112+) */
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --ease-spring: linear(0, 0.042, 0.14, 0.263, 0.401, 0.537, 0.66, 0.767, 0.855, 0.923, 0.974, 1.011, 1.034, 1.047, 1.052, 1.052, 1.048, 1.042, 1.035, 1.028, 1.021, 1.015, 1.01, 1.006, 1.002, 1, 0.999, 0.998, 0.997, 0.997, 0.997, 0.998, 1);
    --ease-spring-soft: linear(0, 0.028, 0.096, 0.183, 0.283, 0.38, 0.474, 0.564, 0.641, 0.709, 0.77, 0.819, 0.861, 0.894, 0.921, 0.943, 0.96, 0.973, 0.983, 0.99, 0.995, 0.999, 1.001, 1.003, 1.004, 1.004, 1.004, 1.004, 1.004, 1.003, 1.003, 1.002, 1);
  }
}

@media (min-resolution: 2dppx), (-webkit-min-device-pixel-ratio: 2) {
  :root { --hair: .5px; --hair-scale: .5; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --sep: color-mix(in srgb, var(--ink) 10%, transparent);
    --line-soft: color-mix(in srgb, var(--ink) 9%, transparent);
    --line-gold: color-mix(in srgb, var(--gold) 30%, var(--line));
    --line-input: color-mix(in srgb, var(--ink-soft) 50%, var(--line));
    --line-input-hover: color-mix(in srgb, var(--ink-soft) 68%, var(--line));
    --art-edge: rgba(244, 250, 255, .09);
    --hi: inset 0 1px 0 rgba(244, 250, 255, .06);
    --hi-soft: inset 0 1px 0 rgba(244, 250, 255, .04);
    --sh-1: 0 1px 2px rgba(0, 0, 0, .30);
    --sh-2: 0 1px 2px rgba(0, 0, 0, .30), 0 6px 16px -4px rgba(0, 0, 0, .35);
    --sh-3: 0 2px 6px rgba(0, 0, 0, .35), 0 14px 32px -8px rgba(0, 0, 0, .50);
    --sh-4: 0 6px 14px rgba(0, 0, 0, .40), 0 28px 60px -12px rgba(0, 0, 0, .60);
    --sh-up: 0 -1px 0 var(--line-soft), 0 -12px 32px -8px rgba(0, 0, 0, .55);
    --shadow: var(--sh-2);
    --focus: #FFD84D;               /* 12:1 on navy bg */
    --halo: color-mix(in srgb, var(--gold) 30%, transparent);
    --sk: color-mix(in srgb, var(--ink) 8%, transparent);
    --sk-sheen: rgba(244, 250, 255, .07);
  }
}

/* --------------------------------------------------------------------------
   2. FOCUS — elegant, accessible, never changes an element's shape
   (style.css sets border-radius:8px on every :focus-visible, which squares off
    pill buttons; the radius restorations below undo that.)
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: var(--focus-w) solid var(--focus);
  outline-offset: var(--focus-off);
}
button:focus-visible, .btn:focus-visible, .chip:focus-visible, .avatar:focus-visible,
.pp:focus-visible, .ctrl:focus-visible, .loop:focus-visible, .handle:focus-visible { border-radius: var(--r-full); }
.track-btn:focus-visible, .notes-btn:focus-visible, button.now:focus-visible { border-radius: var(--r-md); }
.menu button:focus-visible, .action-list button:focus-visible { border-radius: var(--r-md); outline-offset: -2px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { border-radius: var(--r-md); }
.pl-main:focus-visible { border-radius: var(--r-md); outline-offset: 3px; }
.list > li.tap:focus-visible { border-radius: var(--r-md); outline-offset: -2px; }
.tabs a:focus-visible { border-radius: var(--r-md); outline-offset: -4px; }
.brand:focus-visible, .back:focus-visible { border-radius: var(--r-sm); outline-offset: 4px; }
.sheet:focus, .sheet:focus-visible { outline: none; }

/* light ring on the dark, image-backed surfaces */
.hero, .np-scrim { --focus: var(--focus-on-dark); }

/* ring "settles" in from a slightly larger offset */
@media (prefers-reduced-motion: no-preference) {
  /* scoped to interactive controls so it never replaces a container's own animation */
  :is(button, a[href], label.btn, [role="button"], input[type=checkbox]):focus-visible {
    animation: vwt-focus-in var(--dur-base) var(--ease-out);
  }
}
@keyframes vwt-focus-in { from { outline-offset: calc(var(--focus-off) + 4px); outline-color: transparent; } }

/* range: ring the thumb, not the whole 28px box (style.css adds a box halo via input:focus) */
input[type=range]:focus { box-shadow: none; }
input[type=range]:focus-visible { outline: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--focus); }
input[type=range]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--focus); }
.np input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px rgba(6, 18, 31, .6), 0 0 0 4px var(--focus-on-dark); }
.np input[type=range]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px rgba(6, 18, 31, .6), 0 0 0 4px var(--focus-on-dark); }

/* --------------------------------------------------------------------------
   3. BUTTONS — states: hover (pointer devices only), press, focus, disabled
   -------------------------------------------------------------------------- */
button, .btn,
.track-btn, .notes-btn, .action-list button, .menu button, .chip, .pp, .ctrl, .loop,
.btn-icon, .handle, .avatar, .big-play {
  transition:
    scale var(--dur-slow) var(--ease-spring),
    background-color var(--dur-fast) var(--ease-standard),
    color var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard),
    box-shadow var(--dur-base) var(--ease-standard),
    opacity var(--dur-fast) var(--ease-standard),
    filter var(--dur-fast) var(--ease-standard);
}

/* neutralise style.css's transform-based press (it fights .pw button's translate) */
button:active, .big-play:active, .pl-card:active { transform: none; }
.pw button, .pw button:active { transform: translateY(-50%); }

/* press: quick in, springy out */
button:active:not(:disabled), .btn:active, label.btn:active {
  scale: var(--press-scale);
  transition-duration: var(--dur-instant);
  transition-timing-function: var(--ease-out);
}
.pp:active:not(:disabled), .ctrl:active:not(:disabled), .btn-icon:active:not(:disabled),
.loop:active, .avatar:active, .handle:active { scale: var(--press-scale-round); }
.track-btn:active:not(:disabled), .action-list button:active, .menu button:active,
.notes-btn:active { scale: .985; }
button.now:active { scale: .985; }
.pl-card:active { scale: .985; transition-duration: var(--dur-instant); }

/* neutral (tinted) buttons get a hairline + inner highlight */
.btn:not(.btn-primary):not(.btn-danger):not(.btn-success):not(.btn-ghost),
.chip {
  box-shadow: inset 0 0 0 var(--hair) var(--line-soft), var(--hi-soft);
}
.chip[aria-pressed="true"] {
  box-shadow: inset 0 0 0 var(--hair) transparent, var(--sh-1);
}

/* primary: crisp edge + inner light; deeper press */
.btn-primary:not(.big-play) {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .20),
    inset 0 0 0 var(--hair) rgba(0, 0, 0, .14),
    0 1px 2px color-mix(in srgb, var(--primary) 30%, transparent),
    0 6px 16px -4px color-mix(in srgb, var(--primary) 38%, transparent);
}
.btn-primary:not(.big-play):active:not(:disabled) {
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, .18),
    inset 0 0 0 var(--hair) rgba(0, 0, 0, .18),
    0 1px 2px color-mix(in srgb, var(--primary) 25%, transparent);
}
.btn-success {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .18),
    inset 0 0 0 var(--hair) rgba(0, 0, 0, .14),
    0 6px 16px -4px color-mix(in srgb, var(--success) 40%, transparent);
}
.btn-danger {
  border: 1px solid color-mix(in srgb, var(--danger) 55%, transparent);
  box-shadow: var(--hi-soft);
}
.big-play {
  box-shadow:
    inset 0 1px 0 #FFFFFF,
    inset 0 0 0 var(--hair) rgba(15, 42, 68, .10),
    0 2px 4px rgba(0, 0, 0, .10),
    0 12px 28px -6px rgba(0, 0, 0, .34) !important;
}
.pp {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .22),
    inset 0 0 0 var(--hair) rgba(0, 0, 0, .14),
    0 2px 4px color-mix(in srgb, var(--gold) 30%, transparent),
    0 10px 22px -6px color-mix(in srgb, #B8860B 40%, transparent);
}
.mini .pp { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), inset 0 0 0 var(--hair) rgba(0, 0, 0, .14), var(--sh-1); }
.pp.xl {
  box-shadow:
    inset 0 1px 0 #FFFFFF,
    inset 0 0 0 var(--hair) rgba(15, 42, 68, .10),
    0 4px 10px rgba(0, 0, 0, .22),
    0 18px 40px -10px rgba(0, 0, 0, .55);
}

/* hover — only where a real pointer can hover (no sticky hover on phones) */
@media (hover: hover) and (pointer: fine) {
  .btn-primary:not(:disabled):hover, .btn-success:not(:disabled):hover, .pp:not(:disabled):hover { filter: brightness(1.06) saturate(1.04); }
  .big-play:hover { filter: brightness(1.02); }
  .btn:not(.btn-primary):not(.btn-danger):not(.btn-success):not(.btn-ghost):hover,
  .chip:not([aria-pressed="true"]):hover { background-color: color-mix(in srgb, var(--tint) 70%, var(--ink) 6%); }
  .btn-danger:hover { background-color: color-mix(in srgb, var(--danger) 8%, transparent); border-color: var(--danger); }
  .btn-ghost:hover { background-color: color-mix(in srgb, var(--primary) 7%, transparent); }
  .ctrl:hover, .loop:hover { background-color: color-mix(in srgb, var(--ink) 6%, transparent); }
  .np .ctrl:hover, .np .loop:hover { background-color: rgba(244, 250, 255, .10); }
  .pl-card:hover { box-shadow: var(--hi), var(--sh-3); }
  .list > li.tap:hover { background-color: color-mix(in srgb, var(--tint) 60%, transparent); }
  .tabs a:hover { color: var(--ink); }
}
@media (hover: none) {
  .btn-icon:hover, .track-btn:hover, .action-list button:hover { background-color: transparent; }
  .np-head .btn-icon:hover { background-color: transparent; }
}
/* touch "highlight" replacement for the tap-highlight we disabled */
@media (hover: none) {
  .track-btn:active, .action-list button:active, .menu button:active, .btn-icon:active,
  .list > li.tap:active { background-color: color-mix(in srgb, var(--ink) 6%, transparent); transition-duration: 0s; }
  .np-head .btn-icon:active, .np .ctrl:active { background-color: rgba(244, 250, 255, .12); }
}

/* disabled */
button:disabled, .btn[aria-disabled="true"] {
  opacity: .42;
  filter: saturate(.55);
  box-shadow: none !important;
  cursor: not-allowed;
  scale: 1;
}
.btn-icon:disabled { opacity: .3; filter: none; }

/* loading state inside buttons (sign-in "go" etc.) */
button > .spin { animation: spin .8s linear infinite, vwt-fade-in var(--dur-fast) var(--ease-out) backwards; }

/* --------------------------------------------------------------------------
   4. INPUTS
   -------------------------------------------------------------------------- */
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=search], textarea, select {
  border: 1px solid var(--line-input);
  border-radius: var(--r-md);
  background-color: var(--surface);
  box-shadow: inset 0 1px 2px rgba(15, 42, 68, .04);
  transition:
    border-color var(--dur-fast) var(--ease-standard),
    box-shadow var(--dur-base) var(--ease-standard),
    background-color var(--dur-fast) var(--ease-standard);
}
@media (hover: hover) and (pointer: fine) {
  input[type=text]:hover, input[type=email]:hover, input[type=password]:hover, input[type=date]:hover,
  input[type=search]:hover, textarea:hover, select:hover { border-color: var(--line-input-hover); }
}
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus, input[type=date]:focus,
input[type=search]:focus, textarea:focus, select:focus {
  border-color: var(--focus);
  outline: none;
  box-shadow: 0 0 0 4px var(--halo), inset 0 1px 2px rgba(15, 42, 68, .03);
}
/* keyboard focus on a field: add the crisp ring too (visible in forced colours / high contrast) */
input[type=text]:focus-visible, input[type=email]:focus-visible, input[type=password]:focus-visible,
input[type=date]:focus-visible, input[type=search]:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 0;
  animation: none;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--ink-soft) 75%, transparent); opacity: 1; }
input[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 14%, transparent);
}
/* separate rule: an unsupported :user-invalid must not void the rule above */
input:user-invalid { border-color: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 14%, transparent); }
input:disabled, textarea:disabled, select:disabled {
  background-color: var(--tint);
  border-style: dashed;
  color: var(--ink-soft);
  cursor: not-allowed;
}
/* calm Chrome/Safari autofill (no yellow), keep our focus halo */
input:-webkit-autofill, input:-webkit-autofill:hover {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 100px var(--surface) inset;
  caret-color: var(--ink);
}
input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 100px var(--surface) inset, 0 0 0 4px var(--halo); }

/* search field: the wrapper carries the border */
.searchbox {
  border: 1px solid var(--line-input);
  border-radius: var(--r-md);
  background-color: var(--surface);
  transition: border-color var(--dur-fast) var(--ease-standard), box-shadow var(--dur-base) var(--ease-standard);
}
.searchbox:focus-within { border-color: var(--focus); box-shadow: 0 0 0 4px var(--halo); color: var(--ink); }
.searchbox input, .searchbox input:focus, .searchbox input:hover { border: 0; box-shadow: none; outline: none; background: transparent; }

/* checkboxes */
.check input { transition: scale var(--dur-base) var(--ease-spring); }
.check input:active { scale: .88; }
.check input:checked { animation: vwt-pop var(--dur-slow) var(--ease-spring) backwards; }
.check input:focus-visible { outline-offset: 3px; border-radius: var(--r-xs); }

/* file pickers: if the builder swaps `hidden` for class="sr-only" on the
   <input type=file>, keyboard focus lands on the input and the label shows the ring */
label.btn:has(+ input[type=file]:focus-visible) { outline: var(--focus-w) solid var(--focus); outline-offset: var(--focus-off); }

/* password show/hide — keep it inside the field's radius */
.pw button { border-radius: var(--r-sm); min-height: 40px; }

/* --------------------------------------------------------------------------
   5. SURFACES — cards, hero, sheets, menu, dock, header
   -------------------------------------------------------------------------- */
/* warm gold-to-neutral hairline edge via dual backgrounds (no extra elements) */
.card:not(.glass), .pl-card, ol.tracks {
  border: var(--hair) solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(180deg, var(--line-gold), var(--line-soft) 60%) border-box;
  box-shadow: var(--hi), var(--sh-2);
}
.card { border-radius: var(--r-lg); }
.card.glass {
  border: var(--hair) solid color-mix(in srgb, var(--line-gold) 70%, transparent);
  box-shadow: var(--hi), var(--sh-3);
}
.signin .card { border-radius: var(--r-xl); }
ol.tracks { border-radius: var(--r-xl); }
.pl-card {
  border-radius: var(--r-lg);
  transition: scale var(--dur-slow) var(--ease-spring), box-shadow var(--dur-base) var(--ease-standard);
}
.pl-card.is-current {
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(180deg, color-mix(in srgb, var(--gold) 80%, transparent), color-mix(in srgb, var(--gold) 35%, var(--line))) border-box;
  box-shadow: var(--hi), 0 0 0 3px color-mix(in srgb, var(--gold) 12%, transparent), var(--sh-2);
}
.list.card { border-radius: var(--r-lg); }

/* soft surfaces */
.msg, .banner, .invite, .lyrics, .current-note { border-radius: var(--r-md); }
.banner {
  border: var(--hair) solid color-mix(in srgb, var(--gold) 55%, transparent);
  box-shadow: var(--hi-soft), var(--sh-1);
}
.banner.err { border-color: color-mix(in srgb, var(--danger) 60%, transparent); }
.invite, .lyrics { box-shadow: inset 0 0 0 var(--hair) var(--line-soft); }
.current-note { border-width: var(--hair); box-shadow: var(--hi-soft); }
.msg.err { box-shadow: inset 0 0 0 var(--hair) color-mix(in srgb, var(--danger) 30%, transparent); }

/* hairline separators */
.divider {
  height: 1px; transform: scaleY(var(--hair-scale)); border: 0;
  background: linear-gradient(90deg, transparent, var(--line-gold) 18%, var(--line-gold) 82%, transparent);
}
.ornament { background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold) 80%, transparent); height: 1.5px; }
.verse { border-left-width: 2px; border-image: linear-gradient(180deg, var(--gold), color-mix(in srgb, var(--gold) 20%, transparent)) 1; }

/* artwork: hairline inner edge (outline paints above the image, follows radius) */
.thumb, .now-art, .hero-art, .pl-art, .cover-lg, .np-art, .brand img, .signin .logo {
  outline: var(--hair) solid var(--art-edge);
  outline-offset: calc(var(--hair) * -1);
}
.thumb { border-radius: var(--r-sm); }
.now-art { border-radius: var(--r-sm); }
.pl-art { border-radius: var(--r-md); }
.hero-art, .cover-lg { border-radius: var(--r-lg); }
.np-art { border-radius: var(--r-lg); outline-color: rgba(244, 250, 255, .10); }
.hero { border-radius: var(--r-xl); outline: var(--hair) solid rgba(244, 250, 255, .14); outline-offset: calc(var(--hair) * -1); }

/* badges & key chips */
.badge { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 0 0 var(--hair) rgba(0, 0, 0, .10); }
.badge.soft { box-shadow: inset 0 0 0 var(--hair) var(--line-soft); }
.key { border-width: 1px; border-color: color-mix(in srgb, var(--gold) 85%, transparent); box-shadow: var(--hi-soft); }

/* header: hairline + soft shadow fade in as the page scrolls (scroll-driven, no JS) */
.top { box-shadow: 0 var(--hair) 0 transparent; }
@supports (animation-timeline: scroll()) {
  .top { animation: vwt-header-edge linear both; animation-timeline: scroll(root block); animation-range: 0 48px; }
  .sheet-head { animation: vwt-header-edge linear both; animation-timeline: scroll(nearest block); animation-range: 0 24px; }
}
@keyframes vwt-header-edge {
  from { box-shadow: 0 var(--hair) 0 transparent, 0 8px 20px -14px transparent; }
  to   { box-shadow: 0 var(--hair) 0 var(--sep), 0 8px 20px -14px rgba(15, 42, 68, .25); }
}

/* bottom dock & tabs */
.dock {
  border-top: 0;
  box-shadow: var(--sh-up);
  animation: none;  /* style.css replays "dockin" on EVERY route render; see hook #5 */
}
html.vwt-first-dock .dock { animation: vwt-dock-in var(--dur-sheet) var(--ease-sheet) backwards; }
.dock::before { /* inner top highlight on the glass */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
}
@media (prefers-color-scheme: dark) { .dock::before { background: linear-gradient(90deg, transparent, rgba(244, 250, 255, .06), transparent); } }
.tabs { border-top: 0; position: relative; }
.tabs::before { content: ""; position: absolute; left: 16px; right: 16px; top: 0; height: 1px; transform: scaleY(var(--hair-scale)); background: var(--sep); }
.tabs a[aria-current="page"] svg.i { animation: vwt-tab-pop var(--dur-slow) var(--ease-spring) backwards; }

/* overflow menu */
.menu {
  border: var(--hair) solid var(--line-soft);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(20px); backdrop-filter: saturate(1.6) blur(20px);
  box-shadow: var(--hi), var(--sh-4);
  transform-origin: top right;
  animation: vwt-menu-in var(--dur-slow) var(--ease-spring) backwards;
}
.menu .who { border-bottom: var(--hair) solid var(--sep); }
.menu button { border-radius: var(--r-md); }

/* bottom sheets */
.scrim { background: rgba(6, 18, 31, .42); animation: vwt-fade-in var(--dur-base) var(--ease-standard) backwards; }
.sheet {
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--hi), var(--sh-up);
  animation: vwt-sheet-up var(--dur-sheet) var(--ease-sheet) backwards;
  will-change: transform;
}
.sheet .grab { width: 36px; height: 5px; border-radius: var(--r-full); background: color-mix(in srgb, var(--ink) 18%, transparent); }
.sheet-foot { border-top: var(--hair) solid var(--sep); }
.action-list button { border-radius: var(--r-md); }
.action-list button + button { position: relative; }
.action-list button + button::before {
  content: ""; position: absolute; left: 52px; right: 12px; top: -2px; height: 1px;
  transform: scaleY(var(--hair-scale)); background: var(--sep); pointer-events: none;
}
.scrim.closing { animation: vwt-fade-out var(--dur-exit) var(--ease-in) forwards; }
.scrim.closing .sheet { animation: vwt-sheet-down var(--dur-exit) var(--ease-in) forwards; }
/* optional drag-to-dismiss (hook #4). .vwt-settle stays on once added (removing it
   would restart the entrance animation); .vwt-dragging is toggled per gesture. */
.scrim .sheet.vwt-settle { animation: none; transform: translate3d(0, var(--drag-y, 0px), 0); transition: transform var(--dur-slow) var(--ease-spring-soft); }
.scrim .sheet.vwt-dragging { animation: none; transform: translate3d(0, var(--drag-y, 0px), 0); transition: none; }
.scrim.closing .sheet.vwt-settle { animation: none; transition: transform var(--dur-exit) var(--ease-in); }

/* --------------------------------------------------------------------------
   6. LIST ROWS & SEPARATORS
   -------------------------------------------------------------------------- */
/* song list: inset hairline separators aligned to the title column (Apple Music style) */
ol.tracks li { border-bottom: 0; }
ol.tracks li + li::after {
  content: ""; position: absolute; top: 0; right: 4px; left: 104px; height: 1px;
  transform: scaleY(var(--hair-scale)); transform-origin: top;
  background: var(--sep); pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-standard);
}
/* hide separators touching the highlighted row */
ol.tracks li.playing::after, ol.tracks li.playing + li::after { opacity: 0; }
.track-btn, .notes-btn { border-radius: var(--r-md); }

/* admin & sheet lists: true hairlines */
.list > li { border-bottom: var(--hair) solid var(--sep); transition: background-color var(--dur-fast) var(--ease-standard), box-shadow var(--dur-base) var(--ease-standard), scale var(--dur-base) var(--ease-spring), transform var(--dur-slow) var(--ease-spring-soft); }
.list > li:last-child { border-bottom: 0; }
.list.card > li { margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: var(--r-sm); }
.upl { border-bottom: var(--hair) solid var(--sep); }

/* --------------------------------------------------------------------------
   7. NOW-PLAYING ROW HIGHLIGHT + EQUALISER
   -------------------------------------------------------------------------- */
ol.tracks > li::before {
  content: ""; position: absolute; left: -8px; top: 14px; bottom: 14px; width: 3px; border-radius: var(--r-full);
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 70%, #fff), var(--gold));
  box-shadow: 0 0 10px color-mix(in srgb, var(--gold) 45%, transparent);
  transform: scaleY(0); opacity: 0;
  transition: transform var(--dur-slow) var(--ease-spring), opacity var(--dur-fast) var(--ease-standard);
}
ol.tracks > li.playing::before { transform: scaleY(1); opacity: 1; }
.track-btn .t b { transition: color var(--dur-base) var(--ease-standard); }
li.playing .track-btn {
  background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 13%, transparent), color-mix(in srgb, var(--gold) 4%, transparent));
  box-shadow: inset 0 0 0 var(--hair) color-mix(in srgb, var(--gold) 22%, transparent);
}
li.playing .eq { animation: vwt-pop var(--dur-slow) var(--ease-spring) backwards; }
li.playing .thumb { box-shadow: 0 2px 10px color-mix(in srgb, var(--primary) 30%, transparent); transition: box-shadow var(--dur-base); }

/* equaliser: GPU scaleY instead of animating height (no layout per frame) */
.eq i {
  height: 100%;
  transform-origin: 50% 100%;
  transform: scaleY(.35);
  animation: vwt-eq 1s var(--ease-standard) infinite alternate;
  will-change: transform;
}
.eq i:nth-child(1) { animation-duration: .82s; animation-delay: -.2s; }
.eq i:nth-child(2) { animation-duration: 1.06s; animation-delay: -.55s; }
.eq i:nth-child(3) { animation-duration: .94s; animation-delay: -.35s; }
.paused .eq i { animation-play-state: paused; }
@keyframes vwt-eq { 0% { transform: scaleY(.28); } 60% { transform: scaleY(.85); } 100% { transform: scaleY(1); } }

/* --------------------------------------------------------------------------
   8. PLAY / PAUSE MORPH  (icon is re-inserted by syncUI → animate on insert)
   -------------------------------------------------------------------------- */
[data-pp] > svg.i, [data-bigplay] > svg.i {
  animation: vwt-icon-morph var(--dur-slow) var(--ease-spring) backwards;
  transform-origin: 50% 50%;
}
[data-pp] > .spin { animation: spin .8s linear infinite, vwt-fade-in var(--dur-base) var(--ease-out) backwards; }
@keyframes vwt-icon-morph {
  0%   { opacity: 0; transform: scale(.4) rotate(-30deg); }
  60%  { opacity: 1; }
}
/* with hook #2 the icon only re-renders on a real state change; give pause→play a
   slightly different personality */
[data-pp][data-state="paused"] > svg.i { animation-name: vwt-icon-morph-play; }
@keyframes vwt-icon-morph-play { 0% { opacity: 0; transform: scale(.4) translateX(-3px); } 60% { opacity: 1; } }

/* artwork breathes with play state (style.css toggles .shrink) */
.np-art { transition: transform var(--dur-sheet) var(--ease-spring-soft), box-shadow var(--dur-sheet) var(--ease-standard); }
.np-art.shrink { box-shadow: 0 16px 34px -18px rgba(0, 0, 0, .6); }

/* --------------------------------------------------------------------------
   9. SEEK / PROGRESS BARS
   -------------------------------------------------------------------------- */
/* --pct is registered (@property) so the filled track glides between the
   ~4 Hz timeupdate ticks instead of stepping. Disabled while dragging. */
input[type=range] { transition: --pct 260ms linear; touch-action: pan-y; }
input[type=range]:active { transition: none; }
input[type=range]::-webkit-slider-runnable-track {
  background: linear-gradient(to right, var(--primary) var(--pct, 0%), color-mix(in srgb, var(--ink) 13%, transparent) var(--pct, 0%));
  border-radius: var(--r-full);
}
input[type=range]::-moz-range-track { background: color-mix(in srgb, var(--ink) 13%, transparent); border-radius: var(--r-full); }
input[type=range]::-webkit-slider-thumb {
  box-shadow: 0 1px 3px rgba(15, 42, 68, .25), 0 0 0 var(--hair) rgba(0, 0, 0, .08);
  transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-fast);
}
input[type=range]::-moz-range-thumb { box-shadow: 0 1px 3px rgba(15, 42, 68, .25); transition: transform var(--dur-base) var(--ease-spring); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.35); box-shadow: 0 2px 8px rgba(15, 42, 68, .30); }
input[type=range]:active::-moz-range-thumb { transform: scale(1.35); }
@media (hover: hover) and (pointer: fine) { input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.15); } }
.np input[type=range]::-webkit-slider-runnable-track {
  background: linear-gradient(to right, #F4FAFF var(--pct, 0%), rgba(244, 250, 255, .22) var(--pct, 0%));
}
.np input[type=range]::-webkit-slider-thumb { box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }

/* upload progress: eased fill + a travelling sheen */
.progress { height: 6px; border-radius: var(--r-full); background: color-mix(in srgb, var(--ink) 10%, transparent); position: relative; }
.progress > div {
  position: relative; overflow: hidden; border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 70%, var(--gold)));
  transition: width var(--dur-slow) var(--ease-out);
}
.progress > div::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: translateX(-100%);
  animation: vwt-sheen 1.4s var(--ease-standard) infinite;
}

/* --------------------------------------------------------------------------
   10. SCREEN / PAGE TRANSITIONS
   -------------------------------------------------------------------------- */
/* The whole #app is re-rendered per route; #view is a fresh node each time so a
   CSS entrance animation is the transition. Direction comes from hook #1
   (html[data-nav]); without it you get a calm fade+rise. */
/* Without the hook the staggered .fade-in sections below are the transition. */
html[data-nav="forward"] .view { animation: vwt-screen-forward var(--dur-slow) var(--ease-out) backwards; }
html[data-nav="back"] .view    { animation: vwt-screen-back var(--dur-slow) var(--ease-out) backwards; }
html[data-nav="swap"] .view    { animation: vwt-fade-in var(--dur-base) var(--ease-standard) backwards; }

/* page sections rise in, staggered (overrides style.css .fade-in timing; fill
   mode `backwards` so no transform lingers afterwards) */
.fade-in { animation: vwt-rise var(--dur-slow) var(--ease-out) backwards; }
.fade-in:nth-child(1) { animation-delay: calc(var(--stagger) * 0); }
.fade-in:nth-child(2) { animation-delay: calc(var(--stagger) * 1.5); }
.fade-in:nth-child(3) { animation-delay: calc(var(--stagger) * 3); }
.fade-in:nth-child(4) { animation-delay: calc(var(--stagger) * 4.5); }
.fade-in:nth-child(5) { animation-delay: calc(var(--stagger) * 6); }
.fade-in:nth-child(n+6) { animation-delay: calc(var(--stagger) * 7); }

/* list item stagger-in (song list, playlist cards, admin lists, picker) */
ol.tracks > li, .cards > li, .list > li {
  animation: vwt-row-in var(--dur-slow) var(--ease-out) backwards;
  animation-delay: calc(120ms + var(--stagger) * var(--vwt-i, 0));
}
ol.tracks > li:nth-child(1), .cards > li:nth-child(1), .list > li:nth-child(1) { --vwt-i: 0; }
ol.tracks > li:nth-child(2), .cards > li:nth-child(2), .list > li:nth-child(2) { --vwt-i: 1; }
ol.tracks > li:nth-child(3), .cards > li:nth-child(3), .list > li:nth-child(3) { --vwt-i: 2; }
ol.tracks > li:nth-child(4), .cards > li:nth-child(4), .list > li:nth-child(4) { --vwt-i: 3; }
ol.tracks > li:nth-child(5), .cards > li:nth-child(5), .list > li:nth-child(5) { --vwt-i: 4; }
ol.tracks > li:nth-child(6), .cards > li:nth-child(6), .list > li:nth-child(6) { --vwt-i: 5; }
ol.tracks > li:nth-child(7), .cards > li:nth-child(7), .list > li:nth-child(7) { --vwt-i: 6; }
ol.tracks > li:nth-child(8), .cards > li:nth-child(8), .list > li:nth-child(8) { --vwt-i: 7; }
ol.tracks > li:nth-child(9), .cards > li:nth-child(9), .list > li:nth-child(9) { --vwt-i: 8; }
ol.tracks > li:nth-child(n+10), .cards > li:nth-child(n+10), .list > li:nth-child(n+10) { --vwt-i: 9; }
.sheet .list > li { animation-delay: calc(200ms + var(--stagger) * .6 * var(--vwt-i, 0)); }

/* same-route re-renders (autosave, filter chips, refresh) should NOT replay
   entrances — hook #1 toggles html.vwt-refresh */
html.vwt-refresh .view, html.vwt-refresh .fade-in, html.vwt-refresh ol.tracks > li,
html.vwt-refresh .cards > li, html.vwt-refresh .list > li, html.vwt-refresh .banner,
html.vwt-refresh .tabs a[aria-current="page"] svg.i { animation: none; }

/* admin view loading: delayed skeleton instead of an immediate spinner flash */
.view-loading {
  display: block; place-items: normal; position: relative; min-height: 420px; padding-top: 22px;
  color: transparent;
  animation: vwt-fade-in var(--dur-base) var(--ease-standard) 180ms backwards;
}
.view-loading .spin {   /* re-skinned as the page-title placeholder */
  display: block; width: 44%; height: 30px; border: 0; border-radius: var(--r-sm);
  background: var(--sk); animation: vwt-pulse 1.4s var(--ease-standard) infinite;
}
.view-loading::before { /* four card placeholders from one element + box-shadow copies */
  content: ""; position: absolute; left: 0; right: 0; top: 76px; height: 78px;
  border-radius: var(--r-lg); background: var(--sk);
  box-shadow: 0 90px 0 var(--sk), 0 180px 0 var(--sk), 0 270px 0 var(--sk);
  animation: vwt-pulse 1.4s var(--ease-standard) .15s infinite;
}

/* banners slide down gently */
.banner { animation: vwt-banner-in var(--dur-slow) var(--ease-spring-soft) backwards; }

/* --------------------------------------------------------------------------
   11. NOW-PLAYING SHEET (full screen)
   -------------------------------------------------------------------------- */
.np-scrim { animation: vwt-fade-in var(--dur-base) var(--ease-standard) backwards; }
.np-scrim .sheet {
  animation: vwt-np-up var(--dur-sheet) var(--ease-sheet) backwards;
  box-shadow: none;
}
.np-scrim .grab { background: rgba(244, 250, 255, .38); }
.np-art { animation: vwt-art-in 640ms var(--ease-spring-soft) 70ms backwards; }
.np-meta  { animation: vwt-rise var(--dur-slow) var(--ease-out) 140ms backwards; }
.seek.big { animation: vwt-rise var(--dur-slow) var(--ease-out) 180ms backwards; }
.np-ctrls { animation: vwt-rise var(--dur-slow) var(--ease-out) 220ms backwards; }
.np-up    { animation: vwt-fade-in var(--dur-slow) var(--ease-standard) 300ms backwards; }
.np-scrim.closing { animation: vwt-fade-out var(--dur-exit) var(--ease-in) forwards; }
.np-scrim.closing .sheet { animation: vwt-np-down var(--dur-exit) var(--ease-in) forwards; }
.np-head .btn-icon { border-radius: var(--r-full); }
/* optional artwork/title swap on track change (hook #6) */
.np-art.vwt-swap, .now-art.vwt-swap { animation: vwt-art-swap var(--dur-slow) var(--ease-spring-soft); }
[data-now-title].vwt-swap, [data-now-sub].vwt-swap { animation: vwt-text-swap var(--dur-base) var(--ease-out); }

/* --------------------------------------------------------------------------
   12. TOAST
   -------------------------------------------------------------------------- */
#toast {
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px);
  box-shadow: inset 0 0 0 var(--hair) rgba(255, 255, 255, .10), inset 0 1px 0 rgba(255, 255, 255, .08), var(--sh-3);
  border-radius: var(--r-full);
  transform: translateX(-50%) translateY(14px) scale(.94);
  transition:
    opacity var(--dur-fast) var(--ease-in),
    transform var(--dur-base) var(--ease-in);     /* exit: quick, no bounce */
}
#toast.show {
  transform: translateX(-50%) translateY(0) scale(1);
  transition:
    opacity var(--dur-base) var(--ease-out),
    transform var(--dur-sheet) var(--ease-spring); /* enter: springy */
}
@media (prefers-color-scheme: dark) {
  #toast { box-shadow: inset 0 0 0 var(--hair) rgba(15, 42, 68, .14), var(--sh-3); }
}

/* --------------------------------------------------------------------------
   13. DRAG-REORDER LIFT
   -------------------------------------------------------------------------- */
/* JS sets an inline translateY on li.dragging; we add lift with the separate
   `scale` property + shadow, and never transition `transform` while dragging
   (so it tracks the finger 1:1). On release the class drops and the row settles
   back with a soft spring via the .list > li transform transition above. */
.list > li.dragging, ol.edit-list > li.dragging {
  scale: 1.025;
  background: var(--surface);
  border-radius: var(--r-md);
  border-bottom-color: transparent;
  box-shadow: inset 0 0 0 var(--hair) var(--line-gold), var(--hi), var(--sh-4);
  z-index: 3;
  cursor: grabbing;
  transition: scale var(--dur-base) var(--ease-spring), box-shadow var(--dur-base) var(--ease-standard), background-color var(--dur-fast);
}
.list > li.dragging .handle { color: var(--primary); cursor: grabbing; }
/* separator just above the lifted row disappears so the lift reads cleanly */
.list > li:has(+ li.dragging) { border-bottom-color: transparent; }
.handle { cursor: grab; }
.handle:active { cursor: grabbing; }
/* optional FLIP for siblings (hook #3) */
.list > li.vwt-flip { transition: transform var(--dur-base) var(--ease-spring-soft); }

/* --------------------------------------------------------------------------
   14. SKELETONS (utility — use anywhere content is loading)
   <div class="sk-row"><span class="skeleton sk-thumb"></span><span class="sk-lines">
     <span class="skeleton sk-line"></span><span class="skeleton sk-line short"></span></span></div>
   -------------------------------------------------------------------------- */
.skeleton {
  display: block; position: relative; overflow: hidden; isolation: isolate;
  background: var(--sk); border-radius: var(--r-sm); color: transparent !important;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(100deg, transparent 20%, var(--sk-sheen) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: vwt-sheen 1.5s var(--ease-standard) infinite;
}
.sk-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.sk-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.sk-thumb { width: 48px; height: 48px; border-radius: var(--r-sm); flex: none; }
.sk-line { height: 12px; width: 70%; border-radius: var(--r-xs); }
.sk-line.short { width: 40%; }
.sk-title { height: 26px; width: 55%; border-radius: var(--r-sm); }
.sk-card { height: 78px; border-radius: var(--r-lg); }

/* --------------------------------------------------------------------------
   15. KEYFRAMES
   -------------------------------------------------------------------------- */
@keyframes vwt-fade-in   { from { opacity: 0; } }
@keyframes vwt-fade-out  { to { opacity: 0; } }
@keyframes vwt-rise      { from { opacity: 0; transform: translate3d(0, 12px, 0); } }
@keyframes vwt-row-in    { from { opacity: 0; transform: translate3d(0, 10px, 0) scale(.985); } }
@keyframes vwt-screen-in { from { opacity: 0; transform: translate3d(0, 8px, 0); } }
@keyframes vwt-screen-forward { from { opacity: 0; transform: translate3d(28px, 0, 0); } }
@keyframes vwt-screen-back    { from { opacity: 0; transform: translate3d(-28px, 0, 0); } }
@keyframes vwt-sheet-up   { from { transform: translate3d(0, 100%, 0); } }
@keyframes vwt-sheet-down { to { transform: translate3d(0, 100%, 0); } }
@keyframes vwt-np-up      { from { transform: translate3d(0, 100%, 0); } }
@keyframes vwt-np-down    { to { transform: translate3d(0, 55%, 0); opacity: 0; } }
@keyframes vwt-art-in     { from { opacity: .4; transform: scale(.82) translate3d(0, 24px, 0); } }
@keyframes vwt-art-swap   { 0% { opacity: .35; transform: scale(.94); } }
@keyframes vwt-text-swap  { from { opacity: 0; transform: translate3d(0, 6px, 0); } }
@keyframes vwt-dock-in    { from { transform: translate3d(0, 100%, 0); } }
@keyframes vwt-menu-in    { from { opacity: 0; transform: scale(.9) translate3d(0, -6px, 0); } }
@keyframes vwt-banner-in  { from { opacity: 0; transform: translate3d(0, -8px, 0) scale(.98); } }
@keyframes vwt-pop        { 0% { transform: scale(.6); opacity: 0; } }
@keyframes vwt-tab-pop    { 0% { transform: scale(.78); } }
@keyframes vwt-pulse      { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes vwt-sheen      { to { transform: translateX(100%); } }

/* --------------------------------------------------------------------------
   16. ACCESSIBILITY PREFERENCES
   -------------------------------------------------------------------------- */
/* Reduced motion: style.css already zeroes every animation/transition.
   We restore ONLY gentle opacity cross-fades (no movement, no scale) for the
   moments where an instant cut is jarring, per Apple's Reduce Motion pattern. */
@media (prefers-reduced-motion: reduce) {
  :root { --press-scale: 1; --press-scale-round: 1; --stagger: 0ms; }
  html .scrim, html .np-scrim { animation: vwt-fade-in 200ms ease-out backwards !important; }
  html .sheet, html .np-scrim .sheet { animation: vwt-fade-in 200ms ease-out backwards !important; }
  html .view { animation: vwt-fade-in 160ms ease-out backwards !important; }
  html #toast { transform: translateX(-50%) !important; transition: opacity 200ms ease !important; }
  html .menu { animation: vwt-fade-in 140ms ease-out backwards !important; }
  html input[type=range] { transition: none !important; }
  .eq i { transform: scaleY(.6); }
  .eq i:nth-child(2) { transform: scaleY(1); }
  .eq i:nth-child(3) { transform: scaleY(.4); }
  .skeleton::after { display: none; }
  ol.tracks > li::before { transform: none; transition: none; }
  button:active, .btn:active { scale: 1; }
}

/* Higher contrast: firmer hairlines, solid separators */
@media (prefers-contrast: more) {
  :root {
    --hair: 1px; --hair-scale: 1;
    --sep: color-mix(in srgb, var(--ink) 30%, transparent);
    --line-soft: color-mix(in srgb, var(--ink) 30%, transparent);
    --line-gold: color-mix(in srgb, var(--ink) 40%, var(--gold));
    --line-input: var(--ink-soft);
    --focus-w: 3px;
  }
}

/* Reduced transparency: replace glass with solid surfaces */
@media (prefers-reduced-transparency: reduce) {
  .top { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .dock, .menu, .glass, #toast { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .dock, .menu, .glass { background: var(--surface); }
  #toast { background: var(--ink); }
}

/* Windows High Contrast / forced colours */
@media (forced-colors: active) {
  :focus-visible { outline-color: Highlight; }
  .card, .pl-card, ol.tracks, .sheet, .menu, #toast { border: 1px solid CanvasText; }
  ol.tracks > li.playing::before { background: Highlight; forced-color-adjust: none; }
  .skeleton, .view-loading .spin, .view-loading::before { background: GrayText; }
}
