/* Control room. Shares tokens/base with the player. */
.control-page {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  background:
    radial-gradient(90% 40% at 50% -8%, var(--bg-glow) 0%, transparent 60%),
    var(--bg);
}
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-family: var(--font-display); font-size: 21px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.brand b { color: var(--accent); font-weight: 800; }
.brand img { border-radius: 7px; }
.bar-right { display: flex; align-items: center; gap: 8px; }
.clock { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 8px; }

.control { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 16px 16px 40px; display: grid; gap: 18px; }

/* Station cards */
.stations { display: grid; gap: 10px; grid-template-columns: 1fr; }
.station {
  position: relative; text-align: left; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: start;
  color: var(--ink);
}
.station.is-live { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 1px var(--accent-soft), 0 10px 30px rgba(0, 0, 0, 0.35); }
.station.is-off { opacity: 0.7; }
.station .k { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }
.station h2 { font-family: var(--font-display); font-size: 30px; line-height: 1; text-transform: uppercase; letter-spacing: 0.01em; margin-top: 2px; }
.station .format { color: var(--muted); font-size: 13px; }
.station .chip { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
.station .now-line { grid-column: 1 / -1; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.station .now-line strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.station .now-line small { color: var(--muted); white-space: nowrap; }
.station[data-station="redline"] .k { color: #eaff68; }
.station[data-station="static93"] .k { color: #aaa7ff; }
.station[data-station="blackened"] .k { color: var(--accent); }

/* Live deck */
.deck {
  display: grid; gap: 18px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "art" "now" "next";
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px;
}
.deck .art {
  grid-area: art; margin: 0;
  width: min(100%, 300px); aspect-ratio: 1; justify-self: center;
  position: relative; overflow: hidden; border-radius: var(--radius-sm);
  background: var(--surface-2); box-shadow: var(--shadow), 0 0 0 1px var(--line);
}
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.6s ease; }
.art .art-b { opacity: 0; }
.art.is-b #art { opacity: 0; }
.art.is-b .art-b { opacity: 1; }
.art.is-loading img { opacity: 0.35; }
.deck .art { cursor: pointer; }
.deck .title { cursor: pointer; }
.art-badge { z-index: 2; }
.art-badge {
  position: absolute; left: 10px; bottom: 10px; padding: 5px 8px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px); color: var(--ink-2);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
}
.art.is-voice .art-badge { color: var(--voice); }
.deck .now { grid-area: now; min-width: 0; }
.title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(36px, 8vw, 64px); line-height: 0.95; letter-spacing: -0.005em;
  margin: 6px 0 8px; overflow-wrap: anywhere; text-wrap: balance;
}
.now.is-voice .title { color: var(--voice); }
.meta { color: var(--ink-2); font-size: 14px; }
.meta .sep { color: var(--faint); padding: 0 6px; }
.progress { height: 4px; margin-top: 14px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--accent); border-radius: 2px; transition: width 0.5s linear; }
.now.is-voice .progress > div { background: var(--voice); }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }

.transport { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.play {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; box-shadow: 0 10px 26px var(--accent-soft);
  transition: transform 0.12s, background 0.2s;
}
.play:hover { background: var(--accent-hover); }
.play:active { transform: scale(0.96); }
.play svg { width: 24px; height: 24px; fill: currentColor; }
.play[aria-pressed="true"] { box-shadow: 0 10px 26px var(--accent-soft), 0 0 0 calc(var(--level, 0) * 14px) rgba(226, 36, 47, calc(0.1 + var(--level, 0) * 0.3)); transition: box-shadow 0.1s linear; }
.play .ico-stop { display: none; }
.play[aria-pressed="true"] .ico-play { display: none; }
.play[aria-pressed="true"] .ico-stop { display: block; }
.play.is-connecting { animation: ring 1.1s ease-out infinite; }
@keyframes ring { 0% { box-shadow: 0 10px 26px var(--accent-soft), 0 0 0 0 var(--accent-ring); } 100% { box-shadow: 0 10px 26px var(--accent-soft), 0 0 0 14px transparent; } }
.play-label { font-weight: 600; font-size: 14px; }
.volume { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 160px; max-width: 260px; margin-left: auto; }
.volume input { flex: 1; height: 28px; min-width: 0; }
.btn-icon .ico-muted { display: none; }
.btn-icon[aria-pressed="true"] .ico-vol { display: none; }
.btn-icon[aria-pressed="true"] .ico-muted { display: block; }
.now .status-line { margin-top: 10px; }

.facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.facts:empty { display: none; }
.facts div { display: flex; align-items: baseline; gap: 6px; }
.facts b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.facts span { font-size: 11px; color: var(--muted); font-family: var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; }

.deck-next { grid-area: next; }
.deck-next h2 { margin-bottom: 8px; }

/* Views */
.views { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.viewbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 20px; }
.tabs [role="tab"] { padding: 14px 0; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-color: var(--accent); }
.view-meta { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
#view { padding: 16px; min-height: 240px; }

.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head p { font-size: 13px; color: var(--muted); }
.section-head .eyebrow { margin: 18px 0 6px; }
.log .list > li.is-now { margin: 6px 0; }

/* Library table */
.library-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.library-tools input[type="search"] { max-width: 320px; }
.rotation-box { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: 14px; font-size: 13px; }
.rotation-box b { font-variant-numeric: tabular-nums; }
.rotation-box .spacer { flex: 1; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
td.num { font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.is-excluded td { opacity: 0.55; }
tr.is-now td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.weight { width: 72px; padding: 6px 8px; text-align: right; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.save { min-width: 64px; }

/* DJ booth */
.booth { display: grid; gap: 18px; grid-template-columns: 1fr; }
.host { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: start; }
.host img { width: 96px; height: 96px; object-fit: cover; object-position: 50% 20%; border-radius: var(--radius-sm); }
.host h3 { font-family: var(--font-display); font-size: 34px; line-height: 1; }
.host p { color: var(--ink-2); font-size: 14px; line-height: 1.55; margin-top: 6px; }
.host .links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.takes .list > li { grid-template-columns: minmax(0, 1fr) auto; }
.takes .actions { display: flex; gap: 6px; }

.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 14px 16px; padding-bottom: max(14px, env(safe-area-inset-bottom)); font-size: 11px; color: var(--faint); border-top: 1px solid var(--line); }

@media (min-width: 700px) {
  .stations { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .deck { grid-template-columns: 260px minmax(0, 1fr); grid-template-areas: "art now" "next next"; padding: 20px; }
  .deck .art { width: 100%; justify-self: stretch; }
  .booth { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (min-width: 1040px) {
  .deck { grid-template-columns: 280px minmax(0, 1fr) 320px; grid-template-areas: "art now next"; }
  .deck-next { align-self: stretch; }
}
@media (max-width: 699px) {
  .bar-right .btn { padding: 0 10px; }
  .clock { display: none; }
  .tabs { gap: 14px; }
  .tabs [role="tab"] { font-size: 13px; }
  th:nth-child(2), td:nth-child(2) { display: none; }
}

.station .badge { width: 26px; height: 26px; object-fit: contain; }
.art.is-voice img { object-fit: cover; }

/* Library: tiers */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 12px; }
.tier-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.tier-box b { font-size: 14px; color: var(--ink); }
.tier-box:first-child b { color: var(--accent); }
.tier-box.is-empty { opacity: 0.45; }
.tier-box small { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; }
td.tier { white-space: nowrap; }
td.tier small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.weight-cell { display: flex; align-items: center; gap: 6px; }
.presets { display: flex; gap: 2px; }
.preset { width: 22px; height: 22px; border-radius: 4px; border: 1px solid var(--line-strong); color: var(--muted); font: 600 10px var(--font-mono); }
.preset:hover { color: var(--ink); border-color: var(--ink-2); }
.bulk { display: flex; gap: 6px; align-items: center; }
.bulk select { width: auto; max-width: 220px; padding: 8px 10px; font-size: 13px; }
@media (max-width: 699px) { th:nth-child(4), td:nth-child(4) { display: none; } .presets { display: none; } }
.programs { margin-bottom: 18px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.programs .list > li { padding: 8px 0; }
.programs .n strong .tag { margin-right: 8px; }

/* Programs */
.list > li.in-program { box-shadow: inset 3px 0 0 var(--program); padding-left: 10px; }
.list > li.is-promo { box-shadow: inset 3px 0 0 var(--program); padding-left: 10px; opacity: 0.9; }
.program-tag { background: color-mix(in srgb, var(--program) 22%, transparent); color: var(--program); margin-right: 6px; }
.program-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: thin; }
.program-pill { flex: 0 0 auto; min-width: 170px; max-width: 240px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); border-top: 3px solid var(--program); display: grid; gap: 3px; }
.program-pill strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.program-pill small { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.program-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.program-card { background: var(--surface-2); border: 1px solid var(--line); border-top: 4px solid var(--program); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; align-content: start; }
.program-card.is-off { opacity: 0.5; }
.program-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.program-head h3 { font-family: var(--font-display); font-size: 26px; line-height: 1; color: var(--program); }
.program-head .chip { border-color: var(--program); color: var(--program); }
.program-brief { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.program-card .list > li { padding: 7px 0; }
.program-voice { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--line); }
.program-voice .btn { margin-left: auto; }
.program-writer { align-items: center; padding-top: 10px; border-top: 1px solid var(--line); }
.program-writer select, .program-writer input { width: auto; min-width: 160px; }

/* Player overlay: the player page in an iframe; audio lives in this document so it never restarts. */
.player-sheet { position: fixed; inset: 0; z-index: 60; background: #121212; animation: sheet-up 0.22s ease-out; }
.player-sheet iframe { width: 100%; height: 100%; border: 0; display: block; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
body.sheet-open { overflow: hidden; }

/* Week schedule grid */
.schedule { margin-top: 18px; }
.schedule-grid { display: grid; grid-template-columns: 44px repeat(7, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.schedule-grid .day-head { padding: 8px 4px; text-align: center; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.schedule-grid .day-head.is-today { color: var(--ink); background: var(--surface-3); }
.schedule-grid .hours { position: relative; height: var(--grid-h); font-family: var(--font-mono); font-size: 10px; color: var(--faint); border-right: 1px solid var(--line); }
.schedule-grid .hours span { position: absolute; left: 6px; transform: translateY(-50%); }
.schedule-grid .day { position: relative; height: var(--grid-h); border-right: 1px solid var(--line); background-image: repeating-linear-gradient(180deg, transparent 0, transparent calc(var(--grid-h) / 24 - 1px), var(--line) calc(var(--grid-h) / 24 - 1px), var(--line) calc(var(--grid-h) / 24)); }
.schedule-grid .day:last-child { border-right: 0; }
.schedule-grid .block { position: absolute; left: 3px; right: 3px; min-height: 14px; border-radius: 4px; background: color-mix(in srgb, var(--program) 28%, var(--surface-2)); border-left: 3px solid var(--program); padding: 2px 5px; font-size: 10px; line-height: 1.25; overflow: hidden; color: var(--ink); cursor: default; }
.schedule-grid .block b { display: block; color: var(--program); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.schedule-grid .block small { display: block; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.schedule-grid .block.is-past { opacity: 0.45; }
.schedule-grid .now-line { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--accent); z-index: 2; }
.schedule-grid .now-line::before { content: ''; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
@media (max-width: 699px) { .schedule-grid { grid-template-columns: 34px repeat(7, minmax(0, 1fr)); } .schedule-grid .block small { display: none; } }

.program-head .program-tile { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--surface-3); flex: none; }
.program-head { justify-content: flex-start; }
.program-head .chip { margin-left: auto; }
.list > li.has-info { cursor: pointer; }

/* Listener heat behind the week grid */
.schedule-grid .heat { position: absolute; left: 0; right: 0; background: var(--accent); pointer-events: none; }
.schedule-grid .block, .schedule-grid .now-line { z-index: 1; }
.heat-legend { display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-weight: 400; color: var(--faint); }
.heat-legend i { width: 12px; height: 12px; border-radius: 2px; background: var(--accent); opacity: 0.55; }

/* Station cards as links; the one this control room is showing */
a.station { text-decoration: none; color: inherit; display: block; }
a.station:hover { border-color: var(--ink-2); }
.station.is-current { outline: 2px solid var(--accent); outline-offset: -2px; }
.station .other-now { color: var(--ink-2); }
