/* Shared base: reset, type, controls. Depends on tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
img { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; font-weight: 700; }
p { margin: 0; }
code { font-family: var(--font-mono); font-size: 0.9em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.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 {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--surface); color: var(--ink); padding: 8px 12px; border-radius: 6px;
}
.skip:focus { left: 8px; }

.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: blip 1.8s ease-out infinite;
}
@keyframes blip {
  0% { box-shadow: 0 0 0 0 var(--accent-ring); }
  100% { box-shadow: 0 0 0 10px transparent; }
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--ink-2); background: var(--surface); white-space: nowrap;
}
.chip.is-live { border-color: var(--accent); color: var(--accent); }
.chip.is-off { color: var(--muted); border-style: dashed; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; font-size: 14px; text-decoration: none; line-height: 1;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink-2); background: transparent; }
.btn-ghost:hover { border-color: var(--ink-2); color: var(--ink); }
.btn-danger { border-color: transparent; background: transparent; color: var(--warn); }
.btn-danger:hover { background: rgba(242, 184, 75, 0.12); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-2);
}
.btn-icon:hover { background: var(--surface-3); color: var(--ink); }
.btn-icon svg { width: 20px; height: 20px; fill: currentColor; }
.btn:disabled, button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

input[type="text"], input[type="search"], input[type="number"], input[type="url"],
textarea, select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--ink);
}
input[type="text"]:focus, input[type="search"]:focus, input[type="number"]:focus,
textarea:focus, select:focus { border-color: var(--accent); outline: none; }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input[type="range"] { accent-color: var(--accent); }
input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; }
label { font-size: 13px; font-weight: 600; color: var(--ink-2); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.notice {
  font-size: 13px; line-height: 1.55; color: var(--ink-2);
  border-left: 3px solid var(--accent); padding: 2px 0 2px 12px;
}
.status-line { font-family: var(--font-mono); font-size: 12px; color: var(--muted); min-height: 16px; }
.status-line.is-error { color: var(--warn); }

.tag {
  display: inline-block;
  font: 500 10px/1 var(--font-mono);
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 6px; border-radius: 4px;
  background: var(--voice-soft); color: var(--voice);
  vertical-align: 2px;
}
.tag.is-accent { background: var(--accent-soft); color: var(--accent); }
.tag.is-muted { background: var(--surface-3); color: var(--muted); }

.list { list-style: none; margin: 0; padding: 0; }
.list > li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.list > li:first-child { border-top: 0; }
.list .t { font-family: var(--font-mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.list .n { min-width: 0; }
.list .n strong { display: block; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .n small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .d { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.list li.is-voice .n strong { color: var(--voice); white-space: normal; }
.list li.is-now { background: var(--accent-soft); margin: 0 -16px; padding: 12px 16px; border-radius: var(--radius-sm); border-top: 0; }
.list li.is-now + li { border-top: 0; }
.list details { margin-top: 4px; }
.list summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.list details p { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin: 6px 0 0; white-space: normal; }
.empty { color: var(--muted); font-size: 14px; padding: 12px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Info sheet (song details), shared by player and control room */
.sheet-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, 0.62); display: flex; align-items: flex-end; justify-content: center; backdrop-filter: blur(4px); }
.sheet { position: relative; width: min(100%, 600px); max-height: 86dvh; overflow: auto; background: var(--surface); border-radius: 16px 16px 0 0; padding: 20px 20px 32px; box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5); animation: sheet-rise 0.22s ease-out; }
@keyframes sheet-rise { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-close { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border-radius: 50%; color: var(--muted); font-size: 22px; line-height: 1; }
.sheet-close:hover { background: var(--surface-3); color: var(--ink); }
.sheet-head { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: center; padding-right: 36px; }
.sheet-head img { width: 96px; height: 96px; border-radius: 8px; object-fit: cover; }
.sheet-head h2 { font-size: 22px; line-height: 1.2; }
.sheet-head p { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
.sheet-sub { color: var(--muted) !important; font-size: 12px !important; }
.sheet-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
.sheet-stats div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; display: grid; gap: 2px; }
.sheet-stats b { font-size: 16px; font-variant-numeric: tabular-nums; }
.sheet-stats span { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.sheet .eyebrow { margin: 14px 0 6px; }
.list.compact > li { grid-template-columns: 36px minmax(0, 1fr) auto; padding: 6px 0; }
.list.compact .thumb { width: 36px; height: 36px; border-radius: 4px; object-fit: cover; }
.list.compact .n strong { font-size: 14px; }
.list.compact > li.is-now { margin: 0; padding: 6px 8px; }
@media (max-width: 480px) { .sheet-stats { grid-template-columns: repeat(2, 1fr); } }

/* Captions for breaks */
.caption { font-size: 15px; line-height: 1.55; color: var(--muted); margin-top: 10px; transition: color 0.2s; }
.caption span { transition: color 0.15s; }
.caption span.spoken { color: var(--ink); }
.caption[hidden] { display: none; }

/* Program banner over artwork */
.art-banner { position: absolute; left: 0; right: 0; top: 0; padding: 8px 12px; background: linear-gradient(180deg, rgba(0,0,0,0.75), rgba(0,0,0,0)); color: #fff; font: 600 12px/1.3 var(--font-body); letter-spacing: 0.02em; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.art-banner::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--program, var(--accent)); flex: none; box-shadow: 0 0 10px var(--program, var(--accent)); }
.art-banner small { color: rgba(255,255,255,0.75); font-weight: 400; }
.art-banner[hidden] { display: none; }
