/* ==========================================================================
   MusicServe — The Listening Room
   Artwork-driven theme: deep navy, electric violet, and waveform highlights.
   ========================================================================== */

:root {
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .18);
  --shadow-md: 0 14px 34px -16px var(--shadow);
  --shadow-lg: 0 28px 70px -28px var(--shadow);
  --ease: cubic-bezier(.2, .7, .25, 1);
  --player-height: 92px;
  --mobile-nav-height: 64px;
}

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: oklch(0.17 0.045 265);
  --bg-2: oklch(0.205 0.055 268);
  --panel: oklch(0.235 0.06 270);
  --panel-2: oklch(0.275 0.065 272);
  --panel-3: oklch(0.315 0.07 274);
  --ink: oklch(0.965 0.01 250);
  --ink-2: oklch(0.86 0.03 255);
  --muted: oklch(0.72 0.04 258);
  --faint: oklch(0.58 0.04 260);
  --line: oklch(0.38 0.07 270 / .55);
  --line-strong: oklch(0.5 0.1 285 / .55);
  --brass: oklch(0.68 0.25 305);
  --brass-2: oklch(0.74 0.22 315);
  --brass-dim: oklch(0.6 0.2 295);
  --brass-wash: oklch(0.64 0.24 305 / .16);
  --brass-line: oklch(0.68 0.24 305 / .42);
  --accent-ink: oklch(0.985 0.005 250);
  --danger: oklch(0.7 0.19 25);
  --danger-wash: oklch(0.7 0.19 25 / .14);
  --success: oklch(0.76 0.16 160);
  --success-wash: oklch(0.76 0.16 160 / .14);
  --warning: oklch(0.82 0.16 85);
  --warning-wash: oklch(0.82 0.16 85 / .14);
  --info: oklch(0.76 0.14 235);
  --info-wash: oklch(0.76 0.14 235 / .14);
  --shadow: oklch(0.08 0.04 265 / .7);
  --grain: .04;
  --vinyl: radial-gradient(circle at 50% 50%, oklch(0.1 0.03 265) 0 8%, oklch(0.16 0.04 268) 8.5% 22%, oklch(0.11 0.03 265) 22.5% 38%, oklch(0.17 0.045 270) 38.5% 55%, oklch(0.1 0.03 265) 55.5% 72%, oklch(0.15 0.04 268) 72.5% 88%, oklch(0.22 0.06 275) 88.5% 100%);
  --hero-glow: radial-gradient(60% 80% at 80% 20%, oklch(0.66 0.25 305 / .22), transparent 70%);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: oklch(0.975 0.01 255);
  --bg-2: oklch(0.99 0.006 250);
  --panel: oklch(0.995 0.004 250);
  --panel-2: oklch(0.965 0.012 255);
  --panel-3: oklch(0.94 0.018 258);
  --ink: oklch(0.23 0.05 265);
  --ink-2: oklch(0.36 0.06 268);
  --muted: oklch(0.48 0.05 265);
  --faint: oklch(0.6 0.04 262);
  --line: oklch(0.86 0.03 262 / .85);
  --line-strong: oklch(0.74 0.06 275 / .7);
  --brass: oklch(0.55 0.24 305);
  --brass-2: oklch(0.5 0.22 295);
  --brass-dim: oklch(0.6 0.18 310);
  --brass-wash: oklch(0.58 0.22 305 / .1);
  --brass-line: oklch(0.55 0.22 305 / .32);
  --accent-ink: oklch(0.99 0.004 250);
  --danger: oklch(0.56 0.2 25);
  --danger-wash: oklch(0.56 0.2 25 / .1);
  --success: oklch(0.52 0.16 160);
  --success-wash: oklch(0.52 0.16 160 / .1);
  --warning: oklch(0.62 0.16 85);
  --warning-wash: oklch(0.62 0.16 85 / .12);
  --info: oklch(0.54 0.16 235);
  --info-wash: oklch(0.54 0.16 235 / .1);
  --shadow: oklch(0.3 0.06 265 / .16);
  --grain: .024;
  --vinyl: radial-gradient(circle at 50% 50%, oklch(0.18 0.04 265) 0 8%, oklch(0.26 0.05 268) 8.5% 22%, oklch(0.2 0.04 265) 22.5% 38%, oklch(0.28 0.05 270) 38.5% 55%, oklch(0.19 0.04 265) 55.5% 72%, oklch(0.25 0.05 268) 72.5% 88%, oklch(0.34 0.07 275) 88.5% 100%);
  --hero-glow: radial-gradient(60% 80% at 80% 20%, oklch(0.62 0.22 305 / .14), transparent 70%);
}

/* --------------------------------------------------------------- Reset -- */

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(90% 60% at 8% -10%, var(--brass-wash), transparent 70%),
    radial-gradient(70% 50% at 100% 0%, var(--info-wash), transparent 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

h1, h2, h3, h4, p, figure { margin: 0; }
h1, h2, h3 { font-weight: 600; }
ul, ol { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--brass-line); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border: 3px solid var(--bg); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--brass-dim); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  transform: translateY(-160%);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--brass);
  color: var(--accent-ink);
  font-weight: 700;
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
  vertical-align: -0.16em;
  pointer-events: none;
}

.muted { color: var(--muted); }
.dot { margin: 0 .45em; color: var(--faint); }

/* --------------------------------------------------------------- Shell -- */

.app-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 26px;
  height: 100dvh;
  padding: 26px 18px 22px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, oklch(0.2 0.02 56 / .55), transparent 26%),
    color-mix(in oklab, var(--bg-2) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 6px 20px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--brass);
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 18px var(--brass-wash));
  transition: transform .5s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.02); }
.brand-mark svg,
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }

.brand-copy { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.05;
}
.brand-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-label {
  margin: 18px 12px 7px;
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.side-label:first-child { margin-top: 0; }

.side-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  text-align: left;
  text-decoration: none;
  appearance: none;
  -webkit-appearance: none;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.side-link:hover { color: var(--ink); background: var(--brass-wash); }
.side-link.is-active { color: var(--brass); background: var(--brass-wash); }
.side-link.is-active::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brass);
}
.side-icon { display: grid; place-items: center; width: 19px; color: currentColor; }
.side-icon .icon { width: 19px; height: 19px; }

.sidebar-foot {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.shelf-note {
  max-width: 20ch;
  margin: 0 6px 14px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-style: italic;
  line-height: 1.5;
}
.side-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.side-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  transition: all .18s var(--ease);
}
.side-mini .icon { width: 15px; height: 15px; }
.side-mini:hover { color: var(--brass); background: var(--brass-wash); border-color: var(--brass-line); }

.page { display: flex; min-width: 0; flex-direction: column; }

/* -------------------------------------------------------------- Topbar -- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 560px) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 13px 32px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
}

.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

.topbar-brand {
  display: none;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}
.topbar-brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--brass-line);
  border-radius: 50%;
  color: var(--brass);
  overflow: hidden;
  background: var(--brass-wash);
  font-family: var(--font-display);
  font-size: 13px;
}
.topbar-brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

.menu-btn { display: none; }

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in oklab, var(--panel) 88%, transparent);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.search-box:focus-within {
  border-color: var(--brass-line);
  background: var(--panel);
  box-shadow: 0 0 0 4px var(--brass-wash);
}
.search-icon { display: grid; place-items: center; color: var(--muted); }
.search-icon .icon { width: 18px; height: 18px; }
.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13.5px;
}
.search-box input::placeholder { color: var(--muted); }
.search-box input::-webkit-search-cancel-button { filter: grayscale(1); opacity: .6; }
.search-kbd {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 5px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.4;
}

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in oklab, var(--panel) 75%, transparent);
  color: var(--ink-2);
  transition: color .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.icon-btn:hover { color: var(--brass); border-color: var(--brass-line); background: var(--brass-wash); }
.icon-btn:active { transform: scale(.96); }
.icon-btn .icon { width: 18px; height: 18px; }

.count-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--brass);
  color: var(--accent-ink);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.content {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 38px 42px calc(var(--player-height) + 74px);
  outline: none;
}

.view { animation: view-in .42s var(--ease) both; }

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

/* ------------------------------------------------------- Shared heading -- */

.eyebrow {
  margin-bottom: 10px;
  color: var(--brass);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.page-head { max-width: 900px; margin-bottom: 28px; }
.page-head h1,
.detail-copy h1 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -.025em;
  line-height: 1.02;
}
.page-head h1 { font-size: clamp(2.3rem, 4.4vw, 3.7rem); }
.page-head .lede { max-width: 62ch; margin-top: 12px; color: var(--ink-2); font-size: 15px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

.section { margin-top: 44px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 17px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.section-sub { margin-top: 4px; color: var(--muted); font-size: 12.5px; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  color: var(--brass);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
  transition: border-color .18s var(--ease);
}
.text-link .icon { width: 15px; height: 15px; transition: transform .18s var(--ease); }
.text-link:hover { border-color: var(--brass-line); }
.text-link:hover .icon { transform: translateX(3px); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .02em;
  transition: color .18s var(--ease);
}
.back-link .icon { width: 16px; height: 16px; }
.back-link:hover { color: var(--brass); }

/* -------------------------------------------------------------- Buttons -- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 19px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .015em;
  line-height: 1;
  white-space: nowrap;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.btn .icon { width: 17px; height: 17px; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .42; cursor: not-allowed; }

.btn-primary {
  border-color: color-mix(in oklab, var(--brass-2) 60%, transparent);
  background: linear-gradient(145deg, var(--brass-2), var(--brass));
  color: var(--accent-ink);
  box-shadow: 0 12px 26px -14px oklch(0.79 0.12 78 / .7), inset 0 1px 0 oklch(1 0 0 / .25);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(145deg, var(--brass), var(--brass-dim));
  box-shadow: 0 16px 32px -14px oklch(0.79 0.12 78 / .8), inset 0 1px 0 oklch(1 0 0 / .25);
}

.btn-ghost {
  border-color: var(--line);
  background: color-mix(in oklab, var(--panel) 68%, transparent);
  color: var(--ink-2);
}
.btn-ghost:hover:not(:disabled) { color: var(--brass); border-color: var(--brass-line); background: var(--brass-wash); }

.btn-danger { border-color: var(--danger); background: var(--danger); color: oklch(0.99 0 0); }
.btn-danger:hover:not(:disabled) { filter: brightness(1.08); }

.btn-sm { min-height: 36px; padding: 0 14px; font-size: 12px; }
.btn-lg { min-height: 50px; padding: 0 26px; font-size: 14px; }
.btn-block { width: 100%; }

/* ----------------------------------------------------------------- Hero -- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  align-items: center;
  gap: 36px;
  min-height: 420px;
  padding: 46px 50px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E"),
    var(--hero-glow),
    linear-gradient(135deg, color-mix(in oklab, var(--panel) 94%, transparent), color-mix(in oklab, var(--bg-2) 90%, transparent));
  box-shadow: var(--shadow-lg), inset 0 1px 0 oklch(1 0 0 / .04);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  left: 50px;
  right: 50px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--brass-line), transparent 60%);
}

.hero-copy { position: relative; z-index: 2; }
.hero h1 {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5.6rem);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: .92;
}
.hero h1 em { color: var(--brass); font-weight: 400; }
.hero .lede { max-width: 46ch; margin-top: 20px; color: var(--ink-2); font-size: 15.5px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 28px; }

.hero-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}
.hero-disc {
  position: relative;
  display: grid;
  place-items: center;
  width: min(310px, 76%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--vinyl);
  box-shadow:
    0 40px 80px -34px var(--shadow),
    inset 0 0 0 1px oklch(1 0 0 / .05),
    inset 0 0 80px oklch(0 0 0 / .45);
  animation: disc-spin 26s linear infinite;
}
.hero-disc::before {
  content: "";
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 3px, oklch(1 0 0 / .022) 3px 4px);
  opacity: .7;
}
.hero-disc::after {
  content: "";
  position: absolute;
  inset: -10%;
  border-radius: 50%;
  border: 1px solid var(--brass-line);
  opacity: .5;
}
.hero-disc-label {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 31%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--brass-2), var(--brass) 52%, var(--brass-dim));
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: clamp(20px, 3.4vw, 34px);
  font-weight: 700;
  box-shadow: inset 0 0 0 6px oklch(0.2 0.03 52 / .14);
}
.hero-disc-label::after {
  content: "";
  position: absolute;
  width: 9%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bg);
}
.hero-tonearm {
  position: absolute;
  top: 4%;
  right: 8%;
  width: 118px;
  height: 158px;
  transform: rotate(17deg);
  transform-origin: 82% 8%;
  pointer-events: none;
}
.hero-tonearm::before {
  content: "";
  position: absolute;
  top: 14px;
  right: 22px;
  width: 2px;
  height: 112px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brass), color-mix(in oklab, var(--brass) 30%, transparent));
  transform: rotate(21deg);
  transform-origin: top center;
}
.hero-tonearm::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 34px;
  height: 34px;
  border: 1px solid var(--brass-line);
  border-radius: 50%;
  background: radial-gradient(circle, var(--brass-dim) 0 28%, var(--panel-3) 30% 100%);
  box-shadow: 0 8px 18px -8px var(--shadow);
}
.hero-caption {
  position: absolute;
  bottom: 2%;
  right: 6%;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
}

@keyframes disc-spin { to { transform: rotate(360deg); } }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 26px 0 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in oklab, var(--panel) 55%, transparent);
  overflow: hidden;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 24px;
  border-right: 1px solid var(--line);
}
.stat:last-child { border-right: 0; }
.stat strong {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.7vw, 2.15rem);
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1;
}
.stat span {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.shelf { margin-top: 46px; }
.shelf-row {
  display: flex;
  gap: 18px;
  padding: 2px 2px 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.shelf-row > * { flex: 0 0 174px; scroll-snap-align: start; }
.shelf-footnote {
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-align: center;
}

/* -------------------------------------------------------------- Artwork -- */

.artwork {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  isolation: isolate;
}
.artwork::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px oklch(1 0 0 / .06);
  pointer-events: none;
}
.artwork img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  transition: transform .5s var(--ease), opacity .3s ease;
}
.artwork-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  background:
    radial-gradient(90% 90% at 20% 10%, var(--brass-wash), transparent 60%),
    repeating-linear-gradient(135deg, transparent 0 9px, oklch(1 0 0 / .02) 9px 10px),
    linear-gradient(145deg, var(--panel-3), var(--panel));
  color: color-mix(in oklab, var(--brass) 78%, var(--muted));
  font-family: var(--font-display);
  font-size: clamp(22px, 4vw, 42px);
  font-weight: 600;
  letter-spacing: -.04em;
}
.artwork-fallback span { opacity: .88; }

.sleeve { border-radius: 5px; box-shadow: var(--shadow-md); }
.sleeve::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 7px;
  z-index: 3;
  background: linear-gradient(90deg, oklch(0 0 0 / .38), oklch(1 0 0 / .07));
  border-right: 1px solid oklch(0 0 0 / .22);
  pointer-events: none;
}

.mini-art { width: 44px; height: 44px; border-radius: 6px; flex: 0 0 auto; }
.mini-art .artwork-fallback { font-size: 15px; }

/* --------------------------------------------------------------- Cards -- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 26px 20px;
}

.album-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}
.album-card .artwork { width: 100%; transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.album-card:hover .artwork { transform: translateY(-4px); box-shadow: 0 26px 48px -24px var(--shadow); }
.album-card:hover .artwork img { transform: scale(1.035); }
.album-card-title {
  margin-top: 8px;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.album-card:hover .album-card-title { color: var(--brass); }
.album-card-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artist-grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
.artist-card { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.artist-art {
  width: 100%;
  border-radius: 50%;
  box-shadow: 0 18px 38px -22px var(--shadow);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.artist-card:hover .artist-art { transform: translateY(-4px) scale(1.012); box-shadow: 0 26px 48px -24px var(--shadow); }
.artist-card-name {
  max-width: 100%;
  margin-top: 10px;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.artist-card:hover .artist-card-name { color: var(--brass); }
.artist-card-meta { color: var(--muted); font-size: 11.5px; }

.taxonomy-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.taxonomy-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--panel) 56%, transparent);
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
}
.taxonomy-card:hover { border-color: var(--brass-line); background: var(--brass-wash); transform: translateY(-2px); }
.taxonomy-art { width: 68px; height: 68px; flex: 0 0 68px; border-radius: var(--radius-sm); }
.taxonomy-art .artwork-fallback { font-size: 20px; }
.taxonomy-body { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.taxonomy-name { overflow: hidden; font-size: 14px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.taxonomy-meta { color: var(--muted); font-size: 11.5px; }

.sleeve-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.sleeve-card .artwork { width: 100%; box-shadow: var(--shadow-md); transition: transform .35s var(--ease); }
.sleeve-card:hover .artwork { transform: translateY(-4px); }
.sleeve-play {
  position: absolute;
  right: 10px;
  top: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brass);
  color: var(--accent-ink);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
  box-shadow: 0 8px 18px -8px var(--shadow);
}
.sleeve-card:hover .sleeve-play,
.sleeve-card:focus-visible .sleeve-play { opacity: 1; transform: none; }
.sleeve-title { margin-top: 7px; overflow: hidden; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.sleeve-meta { overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }

/* --------------------------------------------------------------- Tracks -- */

.track-list {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in oklab, var(--panel) 42%, transparent);
  overflow: hidden;
}
.track-list-head,
.track-row {
  display: grid;
  grid-template-columns: 46px 44px minmax(0, 2.4fr) minmax(120px, 1.15fr) 58px 36px;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
}
.track-list-head {
  padding-top: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.track-row {
  position: relative;
  border-bottom: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  transition: background .15s var(--ease);
}
.track-row:last-child { border-bottom: 0; }
.track-row:hover { background: color-mix(in oklab, var(--ink) 4%, transparent); }
.track-row.is-current { background: var(--brass-wash); }
.track-row.is-current::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brass);
}

.row-play {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  transition: all .16s var(--ease);
}
.row-play:hover, .row-play:focus-visible { color: var(--brass); border-color: var(--brass-line); background: var(--brass-wash); }
.row-index { opacity: 1; }
.row-play-icon { position: absolute; opacity: 0; transform: scale(.8); transition: opacity .15s var(--ease), transform .15s var(--ease); }
.row-play-icon .icon { width: 14px; height: 14px; }
.row-play:hover .row-index,
.row-play:focus-visible .row-index,
.track-row.is-current .row-index { opacity: 0; }
.row-play:hover .row-play-icon,
.row-play:focus-visible .row-play-icon,
.track-row.is-current .row-play-icon { opacity: 1; transform: none; }
.track-row.is-current .row-play { color: var(--brass); }

.track-art { display: block; width: 44px; }
.track-main { display: flex; min-width: 0; flex-direction: column; gap: 1px; }
.track-title-btn {
  display: block;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 620;
  line-height: 1.35;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .15s var(--ease);
}
.track-title-btn:hover { color: var(--brass); }
.track-row.is-current .track-title-btn { color: var(--brass); }
.track-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}
.meta-link { overflow: hidden; color: inherit; text-overflow: ellipsis; transition: color .15s var(--ease); }
.meta-link:hover { color: var(--brass); }
.track-alt {
  overflow: hidden;
  color: var(--faint);
  font-size: 10.5px;
  font-style: italic;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-tags { display: flex; min-width: 0; gap: 5px; overflow: hidden; }
.chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: .03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip .icon { width: 11px; height: 11px; margin-right: 4px; flex: 0 0 auto; }
.chip-genre { border-color: var(--brass-line); color: var(--brass); background: var(--brass-wash); }
.chip-mood { border-color: color-mix(in oklab, var(--success) 34%, transparent); color: var(--success); background: var(--success-wash); }
.chip-lang { border-color: color-mix(in oklab, var(--info) 34%, transparent); color: var(--info); background: var(--info-wash); }

.track-duration { color: var(--muted); font-family: var(--font-mono); font-size: 10.5px; text-align: right; }
.row-queue { width: 30px; height: 30px; border-color: transparent; background: transparent; opacity: 0; }
.track-row:hover .row-queue,
.track-row:focus-within .row-queue { opacity: 1; }
.row-queue .icon { width: 15px; height: 15px; }

/* -------------------------------------------------------------- Filters -- */

.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--panel) 48%, transparent);
}
.field { display: flex; min-width: 130px; flex-direction: column; gap: 5px; }
.field > span {
  color: var(--faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.field select,
.field input,
.input-field {
  min-height: 38px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background-color: var(--panel);
  color: var(--ink);
  font-size: 12.5px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 16px, calc(100% - 10px) 16px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field input,
.input-field { padding-right: 12px; background-image: none; }
.field select:focus,
.field input:focus,
.input-field:focus {
  outline: 0;
  border-color: var(--brass-line);
  box-shadow: 0 0 0 3px var(--brass-wash);
}
.filter-clear {
  margin-left: auto;
  padding: 9px 4px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  border-bottom: 1px solid transparent;
}
.filter-clear:hover { color: var(--brass); border-color: var(--brass-line); }

.result-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: .02em;
}
.result-line .muted { color: var(--faint); }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 11.5px;
}

/* --------------------------------------------------------------- Detail -- */

.detail-hero {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  align-items: end;
  gap: 38px;
  margin-bottom: 44px;
}
.detail-art { position: relative; z-index: 0; }
.detail-cover {
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 40px 70px -32px var(--shadow);
}
.detail-art::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 7%;
  right: -9%;
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--vinyl);
  box-shadow: 0 24px 50px -24px var(--shadow), inset 0 0 0 1px oklch(1 0 0 / .06);
}
.detail-art::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: calc(7% + 32%);
  right: calc(-9% + 32%);
  width: 8%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--brass);
}
.detail-copy { position: relative; z-index: 1; }
.detail-copy h1 { font-size: clamp(2.5rem, 5vw, 4.4rem); }
.detail-byline { margin-top: 10px; color: var(--ink-2); font-size: 16px; }
.detail-byline a { border-bottom: 1px solid var(--brass-line); transition: color .18s var(--ease); }
.detail-byline a:hover { color: var(--brass); }
.detail-meta {
  margin-top: 7px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.detail-bio { max-width: 65ch; margin-top: 22px; color: var(--ink-2); font-size: 13.5px; line-height: 1.65; }

.artist-hero { grid-template-columns: minmax(190px, 250px) minmax(0, 1fr); }
.detail-portrait { width: 100%; border-radius: 50%; box-shadow: 0 30px 60px -28px var(--shadow); }
.detail-art:has(.detail-portrait)::before,
.detail-art:has(.detail-portrait)::after { display: none; }

/* ---------------------------------------------------------------- States -- */

.state-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 52px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: color-mix(in oklab, var(--panel) 32%, transparent);
  text-align: center;
}
.state-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 6px;
  border: 1px solid var(--brass-line);
  border-radius: 50%;
  background: var(--brass-wash);
  color: var(--brass);
}
.state-icon .icon { width: 24px; height: 24px; }
.state-panel h2 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 500; }
.state-panel p { max-width: 46ch; color: var(--muted); font-size: 13px; }
.state-panel .btn { margin-top: 12px; }
.queue-dialog .state-panel { padding: 34px 20px; border: 0; background: transparent; }

.skeleton-wrap { display: flex; flex-direction: column; gap: 18px; }
.skeleton {
  border-radius: var(--radius-md);
  background: linear-gradient(100deg, var(--panel) 8%, var(--panel-2) 18%, var(--panel) 33%);
  background-size: 240% 100%;
  animation: shimmer 1.5s linear infinite;
}
.skeleton-hero { height: 300px; border-radius: var(--radius-xl); }
.skeleton-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.skeleton-card { aspect-ratio: 1; }
.skeleton-line { height: 16px; width: 60%; }
.skeleton-line.short { width: 34%; }
@keyframes shimmer { to { background-position: -240% 0; } }

/* ---------------------------------------------------------------- Player -- */

.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(330px, 1.4fr) minmax(190px, 1fr);
  align-items: center;
  gap: 24px;
  height: var(--player-height);
  padding: 10px 28px;
  border-top: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-2) 88%, transparent);
  box-shadow: 0 -20px 50px -30px var(--shadow);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
}
.player::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass-line) 18%, var(--brass-line) 82%, transparent);
}
.player-progress { position: absolute; left: 0; right: 0; top: 0; height: 2px; overflow: hidden; }
.player-progress span { display: block; width: 0; height: 100%; background: var(--brass); box-shadow: 0 0 10px var(--brass); }

.player-now { display: flex; min-width: 0; align-items: center; gap: 12px; }
.player-art {
  position: relative;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-2);
  box-shadow: 0 8px 18px -10px var(--shadow);
}
.player-art img { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: cover; }
.player-art .artwork-fallback { font-size: 18px; }
.player-art-badge {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: oklch(0.1 0.01 50 / .55);
  color: var(--brass-2);
  opacity: 0;
  transition: opacity .18s var(--ease);
}
.player-art:hover .player-art-badge { opacity: 1; }
.player-art-badge .icon { width: 20px; height: 20px; }
.player-meta { min-width: 0; }
.player-title {
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-artist {
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-center { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.player-controls { display: flex; align-items: center; justify-content: center; gap: 4px; }
.player-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  transition: color .16s var(--ease), background .16s var(--ease), border-color .16s var(--ease), transform .16s var(--ease);
}
.player-btn:hover { color: var(--brass); background: var(--brass-wash); }
.player-btn:active { transform: scale(.94); }
.player-btn .icon { width: 17px; height: 17px; }
.player-btn.is-active { color: var(--brass); background: var(--brass-wash); border-color: var(--brass-line); }
.play-btn {
  width: 44px;
  height: 44px;
  margin: 0 6px;
  border-color: color-mix(in oklab, var(--brass-2) 55%, transparent);
  background: linear-gradient(145deg, var(--brass-2), var(--brass));
  color: var(--accent-ink);
  box-shadow: 0 10px 22px -10px oklch(0.79 0.12 78 / .7);
}
.play-btn:hover { color: var(--accent-ink); background: linear-gradient(145deg, var(--brass), var(--brass-dim)); }
.play-btn .icon { width: 19px; height: 19px; }

.player-scrub { display: flex; align-items: center; gap: 9px; }
.player-time { min-width: 34px; color: var(--muted); font-family: var(--font-mono); font-size: 9.5px; text-align: center; }

.range {
  --fill: 0%;
  width: 100%;
  height: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  appearance: none;
  cursor: pointer;
}
.range::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--brass) 0 var(--fill), var(--line-strong) var(--fill) 100%);
}
.range::-moz-range-track {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--brass) 0 var(--fill), var(--line-strong) var(--fill) 100%);
}
.range::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  border: 2px solid var(--bg-2);
  border-radius: 50%;
  background: var(--brass-2);
  appearance: none;
  opacity: 0;
  transition: opacity .15s var(--ease);
}
.range:hover::-webkit-slider-thumb,
.range:focus-visible::-webkit-slider-thumb { opacity: 1; }
.range::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 2px solid var(--bg-2);
  border-radius: 50%;
  background: var(--brass-2);
  opacity: 0;
}
.range:hover::-moz-range-thumb,
.range:focus-visible::-moz-range-thumb { opacity: 1; }

.player-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.volume-range { width: 82px; }
.queue-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 650;
  transition: all .16s var(--ease);
}
.queue-pill:hover { color: var(--brass); border-color: var(--brass-line); background: var(--brass-wash); }
.queue-pill .icon { width: 15px; height: 15px; }
.queue-pill-count {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--brass-wash);
  color: var(--brass);
  font-family: var(--font-mono);
  font-size: 9px;
}

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

.mobile-nav { display: none; }
.nav-backdrop { display: none; }

/* --------------------------------------------------------------- Dialogs -- */

.dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: 86vh;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  color: var(--ink);
  box-shadow: 0 50px 100px -40px oklch(0 0 0 / .7);
  overflow: hidden;
}
.dialog::backdrop {
  background: oklch(0.08 0.01 50 / .62);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.dialog[open] { animation: dialog-in .28s var(--ease) both; }
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
}
.dialog-head .eyebrow { margin-bottom: 3px; }
.dialog-head h2 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 500; letter-spacing: -.02em; }
.dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
}

.queue-list { max-height: 55vh; overflow-y: auto; }
.queue-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid color-mix(in oklab, var(--line) 62%, transparent);
}
.queue-row:last-child { border-bottom: 0; }
.queue-row.is-current { background: var(--brass-wash); }
.queue-play {
  display: grid;
  grid-template-columns: 28px 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  flex: 1;
  min-width: 0;
  padding: 9px 8px 9px 20px;
  border: 0;
  background: transparent;
  text-align: left;
}
.queue-index {
  display: grid;
  place-items: center;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10px;
}
.queue-row.is-current .queue-index { color: var(--brass); }
.queue-index .icon { width: 13px; height: 13px; }
.queue-art { width: 40px; }
.queue-main { display: flex; min-width: 0; flex-direction: column; }
.queue-title { overflow: hidden; font-size: 12.5px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.queue-row.is-current .queue-title { color: var(--brass); }
.queue-meta { overflow: hidden; color: var(--muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.queue-time { color: var(--faint); font-family: var(--font-mono); font-size: 9.5px; }
.queue-remove { width: 30px; height: 30px; margin-right: 14px; border-color: transparent; background: transparent; opacity: 0; }
.queue-row:hover .queue-remove,
.queue-row:focus-within .queue-remove { opacity: 1; }
.queue-remove:hover { color: var(--danger); background: var(--danger-wash); border-color: transparent; }
.queue-remove .icon { width: 14px; height: 14px; }

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 18px;
  padding: 18px 24px;
}
.shortcut { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid color-mix(in oklab, var(--line) 55%, transparent); }
.shortcut kbd {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 25px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 5px;
  background: var(--panel);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 10px;
}
.shortcut span { color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- Toasts -- */

.toast-region {
  position: fixed;
  right: 22px;
  bottom: calc(var(--player-height) + 20px);
  z-index: 90;
  display: flex;
  max-width: min(360px, calc(100vw - 32px));
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--info);
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--bg-2) 94%, transparent);
  color: var(--ink);
  font-size: 12px;
  font-weight: 550;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  animation: toast-in .26s var(--ease) both;
  pointer-events: auto;
}
.toast.is-leaving { animation: toast-out .3s var(--ease) both; }
.toast-icon { display: grid; place-items: center; color: var(--info); }
.toast-icon .icon { width: 17px; height: 17px; }
.toast-success { border-left-color: var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(18px); }
}

/* -------------------------------------------------------------- Responsive -- */

@media (max-width: 1180px) {
  .content { padding-left: 30px; padding-right: 30px; }
  .hero { padding: 38px 38px; }
  .hero::after { left: 38px; right: 38px; }
  .topbar { padding-left: 24px; padding-right: 24px; }
}

@media (max-width: 1020px) {
  .app-shell { grid-template-columns: 226px minmax(0, 1fr); }
  .sidebar { padding-left: 14px; padding-right: 14px; }
  .side-link.is-active::before { left: -14px; }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(230px, .7fr); }
  .hero h1 { font-size: clamp(2.8rem, 5.4vw, 4.4rem); }
  .player { grid-template-columns: minmax(160px, 1fr) minmax(300px, 1.5fr) minmax(150px, .9fr); gap: 14px; padding-left: 18px; padding-right: 18px; }
  .volume-range { width: 58px; }
}

@media (max-width: 860px) {
  :root { --player-height: 76px; }

  .app-shell { display: block; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 70;
    width: min(320px, 86vw);
    height: 100dvh;
    border-right: 1px solid var(--line-strong);
    background: var(--bg-2);
    transform: translateX(-104%);
    transition: transform .3s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; }
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 65;
    border: 0;
    background: oklch(0.06 0.01 50 / .55);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s var(--ease), visibility .25s;
  }
  body.nav-open .nav-backdrop { opacity: 1; visibility: visible; }
  body.nav-open { overflow: hidden; }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 9px;
    padding: 10px 14px;
  }
  .topbar-brand { display: flex; }
  .menu-btn { display: inline-grid; }
  .admin-shortcut { display: none; }
  .search-box { height: 40px; padding: 0 11px; }
  .search-kbd { display: none; }
  .search-box input { font-size: 12.5px; }
  .topbar-actions { gap: 5px; }
  .topbar-actions .icon-btn { width: 38px; height: 38px; }

  .content { padding: 26px 16px calc(var(--player-height) + var(--mobile-nav-height) + 34px); }
  .page-head h1 { font-size: clamp(2rem, 8vw, 3rem); }
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 30px 24px 26px;
    gap: 18px;
  }
  .hero::after { left: 24px; right: 24px; }
  .hero h1 { font-size: clamp(2.7rem, 11vw, 4rem); }
  .hero .lede { font-size: 14px; }
  .hero-art { min-height: 210px; order: -1; }
  .hero-disc { width: min(220px, 58%); }
  .hero-tonearm { right: 18%; top: -2%; transform: scale(.8) rotate(17deg); transform-origin: 82% 8%; }
  .hero-caption { display: none; }
  .hero-actions .btn { flex: 1; }

  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 14px 18px; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }

  .shelf { margin-top: 34px; }
  .shelf-row > * { flex-basis: 148px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); gap: 22px 14px; }
  .artist-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
  .taxonomy-grid { grid-template-columns: 1fr; }

  .track-list-head { display: none; }
  .track-row {
    grid-template-columns: 38px 42px minmax(0, 1fr) 44px;
    gap: 9px;
    padding: 9px 12px;
  }
  .track-art { width: 42px; }
  .track-tags { display: none; }
  .track-duration { font-size: 9.5px; }
  .row-queue { display: none; }
  .row-play { width: 30px; height: 30px; }

  .filter-bar { gap: 9px; padding: 12px; }
  .field { min-width: 0; flex: 1 1 42%; }
  .field select { min-height: 36px; }
  .filter-clear { margin-left: 0; }

  .detail-hero,
  .artist-hero {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 26px;
  }
  .detail-art { max-width: 270px; }
  .detail-copy h1 { font-size: clamp(2.2rem, 9vw, 3.4rem); }
  .detail-art::before { display: none; }
  .detail-art::after { display: none; }

  .player {
    grid-template-columns: minmax(0, 1fr) auto;
    height: var(--player-height);
    padding: 8px 14px;
    bottom: var(--mobile-nav-height);
    gap: 10px;
  }
  .player-center { order: 3; grid-column: 1 / -1; }
  .player-now { min-width: 0; }
  .player-art { width: 44px; height: 44px; flex-basis: 44px; }
  .player-title { font-size: 12px; }
  .player-artist { font-size: 10.5px; }
  .player-right { display: none; }
  .player-scrub { display: none; }
  .player-controls { gap: 2px; }
  .player-btn { width: 30px; height: 30px; }
  .player-btn .icon { width: 15px; height: 15px; }
  .play-btn { width: 40px; height: 40px; margin: 0 4px; }
  #shuffleBtn, #repeatBtn { display: none; }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 61;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: var(--mobile-nav-height);
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: color-mix(in oklab, var(--bg-2) 94%, transparent);
    backdrop-filter: blur(20px);
  }
  .mobile-nav a,
  .mobile-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 9px;
    font-weight: 650;
    letter-spacing: .02em;
  }
  .mobile-nav a.is-active { color: var(--brass); }
  .mobile-nav .icon { width: 19px; height: 19px; }
  .mobile-nav em { font-style: normal; }

  .toast-region { bottom: calc(var(--player-height) + var(--mobile-nav-height) + 14px); right: 12px; }

  .shortcut-grid { grid-template-columns: 1fr; padding: 12px 20px; }
  .dialog { max-height: 90vh; }
  .dialog-head { padding: 17px 20px 13px; }
  .dialog-foot { padding: 12px 20px; }
  .queue-play { padding-left: 14px; }
}

@media (max-width: 460px) {
  .topbar-brand span:last-child { display: none; }
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; }
  .hero { padding: 24px 18px 22px; }
  .hero h1 { font-size: clamp(2.4rem, 12vw, 3.2rem); }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .hero-art { min-height: 170px; }
  .detail-art { max-width: 220px; }
  .result-line { flex-direction: column; align-items: flex-start; gap: 2px; }
  .pagination { gap: 8px; }
  .pagination span { font-size: 10px; }
}

/* ---------------------------------------------------------- Reduced motion -- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .hero-disc { animation: none; }
}

/* ==========================================================================
   Admin
   ========================================================================== */

.admin-body .content { max-width: 1320px; }

.login-screen {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 140px);
  padding: 20px;
}
.login-card {
  width: min(430px, 100%);
  padding: 34px 32px 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(70% 60% at 100% 0%, var(--brass-wash), transparent 60%),
    var(--panel);
  box-shadow: var(--shadow-lg);
}
.login-card .brand { justify-content: center; border-bottom: 0; padding-bottom: 8px; }
.login-logo { display: block; width: min(260px, 100%); height: auto; margin: 0 auto 4px; filter: drop-shadow(0 10px 24px var(--brass-wash)); }
.login-logo-mark { width: 72px; height: 72px; margin: 0 auto 6px; }
.login-card h1 { margin: 8px 0 6px; font-family: var(--font-display); font-size: 2rem; font-weight: 500; text-align: center; }
.login-card p { margin-bottom: 22px; color: var(--muted); font-size: 12.5px; text-align: center; }

.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .third { grid-column: span 1; }
.input-field,
.textarea-field,
.select-field {
  width: 100%;
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
}
.textarea-field { min-height: 92px; resize: vertical; line-height: 1.5; }
.input-field:focus,
.textarea-field:focus,
.select-field:focus {
  outline: 0;
  border-color: var(--brass-line);
  box-shadow: 0 0 0 3px var(--brass-wash);
}
.form-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.form-hint { margin-top: 4px; color: var(--faint); font-size: 10.5px; }
.form-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 4px; }

.tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 24px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in oklab, var(--panel) 55%, transparent);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 17px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  transition: all .18s var(--ease);
}
.tab .icon { width: 15px; height: 15px; }
.tab:hover { color: var(--ink); background: color-mix(in oklab, var(--ink) 6%, transparent); }
.tab.is-active { background: var(--brass); color: var(--accent-ink); box-shadow: 0 8px 18px -10px oklch(0.79 0.12 78 / .7); }

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in oklab, var(--panel) 55%, transparent);
}
.panel + .panel { margin-top: 18px; }
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.panel-head h2 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 500; letter-spacing: -.02em; }
.panel-head p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.split-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 18px; align-items: start; }

.dropzone {
  position: relative;
  display: flex;
  min-height: 150px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 26px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: color-mix(in oklab, var(--panel) 40%, transparent);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: all .18s var(--ease);
}
.dropzone:hover,
.dropzone.is-dragover { border-color: var(--brass-line); background: var(--brass-wash); color: var(--ink-2); }
.dropzone .icon { width: 26px; height: 26px; color: var(--brass); }
.dropzone strong { color: var(--ink); font-size: 13.5px; }
.dropzone span { font-size: 11.5px; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.progress-track {
  height: 6px;
  margin-top: 12px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--brass); transition: width .2s var(--ease); }

.data-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--panel) 42%, transparent);
  overflow-x: auto;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .14em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.data-table td { padding: 10px 14px; border-bottom: 1px solid color-mix(in oklab, var(--line) 58%, transparent); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: color-mix(in oklab, var(--ink) 3.5%, transparent); }
.data-table .row-title { font-weight: 620; }
.data-table .row-sub { color: var(--muted); font-size: 10.5px; }
.data-table .actions { display: flex; gap: 4px; justify-content: flex-end; }
.table-thumb { width: 38px; height: 38px; border-radius: 5px; }
.table-thumb .artwork-fallback { font-size: 13px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--muted) 14%, transparent);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
}
.badge-success { background: var(--success-wash); color: var(--success); }
.badge-warning { background: var(--warning-wash); color: var(--warning); }
.badge-danger { background: var(--danger-wash); color: var(--danger); }
.badge-info { background: var(--info-wash); color: var(--info); }
.badge-brass { background: var(--brass-wash); color: var(--brass); }

.admin-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.admin-stat {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--panel) 52%, transparent);
}
.admin-stat strong { display: block; font-family: var(--font-display); font-size: 1.9rem; font-weight: 500; line-height: 1; }
.admin-stat span { color: var(--muted); font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }

.admin-toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-toolbar .search-box { max-width: 340px; flex: 1; height: 38px; }
.admin-toolbar .spacer { flex: 1; }

.image-picker { display: flex; align-items: center; gap: 12px; }
.image-picker .artwork { width: 64px; height: 64px; flex: 0 0 64px; }

.check-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.check-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brass); }

.empty-mini { padding: 26px 16px; color: var(--muted); font-size: 12.5px; text-align: center; }

.log-row { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid color-mix(in oklab, var(--line) 50%, transparent); font-size: 11.5px; }
.log-row:last-child { border-bottom: 0; }
.log-time { color: var(--faint); font-family: var(--font-mono); font-size: 9.5px; white-space: nowrap; }

.admin-help { color: var(--muted); font-size: 11.5px; line-height: 1.65; }
.admin-help code { padding: 1px 5px; border-radius: 4px; background: var(--panel-2); font-family: var(--font-mono); font-size: 10.5px; }

@media (max-width: 1000px) {
  .split-grid { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .panel { padding: 16px; }
  .panel-head { flex-direction: column; gap: 8px; }
  .admin-tracks .col-cover,
  .admin-tracks .col-num { display: none; }
}

/* ==========================================================================
   Admin extensions
   ========================================================================== */

.admin-body .topbar { grid-template-columns: minmax(0, 1fr) auto; }
.admin-body .content { max-width: 1320px; }

.admin-crumb { display: flex; min-width: 0; flex-direction: column; gap: 1px; }
.admin-crumb .eyebrow { margin-bottom: 0; font-size: 8.5px; letter-spacing: .2em; }
.admin-crumb-title {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-user { color: var(--muted); font-size: 11px; white-space: nowrap; }
.admin-room-link { display: inline-flex; }

.dialog-wide { width: min(880px, calc(100vw - 32px)); }
.dialog-body {
  max-height: 62vh;
  padding: 20px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.dialog-wide .dialog-body { max-height: 64vh; }
.dialog-copy { color: var(--ink-2); font-size: 13px; line-height: 1.68; }
.dialog-copy + .dialog-copy { margin-top: 9px; }
.dialog-note { color: var(--faint); font-size: 10.5px; line-height: 1.55; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.dialog-foot .dialog-actions { margin-left: auto; }

.form-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid color-mix(in oklab, var(--line) 70%, transparent); }
.form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form-section h3 {
  margin-bottom: 11px;
  color: var(--brass);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.form-error { color: var(--danger); font-size: 11.5px; line-height: 1.5; }
.form-optional { color: var(--faint); font-size: 8.5px; font-weight: 600; letter-spacing: .04em; text-transform: none; }
.input-file { padding: 8px 10px; font-size: 10.5px; }
.input-file::file-selector-button {
  margin-right: 10px;
  padding: 6px 11px;
  border: 1px solid var(--brass-line);
  border-radius: 7px;
  background: var(--brass-wash);
  color: var(--brass);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.input-file::file-selector-button:hover { background: color-mix(in oklab, var(--brass) 18%, transparent); }

.row-check { width: 15px; height: 15px; accent-color: var(--brass); cursor: pointer; }
.row-check:disabled { cursor: not-allowed; opacity: .45; }

.data-table .col-check { width: 36px; padding-right: 4px; }
.data-table .col-cover { width: 54px; padding-right: 4px; }
.data-table .col-num { width: 68px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .col-actions { width: 116px; }
.data-table.admin-tracks { table-layout: fixed; }
.data-table.admin-crawl { table-layout: fixed; }
.admin-crawl .col-actions { width: 86px; }

.cell-title { overflow: hidden; max-width: 100%; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { overflow: hidden; max-width: 100%; color: var(--muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.cell-alt { color: var(--faint); }
.cell-url { font-family: var(--font-mono); font-size: 9.5px; }
.cell-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-selection { margin-right: 4px; font-size: 11px; }

.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.row-action {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  transition: all .16s var(--ease);
}
.row-action:hover { color: var(--brass); border-color: var(--brass-line); background: var(--brass-wash); }
.row-action-danger:hover { color: var(--danger); border-color: color-mix(in oklab, var(--danger) 34%, transparent); background: var(--danger-wash); }
.row-action .icon { width: 15px; height: 15px; }
.pager-actions { display: flex; align-items: center; gap: 8px; }

.taxonomy-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 9px; }
.taxonomy-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid color-mix(in oklab, var(--line) 78%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--bg) 34%, transparent);
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.taxonomy-item:hover { border-color: var(--brass-line); background: var(--brass-wash); }
.taxonomy-thumb { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 6px; }
.taxonomy-thumb .artwork-fallback { font-size: 14px; }
.taxonomy-item-body { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 1px; }
.taxonomy-item-body .cell-title { font-size: 12.5px; }
.taxonomy-item-meta { color: var(--faint); font-size: 10px; }
.taxonomy-item .row-action { width: 28px; height: 28px; flex: 0 0 28px; }

.upload-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.upload-limit { margin-left: auto; font-size: 10.5px; }
.upload-hint { display: flex; flex-direction: column; gap: 6px; padding-left: 16px; color: var(--muted); font-size: 11.5px; line-height: 1.55; }
.upload-hint li::marker { color: var(--brass); }
.upload-summary { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0 10px; }
.upload-list { display: flex; flex-direction: column; gap: 7px; }
.upload-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--panel) 44%, transparent);
}
.upload-art { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 5px; }
.upload-art .artwork-fallback { font-size: 13px; }
.upload-item-body { min-width: 0; flex: 1; }
.upload-errors { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.upload-error { display: flex; gap: 7px; color: var(--warning); font-size: 11px; line-height: 1.55; }
.upload-error .icon { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 1px; }
.dropzone.is-busy { pointer-events: none; opacity: .6; }

.status-line { display: flex; min-height: 18px; align-items: center; gap: 6px; margin-top: 10px; color: var(--muted); font-size: 11.5px; line-height: 1.55; }
.status-line.is-success { color: var(--success); }
.status-line.is-warning { color: var(--warning); }
.status-line.is-error { color: var(--danger); }
.status-line.is-busy { color: var(--brass); }

.progress-track.is-indeterminate span { width: 34% !important; animation: admin-progress-slide 1.25s ease-in-out infinite; }
@keyframes admin-progress-slide {
  0% { transform: translateX(-130%); }
  100% { transform: translateX(330%); }
}

.empty-state { display: flex; max-width: 440px; flex-direction: column; align-items: center; gap: 8px; margin: 0 auto; padding: 48px 24px; text-align: center; }
.empty-state .eyebrow { margin: 0; }
.empty-state h1,
.empty-state h2 { font-family: var(--font-display); font-size: 1.75rem; font-weight: 500; letter-spacing: -.02em; line-height: 1.15; }
.empty-state .muted { font-size: 12.5px; line-height: 1.6; }
.empty-state .btn { margin-top: 6px; }

.stream-health { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.stream-preview { width: 100%; margin: 2px 0 12px; }
.stream-preview-url { overflow-wrap: anywhere; font-family: var(--font-mono); font-size: 10px; }

.crawl-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.crawl-url { min-width: 240px; flex: 1; }
.crawl-toolbar { margin: 14px 0 10px; }

.maintenance-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.maintenance-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(80% 70% at 100% 0%, var(--brass-wash), transparent 62%),
    color-mix(in oklab, var(--panel) 48%, transparent);
}
.maintenance-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--brass-line);
  border-radius: 10px;
  background: var(--brass-wash);
  color: var(--brass);
}
.maintenance-icon .icon { width: 18px; height: 18px; }
.maintenance-card h2 { font-family: var(--font-display); font-size: 1.35rem; font-weight: 500; letter-spacing: -.015em; }
.maintenance-card > p { color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.maintenance-card .btn { margin-top: auto; }
.health-list { display: flex; width: 100%; flex-direction: column; }
.health-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid color-mix(in oklab, var(--line) 58%, transparent); font-size: 11.5px; }
.health-row:last-child { border-bottom: 0; }
.log-list { display: flex; flex-direction: column; }
.log-status { margin-left: auto; flex: 0 0 auto; }

#libraryTable.is-loading { opacity: .6; }
#tabPanel[aria-busy="true"] { cursor: progress; }

@media (max-width: 1100px) {
  .hide-md { display: none !important; }
}

@media (max-width: 860px) {
  .admin-body .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .admin-body .content { padding-bottom: 44px; }
  .admin-user { display: none; }
}

@media (max-width: 760px) {
  .hide-sm { display: none !important; }
  .maintenance-grid { grid-template-columns: 1fr; }
  .taxonomy-list { grid-template-columns: 1fr; }
  .dialog-wide { width: calc(100vw - 20px); }
  .dialog-body { padding: 16px 18px; }
  .dialog-foot { padding: 12px 18px; }
  .dialog-actions { width: 100%; }
  .dialog-foot .dialog-note { display: none; }
  .admin-room-link span:last-child { display: none; }
  .admin-tracks .col-cover,
  .admin-tracks .col-num,
  .admin-crawl .col-cover { display: none; }
  .data-table th,
  .data-table td { padding: 9px 10px; }
}

@media (max-width: 520px) {
  .admin-room-link { display: none; }
  .crawl-form { flex-direction: column; align-items: stretch; }
  .crawl-form .btn { width: 100%; }
  .upload-limit { margin-left: 0; }
  .admin-tracks .col-actions { width: 96px; }
  .row-action { width: 28px; height: 28px; }
}

/* --------------------------------------------------------- activity stats -- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(90% 70% at 100% 0%, var(--brass-wash), transparent 60%),
    color-mix(in oklab, var(--panel) 48%, transparent);
}
.stat-card-head { display: flex; align-items: center; gap: 8px; }
.stat-card-icon,
.chart-card-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid var(--brass-line);
  border-radius: 8px;
  background: var(--brass-wash);
  color: var(--brass);
}
.stat-card-icon .icon,
.chart-card-icon .icon { width: 15px; height: 15px; }
.stat-card-label { margin: 0; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .01em; }
.stat-card-value { margin: 0; font-family: var(--font-display); font-size: 1.7rem; font-weight: 500; letter-spacing: -.02em; line-height: 1.1; }
.stat-card-sub { margin-top: 2px; display: flex; flex-wrap: wrap; gap: 6px; }
.stat-card-sub .badge { display: inline-flex; align-items: center; gap: 4px; }
.stat-card-sub .badge .icon { width: 12px; height: 12px; }

.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.chart-grid-wide { align-items: start; }
.chart-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in oklab, var(--panel) 48%, transparent);
  min-width: 0;
}
.chart-card-head { display: flex; flex-direction: column; gap: 2px; }
.chart-card-head-icon { flex-direction: row; align-items: center; gap: 8px; }
.chart-card-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.15rem; font-weight: 500; letter-spacing: -.01em; }
.chart-card-body { min-width: 0; }

.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-chart-list { gap: 9px; }
.bar-row { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.bar-row-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 11.5px; }
.bar-row-meta > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row-meta .bar-label { max-width: 100%; }
.bar-row-meta strong { flex: 0 0 auto; font-weight: 600; }
.bar-track {
  position: relative;
  display: flex;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--line) 55%, transparent);
  overflow: hidden;
}
.bar-track-stacked { height: 12px; }
.bar-fill {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: 999px;
  transition: width .35s ease;
}
.bar-fill.is-success { background: var(--success); }
.bar-fill.is-danger { background: var(--danger); }
.bar-fill.is-warning { background: color-mix(in oklab, var(--brass-2) 85%, var(--danger)); }
.bar-fill.is-brass { background: linear-gradient(90deg, var(--brass-dim), var(--brass)); }
.bar-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 10.5px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.legend-dot.is-success { background: var(--success); }
.legend-dot.is-danger { background: var(--danger); }

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