:root {
  color-scheme: dark;
  --bg: #0b0b0d;
  --bg-raised: #111114;
  --surface: #17171b;
  --surface-2: #1d1d22;
  --surface-3: #24242a;
  --line: #303038;
  --line-strong: #5f5f6b;
  --text: #f5f2ec;
  --muted: #aaa9b2;
  --muted-2: #85858f;
  --coral: #ff6b50;
  --coral-hover: #ff8069;
  --coral-soft: #361c1a;
  --green: #8ce3a4;
  --green-soft: #173222;
  --amber: #ffd37a;
  --amber-soft: #332815;
  --red: #ff8a8a;
  --red-soft: #3a1c20;
  --blue: #9bc6ff;
  --focus: #fff1a8;
  --rail-w: 224px;
  --panel-w: clamp(300px, 29vw, 430px);
  --player-h: 94px;
  --mobile-tabs-h: 68px;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 22px 70px rgb(0 0 0 / 42%);
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--bg); scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: clip;
  background:
    radial-gradient(circle at 72% -20%, rgb(255 107 80 / 9%), transparent 34rem),
    var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font);
  text-rendering: optimizeLegibility;
}

button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
img { display: block; max-width: 100%; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
}
.boot-screen p { color: var(--muted); margin: 4px 0; }

.brand-mark {
  width: 58px;
  height: 40px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
}
.brand-mark span {
  width: 7px;
  border-radius: 10px;
  background: var(--coral);
  animation: brand-pulse 1.2s ease-in-out infinite alternate;
}
.brand-mark span:nth-child(1) { height: 20px; }
.brand-mark span:nth-child(2) { height: 34px; animation-delay: -0.5s; }
.brand-mark span:nth-child(3) { height: 25px; animation-delay: -0.85s; }
.brand-mark.small { width: 28px; height: 24px; gap: 3px; }
.brand-mark.small span { width: 4px; }
.brand-mark.small span:nth-child(1) { height: 12px; }
.brand-mark.small span:nth-child(2) { height: 21px; }
.brand-mark.small span:nth-child(3) { height: 15px; }

@keyframes brand-pulse { to { transform: scaleY(.7); opacity: .72; } }

.wordmark {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.045em;
}
.wordmark span { color: var(--coral); }
.wordmark.small { font-size: 20px; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.auth-screen {
  min-height: 100vh;
  padding: 24px;
  display: grid;
  place-items: center;
}
.auth-panel { width: min(100%, 430px); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 52px; }
.auth-panel h1 { margin: 0 0 12px; font-size: clamp(34px, 7vw, 52px); line-height: 1; letter-spacing: -.045em; }
.auth-panel .lead { max-width: 35ch; margin: 0 0 30px; color: var(--muted); font-size: 17px; }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-weight: 700; }
.field input, .field select, .admin-create input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}
.field input::placeholder { color: var(--muted-2); }
.field small { color: var(--muted); }
.field-error { min-height: 24px; margin: 8px 0 0; color: var(--red); }
.code-input { font-size: 27px; letter-spacing: .32em; font-variant-numeric: tabular-nums; text-align: center; }
.auth-address { overflow-wrap: anywhere; color: var(--text); }
.auth-links { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 14px; }

.button,
.text-button,
.icon-button,
.play-button,
.decision-button,
.nav-button,
.account-button,
.filter-button,
.rating-button,
.row-play,
.player-track {
  border: 0;
  cursor: pointer;
}
.button {
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--coral);
  color: #1a0c09;
  font-weight: 800;
}
.button:hover { background: var(--coral-hover); }
.button.secondary { border-color: var(--line-strong); background: transparent; color: var(--text); }
.button.secondary:hover { background: var(--surface-3); }
.button.danger { background: var(--red); color: #24090c; }
.button:disabled, .icon-button:disabled, .decision-button:disabled, .filter-button:disabled {
  cursor: not-allowed;
  opacity: .42;
}
.button.full { width: 100%; }
.text-button { min-height: 44px; padding: 8px 0; background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; }
.text-button:hover { color: var(--text); }

.app-shell { min-height: 100vh; padding: 0 var(--panel-w) var(--player-h) var(--rail-w); }
.desktop-rail {
  position: fixed;
  z-index: 30;
  inset: 0 auto var(--player-h) 0;
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  padding: 25px 18px 18px;
  border-right: 1px solid var(--line);
  background: rgb(11 11 13 / 96%);
  backdrop-filter: blur(18px);
}
.rail-brand { display: flex; align-items: center; gap: 9px; padding: 0 8px; }
.rail-nav { display: grid; gap: 5px; margin-top: 46px; }
.nav-button {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 700;
}
.nav-button svg { width: 21px; height: 21px; flex: 0 0 auto; }
.nav-button:hover { background: var(--surface); color: var(--text); }
.nav-button[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.nav-button[aria-current="page"] svg { color: var(--coral); }
.rail-account { display: flex; align-items: center; gap: 10px; margin-top: auto; min-width: 0; }
.account-avatar, .account-button span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--coral-soft);
  color: var(--coral);
  font-size: 12px;
  font-weight: 850;
}
.account-copy { min-width: 0; flex: 1; }
.account-copy strong, .account-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: 13px; }
.account-copy span { color: var(--muted); font-size: 11px; }
.account-button { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border-radius: 50%; background: transparent; }
.mobile-header, .mobile-tabs { display: none; }

.connection-banner {
  position: fixed;
  z-index: 45;
  top: 14px;
  left: calc(var(--rail-w) + 24px);
  right: calc(var(--panel-w) + 24px);
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--amber);
  border-radius: 10px;
  background: var(--amber-soft);
  color: var(--text);
  text-align: center;
  font-size: 14px;
  box-shadow: var(--shadow);
}

.main-view { min-width: 0; width: 100%; max-width: 980px; margin: 0 auto; padding: 42px clamp(24px, 4vw, 62px) 80px; }
.app-shell.has-banner .main-view { padding-top: 90px; }
.page-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-header h1 { margin: 0; font-size: clamp(32px, 4.4vw, 58px); line-height: .98; letter-spacing: -.045em; }
.page-header p { margin: 10px 0 0; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 10px; }
.select-wrap { position: relative; }
.select-wrap select {
  min-height: 44px;
  appearance: none;
  padding: 9px 42px 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
}
.select-wrap::after { content: ""; position: absolute; top: 17px; right: 16px; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); pointer-events: none; }

.status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.status-strip.pending { border-color: #6e572a; background: var(--amber-soft); }
.status-strip.error { border-color: #754148; background: var(--red-soft); }
.status-strip strong, .status-strip span { display: block; }
.status-strip span { color: var(--muted); font-size: 13px; }

.track-list { display: grid; gap: 2px; }
.track-row {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  min-height: 88px;
  padding: 10px 12px 10px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
}
.track-row:hover, .track-row:focus-within { border-color: var(--line); background: var(--surface); }
.track-row.is-active { border-color: #75473e; background: var(--coral-soft); }
/* D-7: raise .track-facts contrast from 4.3:1 to ≥4.5:1 on the active-row background #361c1a.
   #8c8c96 achieves ~4.72:1 against #361c1a; still ≥4.5:1 on the default dark bg #0b0b0d. */
.track-row.is-active .track-facts { color: #8c8c96; }
.track-row.is-pending::after { content: "Syncing"; position: absolute; right: 12px; bottom: 4px; color: var(--amber); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.art-wrap { position: relative; width: 64px; height: 64px; }
.cover-art, .missing-art {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-3);
}
.missing-art {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--muted-2);
}
.missing-art svg { width: 28px; height: 28px; }
.row-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgb(0 0 0 / 58%);
  opacity: 0;
  color: #fff;
}
.row-play svg { width: 27px; height: 27px; }
.track-row:hover .row-play, .row-play:focus-visible, .track-row.is-active .row-play { opacity: 1; }
.track-copy { min-width: 0; }
.track-title { margin: 0; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.track-version { color: var(--muted); font-weight: 500; }
.track-byline { margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.track-facts { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 7px; color: var(--muted-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.track-facts span + span::before { content: "·"; margin-right: 10px; }
.reason-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.reason-chip { min-height: 44px; max-width: min(100%, 38ch); padding: 7px 11px; border: 1px solid #51433f; border-radius: 999px; background: var(--coral-soft); color: var(--text); cursor: pointer; font-size: 11px; line-height: 1.25; text-align: left; }
.reason-chip:hover { border-color: var(--coral); }
.track-end { min-width: 90px; display: grid; justify-items: end; gap: 8px; }
.source-chip, .state-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
  white-space: nowrap;
}
.state-chip.kept { border-color: #376d48; background: var(--green-soft); color: var(--green); }
.state-chip.skipped { border-color: #6b464b; background: var(--red-soft); color: var(--red); }
.state-chip.pending { border-color: #765d29; background: var(--amber-soft); color: var(--amber); }
.row-audio-state { position: absolute; inset: auto 4px 4px; min-height: 28px; display: grid; place-items: center; padding: 4px 6px; border-radius: 6px; background: rgb(11 11 13 / 88%); color: var(--amber); font-size: 9px; font-weight: 800; text-align: center; }
.row-audio-state.unavailable { color: var(--red); }
.track-row.is-audio-pending { cursor: default; }

.arrival-panel { margin-bottom: 18px; padding: 20px; border: 1px solid #59453d; border-radius: var(--radius); background: linear-gradient(145deg, var(--surface), #221713); }
.arrival-panel.error { border-color: #754148; background: var(--red-soft); }
.arrival-panel .section-head { margin-bottom: 14px; }
.arrival-panel h2 { margin: 0; font-size: 24px; letter-spacing: -.03em; }
.arrival-panel p { margin: 5px 0 0; color: var(--muted); }
.sync-sources { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sync-source { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgb(11 11 13 / 42%); }
.sync-source.error { border-color: #754148; }
.sync-source-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.sync-source-head strong, .sync-source-head span { display: block; }
.sync-source-head > div > span { color: var(--muted-2); font-size: 10px; text-transform: uppercase; }
.sync-source p { font-size: 12px; }
.sync-counts { color: var(--text) !important; font-variant-numeric: tabular-nums; }
.sync-source progress { width: 100%; height: 8px; margin-top: 10px; accent-color: var(--coral); }
.sync-next { color: var(--amber) !important; }
.arrival-ready { border-color: #765d29; background: var(--amber-soft); }

.skeleton-list { display: grid; gap: 8px; }
.skeleton { height: 82px; border-radius: var(--radius); background: linear-gradient(100deg, var(--surface) 20%, var(--surface-3) 35%, var(--surface) 50%); background-size: 250% 100%; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { to { background-position-x: -250%; } }

.empty-state, .error-state {
  min-height: 360px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 42px 22px;
  text-align: center;
}
.empty-graphic { width: 100px; height: 100px; display: grid; place-items: center; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--coral); }
.empty-graphic svg { width: 46px; height: 46px; }
.empty-state h2, .error-state h2 { margin: 0 0 8px; font-size: 26px; letter-spacing: -.03em; }
.empty-state p, .error-state p { max-width: 45ch; margin: 0 0 22px; color: var(--muted); }

.now-panel {
  position: fixed;
  z-index: 20;
  inset: 0 0 var(--player-h) auto;
  width: var(--panel-w);
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--bg-raised);
}
.panel-empty { min-height: 100%; display: grid; place-content: center; justify-items: center; padding: 40px; text-align: center; color: var(--muted); }
.panel-empty .empty-graphic { width: 82px; height: 82px; }
.now-card { min-height: 100%; padding: clamp(24px, 3vw, 42px); display: flex; flex-direction: column; }
.now-art-shell { position: relative; width: 100%; aspect-ratio: 1; margin-bottom: 28px; }
.now-art-shell::before { content: ""; position: absolute; inset: 12% 8% -8%; z-index: -1; border-radius: 50%; background: rgb(255 107 80 / 14%); filter: blur(35px); }
.now-art-shell img, .now-art-shell .missing-art { width: 100%; height: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.now-card h2 { margin: 0; font-size: clamp(25px, 2.4vw, 38px); line-height: 1.08; letter-spacing: -.04em; overflow-wrap: anywhere; }
.now-card .artist { margin: 9px 0 0; color: var(--muted); font-size: 16px; overflow-wrap: anywhere; }
.now-card .label { margin: 4px 0 0; color: var(--muted-2); font-size: 13px; overflow-wrap: anywhere; }
.now-facts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.fact-chip { min-height: 28px; display: inline-flex; align-items: center; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; }
.why-link { justify-self: start; align-self: start; }
.ratings { margin-top: 24px; }
.ratings-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ratings-head span { color: var(--muted); font-size: 12px; }
.rating-row { display: flex; gap: 3px; margin-top: 7px; }
.rating-button { width: 44px; height: 44px; padding: 7px; background: transparent; color: var(--muted-2); }
.rating-button svg { width: 24px; height: 24px; fill: transparent; stroke: currentColor; }
.rating-button.is-on { color: var(--amber); }
.rating-button.is-on svg { fill: currentColor; }
.now-hint { margin-top: auto; padding-top: 26px; color: var(--muted-2); font-size: 11px; }

.player-bar {
  position: fixed;
  z-index: 60;
  inset: auto 0 0 0;
  height: var(--player-h);
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) auto minmax(240px, 1.6fr) auto minmax(100px, .6fr);
  align-items: center;
  gap: clamp(10px, 1.5vw, 24px);
  padding: 10px clamp(18px, 2.6vw, 38px) max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgb(17 17 20 / 97%);
  backdrop-filter: blur(22px);
}
.player-track { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 0; background: transparent; text-align: left; }
.mini-art { width: 54px; height: 54px; flex: 0 0 auto; border-radius: 7px; }
.mini-meta { min-width: 0; }
.mini-meta strong, .mini-meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-meta strong { font-size: 13px; }
.mini-meta span { color: var(--muted); font-size: 11px; }
.player-transport, .player-decisions, .player-volume { display: flex; align-items: center; gap: 6px; }
.icon-button, .play-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}
.icon-button:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.icon-button svg, .play-button svg { width: 20px; height: 20px; }
.play-button { background: var(--text); color: var(--bg); }
.play-button:hover:not(:disabled) { transform: scale(1.04); }
.player-progress-wrap { min-width: 0; display: grid; grid-template-columns: 38px minmax(100px, 1fr) 42px; align-items: center; gap: 8px; }
.time-label { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.time-label:last-child { text-align: right; }
input[type="range"] { accent-color: var(--coral); cursor: pointer; }
.seek-control { width: 100%; }
.decision-button { min-width: 67px; min-height: 44px; padding: 8px 13px; border-radius: 999px; font-weight: 800; }
.decision-button.skip { border: 1px solid var(--line-strong); background: transparent; }
.decision-button.keep { background: var(--coral); color: #1a0c09; }
.decision-button.is-selected.skip { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.decision-button.is-selected.keep { background: var(--green); color: #092111; }
.player-volume input { width: min(8vw, 105px); }
.player-bar.is-empty .player-track { cursor: default; }

.settings-layout { display: grid; gap: 20px; }
.settings-section { padding: 24px; border-top: 1px solid var(--line); }
.settings-section:first-child { border-top: 0; }
.section-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.section-head p { max-width: 62ch; margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.privacy-note { padding: 14px 16px; border-left: 3px solid var(--coral); background: var(--coral-soft); color: var(--muted); font-size: 13px; }
.taste-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.taste-form .field { margin: 0; }
.toggle-row { grid-column: 1 / -1; min-height: 52px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.toggle-row input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--coral); }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row small { margin-top: 3px; color: var(--muted); }
.preference-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
.preference-message { grid-column: 1 / -1; min-height: 24px; margin: 0; color: var(--muted); }
.preference-message.error { color: var(--red); }
.preference-message.success { color: var(--green); }
.filter-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0; }
.filter-button { min-height: 44px; padding: 7px 13px; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 700; }
.filter-button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

.history-list { display: grid; gap: 12px; }
.history-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.history-summary { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 13px; align-items: center; width: 100%; padding: 14px; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; }
.history-summary:hover { background: var(--surface-2); }
.history-art { width: 58px; height: 58px; border-radius: 7px; }
.history-title { min-width: 0; }
.history-title strong { display: block; overflow-wrap: anywhere; }
.history-title span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.history-stats { display: grid; grid-template-columns: repeat(3, auto); gap: 18px; text-align: right; }
.history-stat strong, .history-stat span { display: block; font-variant-numeric: tabular-nums; }
.history-stat strong { font-size: 13px; }
.history-stat span { color: var(--muted-2); font-size: 9px; letter-spacing: .07em; text-transform: uppercase; }
.history-detail { padding: 0 14px 16px 85px; }
.timeline {
  position: relative;
  height: 18px;
  margin: 4px 0 12px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.timeline-segment { position: absolute; top: 0; bottom: 0; min-width: 2px; border-radius: 999px; background: var(--coral); }
.range-list { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 0 0 14px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.event-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.event-row { display: grid; grid-template-columns: 56px 110px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.event-row strong { color: var(--text); font-weight: 700; }
.load-more { display: flex; justify-content: center; margin: 20px 0 0; }

.keeper-grid { display: grid; gap: 10px; }
.keeper-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.keeper-state { text-align: right; }
.keeper-state p { margin: 4px 0 0; color: var(--muted); font-size: 11px; max-width: 24ch; }
.capability-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.capability-card + .capability-card { margin-top: 10px; }
.capability-card h3 { margin: 0; font-size: 15px; }
.capability-card p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

.admin-create { display: flex; gap: 10px; margin-bottom: 20px; }
.admin-create input { flex: 1; }
.admin-create-card { margin-bottom: 28px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.admin-create-card h2, .admin-list-head h2 { margin: 0; font-size: 20px; }
.admin-create-card p, .admin-list-head p { margin: 4px 0 16px; color: var(--muted); font-size: 12px; }
.admin-create-card .admin-create { margin-bottom: 0; }
.admin-list-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 10px; }
.admin-list-head p { margin-bottom: 0; }
.admin-search { width: min(100%, 310px); margin: 0; }
.admin-search label { font-size: 12px; }
.account-list { display: grid; gap: 8px; }
.account-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.account-row strong { display: block; overflow-wrap: anywhere; }
.account-row span { color: var(--muted); font-size: 12px; }
.account-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 6px; }
.small-button { min-height: 44px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.small-button:hover { border-color: var(--line-strong); color: var(--text); }
.small-button.danger { color: var(--red); }
.small-button:disabled { cursor: not-allowed; opacity: .48; }

dialog { color: var(--text); }
dialog::backdrop { background: rgb(0 0 0 / 76%); backdrop-filter: blur(8px); }
.sheet-dialog { width: min(92vw, 680px); max-height: min(86dvh, 820px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.sheet-dialog > div { padding: 26px; }
.sheet-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.sheet-head h2 { margin: 0; font-size: 28px; letter-spacing: -.035em; overflow-wrap: anywhere; }
.sheet-loading { min-height: 180px; display: grid; place-items: center; color: var(--muted); }
.why-reasons { display: grid; gap: 10px; }
.why-reason { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-raised); }
.why-reason h3 { margin: 0; font-size: 16px; }
.evidence-list { margin: 9px 0 0; padding-left: 20px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.absent-reasons { margin: 16px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.absent-reasons summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
.absent-reasons li { margin-top: 7px; color: var(--muted); }
.learning-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.learning-columns section { padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.learning-columns h3 { margin: 0 0 9px; }
.learning-columns ul { margin: 0; padding-left: 20px; color: var(--muted); }
.learning-columns li + li { margin-top: 7px; }
.confirm-dialog { width: min(92vw, 480px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.confirm-dialog form { padding: 28px; }
.confirm-dialog h2 { margin: 0 0 10px; font-size: 28px; letter-spacing: -.035em; }
.confirm-dialog p:not(.eyebrow) { margin: 0 0 20px; color: var(--muted); }
.dialog-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 20px; border-radius: 50%; background: var(--red-soft); color: var(--red); }
.dialog-icon svg { width: 23px; height: 23px; }
.dialog-actions { display: flex; justify-content: end; gap: 10px; margin-top: 24px; }
.scope-list { display: grid; gap: 8px; margin: 18px 0; }
.scope-option { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.scope-option input { margin-top: 4px; }
.scope-option strong, .scope-option span { display: block; }
.scope-option span { color: var(--muted); font-size: 12px; }

.now-dialog { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: var(--bg); }
.now-dialog[open] { display: none; }

.toast-region { position: fixed; z-index: 100; left: 50%; bottom: calc(var(--player-h) + 18px); transform: translateX(-50%); width: min(calc(100vw - 32px), 520px); display: grid; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 54px; padding: 10px 12px 10px 16px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--text); color: var(--bg); box-shadow: var(--shadow); pointer-events: auto; }
.toast span { min-width: 0; overflow-wrap: anywhere; }
.toast button { min-width: 62px; min-height: 44px; border: 0; border-radius: 999px; background: var(--bg); color: var(--text); cursor: pointer; font-weight: 800; }

@media (max-width: 1120px) {
  :root { --panel-w: 330px; --rail-w: 200px; }
  .player-bar { grid-template-columns: minmax(170px, 1fr) auto minmax(200px, 1.2fr) auto; }
  .player-volume { display: none; }
}

@media (max-width: 899px) {
  :root { --player-h: 72px; }
  body { background: var(--bg); }
  .app-shell { padding: 58px 0 calc(var(--player-h) + var(--mobile-tabs-h) + 22px); }
  .desktop-rail, .now-panel { display: none; }
  .mobile-header {
    position: fixed;
    z-index: 50;
    inset: 0 0 auto;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px 6px 13px;
    border-bottom: 1px solid var(--line);
    background: rgb(11 11 13 / 96%);
    backdrop-filter: blur(18px);
  }
  .connection-banner { top: 68px; left: 12px; right: 12px; }
  .main-view { max-width: 760px; padding: 28px 18px 40px; }
  .app-shell.has-banner .main-view { padding-top: 82px; }
  .page-header { align-items: start; }
  .page-header h1 { font-size: 38px; }
  .player-bar {
    bottom: var(--mobile-tabs-h);
    height: var(--player-h);
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    padding: 7px 10px;
  }
  .mini-art { width: 48px; height: 48px; }
  .player-transport { grid-column: 2; }
  .player-decisions { grid-column: 3; }
  .player-progress-wrap, .player-decisions .skip, .desktop-only { display: none !important; }
  .decision-button { min-width: 58px; min-height: 44px; padding-inline: 11px; }
  .mobile-tabs {
    position: fixed;
    z-index: 65;
    inset: auto 0 0;
    height: var(--mobile-tabs-h);
    display: flex;
    justify-content: space-around;
    padding: 4px 6px max(4px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgb(11 11 13 / 98%);
  }
  .mobile-tabs .nav-button { min-width: 64px; min-height: 58px; display: grid; justify-items: center; gap: 1px; padding: 5px 8px; border-radius: 8px; font-size: 10px; }
  .mobile-tabs .nav-button svg { width: 22px; height: 22px; }
  .mobile-tabs .nav-button[aria-current="page"] { background: transparent; color: var(--text); }
  .mobile-tabs .nav-button[aria-current="page"]::after { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--coral); }
  .now-dialog[open] { display: block; }
  .toast-region { bottom: calc(var(--player-h) + var(--mobile-tabs-h) + 12px); }
  .history-stats { gap: 10px; }
  .mobile-now { min-height: 100dvh; width: min(100%, 720px); margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 26px max(26px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
  .mobile-now-head { display: flex; align-items: center; justify-content: space-between; min-height: 48px; margin-bottom: 12px; }
  .mobile-now-head strong { font-size: 13px; }
  .mobile-now-art { width: min(100%, 45vh); aspect-ratio: 1; align-self: center; margin: 0 auto 22px; }
  .mobile-now-art img, .mobile-now-art .missing-art { width: 100%; height: 100%; border-radius: var(--radius); object-fit: cover; box-shadow: var(--shadow); }
  .mobile-now h1 { margin: 0; font-size: clamp(25px, 6vw, 38px); line-height: 1.06; letter-spacing: -.04em; overflow-wrap: anywhere; }
  .mobile-now .artist { margin: 8px 0 0; color: var(--muted); overflow-wrap: anywhere; }
  .mobile-now .label { margin: 3px 0 0; color: var(--muted-2); font-size: 12px; overflow-wrap: anywhere; }
  .mobile-progress { display: grid; grid-template-columns: 38px 1fr 42px; align-items: center; gap: 8px; margin-top: 22px; }
  .mobile-progress input { width: 100%; }
  .mobile-transport { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 10px; }
  .mobile-transport .play-button { width: 58px; height: 58px; }
  .mobile-decisions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; margin-top: 8px; }
  .mobile-decisions .decision-button { min-height: 50px; }
  .mobile-rating { margin-top: 14px; }
  .mobile-rating .rating-row { justify-content: center; }
  .mobile-now .now-facts { margin-top: 13px; }
}

@media (max-width: 600px) {
  .main-view { padding-inline: 12px; }
  .page-header { display: block; margin: 6px 4px 22px; }
  .page-header h1 { font-size: 34px; }
  .page-actions { justify-content: start; margin-top: 17px; }
  .status-strip { align-items: start; margin-inline: 0; }
  .track-row { grid-template-columns: 58px minmax(0, 1fr); gap: 11px; min-height: 78px; padding: 9px 5px; }
  .art-wrap { width: 56px; height: 56px; }
  .track-end { grid-column: 2; min-width: 0; display: flex; flex-wrap: wrap; justify-content: start; gap: 6px; margin-top: -3px; }
  .track-byline { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .track-facts { margin-top: 5px; }
  .reason-list { display: grid; }
  .reason-chip { width: 100%; max-width: none; border-radius: 10px; }
  .row-play { opacity: 1; inset: auto 6px 6px auto; width: 44px; height: 44px; border-radius: 50%; background: rgb(0 0 0 / 72%); }
  .row-play svg { width: 18px; height: 18px; }
  .source-chip { font-size: 9px; }
  .settings-section { padding: 20px 4px; }
  .taste-form { grid-template-columns: 1fr; }
  .toggle-row, .preference-actions, .preference-message { grid-column: 1; }
  .section-head { display: block; }
  .section-head .button { margin-top: 12px; }
  .history-summary { grid-template-columns: 50px minmax(0, 1fr); padding: 12px; }
  .history-art { width: 50px; height: 50px; }
  .history-stats { grid-column: 2; justify-content: start; text-align: left; margin-top: 4px; }
  .history-detail { padding: 0 12px 14px; }
  .event-row { grid-template-columns: 50px minmax(0, 1fr); }
  .event-row span:last-child { grid-column: 2; }
  .keeper-row { grid-template-columns: 54px minmax(0, 1fr); }
  .keeper-state { grid-column: 2; text-align: left; }
  .capability-card { display: block; }
  .capability-card .button { margin-top: 12px; }
  .admin-create { display: grid; }
  .admin-list-head { display: block; }
  .admin-search { width: 100%; margin-top: 14px; }
  .account-row { grid-template-columns: minmax(0, 1fr) auto; }
  .account-actions { grid-column: 1 / -1; justify-content: start; }
  .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .dialog-actions .button { width: 100%; }
  .arrival-panel { padding: 16px 12px; }
  .sync-sources, .learning-columns { grid-template-columns: 1fr; }
  .sheet-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .sheet-dialog > div { padding: 20px 16px; }
  .now-dialog-content { min-height: 100%; }
  .mobile-now { padding-inline: 18px; }
  .mobile-now-art { width: min(100%, 45vh); aspect-ratio: 1; align-self: center; margin: 0 auto 22px; }
  .mobile-now h1 { margin: 0; font-size: clamp(25px, 8vw, 36px); line-height: 1.06; letter-spacing: -.04em; overflow-wrap: anywhere; }
}

@media (max-width: 360px) {
  .mini-meta span { display: none; }
  .player-bar { grid-template-columns: minmax(0, 1fr) auto auto; }
  .decision-button.keep { min-width: 52px; }
  .mobile-tabs .nav-button { min-width: 56px; padding-inline: 5px; }
  .track-facts span:nth-child(n+4) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .brand-mark span { transform: none !important; opacity: 1; }
}

/* BoothFuel · Suggested (P1 O2 additive surface) */
.suggested-section { min-width: 0; }
.suggested-status-card, .suggested-companion { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.suggested-companion { margin-top: 12px; }
.suggested-status-head, .suggested-link-head { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.suggested-status-head h3, .suggested-link-head strong { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.suggested-link-head span, .suggested-link p { color: var(--muted); font-size: 12px; }
.suggested-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.suggested-facts div { min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-raised); }
.suggested-facts dt { color: var(--muted-2); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.suggested-facts dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.suggested-blockers { margin: 12px 0; padding: 12px 12px 12px 30px; border-left: 3px solid var(--amber); background: var(--amber-soft); color: var(--muted); }
.suggested-ok { color: var(--green); }
.suggested-message { min-height: 24px; margin: 10px 0; color: var(--muted); overflow-wrap: anywhere; }
.suggested-message.error { color: var(--red); }
.suggested-message.success { color: var(--green); }
.suggested-actions, .suggested-preview-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.suggested-section button, .suggested-dialog button, .suggested-section input, .suggested-dialog input, .suggested-dialog select { min-height: 44px; }
.suggested-links { display: grid; gap: 10px; }
.suggested-link { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg-raised); }
.suggested-scopes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.suggested-scope, .suggested-consent-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 10px; min-height: 52px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; }
.suggested-scope input, .suggested-consent-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--coral); }
.suggested-scope strong, .suggested-scope small, .suggested-consent-row small { display: block; }
.suggested-scope small, .suggested-consent-row small { color: var(--muted); }
.suggested-disabled { opacity: .62; }
.suggested-empty, .suggested-error { color: var(--muted); }
.suggested-error { padding: 18px; border: 1px solid #754148; border-radius: 12px; background: var(--red-soft); }
.suggested-error h3 { margin: 0; color: var(--text); }
.suggested-track-chip { border-color: #765d29; background: var(--amber-soft); color: var(--amber); }
.suggested-dialog { overflow-y: auto; }
.suggested-preview-group { margin-top: 18px; }
.suggested-preview-group h3, .suggested-consent h3 { margin: 0 0 10px; }
.suggested-preview-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; margin-top: 8px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg-raised); }
.suggested-preview-card h4, .suggested-preview-card p { margin: 0; overflow-wrap: anywhere; }
.suggested-preview-card ul { grid-column: 1 / -1; margin: 5px 0 0; padding-left: 20px; color: var(--muted); }
.suggested-budget { padding: 10px 12px; border-radius: 10px; background: var(--coral-soft); color: var(--text); font-variant-numeric: tabular-nums; }
.suggested-excluded { margin: 16px 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.suggested-excluded summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
.suggested-excluded li { margin-top: 6px; color: var(--muted); }
.suggested-consent { display: grid; gap: 9px; margin-top: 18px; }
.suggested-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.suggested-form-grid label { display: grid; gap: 6px; font-weight: 700; }
.suggested-form-grid input, .suggested-form-grid select { width: 100%; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-2); color: var(--text); }
.suggested-pairing-code { margin: 20px 0 6px; color: var(--coral); font-size: clamp(30px, 8vw, 52px); font-weight: 850; letter-spacing: .18em; text-align: center; }

@media (max-width: 600px) {
  .suggested-facts, .suggested-scopes, .suggested-form-grid { grid-template-columns: 1fr; }
  .suggested-status-head, .suggested-link-head { display: grid; }
  .suggested-status-card, .suggested-companion { padding: 14px 10px; }
  .suggested-preview-card { grid-template-columns: minmax(0, 1fr); }
  .suggested-preview-card .state-chip { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .suggested-section *, .suggested-dialog * { transition: none !important; animation: none !important; }
}
