/* ═══════════════════════════════════════════════════════════════════════════
   AFUROTAKU DJ: design tokens + component styles.
   Light, easy-on-the-eyes cream ground, the Afurotaku poster palette, heavy Geist
   headings, white cards, and 16px minimum text so it reads from across a room.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #FDFCFA;
  --ink: #1a1a1f;
  --ink-2: #33333b;
  --muted: #55555f;
  --line: #DAD6E6;
  --line-strong: #CFC8E3;
  --tint: #F3EEFF;
  --tint-2: #EDE7FF;
  --card: #ffffff;

  --indigo: #432c8c;
  --indigo-ink: #2a1b66;
  --pink: #d32f6a;
  --pink-ink: #b3245a;
  --amber: #e08c00;
  --amber-ink: #a85f00;
  --teal: #1f9486;
  --teal-ink: #177a6e;
  --teal-tint: #E3F4F1;
  --lav: #a78bfa;
  --spotify: #1db954;
  --warn-tint: #FFF0D1;
  --err-tint: #FDE8EF;

  --accent: #432c8c;
  --accent-dim: #432c8c30;

  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --beat: 0.667s;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --shadow: 0 10px 30px rgba(67, 44, 140, 0.08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink);
  font-size: 17px; line-height: 1.45;
}
a { color: var(--indigo); }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; }

.wrap { max-width: 1152px; width: 100%; margin: 0 auto; padding: 0 24px; }
.right { text-align: right; }
.muted { color: var(--muted); }
.label {
  display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--indigo);
}
.label::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--pink); }
.label.teal::before { background: var(--teal); }
.label.plain::before { display: none; }

/* HTMX busy labels */
.lbl-busy { display: none; }
.htmx-request .lbl-idle, .htmx-request.lbl-idle { display: none; }
.htmx-request .lbl-busy { display: inline; }

@keyframes vzBeat { 0% { transform: scale(1.35); } 38% { transform: scale(1); } 100% { transform: scale(1); } }
@keyframes vzDrift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(48px, 20px); } }
@keyframes vzDriftB { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-44px, 16px); } }
@keyframes vzRing { 0% { transform: translate(-50%, -50%) scale(0.15); opacity: 0.55; } 100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } }
@keyframes barShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ── Colour bar + loading bar ───────────────────────────────────────────── */
.cbar { display: flex; height: 12px; }
.cbar i { flex: 1; }
.cbar i:nth-child(1) { background: var(--indigo); }
.cbar i:nth-child(2) { background: var(--pink); }
.cbar i:nth-child(3) { background: var(--amber); }
.cbar i:nth-child(4) { background: var(--teal); }
.cbar i:nth-child(5) { background: var(--lav); }
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 9999; height: 4px; background: transparent; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.topbar.on { opacity: 1; }
.topbar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--indigo), var(--pink), var(--amber)); background-size: 200% 100%; transition: width 0.25s ease; }
.topbar.busy .topbar-fill { animation: barShimmer 1s linear infinite; }

/* ── Shared buttons ─────────────────────────────────────────────────────── */
.btn, .btn-grad, .btn-outline, .btn-ghost, .btn-accent, .btn-spotify, .btn-line, .btn-del {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  min-height: 52px; padding: 0 28px; border-radius: 28px; font-size: 18px; font-weight: 800; border: 2px solid transparent;
}
.btn-grad, .btn-accent, .btn { background: var(--indigo); color: #fff; }
.btn-grad:hover:not(:disabled), .btn-accent:hover:not(:disabled) { background: var(--indigo-ink); }
.btn-grad:disabled, .btn-accent:disabled { opacity: 0.45; }
.btn-outline, .btn-ghost, .btn-line { background: #fff; color: var(--indigo); border-color: var(--indigo); }
.btn-outline:hover, .btn-ghost:hover, .btn-line:hover { background: var(--tint); }
.btn-spotify { background: var(--spotify); color: #0b0b0f; }
.btn-spotify:hover { filter: brightness(1.06); }
.btn-spotify:disabled { opacity: 0.6; }
.btn-del { background: #fff; color: var(--pink-ink); border-color: var(--pink); }
.btn-grad.small, .btn-line.small, .btn-spotify.small { min-height: 44px; padding: 0 20px; font-size: 16px; }
.btn-grad.full, .btn-spotify.full, .btn-outline.full { width: 100%; }

.form-error { background: var(--err-tint); border-radius: var(--r-md); padding: 14px 18px; margin: 12px 0; color: #8c1a47; font-size: 17px; }
.push-ok { color: var(--teal-ink); font-weight: 700; font-size: 17px; }
.push-ok a { color: var(--teal-ink); }
.empty-all { text-align: center; padding: 80px 20px; color: var(--muted); font-size: 18px; }
.empty-inline { padding: 24px; color: var(--muted); text-align: center; border: 2px dashed var(--line); border-radius: var(--r-md); }
mark { background: #FFE3A3; color: var(--ink); border-radius: 3px; padding: 0 2px; }

.notice { font-size: 17px; font-weight: 600; margin: 0 0 14px; padding: 12px 16px; border-radius: var(--r-md); }
.notice.ok { background: var(--teal-tint); color: #0f5c52; }
.notice.warn { background: var(--warn-tint); color: #6b4000; }

.pager { display: flex; align-items: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.pager-info { font-size: 17px; color: var(--muted); margin-right: auto; }
.pager-info b { color: var(--ink); }
.pager a, .pager button {
  min-height: 52px; padding: 0 26px; border-radius: 26px; font-size: 17px; font-weight: 700; text-decoration: none;
  border: 2px solid var(--line-strong); background: #fff; color: var(--indigo); display: inline-flex; align-items: center;
}
.pager .next { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.pager button:disabled, .pager .off { color: #8a8499; background: #fff; border-color: var(--line-strong); pointer-events: none; }

/* ═══ VIEWER ═══════════════════════════════════════════════════════════════ */
.viewer { min-height: 100vh; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 24px; min-height: 84px; border-bottom: 1px solid var(--line); flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { font-size: 34px; font-weight: 900; letter-spacing: -0.05em; color: var(--indigo); text-decoration: none; }
.top .label { color: var(--muted); }
.top .label::before { display: none; }
.stats { font-size: 18px; color: var(--muted); }
.stats b { font-weight: 800; }
.stats .s1 { color: var(--pink); } .stats .s2 { color: var(--teal-ink); } .stats .s3 { color: var(--amber-ink); }

.conn { display: inline-flex; align-items: center; gap: 10px; }
.conn-link, .conn-btn, .conn-pill {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 24px;
  font-size: 17px; font-weight: 800; text-decoration: none; border: 2px solid transparent; background: none;
}
.conn-link { background: var(--spotify); color: #0b0b0f; }
.conn-btn { background: #fff; color: var(--teal-ink); border-color: var(--teal); }
.conn-pill { color: var(--muted); }

.setbar { padding-top: 16px; padding-bottom: 8px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.set-label { font-size: 15px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.set-pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 22px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink-2); font-size: 17px; font-weight: 600; text-decoration: none;
}
.set-pill img { border-radius: 4px; }
.set-pill.on { background: var(--indigo); border-color: var(--indigo); color: #fff; font-weight: 700; }
.set-pill .cnt { opacity: 0.8; font-weight: 500; }
.setbar-actions { margin-left: auto; display: inline-flex; gap: 22px; flex-wrap: wrap; }
.text-link { font-size: 17px; font-weight: 700; color: var(--teal-ink); background: none; border: none; padding: 0; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.text-link:hover { text-decoration: underline; }

/* Visualizer stage: soft colour washes pulse on the track's BPM; the live MilkDrop
   canvas takes over once Spotify is connected. */
.stage { position: relative; height: 220px; margin: 16px auto 0; max-width: 1104px; width: calc(100% - 48px); border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: var(--tint); }
.stage-blob { position: absolute; border-radius: 50%; filter: blur(34px); opacity: 0.8; width: 260px; height: 260px; animation: vzBeat var(--beat) ease-out infinite; }
.stage-blob.b1 { left: 6%; top: 25%; background: var(--pink); }
.stage-blob.b2 { left: 28%; top: -35%; width: 310px; height: 310px; background: var(--lav); animation: vzDrift 9s ease-in-out infinite; }
.stage-blob.b3 { left: 52%; top: 30%; background: var(--teal); animation-delay: calc(var(--beat) / 2); }
.stage-blob.b4 { left: 76%; top: -25%; width: 280px; height: 280px; background: var(--amber); animation: vzDriftB 11s ease-in-out infinite; }
.stage-blob.b5 { left: 42%; top: 10%; width: 210px; height: 210px; background: var(--indigo); animation-delay: calc(var(--beat) / 2); }
.stage-ring { position: absolute; left: 50%; top: 50%; width: 440px; height: 440px; border-radius: 50%; border: 3px solid rgba(67, 44, 140, 0.4); animation: vzRing calc(var(--beat) * 2) ease-out infinite; }
.stage-ring.r2 { animation-delay: var(--beat); }
.milk { position: absolute; inset: 0; background: #14102b; }
.milk canvas { width: 100%; height: 100%; display: block; }
.stage-label, .stage-cap { position: absolute; left: 20px; font-weight: 700; color: var(--indigo-ink); z-index: 2; }
.stage.live .stage-label, .stage.live .stage-cap { color: #E9E2FF; }
.stage-label { top: 16px; font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase; }
.stage-cap { bottom: 16px; font-size: 18px; }

.layout { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 40px; align-items: start; padding-top: 32px; padding-bottom: 56px; }

.player {
  background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 28px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px;
}
.status-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--indigo); }
.pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pink); animation: pulse 1.6s ease-in-out infinite; }
.status-line .muted { text-transform: none; letter-spacing: 0; font-size: 16px; }
.p-art { aspect-ratio: 1; width: 100%; border-radius: 18px; background: var(--tint-2); display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.p-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-art-ph { color: var(--indigo); display: flex; }
.p-art-ph svg { width: 110px; height: 110px; }
.hero-text.fade { animation: fadeIn 0.3s ease; }
.hero-title { margin: 0; font-size: 34px; font-weight: 800; line-height: 1.05; letter-spacing: -0.03em; }
.hero-artist { font-size: 21px; font-weight: 600; color: var(--indigo); margin-top: 4px; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.chip { background: var(--tint); color: var(--indigo); font-size: 16px; font-weight: 700; padding: 5px 14px; border-radius: 20px; }
.hero-note { font-size: 18px; line-height: 1.5; color: var(--ink-2); margin-top: 12px; }

.p-prog { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 600; color: var(--ink-2); margin-top: 6px; font-variant-numeric: tabular-nums; }
.pc-bar { flex: 1; height: 8px; background: #E6E1F2; border-radius: 4px; position: relative; cursor: pointer; }
.pc-fill { height: 8px; width: 0; background: var(--indigo); border-radius: 4px; }
.pc-knob { position: absolute; top: -6px; left: 0; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: var(--indigo); }
.p-ctl { display: flex; align-items: center; justify-content: center; gap: 28px; }
.round { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--indigo); background: #fff; color: var(--indigo); font-size: 28px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.round:disabled { opacity: 0.35; }
.pc-play { width: 76px; height: 76px; border-radius: 50%; border: none; background: var(--indigo); color: #fff; font-size: 26px; display: inline-flex; align-items: center; justify-content: center; }
.pc-play:disabled { background: #B9B2D4; }
.pc-vol { display: flex; align-items: center; gap: 12px; font-size: 16px; color: var(--muted); }
.pc-vol input { flex: 1; accent-color: var(--indigo); height: 28px; }
.locked .p-prog, .locked .pc-vol { opacity: 0.4; }

.login-box { background: var(--tint); border-radius: var(--r-md); padding: 16px; display: flex; flex-direction: column; gap: 12px; font-size: 18px; line-height: 1.45; color: var(--indigo-ink); }
.login-box .btn-spotify { width: 100%; min-height: 56px; font-size: 19px; }
.embed { position: relative; border-radius: var(--r-md); overflow: hidden; background: var(--tint); min-height: 152px; }
.embed iframe { display: block; border: 0; width: 100%; }
.open-link { font-size: 17px; font-weight: 700; text-align: center; }
.hint { font-size: 16px; color: var(--muted); text-align: center; }
.push-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Track list */
.tracklist { min-width: 0; }
.act-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.act-pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 22px;
  border: 2px solid var(--c, var(--indigo)); background: #fff; color: var(--ink); font-size: 16px; font-weight: 700;
}
.act-pill i { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--indigo)); }
.act-pill.current { background: var(--tint-2); }
.search-box { position: relative; margin-top: 20px; }
.search-box input {
  width: 100%; min-height: 56px; border: 2px solid var(--line-strong); background: #fff; border-radius: var(--r-md);
  padding: 0 52px 0 20px; font-size: 19px;
}
.search-box input::placeholder { color: var(--muted); }
.search-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: none; background: transparent; font-size: 26px; color: var(--muted); }
.match-count { margin-top: 14px; font-size: 17px; font-weight: 700; color: var(--teal-ink); }
.match-count.none { color: var(--pink-ink); }
.act-block { margin-top: 28px; }
.act-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.act-badge { font-size: 15px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--pink); }
.act-name { font-size: 36px; font-weight: 900; letter-spacing: -0.04em; text-transform: capitalize; }
.act-count { font-size: 17px; color: var(--muted); }
.act-block > .row:first-of-type { margin-top: 8px; }
.row { display: flex; align-items: center; gap: 18px; min-height: 108px; padding: 0 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.row:hover { background: #faf8ff; }
.row.active { background: var(--tint-2); border-radius: 12px; }
.row-art { position: relative; width: 56px; flex: none; }
.row-art img { width: 56px; height: 56px; border-radius: 10px; display: block; object-fit: cover; }
.row-num { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; color: var(--indigo); }
.row-ov { display: none; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 22px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-artist { font-size: 17px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-genre { font-size: 16px; font-weight: 700; color: var(--indigo); flex: none; }
.row-bpm { width: 96px; text-align: right; font-size: 18px; font-weight: 800; color: var(--amber-ink); flex: none; }
.meter { display: none; }
.row-link { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); text-decoration: none; font-size: 20px; flex: none; border-radius: 50%; }
.row-link:hover { background: var(--tint); color: var(--indigo); }
.empty-search { text-align: center; padding: 56px 20px; color: var(--muted); font-size: 18px; }

/* Import modal */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(26, 26, 31, 0.5); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-card { background: #fff; border-radius: 24px; padding: 32px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); }
.modal-title { font-size: 30px; font-weight: 900; letter-spacing: -0.04em; color: var(--indigo); margin-bottom: 8px; }
.modal-copy { font-size: 18px; line-height: 1.5; color: var(--ink-2); margin: 0 0 16px; }
.modal-input { width: 100%; min-height: 56px; border: 2px solid var(--line-strong); border-radius: var(--r-md); padding: 0 16px; font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 18px; }

/* ═══ ADMIN SHELL + FORMS ══════════════════════════════════════════════════ */
.admin-bar { display: flex; align-items: center; gap: 24px; min-height: 84px; max-width: 1152px; margin: 0 auto; padding: 8px 24px; border-bottom: 1px solid var(--line); }
.admin-bar .tag { font-size: 15px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.bar-back { font-size: 17px; font-weight: 700; color: var(--muted); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.admin-wrap { max-width: 1152px; margin: 0 auto; padding: 32px 24px 72px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-title { margin: 0; font-size: 60px; font-weight: 900; line-height: 0.95; letter-spacing: -0.05em; color: var(--indigo); }
.tabs { display: flex; gap: 36px; border-bottom: 1px solid var(--line); margin-top: 22px; }
.tab { font-size: 20px; font-weight: 600; color: var(--muted); padding: 10px 0 14px; text-decoration: none; }
.tab.on { font-weight: 800; color: var(--indigo); border-bottom: 5px solid var(--indigo); margin-bottom: -1px; }

.stat-line { margin: 22px 0 18px; font-size: 19px; color: var(--ink-2); }
.stat-line b.a { color: var(--pink); } .stat-line b.b { color: var(--amber-ink); } .stat-line b.c { color: var(--indigo); }
.filter-bar { display: flex; gap: 16px; flex-wrap: wrap; }
.filter-bar .search-box { margin: 0; flex: 1; min-width: 240px; }
.select {
  min-height: 60px; border: 2px solid var(--line-strong); background: #fff; border-radius: var(--r-md);
  padding: 0 16px; font-size: 18px; font-weight: 700; min-width: 190px;
}

.adm-table { margin-top: 24px; }
.adm-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 90px 150px 120px 90px; gap: 20px; align-items: center; min-height: 96px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.adm-head { min-height: 48px; border-bottom: 2px solid var(--ink); font-size: 14px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.adm-pos { font-size: 24px; font-weight: 800; color: var(--indigo); }
.adm-title { font-size: 21px; font-weight: 700; }
.adm-artist { font-size: 17px; color: var(--muted); }
.adm-bpm { font-size: 18px; font-weight: 800; color: var(--amber-ink); }
.adm-genre { font-size: 17px; font-weight: 700; color: var(--indigo); }
.adm-id { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; color: var(--amber-ink); }
.adm-id.has { color: var(--teal-ink); }
.adm-id .dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.adm-actions { display: flex; justify-content: flex-end; }
.adm-edit { display: inline-flex; align-items: center; min-height: 48px; padding: 0 26px; border-radius: 24px; border: 2px solid var(--indigo); background: #fff; color: var(--indigo); font-size: 17px; font-weight: 700; text-decoration: none; }
.adm-edit:hover { background: var(--tint); }
.adm-edit.spot { border-color: var(--teal); color: var(--teal-ink); }
.adm-del { background: none; border: none; color: var(--pink-ink); font-size: 17px; font-weight: 700; min-height: 48px; padding: 0 8px; text-decoration: none; display: inline-flex; align-items: center; }

.set-list { margin-top: 20px; }
.set-row { display: flex; align-items: center; gap: 20px; min-height: 120px; border-bottom: 1px solid var(--line); flex-wrap: wrap; padding: 12px 0; }
.set-cover { width: 72px; height: 72px; flex: none; border-radius: 16px; background: var(--tint-2); display: flex; align-items: center; justify-content: center; color: var(--indigo); font-size: 28px; overflow: hidden; }
.set-cover img { width: 100%; height: 100%; object-fit: cover; }
.set-info { flex: 1; min-width: 180px; }
.set-name { font-size: 24px; font-weight: 800; }
.set-kind { font-size: 18px; color: var(--muted); }
.set-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.set-msg { font-size: 16px; }

.tform-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }
.tform-title { margin: 0; font-size: 64px; font-weight: 900; line-height: 0.95; letter-spacing: -0.05em; color: var(--indigo); }
.tform-sub { margin: 0; font-size: 21px; line-height: 1.5; color: var(--ink-2); max-width: 760px; }
.tform-badges { display: flex; align-items: center; gap: 12px; }
.act-tag { background: var(--indigo); color: #fff; font-size: 16px; font-weight: 800; padding: 6px 14px; border-radius: 8px; }
.tform-actname { font-size: 17px; font-weight: 700; color: var(--indigo); }
.form-card { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 32px; display: flex; flex-direction: column; gap: 24px; box-shadow: var(--shadow); }
.narrow { max-width: 880px; margin: 0 auto; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 20px; }
.ffield { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ffield.full { grid-column: 1 / -1; }
.flabel { font-size: 17px; font-weight: 700; display: flex; align-items: baseline; }
.flabel-aside { margin-left: auto; font-size: 16px; font-weight: 400; color: var(--muted); }
.ffield input, .ffield textarea, .ffield select {
  width: 100%; min-height: 60px; border: 2px solid var(--line-strong); border-radius: var(--r-md); padding: 0 20px; font-size: 20px; background: #fff;
}
.ffield textarea { padding: 16px 20px; line-height: 1.7; font-size: 19px; resize: vertical; }
.ffield input::placeholder, .ffield textarea::placeholder { color: #6b6578; }
.ffield input.has-id { border-color: var(--teal); }
.lookup-box { background: var(--teal-tint); border-radius: 18px; padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.lookup-box .flabel { color: #0f5c52; font-weight: 800; }
.lookup-in { display: flex; gap: 12px; }
.lookup-in input { flex: 1; min-height: 60px; border: 2px solid #7cc9bd; border-radius: var(--r-md); padding: 0 20px; font-size: 18px; background: #fff; min-width: 0; }
.btn-fetch { min-height: 60px; padding: 0 30px; border-radius: 30px; border: none; background: var(--teal-ink); color: #fff; font-size: 18px; font-weight: 800; }
.lookup-card { display: flex; gap: 14px; align-items: center; margin-top: 8px; }
.lookup-card img { border-radius: 10px; }
.lookup-ok { color: var(--teal-ink); font-weight: 800; }
.lookup-meta, .lookup-tags { font-size: 16px; color: var(--ink-2); }
.lookup-meta .warn { color: var(--amber-ink); font-weight: 700; }
.lookup-err { color: #8c1a47; font-weight: 700; }
.tform-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* Playlist builder */
.steps { display: flex; align-items: center; gap: 14px; max-width: 880px; margin: 0 auto 36px; }
.step { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; color: var(--muted); }
.step b { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line-strong); background: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 800; }
.step.on { color: var(--ink); font-weight: 800; }
.step.on b { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.step.done b { background: var(--teal-tint); border-color: var(--teal-ink); color: var(--teal-ink); }
.step-line { flex: 1; height: 2px; background: var(--line); }
.pl-formats { background: var(--tint); border-radius: var(--r-md); padding: 16px 20px; font-size: 17px; line-height: 1.6; color: var(--indigo-ink); }
.pl-formats summary { font-weight: 800; cursor: pointer; }
.pl-formats ul { margin: 8px 0 0; padding-left: 20px; }
.pl-formats code { background: #fff; padding: 1px 6px; border-radius: 6px; }
.pl-preview { margin-top: 32px; }
.pl-summary { display: flex; align-items: flex-end; gap: 24px; margin-bottom: 8px; flex-wrap: wrap; }
.pl-count { font-size: 22px; font-weight: 800; }
.pl-notes { margin-left: auto; text-align: right; font-size: 16px; color: var(--muted); display: flex; flex-direction: column; }
.pl-rows { list-style: none; margin: 0; padding: 0; }
.pl-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 8px 18px; align-items: center; min-height: 116px; padding: 12px 8px; border-bottom: 1px solid var(--line); }
.pl-n { font-size: 22px; font-weight: 800; color: var(--indigo); }
.pl-chosen { display: flex; align-items: center; gap: 16px; min-width: 0; }
.pl-art { width: 60px; height: 60px; flex: none; border-radius: 12px; background: var(--tint-2); display: flex; align-items: center; justify-content: center; color: var(--indigo); overflow: hidden; }
.pl-art img { width: 100%; height: 100%; object-fit: cover; }
.pl-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pl-t { font-size: 21px; font-weight: 700; }
.pl-a { font-size: 17px; color: var(--muted); }
.pl-line { grid-column: 2 / 3; font-size: 16px; font-style: italic; color: #6b6578; }
.pl-ctl { display: flex; align-items: center; gap: 12px; grid-column: 3; grid-row: 1 / 3; }
.pl-more { background: none; border: none; color: var(--indigo); font-size: 17px; font-weight: 700; min-height: 44px; }
.pl-remove { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line-strong); background: #fff; color: var(--muted); font-size: 18px; font-weight: 700; }
.pl-cands { grid-column: 2 / -1; display: flex; flex-direction: column; gap: 8px; }
.pl-card { display: block; border: 2px solid var(--line); border-radius: var(--r-md); padding: 10px 14px; cursor: pointer; }
.pl-card:has(input:checked) { border-color: var(--indigo); background: var(--tint); }
.pl-card-body { display: flex; align-items: center; gap: 14px; }
.badge { font-size: 15px; font-weight: 800; padding: 6px 14px; border-radius: 20px; flex: none; }
.b-exact { background: var(--teal-tint); color: var(--teal-ink); }
.b-close, .b-check { background: var(--warn-tint); color: #8a4f00; }
.b-none { background: #ECEAF2; color: var(--muted); }
.pl-miss { display: flex; align-items: center; gap: 12px; }
.pl-miss-t { font-size: 21px; font-weight: 700; }
.pl-row.nomatch { opacity: 0.8; }
.pl-create { display: flex; align-items: center; gap: 20px; margin-top: 28px; background: var(--tint); border-radius: 20px; padding: 22px 28px; flex-wrap: wrap; }
.pl-check { display: flex; align-items: center; gap: 14px; font-size: 19px; font-weight: 600; color: var(--indigo-ink); flex: 1; }
.pl-check input { width: 28px; height: 28px; accent-color: var(--indigo); }
.pl-done { background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: 40px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; box-shadow: var(--shadow); }
.pl-done-h { font-size: 26px; font-weight: 800; color: var(--indigo); }
.pl-done-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

/* ═══ Responsive ═══════════════════════════════════════════════════════════ */
@media (max-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .player { position: static; }
  .adm-row { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 8px 14px; padding: 12px 8px; }
  .adm-head { display: none; }
  .adm-bpm, .adm-genre, .adm-id { grid-column: 2; font-size: 16px; }
  .adm-actions { grid-column: 3; grid-row: 1 / 3; }
}
@media (max-width: 640px) {
  .wrap, .admin-wrap, .admin-bar { padding-left: 16px; padding-right: 16px; }
  .brand { font-size: 26px; }
  .stage { height: 130px; width: calc(100% - 32px); }
  .stage-cap { font-size: 16px; bottom: 12px; }
  .page-title, .tform-title { font-size: 44px; }
  .act-name { font-size: 28px; }
  .row { min-height: 84px; gap: 12px; padding: 0 10px; }
  .row-title { font-size: 19px; }
  .row-genre, .row-link { display: none; }
  .row-bpm { width: auto; font-size: 16px; }
  .fgrid { grid-template-columns: minmax(0, 1fr); }
  .form-card { padding: 20px; }
  .lookup-in { flex-direction: column; }
  .steps .step span { display: none; }
  .pl-row { grid-template-columns: 24px minmax(0, 1fr); }
  .pl-ctl { grid-column: 2; grid-row: auto; justify-content: space-between; }
  .pl-line { grid-column: 2; }
  .p-ctl { gap: 18px; }
  .player { padding: 20px; }
}

/* ═══ Admin filters, pills, genre chips ════════════════════════════════════ */
.page-head .btn-grad, .page-head .btn-line { margin-bottom: 6px; }
.adm-main { display: flex; flex-direction: column; min-width: 0; }
.pill-group { display: flex; flex-wrap: wrap; gap: 10px; }
.pill input, .gchip input { position: absolute; opacity: 0; pointer-events: none; }
.pill, .gchip { position: relative; display: inline-flex; }
.pill span, .gchip span {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 20px; border-radius: 24px;
  border: 2px solid var(--line-strong); background: #fff; font-size: 17px; font-weight: 700; cursor: pointer;
}
.pill input:checked + span { background: var(--c); border-color: var(--c); color: #fff; }
.gchip input:checked + span { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.pill input:focus-visible + span, .gchip input:focus-visible + span { outline: 3px solid var(--lav); outline-offset: 2px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 10px; }
.pl-eyebrow { font-size: 15px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.pl-input { display: flex; flex-direction: column; gap: 22px; }
.pl-page { max-width: 880px; margin: 0 auto; }
.form-card .tform-actions { margin-top: 8px; }
.grow { flex: 1; }
