/* AirForge — broadcast console design system.
   Direction: hardware-console dark, warm signal amber, tabular numerals.
   No gradients-for-gradients'-sake, no glass. Function-first density. */
:root {
  --accent: #e8a33d;
  --bg: #0c1322;          /* deep navy */
  --panel: #131c30;
  --panel-2: #1b2640;
  --line: #2c3a5c;
  --text: #e8edf7;
  --text-dim: #93a1c0;
  --on-air: #e5484d;
  --ok: #46a758;
  --warn: #f0b429;
  --radius: 6px;
  --radius-lg: 10px;
  --surface: #16203a;     /* softly raised panel */
  --line-soft: #22314f;   /* quieter separator */
  --mono: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  --sans: "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.55 var(--sans); min-height: 100vh; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--accent); color: #16130f; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }

/* top bar */
#topbar { display: flex; align-items: center; gap: 20px; padding: 0 18px; height: 52px;
  background: var(--panel); border-bottom: 2px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 16px; letter-spacing: .4px; }
.brand-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 8px 1px color-mix(in srgb, var(--accent) 60%, transparent); }
/* brand becomes the station switcher launcher */
#brandBtn { display: flex; align-items: center; gap: 9px; background: none; border: none; cursor: pointer;
  color: var(--text); font-size: 16px; letter-spacing: .4px; padding: 4px 8px; border-radius: 8px; }
#brandBtn:hover { background: var(--panel-2); }
.brand-caret { color: var(--text-dim); font-size: 11px; }
/* single-station: brand dot goes green (pulsing) while on air */
#brandBtn.playing .brand-dot { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); animation: af-pulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { #brandBtn.playing .brand-dot { animation: none; } }
/* station switcher popover */
.station-menu { position: absolute; top: 48px; left: 12px; z-index: 40; min-width: 240px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.45); padding: 6px; }
.station-menu .sm-head { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--text-dim); padding: 8px 10px 6px; }
.station-menu .sm-row { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none;
  border: none; color: var(--text); padding: 9px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; }
.station-menu .sm-row:hover { background: var(--panel-2); }
.station-menu .sm-row.active { color: var(--accent); }
.station-menu { max-height: 70vh; overflow-y: auto; }
.station-menu .sm-head { display: flex; align-items: center; justify-content: space-between; }
.station-menu .sm-count { font-size: 11px; color: var(--ok); font-weight: 700; letter-spacing: .3px; }
.station-menu .sm-swatch { width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; }
.station-menu .sm-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.station-menu .sm-onair { font-size: 10px; font-weight: 800; letter-spacing: .5px; color: #06210f; background: var(--ok); padding: 2px 7px; border-radius: 10px; }
.station-menu .sm-off { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; }
.station-menu .sm-open { color: var(--text-dim); font-size: 12px; }
.station-menu .sm-cur { font-size: 10px; color: var(--accent); text-transform: uppercase; letter-spacing: .5px; }
.station-menu .sm-add { color: var(--accent); border-top: 1px solid var(--line-soft); margin-top: 4px; }
/* many open stations: let the tab strip scroll instead of overflowing the bar */
.station-tabs { max-width: 52vw; overflow-x: auto; scrollbar-width: thin; }
/* open-station tabs */
.station-tabs { display: flex; gap: 4px; align-items: center; margin: 0 6px; }
.station-tab { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px 8px 0 0;
  background: var(--panel-2); color: var(--text-dim); cursor: pointer; font-size: 13px; white-space: nowrap; border: 1px solid transparent; }
.station-tab:hover { color: var(--text); }
.station-tab.active { background: var(--surface); color: var(--accent); font-weight: 600; border-color: var(--line); border-bottom-color: var(--surface); }
.station-tab .st-x { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 11px; padding: 0 2px; border-radius: 4px; }
.station-tab .st-x:hover { color: #fff; background: #e5484d; }
/* Three independent signals so nothing competes:
   1) station identity = the color swatch, 2) which you're working on = the ACTIVE (selected) tab,
   3) which are on air = the green ON AIR pill (the thing you scan for across many stations). */
.station-tab .st-swatch { width: 10px; height: 10px; border-radius: 2px; background: var(--st-col, var(--accent)); flex: 0 0 auto; }
.station-tab.active { background: var(--surface); color: var(--text); font-weight: 700; border-color: var(--line);
  border-top: 3px solid var(--st-col, var(--accent)); border-bottom-color: var(--surface); }
/* ON AIR — a compact pulsing green dot on the tab (saves space vs a pill) */
.st-onair { color: var(--ok); font-size: 12px; line-height: 1; flex: 0 0 auto; animation: af-pulse 1.6s ease-in-out infinite; }
.station-tab.live { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 55%, transparent); }
@media (prefers-reduced-motion: reduce) { .st-onair { animation: none; } }
@keyframes af-pulse { 50% { opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .st-onair { } }
/* a thin strip at the very top in the active station's color — always visible */
#topbar { border-top: 3px solid var(--accent); }
/* bold identity banner naming the station you're working on */
#stationRibbon { display: flex; align-items: center; gap: 10px; padding: 8px 18px;
  background: color-mix(in srgb, var(--st-col) 15%, var(--panel)); border-left: 6px solid var(--st-col); border-bottom: 1px solid var(--line); }
#stationRibbon .rb-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--st-col); flex: 0 0 auto;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--st-col) 25%, transparent); }
#stationRibbon .rb-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); }
#stationRibbon .rb-name { font-size: 18px; font-weight: 800; letter-spacing: .4px; color: var(--st-col); }
#stationRibbon .rb-tag { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); }
#stationRibbon .rb-onair { font-size: 11px; font-weight: 800; letter-spacing: .5px; color: #06210f; background: var(--ok); padding: 2px 9px; border-radius: 11px; }
#stationRibbon.live .rb-dot { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); animation: af-pulse 1.6s infinite; }
#mainNav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
#mainNav a { color: var(--text-dim); text-decoration: none; padding: 6px 12px; border-radius: var(--radius);
  border-bottom: 2px solid transparent; white-space: nowrap; }
#mainNav a[hidden] { display: none !important; }   /* AI DJ tab stays gone unless the admin ticks it on */
#mainNav a:hover { color: var(--text); background: var(--panel-2); }
#mainNav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
/* Control Room sub-nav (Library/Clocks/Schedule/Playlists/Admin) — sits just under the top bar */
#crNav { display: flex; gap: 4px; align-items: center; padding: 0 18px; height: 40px;
  background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 52px; z-index: 19; }
#crNav a { color: var(--text-dim); text-decoration: none; padding: 5px 12px; border-radius: var(--radius);
  font-size: 14px; white-space: nowrap; }
#crNav a:hover { color: var(--text); background: var(--panel-2); }
#crNav a[aria-current="page"] { color: var(--accent); font-weight: 600; background: var(--panel-2); }
/* Admin — modern left-rail settings layout (sections in setup order) */
.adm-layout { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: start; margin-top: 6px; }
.adm-rail { position: sticky; top: 104px; display: flex; flex-direction: column; gap: 2px; }
.adm-tab { text-align: left; background: none; border: none; color: var(--text-dim); padding: 10px 12px;
  border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; }
.adm-tab:hover { background: var(--panel-2); color: var(--text); }
.adm-tab[aria-current="page"] { background: var(--panel-2); color: var(--accent); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.adm-sec { display: grid; gap: 16px; }
.adm-sec[hidden] { display: none; }
@media (max-width: 820px) {
  .adm-layout { grid-template-columns: 1fr; }
  .adm-rail { position: static; flex-direction: row; overflow-x: auto; gap: 4px; }
  .adm-tab { white-space: nowrap; }
}
#clockNow { font-size: 15px; color: var(--accent); }
#userBadge { color: var(--text-dim); font-size: 13px; }

main { padding: 20px; max-width: 1500px; margin: 0 auto; }
.pad { padding: 24px; }
h1 { font-size: 21px; margin: 0 0 16px; font-weight: 600; letter-spacing: .3px; }
h2 { font-size: 16px; margin: 22px 0 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }

/* panels & layout */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: 1fr 1fr; } .cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }

/* controls */
.btn { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 7px 14px; font: inherit; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; }
.btn.primary { background: var(--accent); color: #16130f; border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: #ff9a9e; border-color: #6e3438; }
.btn.danger:hover { border-color: var(--on-air); }
.btn.ghost { background: transparent; }
.btn.big { padding: 12px 22px; font-size: 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* DJ portal landing — the station's own logo, shown big and centered like a marketing splash. Made the
   primary identity on the page (David 2026-08-13: don't want it looking like "the control panel") now
   that the top bar itself carries no station name — just a Menu button. */
.dj-brand { margin-bottom: 20px; }
.dj-brand-logo { max-width: 280px; max-height: 140px; width: auto; height: auto; object-fit: contain;
  border-radius: 16px; box-shadow: 0 10px 34px rgba(0,0,0,.45); background: var(--panel-2); padding: 12px; }
.dj-brand-logo.dj-brand-fallback { width: 64px; height: 64px; max-width: none; max-height: none;
  padding: 0; box-shadow: none; background: transparent; }
.dj-brand-name { margin-top: 14px; font-size: 28px; font-weight: 800; letter-spacing: .4px; color: var(--accent); }
/* DJ portal top bar — small AirForge logo + station name, present on every screen (not just Home) */
.dj-top-brand { display: flex; align-items: center; gap: 8px; margin-left: 6px; }
.dj-top-brand img { width: 22px; height: 22px; border-radius: 6px; flex: 0 0 auto; }
.dj-top-brand strong { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: .2px; }
/* DJ portal footer — © line, injected once by app.js boot() for every DJ portal screen */
#djFooter { text-align: center; padding: 18px 10px 22px; color: var(--text-dim); font-size: 12px; }

/* DJ portal landing ("What are you recording?") — equal-size, aligned choice cards */
.vt-choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 18px; }
@media (max-width: 560px) { .vt-choice-grid { grid-template-columns: 1fr; } }
.vt-choice { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px 14px; min-height: 118px; font: inherit; color: var(--text); text-align: center; cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease; }
.vt-choice:hover { border-color: var(--accent); background: var(--panel); transform: translateY(-2px); }
.vt-choice:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.vt-choice.primary { background: var(--accent); color: #16130f; border-color: var(--accent); }
.vt-choice.primary:hover { filter: brightness(1.06); }
.vt-choice-icon { font-size: 28px; line-height: 1; }
.vt-choice-title { font-size: 16px; font-weight: 700; }
.vt-choice-sub { font-size: 12.5px; opacity: .75; }
.vt-choice.primary .vt-choice-sub { opacity: .85; }
input, select, textarea { background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 7px 10px; font: inherit; }
label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 3px; }
.field { margin-bottom: 12px; }
/* A field's control fills its column. Without this, inputs/textareas fell back to the browser's tiny
   default size and looked shrunken. An explicit inline width (e.g. the small number boxes) still wins. */
.field > input, .field > select, .field > textarea { width: 100%; box-sizing: border-box; display: block; }
.field > textarea { min-height: 76px; resize: vertical; }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--text-dim); font-weight: 600; font-size: 12px; text-transform: uppercase;
  letter-spacing: .6px; padding: 8px 10px; border-bottom: 2px solid var(--line); }
td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: var(--panel-2); }
.table-wrap { overflow-x: auto; }

/* Library table: compact rows and content-sized width so columns don't stretch across a wide screen. */
#libTable table { width: auto; min-width: 900px; max-width: 100%; }
#libTable th, #libTable td { padding: 4px 12px; white-space: nowrap; }
#libTable th:nth-child(2), #libTable td:nth-child(2) { white-space: normal; max-width: 380px; }   /* Title may wrap */
#libTable td:last-child { white-space: nowrap; }        /* keep Track Tool + Edit on one line */
#libTable .btn.small { padding: 3px 9px; }

/* tags & status */
.tag { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--line); color: var(--text-dim); }
.tag.cat { border-color: transparent; color: #16130f; font-weight: 600; }
.status-on { color: var(--ok); } .status-off { color: var(--text-dim); }
.badge-onair { background: var(--on-air); color: #fff; font-weight: 700; letter-spacing: 2px;
  padding: 4px 14px; border-radius: var(--radius); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .72; } }
@media (prefers-reduced-motion: reduce) { .badge-onair { animation: none; } }

/* login/setup */
.auth-wrap { max-width: 400px; margin: 9vh auto; }
.auth-logo { text-align: center; font-size: 26px; margin-bottom: 24px; letter-spacing: 1px; }
.auth-logo .brand-dot { display: inline-block; margin-right: 10px; width: 16px; height: 16px; }

/* schedule grid */
/* compact schedule toolbar — one tight row instead of a tall Step 1/2/3 panel */
.sched-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; margin-bottom: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; position: sticky; top: 52px; z-index: 5; }
.sched-sep { width: 1px; height: 20px; background: var(--line); }
.sched-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; cursor: pointer;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.sched-chip:hover { border-color: var(--accent); }
.sched-chip.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.sched-chip .sw { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto; }
.sched-chip.erase.on { color: var(--on-air); box-shadow: inset 0 0 0 1px var(--on-air); border-color: var(--on-air); }
.sched-grid { display: grid; grid-template-columns: 46px repeat(7, 1fr); gap: 2px; font-size: 12px; }
.sched-grid .hd { color: var(--text-dim); text-align: center; padding: 4px 0; font-weight: 600; }
.sched-grid { gap: 1px; }
.sched-cell { background: var(--panel); border: 1px solid var(--line); border-radius: 2px; min-height: 22px;
  cursor: pointer; padding: 0 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #16130f;
  font-weight: 600; font-size: 11px; line-height: 22px; }
.sched-cell.empty { color: var(--text-dim); font-weight: 400; }
.sched-cell:hover { outline: 1px solid var(--accent); }
.hour-label { color: var(--text-dim); text-align: right; padding-right: 7px; line-height: 22px; font-size: 10px; }
/* the fill-hour / fill-day buttons drive the row height — keep them just under the cell height */
.sched-grid .hour-label .btn, .sched-grid .hd .btn { padding: 0 4px; font-size: 9px; line-height: 22px; min-height: 0; height: 22px; border-radius: 2px; }
.sched-grid .hd { padding: 1px 0; }
.sched-grid .hour-label { display: flex; align-items: center; justify-content: flex-end; }

/* clock slot editor */
.slot { display: flex; gap: 8px; align-items: center; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 6px 10px; margin-bottom: 6px; }
.slot .num { color: var(--text-dim); width: 24px; }
.slot .type { font-weight: 600; min-width: 110px; }

/* studio — clean, minimal playout dashboard */
.spl-top { display: flex; align-items: center; gap: 14px; padding: 3px 14px; background: var(--surface);
  border: 1px solid var(--line-soft); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.spl-date { font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: .2px; }
.spl-clock { font-size: 17px; font-weight: 600; color: var(--accent); }
.spl-el { text-align: center; margin-left: 14px; }
.spl-bar { display: flex; align-items: center; gap: 14px; padding: 7px 14px; border: none; }
.spl-bar-label { min-width: 92px; font-size: 10px; text-transform: uppercase; letter-spacing: .9px;
  color: var(--text-dim); font-weight: 600; }
.spl-last { background: var(--panel); color: var(--text-dim); }
.spl-now { background: var(--surface); color: var(--text); padding: 8px 14px; border-left: 3px solid var(--ok); }
.spl-now strong { font-size: 17px; }
.spl-next { background: var(--panel); color: var(--text-dim); border-left: 3px solid var(--line); padding: 6px 14px; }
/* Now + Next split 50/50 on one line with a divider between them */
.spl-nownext { display: flex; align-items: center; padding: 8px 0; background: var(--surface); border-left: 3px solid var(--ok); }
.spl-now-cell { flex: 1 1 50%; min-width: 0; display: flex; align-items: baseline; gap: 10px; overflow: hidden; padding: 0 16px; }
.spl-now-cell strong { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spl-next-cell { flex: 1 1 50%; min-width: 0; display: flex; align-items: baseline; gap: 8px; overflow: hidden; padding: 0 16px;
  border-left: 1px solid var(--line); color: var(--text-dim); }
.spl-next-cell #spNext { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spl-stats { background: var(--panel); border: none; border-top: 1px solid var(--line-soft);
  padding: 6px 14px; gap: 18px; font-size: 12px; color: var(--text-dim);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.spl-stats strong { color: var(--warn); font-weight: 600; }
.spl-btns { margin: 8px 0; gap: 6px; flex-wrap: wrap; }
.spl-btns .btn.big { flex: 0 0 auto; padding: 5px 10px; font-size: 11px; font-weight: 500; border-radius: 6px;
  background: var(--panel-2); border: 1px solid var(--line-soft); color: var(--text); }
/* shrink the whole control bar ~20% (buttons + date/hour section) */
.spl-load .btn, .spl-load input, .spl-load select { padding: 4px 8px; font-size: 12px; }
.spl-btns .btn.big:hover { border-color: var(--accent); background: var(--panel); }
/* lit/active toggle (Automate, Hour, etc.) — must beat the base .spl-btns .btn.big rule above */
.spl-btns .btn.big.primary { background: var(--accent); color: #16130f; border-color: var(--accent); font-weight: 600; }
/* Play lights green ONLY while actually playing (has .primary); idle = neutral like the others */
.spl-btns #stPlay.primary { background: var(--ok); border-color: var(--ok); color: #08160b; font-weight: 600; }
.spl-btns #stPlay.primary:hover { filter: brightness(1.08); background: var(--ok); border-color: var(--ok); }
/* transport + hour-load on one line, two sections split by a divider */
.spl-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 8px 0; }
/* date/hour on the LEFT, transport commands on the RIGHT, split by a divider */
.spl-load { order: -1; display: flex; align-items: center; gap: 6px; }
.spl-controls .spl-btns { margin: 0 0 0 auto; padding-left: 14px; border-left: 1px solid var(--line); }
/* thin progress bar under Now Playing */
.spl-progress { height: 5px; background: var(--panel); overflow: hidden; margin-bottom: 2px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.spl-progress > #spProgress { height: 100%; width: 0; background: var(--ok); transition: width .25s linear; }
.spl-grid { width: 100%; font-size: 13px; }
.spl-grid td, .spl-grid th { padding: 4px 10px; }
.spl-grid td { border-bottom: 1px solid var(--line-soft); }
.spl-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--panel);
  color: var(--text-dim); font-size: 11px; letter-spacing: .6px; border-bottom: 1px solid var(--line); }
.spl-row-current td { background: color-mix(in srgb, #4a90d9 18%, transparent) !important; color: #fff; font-weight: 600; }
.spl-row-played td { opacity: .42; }
/* look-ahead rows (future hours shown via "View N hr") — dimmer, with an hour marker */
.spl-grid tr.ro-lookahead td { opacity: 1; }
.spl-grid tr.ro-lookahead .la-hr { color: var(--accent); font-weight: 700; }
.spl-grid tr.ro-lookahead + tr:not(.ro-lookahead) td { border-top: 2px solid var(--line); }
/* clear break between hours in the queue */
.spl-grid tr.spl-hour-start td { border-top: 2px solid var(--accent); }
.spl-row-marker td { color: #6ea8ff; font-weight: 600; }
.spl-ic { width: 26px; text-align: center; }
.spl-ic.on { color: var(--ok); } .spl-ic.off { color: var(--on-air); }
/* lighten the running-order type tint inside the queue — keep the slim left accent bar */
.studio .spl-grid tr.ro-music  { background: color-mix(in srgb, #4a90d9 8%, transparent); }
.studio .spl-grid tr.ro-jingle { background: color-mix(in srgb, #f0862d 8%, transparent); }
.studio .spl-grid tr.ro-spot   { background: color-mix(in srgb, #46a758 8%, transparent); }
.studio .spl-grid tr.ro-vt     { background: color-mix(in srgb, #ec5f9e 9%, transparent); }
.spl-status { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 10px 16px; gap: 20px; margin-top: 12px; color: var(--text-dim); }
.flash { animation: af-flash .5s steps(2) infinite; }
@keyframes af-flash { 50% { color: var(--on-air); } }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; color: var(--on-air); } }
/* v1.5.6: columns flex (minmax) and the stacked phone layout starts at 780px, not 1000 - a Mac
   with Chrome zoomed to 150% reported ~930px CSS width and got the phone layout on a huge screen. */
/* THREE tracks, because the grid holds THREE children: queue | drag-bar | side panel. The old
   two-track template let the 10px drag-bar swallow the whole second column and pushed the cart
   wall/library onto a second ROW for every browser without a saved split width (fresh browsers,
   iPads, the Valley's Mac) - width had nothing to do with it (David 2026-08-26). */
.studio { display: grid; grid-template-columns: minmax(0, 1.4fr) 10px minmax(300px, 1fr); gap: 20px; margin-top: 4px; }
@media (max-width: 700px) { .studio { grid-template-columns: 1fr; } }   /* 700: EVERY iPad (768+ CSS px) keeps two columns; only phones stack (David 2026-08-26) */
/* Drag-bar between the queue and the cart wall (afStudioSplit() in app.js already wires the drag —
   this was the missing visual: the element existed with zero CSS, so it was never actually visible). */
.st-split { width: 10px; min-width: 10px; cursor: col-resize; align-self: stretch; justify-self: center; background: var(--line); border-radius: 4px; transition: background .15s; }
.st-split:hover, .st-split.dragging { background: var(--accent); }
.st-split:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.af-col-resizing { cursor: col-resize !important; user-select: none; }
@media (max-width: 700px) { .st-split { display: none; } }
.deck { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--panel); }
.deck.live { border-color: var(--on-air); box-shadow: 0 0 0 1px var(--on-air); }
.deck .title { font-size: 18px; font-weight: 600; }
.deck .artist { color: var(--text-dim); }
.time-big { font-family: var(--mono); font-size: 34px; font-variant-numeric: tabular-nums; }
.time-big.negative { color: var(--warn); }
.progress { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; margin: 8px 0; }
.progress > div { height: 100%; background: var(--accent); width: 0%; }
.queue-item { display: flex; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--line); align-items: center; }
.queue-item.current { background: color-mix(in srgb, var(--accent) 12%, transparent); border-left: 3px solid var(--accent); }
.queue-item.played { opacity: .4; }
.queue-item .pos { width: 26px; color: var(--text-dim); }
.cartwall { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cart { min-height: 60px; border-radius: 8px; border: 1px solid var(--line-soft); background: var(--panel-2);
  color: var(--text); font: inherit; cursor: pointer; padding: 8px; display: flex; flex-direction: column; justify-content: center; }
.cart.assigned { border-color: var(--cart-color, var(--accent)); border-width: 2px; font-weight: 600; }
.cart.cart-sm { min-height: 34px; padding: 4px 8px; font-size: 13px; }
/* compact Quick-library rows: whole row queues next, tiny footprint */
.qlib-row { display: flex; align-items: center; gap: 6px; padding: 5px 8px; font-size: 12.5px; cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.qlib-row:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.qlib-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qlib-cat { font-size: 9.5px; padding: 0 5px; border-radius: 4px; background: var(--panel-2); color: var(--text-dim); }
.qlib-pv { cursor: pointer; opacity: .6; font-size: 12px; }
.qlib-pv:hover { opacity: 1; }
/* keep the Studio transport bar + status visible while the queue scrolls */
.studio-sticky { position: sticky; top: 52px; z-index: 6; background: var(--bg); padding-top: 6px; padding-bottom: 6px; }
/* Open Mic: the whole row goes red while the announcer is live */
.spl-grid tr.openmic-live td { background: #e5484d !important; color: #fff !important; font-weight: 600; }
.spl-grid tr.openmic-live .btn.small { background: #fff; color: #b21620; border-color: #fff; font-weight: 700; }
.spl-grid tr.openmic-live .btn.small.primary { background: #16130f; color: #fff; border-color: #16130f; }
.spl-grid tr.openmic-live .btn-x { color: #fff; opacity: .8; }
/* tiny per-row delete ✕ in the studio queue */
.spl-grid td.spl-del { width: 22px; text-align: center; padding: 0 6px 0 0; }
.btn-x { background: none; border: none; color: var(--text-dim); font-size: 11px; line-height: 1; cursor: pointer;
  padding: 2px 4px; border-radius: 4px; opacity: .55; }
.btn-x:hover { color: #fff; background: #e5484d; opacity: 1; }
/* right column: quick-library list fills down to the bottom, like the queue on the left */
/* Quick library grows to its full song list; the whole right panel (#stSide) is the single scroll,
   so scrolling pushes the cart wall up out of view and the songs fill the space. */
#stLibBody:not([hidden]) { display: flex; flex-direction: column; }
#stLibBody #stLibList { flex: 0 0 auto; overflow: visible; }
/* big red splash while previewing a song (live playout is muted) */
#previewSplash { position: fixed; inset: 0; z-index: 9998; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(160, 12, 18, .82); color: #fff; font-size: 12vw; font-weight: 900; letter-spacing: .12em; cursor: pointer;
  text-shadow: 0 4px 24px rgba(0,0,0,.5); animation: pv-pulse 1s ease-in-out infinite; }
#previewSplash .pv-hint { font-size: 20px; font-weight: 600; letter-spacing: .05em; opacity: .85; margin-top: 8px; }
@keyframes pv-pulse { 50% { opacity: .78; } }
@media (prefers-reduced-motion: reduce) { #previewSplash { animation: none; } }
/* soften the queue card to match the studio surfaces */
#stQueueWrap.panel { border-color: var(--line-soft); border-radius: var(--radius-lg); }
.cart.playing { background: var(--cart-color, var(--accent)); color: #16130f; }

/* VT editor */
.vt-lane { display: flex; align-items: center; gap: 4px; margin: 14px 0; }
.vt-block { height: 44px; border-radius: 4px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; overflow: hidden; white-space: nowrap; }
.vt-out { background: #33405e; flex: 1; } .vt-in { background: #23496a; flex: 1; }
.vt-mic { background: var(--on-air); color: #fff; min-width: 80px; font-weight: 600; }

/* toasts & modal */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 10px 16px; max-width: 380px; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
.toast.err { border-left-color: var(--on-air); }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 20px; max-width: 640px; width: 92vw; max-height: 88vh; overflow: auto; }
dialog.wide { max-width: 920px; }
dialog select, dialog input { max-width: 100%; }
.sticky-panel { position: sticky; top: -20px; z-index: 5; background: var(--panel);
  padding: 10px 0; margin: 0 0 10px; border-bottom: 2px solid var(--line); }
.dlg-x { position: sticky; top: -12px; float: right; z-index: 20; margin: -8px -8px 0 8px;
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font-size: 15px; cursor: pointer; }
.dlg-x:hover { border-color: var(--on-air); color: var(--on-air); }
dialog::backdrop { background: rgba(0,0,0,.6); }
/* v1.5.7: the preview bar is the ONLY preview UI now (the full-screen red splash is retired) —
   made brighter and unmissable, with its PREVIEW badge pulsing gently. */
#previewBar { position: fixed; left: 16px; bottom: 16px; z-index: 9998; display: flex; align-items: center; gap: 10px;
  background: var(--panel-2); border: 2px solid var(--on-air, #c22); border-radius: 8px; padding: 8px 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,.6); max-width: 480px; }
#previewBar #pvTitle { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#previewBar .pv-badge { color: #fff; background: rgba(160, 12, 18, .92); border-radius: 6px; padding: 2px 8px;
  font-weight: 900; letter-spacing: .08em; font-size: 12px; animation: pv-pulse 1s ease-in-out infinite; flex: none; }
@media (prefers-reduced-motion: reduce) { #previewBar .pv-badge { animation: none; } }
/* v1.5.7: the little ear/headphone preview button that sits before song titles */
.pv-ear { padding: 1px 6px; line-height: 1.3; flex: none; }
.pv-ear:hover { border-color: var(--accent); }
.clickable-title { cursor: pointer; }
.clickable-title:hover { color: var(--accent); text-decoration: underline; }
.dim { color: var(--text-dim); } .small { font-size: 12.5px; }
.right { text-align: right; }

/* DJ running-order row colour coding (subtle tints readable on dark navy) */
.ro-vt      { background: color-mix(in srgb, #ec5f9e 15%, transparent); box-shadow: inset 3px 0 0 #ec5f9e; }
.ro-music   { background: color-mix(in srgb, #4a90d9 13%, transparent); box-shadow: inset 3px 0 0 #4a90d9; }
.ro-jingle  { background: color-mix(in srgb, #f0862d 14%, transparent); box-shadow: inset 3px 0 0 #f0862d; }
.ro-spot    { background: color-mix(in srgb, #46a758 15%, transparent); box-shadow: inset 3px 0 0 #46a758; }
/* a song a DJ manually added — whole row text in red so it stands out */
.ro-added td, .ro-added td .dim, .ro-added td .clickable-title, .ro-added td .num { color: #ff6b6b !important; }
/* the row the DJ has selected as the insert anchor */
.ro-sel { outline: 2px solid var(--accent); outline-offset: -2px; }
.ro-sel td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
tr[draggable="true"] { cursor: grab; }
tr[draggable="true"]:active { cursor: grabbing; }
/* right-click context menu */
.ro-menu .ro-mi { padding: 8px 11px; border-radius: 4px; cursor: pointer; font-size: 13.5px; white-space: nowrap; }
.ro-menu .ro-mi:hover, .ro-menu .ro-mi:focus { background: color-mix(in srgb, var(--accent) 22%, transparent); outline: none; }
/* hide the native horizontal scrollbar where a custom styled one is provided (VT timeline) */
.vt-nobar { scrollbar-width: none; -ms-overflow-style: none; }
.vt-nobar::-webkit-scrollbar { height: 0; width: 0; display: none; }

/* Automate = the one transport light: solid GREEN the moment it's chosen.
   Must out-rank .spl-btns .btn.big (and its :hover), same as the old .primary lit rule. */
.btn.auto-live,
.spl-btns .btn.big.auto-live,
.spl-btns .btn.big.auto-live:hover { background: var(--ok); border-color: var(--ok); color: #06210f; font-weight: 800; }

/* Cart number badge on every cart-wall button */
.cart .cart-no { display:inline-block; min-width:1.4em; text-align:center; margin-right:7px; padding:0 5px;
  border-radius:5px; background:color-mix(in srgb, var(--cart-color,#e8a33d) 30%, transparent);
  color:var(--text); font-weight:800; font-size:12px; opacity:.95; }

/* Studio status lights: "Playing" + one per stream. Red = not doing its thing, green = live. */
.af-status { display:inline-flex; gap:7px; align-items:center; flex-wrap:wrap; }
.af-lite { font-size:12px; font-weight:800; letter-spacing:.4px; padding:3px 11px; border-radius:12px; text-transform:uppercase;
  border:1px solid transparent; white-space:nowrap; }
.af-lite.off { background:color-mix(in srgb, var(--on-air) 22%, transparent); color:#ff9ea0; border-color:color-mix(in srgb, var(--on-air) 55%, transparent); }
.af-lite.on  { background:var(--ok); color:#06210f; border-color:var(--ok); box-shadow:0 0 8px 1px color-mix(in srgb, var(--ok) 45%, transparent); }

/* ---- Voice-track recorder: clean, stepped review layout ---- */
.vt-steps { display: flex; gap: 6px; margin: 6px 0 14px; border-bottom: 1px solid var(--line); }
.vt-step { padding: 9px 16px; cursor: pointer; border: 0; background: transparent; color: var(--text-dim);
  border-bottom: 2px solid transparent; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.vt-step:hover { color: var(--text); }
.vt-step[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.vt-step .vt-num { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; background: var(--panel-2);
  align-items: center; justify-content: center; font-size: 12px; }
.vt-step[aria-selected="true"] .vt-num { background: var(--accent); color: #111; }
.vt-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.vt-card > h3 { margin: 0 0 2px; font-size: 15px; color: var(--text); }
.vt-card .vt-sub { color: var(--text-dim); font-size: 12px; margin: 0 0 10px; line-height: 1.5; }
.vt-toolrow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.vt-toolrow .vt-spacer { flex: 1; }
.vt-review-foot { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-top: 14px; padding: 12px 4px 4px; background: linear-gradient(transparent, var(--panel) 40%); }

/* Admin: collapsible panels — every group shows just its title until clicked */
.adm-collapse{cursor:pointer;user-select:none}
.adm-collapse::before{content:attr(data-caret) " ";color:var(--accent,#e8a33d);font-size:0.9em}
.adm-collapse:hover{color:var(--accent,#e8a33d)}

/* class-based panel collapse (robust against panels whose scripts re-show their own children) */
.panel.af-closed > :not(h2){display:none !important}
/* Track List column-resize grips */
.tl-grip{position:absolute;right:0;top:0;bottom:0;width:7px;cursor:col-resize}
.tl-grip:hover{background:rgba(232,163,61,.35)}

/* Track List: chunky horizontal drag bars for resizing the right-side boxes */
.tl-hgrab{height:12px;margin:2px 0;display:flex;align-items:center;justify-content:center;cursor:row-resize;color:var(--text-dim);font-size:9px;letter-spacing:2px;border-radius:4px;user-select:none}
.tl-hgrab:hover{background:rgba(232,163,61,.3);color:var(--accent,#e8a33d)}

/* ===== Mobile (phones): run the whole station from a handset — control + voice tracking ===== */
@media (max-width: 640px) {
  /* Header wraps to extra rows instead of cramming/clipping its brand, nav and buttons. */
  #topbar { height: auto; min-height: 52px; flex-wrap: wrap; gap: 6px 12px; padding: 8px 12px; }
  #mainNav { order: 4; }
  .station-tabs { max-width: 100%; flex-basis: 100%; order: 5; }
  .topbar-right { gap: 8px; margin-left: auto; }
  #clockNow, #verBadge, #aboutBtn { display: none; }   /* reclaim room; Help + Log out stay */
  #crNav { padding: 0 10px; }                            /* control-room nav scrolls, never clips */

  /* Bigger tap targets; 16px inputs stop iOS auto-zoom on focus. */
  .btn { padding: 9px 14px; }
  .btn.small { padding: 6px 11px; }
  input, select, textarea { padding: 9px 10px; font-size: 16px; }

  /* Edge-to-edge content. */
  main { padding: 12px; }
  .pad { padding: 14px; }
  h1 { font-size: 19px; }

  /* Dialogs go full-screen so the voice-track recorder and folder browser fit a phone.
     100vw/100vh (not %) measure the LAYOUT viewport, which iOS Safari makes wider/taller than what's
     actually visible (scrollbar gutter, address bar) — the dialog overflowed off the right edge, which
     is why the record button needed a horizontal scroll to reach (David 8/14, iPhone). % resolves
     against the real visible viewport for a top-layer <dialog>, so it doesn't overflow. */
  dialog, dialog.wide { width: 100%; max-width: 100%; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh;
    border-radius: 0; border-left: 0; border-right: 0; margin: 0; padding: 14px 12px; }

  /* Multi-column layouts collapse to one column. */
  .grid.cols-2, .grid.cols-3, .cols-2, .cols-3 { grid-template-columns: 1fr; }

  /* Wide widgets scroll horizontally instead of pushing the page sideways. */
  .sched-grid { overflow-x: auto; }
  .studio { grid-template-columns: 1fr; }

  /* Full-width primary/action buttons in the studio and voice-track cards. */
  .studio .btn.big, .vt-card .btn.big, .vt-card .btn.primary { width: 100%; }
}
/* Mobile-only (David 8/14), voice-drop/voice-track recorder: no carts on a phone — #vtCarts is the
   3-cart "fire a drop/jingle during recording" row in the recording dialog. Also drop the two DJ-chooser
   tiles that don't belong on a phone: Create AirCheck and Record Future Show (both desktop workflows).
   Scoped to body.af-mobile (real device check, afIsMobile() in app.js — same one the recorder itself
   already uses), not a width media query, so a phone in landscape or a zoomed-out view still hides them,
   and a narrow DESKTOP window does not. */
body.af-mobile #vtCarts { display: none; }
body.af-mobile #vtModeAircheck, body.af-mobile #vtModeShow { display: none; }
/* Mobile-only, "My voice tracks" hour list: the ● Record button lives in a plain <table>'s last
   column (time | title | artist | actions) — tables don't wrap, so on a phone the row is simply wider
   than the screen and Record sits off the right edge, reachable only by scrolling sideways (David 8/14
   screenshot, iPhone: still couldn't see it after the earlier dialog-width fix, which was a different
   element — this table isn't inside a <dialog> at all). Stack each row's cells as their own full-width
   lines instead, so Record/Redo/✕ always lands on screen with no horizontal scroll. */
body.af-mobile .vt-hr-table, body.af-mobile .vt-hr-table tbody, body.af-mobile .vt-hr-table tr, body.af-mobile .vt-hr-table td {
  display: block; width: auto !important; }
body.af-mobile .vt-hr-table tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
body.af-mobile .vt-hr-table td.right { padding-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
