/* ===== Bauer Media Sans font ===== */
@font-face { font-family:'BauerMediaSans'; src:url('fonts/BauerMediaSans-Light.otf') format('opentype'); font-weight:300; font-style:normal; font-display:swap; }
@font-face { font-family:'BauerMediaSans'; src:url('fonts/BauerMediaSans-LightItalic.otf') format('opentype'); font-weight:300; font-style:italic; font-display:swap; }
@font-face { font-family:'BauerMediaSans'; src:url('fonts/BauerMediaSans-Regular.otf') format('opentype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'BauerMediaSans'; src:url('fonts/BauerMediaSans-RegularItalic.otf') format('opentype'); font-weight:400; font-style:italic; font-display:swap; }
@font-face { font-family:'BauerMediaSans'; src:url('fonts/BauerMediaSans-Bold.otf') format('opentype'); font-weight:700; font-style:normal; font-display:swap; }
@font-face { font-family:'BauerMediaSans'; src:url('fonts/BauerMediaSans-BoldItalic.otf') format('opentype'); font-weight:700; font-style:italic; font-display:swap; }

/* ===== CSS Variables — Bauer Media Dark Theme ===== */
:root {
  --bg: #0f1117;
  --bg2: #14101f;
  --bg3: #1e1830;
  --border: #2d2548;
  --text: #e8eaf0;
  --text-muted: #8892a4;
  --text-dim: #555e72;
  --accent: #6622CC;
  --accent-hover: #7833DD;
  --primary: #6622CC;
  --bauer-purple: #4700A3;
  --bauer-purple-light: #E1DCFF;
  --green: #5CB85C;
  --green-bg: #0f2a1a;
  --red: #D95354;
  --red-bg: #2a0f0f;
  --amber: #F0AD4E;
  --amber-bg: #2a1f0a;
  --capture-btn: #4700A3;
  --capture-btn-hover: #6622CC;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 2px 12px rgba(71,0,163,0.3);
  --font: 'BauerMediaSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== Light Theme — script area only ===== */
body.theme-light .read-notes { background: #ffffff; color: #000000; border-color: #cdd0da; }
body.theme-light .read-notes strong, body.theme-light .read-notes b { color: #000000; }

/* ===== Teleprompter Theme — yellow highlighted script, rest stays dark ===== */
body.theme-teleprompter .read-notes { background: #ffffff; color: #000000; border-color: #cdd0da; }
body.theme-teleprompter .read-notes p.para-content,
body.theme-teleprompter .read-notes div.para-content,
body.theme-teleprompter .read-notes li { background-color: #fef08a; }
body.theme-teleprompter .read-notes strong, body.theme-teleprompter .read-notes b { color: #000000; }
body.theme-teleprompter .read-notes a { color: #1a4fa0; }
body.theme-teleprompter .read-notes h3, body.theme-teleprompter .read-notes h4 { color: #000000; background-color: #fef08a; }

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
img { max-width: 100%; }

/* ===== Layout ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.page { padding: 20px 16px; }

/* ===== Navigation ===== */
.nav {
  background: var(--bg2);
  border-bottom: 3px solid var(--bauer-purple);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand { display:flex; align-items:center; gap:12px; text-decoration:none; }
.nav-logo { height:28px; width:auto; display:block; }
.nav-brand-text { font-size:1.05rem; font-weight:700; color:var(--text); letter-spacing:-0.3px; }
.nav-brand-text span { color:var(--accent); }
.nav-user { display: flex; align-items: center; gap: 12px; font-size: 0.85rem; color: var(--text-muted); }
.nav-tabs { display: flex; gap: 4px; }
.nav-tab {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-tab:hover { background: var(--bg3); color: var(--text); }
.nav-tab.active { background: var(--bg3); color: var(--text); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); background: var(--bg3); }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ===== CAPTURE BUTTON — The Big One ===== */
.btn-capture {
  width: 100%;
  min-height: 48px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  border-radius: var(--radius);
  border: none;
  background: var(--capture-btn);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn-capture:hover:not(:disabled) { background: var(--capture-btn-hover); }
.btn-capture:active:not(:disabled) { transform: scale(0.98); }
.btn-capture:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-capture.btn-capture-locked { opacity: 0.35; cursor: not-allowed; filter: grayscale(0.4); }
.btn-capture.capturing { background: var(--amber); }
.btn-capture.done { background: var(--green); }
.btn-capture.failed { background: var(--red); }

/* ===== Cards ===== */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
}
.card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; gap: 8px; }
.card-title { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.card-client { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }

/* ===== Notes / Script ===== */
.script-section { margin-bottom: 12px; }
.notes-toggle {
  background: none; border: none; color: var(--text-muted); font-size: 0.78rem;
  cursor: pointer; padding: 0 0 6px 0; letter-spacing: 0.3px;
}
.notes-toggle:hover { color: var(--text); }
.read-notes {
  background: #1c1535;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) var(--radius-sm);
  padding: 14px 16px;
  font-size: 1rem;
  color: var(--text);
  line-height: 1.75;
}

/* Text size accessibility levels (applied to #presenter-reads-list) */
#presenter-reads-list.text-size-2 .read-notes { font-size: 1.2rem; line-height: 1.8; }
#presenter-reads-list.text-size-3 .read-notes { font-size: 1.45rem; line-height: 1.85; padding: 16px 18px; }
#presenter-reads-list.text-size-4 .read-notes { font-size: 1.75rem; line-height: 1.9; padding: 18px 20px; }
#presenter-reads-list.text-size-5 .read-notes { font-size: 2.1rem;  line-height: 2.0; padding: 20px 22px; }

/* Text size control buttons */
.text-size-controls { display: flex; align-items: center; gap: 2px; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px; }
.text-size-btn { background: none; border: none; border-radius: 3px; padding: 3px 8px; font-size: 0.78rem; font-weight: 700; color: var(--text-muted); cursor: pointer; line-height: 1; transition: background 0.15s, color 0.15s; }
.text-size-btn:hover:not(:disabled) { background: var(--bg4, var(--border)); color: var(--text); }
.text-size-btn:disabled { opacity: 0.3; cursor: default; }
.read-notes p { margin-bottom: 10px; }
.read-notes p:last-child { margin-bottom: 0; }
.read-notes strong, .read-notes b { font-weight: 700; color: #fff; }
.read-notes em, .read-notes i { font-style: italic; }
.read-notes a { color: #a78bfa; text-decoration: underline; word-break: break-all; }
.read-notes a:hover { color: #c4b5fd; }
.read-notes img { max-width: 100%; border-radius: var(--radius-sm); margin: 10px 0; display: block; }
.read-notes ul, .read-notes ol { padding-left: 22px; margin-bottom: 10px; }
.read-notes li { margin-bottom: 4px; }
.read-notes h3, .read-notes h4 { color: #fff; margin: 12px 0 6px; font-size: 1rem; }

/* ===== Pronunciation guides ===== */
/* Dotted underline so presenters know a guide is available */
.pron {
  border-bottom: 2px dotted var(--accent);
  cursor: help;
  position: relative;
}
/* Tooltip on hover */
.pron::after {
  content: attr(data-pron);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #0d0a17;
  color: #f0eaff;
  border: 1px solid var(--accent);
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-style: italic;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.pron:hover::after { opacity: 1; }
/* Small arrow under the tooltip bubble */
.pron::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 1px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--accent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 201;
}
.pron:hover::before { opacity: 1; }
/* In the editor, show a subtle teal tint so producers see marked words */
[contenteditable] .pron { background: rgba(45, 212, 191, 0.12); border-radius: 2px; }
/* Teleprompter theme: keep highlight but ensure tooltip is still visible */
body.theme-teleprompter .pron::after { background: #fff; color: #000; border-color: #1a4fa0; }

/* Rich editor (producer modal) */
.rich-toolbar {
  display: flex;
  gap: 2px;
  padding: 5px 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  flex-wrap: wrap;
}
.rich-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 0.82rem;
  cursor: pointer;
  line-height: 1.4;
}
.rich-btn:hover { background: var(--bg2); color: var(--text); border-color: var(--border); }
.rich-btn-sep { margin-left: 6px; padding-left: 6px; border-left: 1px solid var(--border) !important; border-radius: 0; }
.rich-vars-wrap { position: relative; display: inline-block; }
.rich-vars-dropdown { position: absolute; top: 100%; left: 0; background: var(--bg2); border: 1px solid var(--border); border-radius: 6px; min-width: 240px; z-index: 100; box-shadow: 0 4px 12px rgba(0,0,0,0.15); padding: 4px 0; }
.rich-var-item { display: block; width: 100%; text-align: left; background: none; border: none; padding: 8px 14px; font-size: 0.85rem; color: var(--text); cursor: pointer; }
.rich-var-item:hover { background: var(--bg3, #2a2a2a); }
.rich-var-item code { font-size: 0.8rem; color: var(--accent, #4f46e5); }
.form-rich-editor {
  min-height: 140px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.65;
  outline: none;
  cursor: text;
}
.form-rich-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(102,34,204,0.2); }
.form-rich-editor:empty::before { content: attr(data-placeholder); color: var(--text-dim); pointer-events: none; }
.form-rich-editor img { max-width: 100%; margin: 4px 0; border-radius: 4px; }
.form-rich-editor a { color: var(--accent); }

/* ===== Capture Result ===== */
.capture-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--green-bg);
  border: 1px solid var(--green);
  border-radius: var(--radius-sm);
  margin-top: 10px;
  font-size: 0.875rem;
}
.capture-result.failed {
  background: var(--red-bg);
  border-color: var(--red);
  color: var(--red);
}
.capture-result audio { height: 32px; flex: 1; min-width: 0; }

/* ===== Station picker (inline on read card) ===== */
.station-picker {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 10px;
  appearance: none;
  -webkit-appearance: none;
}

/* ===== Status badges ===== */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.badge-pending { background: var(--amber-bg, #3d2e00); color: var(--amber, #f59e0b); border: 1px solid currentColor; }
.badge-processing { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber); }
.badge-ready { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }
.badge-failed { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }
.badge-active { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }
.badge-inactive { background: var(--bg3); color: var(--text-muted); border: 1px solid var(--border); }
.badge-draft { background: var(--bg3); color: var(--accent); border: 1px solid var(--accent); }
.badge-archived { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber); }
.badge-expired { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }
.badge-confirmed { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }
.badge-cancelled { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }
.badge-approved { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }
.badge-rejected { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }
.badge-no-cover { background: var(--amber-bg, #3d2e00); color: var(--amber, #f59e0b); border: 1px solid currentColor; }
.badge-upcoming { background: #0f1f2a; color: #60a5fa; border: 1px solid #2563eb; }
.badge-presenter { background: #1a2a3a; color: #60a5fa; border: 1px solid #2563eb; }
.badge-producer { background: #1a2a20; color: #4ade80; border: 1px solid #16a34a; }
.badge-content_producer { background: #0f2a28; color: #2dd4bf; border: 1px solid #0d9488; }
.badge-admin { background: #2a1a2a; color: #c084fc; border: 1px solid #7e22ce; }

/* ===== Feature badges (user list) ===== */
.feature-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.feature-badge-on { background: var(--green-bg, #0f2a1a); color: var(--green, #4ade80); border-color: var(--green, #4ade80); }
.feature-badge-off { background: var(--bg3); color: var(--text-muted); }

/* ===== Bulk action bar ===== */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg2);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.bulk-bar-count { font-size: 0.82rem; font-weight: 600; color: var(--accent); white-space: nowrap; margin-right: 4px; }
.bulk-bar-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; flex: 1; }
.bulk-bar-label { font-size: 0.75rem; color: var(--text2); white-space: nowrap; }
.bulk-bar-sep { width: 1px; height: 16px; background: var(--border); margin: 0 4px; }

/* ===== Selected rows ===== */
tr.row-selected td { background: var(--bg2); }

/* ===== Tables ===== */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.table-wrap { overflow-x: auto; }
th[data-sort]:hover { color: var(--text); background: var(--bg2); }
th.sort-active { color: var(--accent); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th {
  background: var(--bg3);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg3); }
.table-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ===== Capture script panel ===== */
.capture-script { padding: 10px 14px; background: var(--bg3); border-top: 1px solid var(--border); border-radius: 0 0 6px 6px; }
.capture-script-inner { font-size: 0.85rem; color: var(--text); line-height: 1.6; }
.capture-script-inner p { margin: 0 0 8px; }
.capture-script-inner p:last-child { margin: 0; }
tr .capture-script-inner { padding: 10px 14px; background: var(--bg3); font-size: 0.85rem; color: var(--text); line-height: 1.6; border-radius: 4px; }

/* ===== Past reads collapsible ===== */
.past-reads-section { margin-top: 24px; }
.past-reads-summary { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 10px 14px; background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; font-size: 0.9rem; font-weight: 600; color: var(--text-muted); list-style: none; user-select: none; }
.past-reads-summary::-webkit-details-marker { display: none; }
.past-reads-summary::before { content: '▶'; font-size: 0.7rem; transition: transform 0.15s; }
details[open] .past-reads-summary::before { transform: rotate(90deg); }
.past-reads-summary:hover { color: var(--text); background: var(--bg3); }
.past-reads-count { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 1px 8px; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.4px; }
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.15s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-select { appearance: none; -webkit-appearance: none; cursor: pointer; }
input[type="date"], input[type="time"], input[type="datetime-local"] { color-scheme: dark; }
.form-hint { font-size: 0.75rem; color: var(--text-dim); margin-top: 4px; }
.form-hint-inline { font-size: 0.75rem; color: var(--text-dim); font-weight: 400; }
.form-row { display: grid; gap: 12px; }
@media (min-width: 600px) { .form-row-2 { grid-template-columns: 1fr 1fr; } }

/* ===== Checkbox ===== */
.check-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.875rem; color: var(--text); }
.check-label input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ===== Station Multi-select ===== */
.station-multiselect { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.station-multiselect-search {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg3);
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.875rem;
}
.station-multiselect-search:focus { outline: none; }
.station-multiselect-list {
  max-height: 180px;
  overflow-y: auto;
  background: var(--bg2);
}
.station-multiselect-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.station-multiselect-list label:last-child { border-bottom: none; }
.station-multiselect-list label:hover { background: var(--bg3); color: var(--text); }
.station-multiselect-list input[type=checkbox] { accent-color: var(--accent); flex-shrink: 0; }
.station-multiselect-list label.selected { color: var(--text); background: rgba(79, 126, 248, 0.08); }
.station-count { font-size: 0.75rem; color: var(--text-dim); margin-top: 4px; }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 20px 16px;
  overflow-y: auto;
}
.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 620px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  position: relative;
}
.modal-wide { max-width: 760px; }

/* Full-page editor */
.modal-page-backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 200; overflow: hidden; display: flex; background: var(--bg); }
.modal-page-editor { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; overflow: hidden; }
.modal-page-header { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--bg2); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-page-title { flex: 1; font-size: 1.1rem; font-weight: 600; color: var(--text); }
.modal-page-actions { display: flex; gap: 8px; }
.modal-page-body { flex: 1; overflow-y: auto; background: var(--bg); -webkit-overflow-scrolling: touch; }
.modal-page-body-inner { max-width: 900px; margin: 0 auto; padding: 24px; }
body.modal-page-open { overflow: hidden; }

/* Image picker */
.imgpicker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 2px;
}
.imgpicker-item {
  position: relative;
  cursor: pointer;
  border-radius: 6px;
  border: 2px solid transparent;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--bg3);
  transition: border-color 0.12s;
}
.imgpicker-item:hover { border-color: var(--border-active, #555); }
.imgpicker-item.selected { border-color: #4f46e5; box-shadow: 0 0 0 2px rgba(79,70,229,0.3); }
.imgpicker-item img { width: 100%; height: 100%; object-fit: contain; display: block; }
.imgpicker-delete {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.75);
  border: none; color: #fff; font-size: 11px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.12s;
  line-height: 1;
}
.imgpicker-item:hover .imgpicker-delete { opacity: 1; }
.imgpicker-empty { grid-column: 1/-1; text-align: center; color: var(--text-muted); padding: 32px 16px; font-size: 0.9rem; }
.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: var(--text-muted);
  font-size: 1.4rem; cursor: pointer; line-height: 1;
  padding: 4px; border-radius: var(--radius-sm);
}
.modal-close:hover { color: var(--text); background: var(--bg3); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ===== Alerts / Toasts ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 14px;
}
.alert-error { background: var(--red-bg); border: 1px solid var(--red); color: var(--red); }
.alert-success { background: var(--green-bg); border: 1px solid var(--green); color: var(--green); }
.alert-warning { background: var(--amber-bg); border: 1px solid var(--amber); color: var(--amber); }

#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  z-index: 999;
  box-shadow: var(--shadow);
  transition: opacity 0.3s;
  pointer-events: none;
}
#toast.hidden { opacity: 0; }

/* ===== Loading spinner ===== */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Section headings ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.section-title { font-size: 1rem; font-weight: 600; color: var(--text); }
.section-subtitle { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* ===== Filter bar ===== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}
.filter-bar .form-input, .filter-bar .form-select {
  width: auto;
  flex: 1;
  min-width: 140px;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ===== Empty state ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.4; }
.empty-state-text { font-size: 0.95rem; }
.empty-state-sub { font-size: 0.8rem; margin-top: 6px; color: var(--text-dim); }

/* ===== History list ===== */
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.history-item:last-child { border-bottom: none; }
.history-info { flex: 1; min-width: 0; }
.history-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-meta { color: var(--text-muted); font-size: 0.8rem; margin-top: 2px; }
.history-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ===== System health ===== */
.health-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.health-ok { background: var(--green); }
.health-warn { background: var(--amber); }
.health-error { background: var(--red); }
.health-off { background: var(--text-dim); }
.disk-bar { height: 8px; background: var(--bg3); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.disk-bar-fill { height: 100%; background: var(--accent); transition: width 0.3s; border-radius: 4px; }
.disk-bar-fill.warn { background: var(--amber); }
.disk-bar-fill.danger { background: var(--red); }

/* ===== Login view ===== */
#view-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
}
.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: 4px solid var(--bauer-purple);
  border-radius: var(--radius);
  padding: 36px 32px 32px;
  box-shadow: 0 8px 40px rgba(71,0,163,0.25);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-bauer-logo { height: 36px; width: auto; margin: 0 auto 14px; display: block; }
.login-app-name { font-size: 1.2rem; font-weight: 700; color: var(--text); letter-spacing: -0.3px; margin-bottom: 2px; }
.login-logo p { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* ===== Hamburger button ===== */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
}
.nav-hamburger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.2s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Mobile menu dropdown ===== */
.nav-mobile-menu {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  padding: 8px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.nav-mobile-menu .nav-tab {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  font-size: 1rem;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .nav-tabs { display: none; }
  .nav-hamburger { display: flex; }
  .card { padding: 16px; }
  .modal { padding: 18px; }
  th, td { padding: 8px 10px; }
  .hide-mobile { display: none !important; }
}
@media (min-width: 768px) {
  .page { padding: 24px; }
  .btn-capture { font-size: 1rem; min-height: 52px; }
}

/* ===== Password change overlay ===== */
#view-change-password {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(0,0,0,0.8);
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0; inset: 0;
  z-index: 300;
}

/* ===== Utils ===== */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.8rem; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.font-bold { font-weight: 700; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== Per-station capture buttons ===== */
.capture-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.station-capture-wrap { display: flex; flex-direction: column; }
.btn-capture {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.capture-station-name {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.9;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.capture-btn-label {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.btn-capture.capturing .capture-btn-label { font-size: 0.95rem; }
.btn-capture.done .capture-btn-label { font-size: 0.95rem; }
.btn-capture.done { filter: brightness(0.85); }
.btn-capture.capturing { filter: brightness(0.75); }

/* ===== Slot chips ===== */
.read-slots {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.slot-chip {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}
.slot-badge-sm {
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ---- Playlist station filter ---- */
.playlist-filter { display:flex; align-items:center; gap:8px; padding:8px 0 12px; flex-wrap:wrap; }
.filter-label { font-size:0.8rem; color:var(--text-dim); }
.filter-btn { padding:4px 12px; border-radius:20px; border:2px solid var(--border); background:transparent; color:var(--text-main); font-size:0.8rem; cursor:pointer; transition:all 0.15s; }
.filter-btn.active { background:var(--primary); border-color:var(--primary); color:#fff; }
.filter-btn:hover:not(.active) { border-color:var(--primary); color:var(--primary); }

/* ---- Week schedule grid ---- */
.sched-week-nav { display:flex; align-items:center; gap:10px; }
.schedule-grid-outer { overflow-x:auto; margin-top:4px; border:1px solid var(--border); border-radius:8px; }
.schedule-grid { min-width:680px; }
.sg-row { display:flex; border-bottom:1px solid var(--border); }
.sg-row:last-child { border-bottom:none; }
.sg-header-row .sg-header-cell:not(.sg-time-cell) { flex:1; min-width:0; font-weight:600; font-size:0.78rem; text-align:center; background:var(--bg-card); padding:8px 4px; border-right:1px solid var(--border); }
.sg-header-row .sg-header-cell:last-child { border-right:none; }
.sg-time-cell { flex:0 0 58px; padding:6px 8px 6px 4px; text-align:right; font-size:0.72rem; color:var(--text-dim); background:var(--bg-main); border-right:1px solid var(--border); }
.sg-header-cell.sg-time-cell { background:var(--bg-main); }
.sg-cell { flex:1; min-width:0; padding:3px 4px; border-right:1px solid var(--border); min-height:34px; }
.sg-cell:last-child { border-right:none; }
.sg-today-col { background:color-mix(in srgb, var(--primary) 7%, var(--bg-card)); }
.sg-entry { border-radius:3px; padding:2px 5px; font-size:0.67rem; margin-bottom:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:default; line-height:1.4; }
.sg-entry[draggable] { cursor:grab; }
.sg-entry.sg-dragging { opacity:0.4; }
.sg-cell.sg-drop-over { background:var(--accent-dim, rgba(99,102,241,0.15)); outline:2px dashed var(--accent); outline-offset:-2px; }
.sg-row-empty .sg-time-cell { opacity:0.4; font-size:0.65rem; }
.sg-row-empty .sg-cell { min-height:18px; }
.sg-row-empty { border-bottom:1px solid var(--border-faint, rgba(255,255,255,0.04)); }
.sg-row-oor { display:none; }

/* ===== Schedule section in read modal ===== */
.schedule-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 16px;
  overflow: hidden;
}
.schedule-summary {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  list-style: none;
  user-select: none;
}
.schedule-summary::-webkit-details-marker { display: none; }
.schedule-summary::after { content: '▸'; font-size: 0.75rem; color: var(--text-muted); }
details[open] .schedule-summary::after { content: '▾'; }
.slot-badge {
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 2px 9px;
}
.schedule-body {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}
.mb-8 { margin-bottom: 8px; }
.schedule-preview {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.sched-preview-inner { padding: 10px 14px; }
.sched-day {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.sched-day:last-child { border-bottom: none; }
.sched-date {
  font-weight: 600;
  color: var(--text);
  min-width: 80px;
}

/* ===== Playlist (Presenter Timeline) ===== */
.playlist-item {
  display: flex;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.playlist-item:last-child { border-bottom: none; }
.playlist-time-col {
  flex-shrink: 0;
  width: 82px;
  min-width: 72px;
  text-align: center;
}
.countdown-badge {
  display: block;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 4px;
  word-break: break-word;
}
@keyframes pulse-now {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}
.countdown-now  { background: var(--green); color: #000; animation: pulse-now 1.4s ease-in-out infinite; }
.countdown-soon { background: var(--red); color: #fff; }
.countdown-upcoming { background: var(--amber); color: #000; }
.countdown-later { background: var(--bg3); color: var(--text-muted); border: 1px solid var(--border); }
.countdown-past { background: transparent; color: var(--red); border: 1px solid var(--red); }
.countdown-none { background: var(--bg3); color: var(--text-dim); border: 1px solid var(--border); }
.slot-time-lbl { font-size: 0.72rem; color: var(--text-muted); letter-spacing: 0.3px; }
.playlist-logo-col { margin-top: 8px; }
.playlist-logo { width: 72px; height: 72px; object-fit: contain; border-radius: 6px; background: var(--bg3); display: block; }
.playlist-body { flex: 1; min-width: 0; }
.playlist-row-header { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.playlist-title { font-size: 1rem; font-weight: 600; color: var(--text); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playlist-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.playlist-station-tag { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 2px 7px; border-radius: 10px; letter-spacing: 0.3px; white-space: nowrap; }
.playlist-client-name { font-size: 0.85rem; color: var(--text-muted); }
.slot-clear-btn { flex-shrink: 0; padding: 2px 8px; font-size: 0.8rem; opacity: 0.6; }
.slot-clear-btn:hover { opacity: 1; }
.slot-remind-btn { flex-shrink: 0; padding: 2px 10px; font-size: 0.78rem; opacity: 0.8; color: var(--amber, #f59e0b); border-color: var(--amber, #f59e0b); }
.slot-remind-btn:hover { opacity: 1; }

/* ===== Schedule mode selector ===== */
.sched-mode-group { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.radio-label { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; cursor: pointer; color: var(--text); }
.radio-label input[type=radio] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

/* ===== Daypart editor ===== */
.dp-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.dp-tab-btn {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg3);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.dp-tab-btn:hover { background: var(--bg2); color: var(--text); }
.dp-tab-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.daypart-editor { margin-top: 10px; }
.daypart-row {
  display: grid;
  grid-template-columns: 1fr 100px 100px 32px;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.daypart-row.has-reads-toggle {
  grid-template-columns: 1fr 100px 100px auto 32px;
}
.daypart-row input { padding: 6px 8px; font-size: 0.85rem; }
.daypart-row .dp-reads-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text2);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.daypart-del { background: none; border: none; color: var(--red); cursor: pointer; font-size: 1.1rem; padding: 4px; }

/* ===== Colour picker ===== */
.logo-upload-row { display: flex; align-items: flex-start; gap: 12px; }
.emergency-audio-upload-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.emergency-audio-status { font-size: 0.85rem; color: var(--text-muted); flex: 1; min-width: 120px; }
.logo-preview { width: 72px; height: 72px; object-fit: contain; border-radius: 6px; background: var(--bg3); border: 1px solid var(--border); flex-shrink: 0; }
.logo-preview-empty { display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: 6px; background: var(--bg3); border: 1px dashed var(--border); flex-shrink: 0; }
/* Inline client logo beside client name input */
.client-logo-row { display: flex; gap: 8px; align-items: center; }
.client-logo-row .form-input { flex: 1; min-width: 0; }
.client-logo-thumb { width: 36px; height: 36px; object-fit: contain; border-radius: 4px; background: var(--bg3); border: 1px solid var(--border); display: block; flex-shrink: 0; }
.client-logo-thumb-empty { width: 36px; height: 36px; border-radius: 4px; background: var(--bg3); border: 1px dashed var(--border); display: block; flex-shrink: 0; }
.client-logo-btn { flex-shrink: 0; white-space: nowrap; }
.colour-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.colour-input {
  width: 44px;
  height: 38px;
  padding: 2px 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg3);
  cursor: pointer;
  flex-shrink: 0;
}
.colour-hex {
  max-width: 110px;
  font-family: monospace;
}
.colour-preview {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* ===== History Drawer ===== */
.history-drawer { position:fixed; top:0; right:-400px; width:min(400px,100vw); height:100vh; background:var(--bg-card, var(--bg2)); border-left:1px solid var(--border); z-index:300; transition:right 0.25s ease; display:flex; flex-direction:column; }
.history-drawer.open { right:0; }
.drawer-backdrop { position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:299; }
.drawer-header { display:flex; align-items:center; justify-content:space-between; padding:16px; border-bottom:1px solid var(--border); flex-shrink:0; }
.drawer-title { font-weight:600; font-size:1rem; }
.drawer-close { background:none; border:none; color:var(--text-dim); font-size:1.5rem; cursor:pointer; line-height:1; padding:4px 8px; }
.drawer-close:hover { color:var(--text); }
.drawer-body { flex:1; overflow-y:auto; padding:12px; }

/* ===== Link buttons (producer clickable counts) ===== */
.link-btn { background:none; border:none; color:var(--accent); cursor:pointer; padding:0; font-size:inherit; text-decoration:underline; }
.link-btn:hover { color:var(--accent-hover); }

/* ===== Slot management modal styles ===== */
.slot-row { display:flex; align-items:flex-start; gap:12px; padding:12px; border-bottom:1px solid var(--border); }
.slot-row:last-child { border-bottom:none; }
.slot-station-section { margin-bottom:16px; }
.slot-station-label { font-weight:600; margin-bottom:0; padding:10px 10px 10px 10px; background:var(--bg); border-radius:6px; display:flex; align-items:center; gap:8px; }
.slot-station-label.slot-station-toggle:hover { background:var(--bg3); }
.slot-station-meta { font-size:0.75rem; font-weight:400; color:var(--text-muted); margin-left:4px; }
.slot-chevron { margin-left:auto; font-size:0.7rem; color:var(--text-muted); transition:transform 0.15s; }
.slot-station-body { padding-top:10px; }
.slot-list { margin-bottom:8px; }
.slot-entry { display:flex; align-items:center; gap:8px; padding:4px 0; border-bottom:1px solid var(--border-light,#2a2a3a); }
.slot-entry:last-child { border-bottom:none; }
.slot-entry-done { opacity:0.6; }
.slot-entry-date { color:var(--text-dim); font-size:0.85rem; min-width:80px; }
.slot-entry-time { font-weight:500; min-width:50px; }
.slot-status-badge { font-size:0.72rem; font-weight:600; padding:1px 7px; border-radius:20px; letter-spacing:0.3px; }
.slot-status-captured { background:rgba(34,197,94,0.15); color:#22c55e; }
.slot-status-cleared { background:rgba(156,163,175,0.15); color:#9ca3af; }
.add-slot-form { display:flex; gap:6px; flex-wrap:wrap; align-items:center; margin-top:8px; }
.slots-modal-body { max-height:70vh; overflow-y:auto; }
.sched-mini { background:var(--bg); border:1px solid var(--border); border-radius:6px; padding:10px; margin-top:8px; }
.sched-mini-title { font-size:0.8rem; font-weight:600; color:var(--text-dim); margin-bottom:8px; text-transform:uppercase; letter-spacing:0.05em; }

/* ===== Captures modal styles ===== */
.captures-modal-body { max-height:70vh; overflow-y:auto; }
.capture-row { display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid var(--border); flex-wrap:wrap; }
.capture-row:last-child { border-bottom:none; }
.capture-who { font-weight:500; min-width:120px; }
.capture-meta { color:var(--text-dim); font-size:0.85rem; }

/* ===== Live / VT mode toggle ===== */
.mode-toggle { display:flex; gap:0; margin-bottom:16px; border:1px solid var(--border); border-radius:8px; overflow:hidden; width:fit-content; }
.mode-btn { background:var(--bg2); color:var(--text-muted); border:none; padding:8px 18px; font-size:0.9rem; font-family:var(--font); cursor:pointer; transition:background 0.15s,color 0.15s; }
.mode-btn:first-child { border-right:1px solid var(--border); }
.mode-btn.active { background:var(--bauer-purple); color:#fff; font-weight:600; }
.mode-btn:hover:not(.active) { background:var(--bg3); color:var(--text); }

/* ===== VT filter bar ===== */
.vt-filter-bar { background:var(--bg2); border:1px solid var(--border); border-radius:8px; padding:14px 16px; margin-bottom:16px; }
.vt-filters { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.vt-filters .form-select, .vt-filters .form-input { min-width:160px; flex:1; max-width:200px; }

/* ===== VT playlist item ===== */
.vt-item { border-left:3px solid var(--bauer-purple); }
.vt-badge-pill { background:var(--bauer-purple); color:#fff; font-size:0.7rem; font-weight:700; padding:3px 8px; border-radius:12px; letter-spacing:0.05em; text-align:center; }

/* ===== VT capture area ===== */
.btn-vt-log { display:block; width:100%; padding:10px 16px; margin-top:10px; background:var(--bauer-purple); color:#fff; border:none; border-radius:8px; font-size:0.95rem; font-family:var(--font); font-weight:600; cursor:pointer; transition:background 0.15s; text-align:center; }
.btn-vt-log:hover { background:var(--accent); }
.vt-timestamp-form { margin-top:10px; padding:12px; background:var(--bg); border:1px solid var(--border); border-radius:8px; }
.vt-ts-input { font-family:var(--font); }
.vt-logged { display:flex; align-items:center; gap:10px; margin-top:10px; padding:10px 14px; background:rgba(92,184,92,0.1); border:1px solid var(--green); border-radius:8px; font-size:0.9rem; flex-wrap:wrap; }
.vt-done { opacity:0.75; }

/* ===== Type badges (Live / VT) ===== */
.type-badge { display:inline-block; padding:2px 7px; border-radius:10px; font-size:0.7rem; font-weight:700; letter-spacing:0.04em; text-transform:uppercase; }
.type-badge.live { background:rgba(217,83,84,0.15); color:var(--red); border:1px solid var(--red); }
.type-badge.vt { background:rgba(71,0,163,0.15); color:var(--bauer-purple-light); border:1px solid var(--bauer-purple); }

/* ===== Playlist footer (show more / show completed) ===== */
.playlist-footer { display:flex; gap:10px; flex-wrap:wrap; padding:12px 0 4px; }
.playlist-item-dimmed { opacity:0.45; pointer-events:none; border-left:3px solid var(--green); }

/* ===== Dismissed panel (top of presenter timeline) ===== */
.dismissed-panel { margin-bottom:12px; border:1px solid var(--border); border-radius:8px; overflow:hidden; }
.dismissed-panel-toggle { width:100%; background:var(--bg2); border:none; padding:10px 14px; text-align:left; cursor:pointer; font-size:0.85rem; color:var(--text-dim); display:flex; justify-content:space-between; align-items:center; }
.dismissed-panel-toggle:hover { color:var(--text-main); }
.dismissed-chevron { font-size:0.7rem; }
.dismissed-panel-body { display:none; }
.dismissed-panel-body.open { display:block; }
.dismissed-panel-row { display:flex; align-items:center; gap:10px; padding:8px 14px; border-top:1px solid var(--border); font-size:0.85rem; flex-wrap:wrap; }
.dismissed-type-badge { font-size:0.7rem; padding:2px 7px; border-radius:20px; font-weight:600; white-space:nowrap; }
.dismissed-type-badge.captured { background:rgba(16,185,129,0.15); color:var(--green,#10b981); }
.dismissed-type-badge.cleared  { background:var(--bg3,rgba(255,255,255,0.05)); color:var(--text-dim); }
.dismissed-title { font-weight:500; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dismissed-meta  { color:var(--text-dim); white-space:nowrap; font-size:0.8rem; }

/* ===== Today's Activity tab ===== */
.today-section { margin-bottom:24px; }
.today-section-title { font-weight:600; font-size:0.9rem; color:var(--text-dim); text-transform:uppercase; letter-spacing:0.05em; margin-bottom:10px; }

/* ===== Scheduler daypart filter ===== */
.sched-daypart-filter { margin-top:10px; padding-top:10px; border-top:1px solid var(--border); }
.sched-dp-list { display:flex; flex-direction:column; gap:4px; max-height:160px; overflow-y:auto; padding:4px 0; }
.sched-dp-option { display:flex; align-items:center; gap:7px; font-size:0.8rem; cursor:pointer; padding:2px 0; }
.sched-dp-option input { accent-color:var(--bauer-purple); width:14px; height:14px; cursor:pointer; }
.sched-option-row { display:flex; align-items:center; gap:7px; font-size:0.82rem; cursor:pointer; }
.sched-option-row input { accent-color:var(--bauer-purple); width:14px; height:14px; cursor:pointer; }
.sched-blackout { margin-top:8px; }
.sched-blackout .form-input { font-size:0.8rem; padding:6px 10px; }

/* Capacity heatmap */
.capacity-heatmap { margin-top:10px; padding:10px; background:var(--bg2); border:1px solid var(--border); border-radius:var(--radius-sm); }
.capacity-heatmap-label { font-size:0.7rem; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-muted); margin-bottom:6px; }
.capacity-row { display:flex; align-items:center; gap:8px; margin-bottom:4px; font-size:0.75rem; }
.capacity-label { width:90px; color:var(--text-muted); flex-shrink:0; text-transform:capitalize; }
.capacity-bar { height:8px; border-radius:4px; flex:1; min-width:4px; }
.capacity-count { width:24px; text-align:right; color:var(--text-muted); flex-shrink:0; }
.capacity-low  { background:var(--green); }
.capacity-mid  { background:var(--amber); }
.capacity-high { background:var(--red); }

/* Conflict warnings */
.sched-conflicts { background:var(--amber-bg); border:1px solid var(--amber); border-radius:var(--radius-sm); padding:10px 14px; margin-top:10px; font-size:0.82rem; color:var(--amber); }
.sched-conflicts ul { margin:6px 0 0; padding-left:16px; color:var(--text); }
.sched-conflicts li { margin-bottom:2px; }

/* Batch generate section */
.sched-batch-section { border:1px solid var(--border); border-radius:var(--radius); margin-bottom:12px; overflow:hidden; }
.sched-batch-title { padding:10px 14px; background:var(--bg2); cursor:pointer; font-size:0.85rem; font-weight:600; color:var(--text-muted); list-style:none; display:flex; align-items:center; gap:6px; }
.sched-batch-title:hover { color:var(--text); }
.sched-batch-title::before { content:'⚡'; }
.sched-batch-body { padding:14px; border-top:1px solid var(--border); }
.sched-batch-stations { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; padding:10px; background:var(--bg3); border-radius:var(--radius-sm); }

/* ===== Email config ===== */
.form-section-block { background:var(--bg3); border:1px solid var(--border); border-radius:var(--radius); padding:16px; }
.form-section-label { font-size:0.72rem; font-weight:700; letter-spacing:0.07em; text-transform:uppercase; color:var(--text-muted); margin-bottom:14px; }

/* ===== Competitions ===== */

/* Section headings */
.comp-section-heading {
  font-size:0.7rem; font-weight:700; letter-spacing:0.08em; text-transform:uppercase;
  color:var(--text-muted); margin:0 0 12px; padding-bottom:8px;
  border-bottom:1px solid var(--border);
}
.comp-section-heading--upcoming { margin-top:32px; }

/* Badges */
.comp-badge, .comp-badge-sm {
  display:inline-block; padding:3px 9px; border-radius:3px;
  font-size:0.7rem; font-weight:700; letter-spacing:0.04em; text-transform:uppercase;
}
.comp-badge { padding:4px 10px; font-size:0.72rem; }
.comp-badge--competition, .comp-badge-sm--competition { background:#1a0a3d; color:#c4a8ff; border:1px solid #4700A3; }
.comp-badge--winning-day, .comp-badge-sm--winning-day { background:#1a2a0a; color:#90c95a; border:1px solid #3a7a0a; }

/* Cards */
.comp-card {
  background:var(--bg3); border:1px solid var(--border); border-radius:var(--radius);
  margin-bottom:16px; overflow:hidden;
}
.comp-card--upcoming {
  background:var(--bg2); border-color:var(--border); opacity:0.85;
}
.comp-card-header {
  padding:16px; border-bottom:1px solid var(--border);
  background:linear-gradient(135deg, #1e1830 0%, #14101f 100%);
}
.comp-card-header-top { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.comp-card-title { font-size:1.1rem; font-weight:700; color:var(--text); }
.comp-card-meta { display:flex; flex-wrap:wrap; gap:12px; font-size:0.82rem; color:var(--text-muted); align-items:center; }
.comp-card-client { font-weight:600; color:var(--bauer-purple-light); }
.comp-card-stations { color:var(--text-muted); }
.comp-card-dates { color:var(--text-dim); }
.comp-upcoming-preview { padding:12px 16px; font-size:0.875rem; color:var(--text-muted); font-style:italic; }

/* Card sections */
.comp-card-section { padding:14px 16px; border-bottom:1px solid var(--border); }
.comp-card-section:last-child { border-bottom:none; }
.comp-card-section-title {
  font-size:0.68rem; font-weight:700; letter-spacing:0.07em; text-transform:uppercase;
  color:var(--text-muted); margin-bottom:8px;
}
.comp-description, .comp-mechanic {
  font-size:0.9rem; line-height:1.65; color:var(--text); white-space:pre-wrap;
}

/* Prizes */
.comp-prizes { display:flex; flex-wrap:wrap; gap:20px; }
.comp-prize-item { font-size:0.9rem; color:var(--text); }
.comp-prize-label { font-weight:700; color:var(--amber); margin-right:5px; }

/* Today's answer */
.comp-today-answer {
  margin:0 16px 0; padding:14px 16px;
  background:linear-gradient(135deg, #1a0a3d 0%, #0f1117 100%);
  border:1px solid var(--bauer-purple); border-radius:var(--radius-sm);
  display:flex; align-items:center; gap:14px;
}
.comp-today-label {
  font-size:0.72rem; font-weight:700; letter-spacing:0.06em; text-transform:uppercase;
  color:var(--bauer-purple-light); white-space:nowrap;
}
.comp-today-value {
  font-size:1.5rem; font-weight:700; color:#fff; letter-spacing:0.04em;
}

/* Daily answers table */
.comp-answers-table { width:100%; border-collapse:collapse; font-size:0.85rem; }
.comp-answers-table td { padding:5px 8px; border-bottom:1px solid var(--border); }
.comp-answers-table tr:last-child td { border-bottom:none; }
.comp-answer-today td { color:var(--text); font-weight:700; background:rgba(71,0,163,0.12); }
.comp-answer-val { font-weight:600; color:var(--bauer-purple-light); }

/* Show schedule */
.comp-show-schedule { display:flex; flex-direction:column; gap:6px; }
.comp-show-row { display:flex; align-items:center; gap:10px; font-size:0.875rem; }
.comp-show-station { font-size:0.72rem; background:var(--bg2); border:1px solid var(--border); border-radius:3px; padding:2px 6px; color:var(--text-muted); white-space:nowrap; }
.comp-show-name { font-weight:600; color:var(--text); }
.comp-show-detail { color:var(--text-muted); }
.comp-show-detail::before { content:'→'; margin-right:6px; color:var(--text-dim); }

/* Files */
.comp-files-section { }
.comp-file-links { display:flex; flex-wrap:wrap; gap:8px; }
.comp-file-link {
  display:inline-flex; align-items:center; gap:6px;
  background:var(--bg2); border:1px solid var(--border); border-radius:var(--radius-sm);
  padding:6px 12px; font-size:0.82rem; color:var(--text); text-decoration:none;
  transition:border-color 0.15s, background 0.15s;
}
.comp-file-link:hover { border-color:var(--accent); background:var(--bg3); text-decoration:none; }

/* Producer file management */
.comp-files-list { display:flex; flex-direction:column; gap:6px; margin-bottom:6px; }
.comp-file-row { display:flex; align-items:center; gap:8px; font-size:0.85rem; }
.comp-file-icon { font-size:1rem; }
.comp-file-name { color:var(--accent); flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.comp-file-delete { padding:2px 7px; font-size:0.85rem; opacity:0.6; }
.comp-file-delete:hover { opacity:1; }

/* Modal rows (answers / show schedule) */
.comp-rows-list { display:flex; flex-direction:column; gap:6px; }
.comp-row { display:flex; align-items:center; gap:6px; }
.comp-row-remove { padding:4px 8px; line-height:1; color:var(--text-muted); font-size:1rem; }

/* Producer form section */
.form-section { border:1px solid var(--border); border-radius:var(--radius-sm); margin-bottom:12px; overflow:hidden; }
.form-section summary.form-section-title {
  padding:10px 14px; font-size:0.78rem; font-weight:700; letter-spacing:0.05em;
  text-transform:uppercase; color:var(--text-muted); cursor:pointer;
  background:var(--bg2); user-select:none; list-style:none;
}
.form-section summary.form-section-title::-webkit-details-marker { display:none; }
.form-section summary.form-section-title::before { content:'▶'; margin-right:8px; font-size:0.65rem; transition:transform 0.2s; display:inline-block; }
.form-section[open] summary.form-section-title::before { transform:rotate(90deg); }
.form-section > :not(summary) { padding:14px; }
.form-section > details { padding:0; }

/* tag pills */
.tag { display:inline-block; background:var(--bg2); border:1px solid var(--border); border-radius:3px; padding:1px 6px; font-size:0.75rem; color:var(--text-muted); }

/* ===== Global footer ===== */
.app-footer { text-align:center; padding:12px; font-size:0.72rem; color:var(--text-dim); opacity:0.6; }
.app-footer a { color:inherit; text-decoration:underline; }
.app-footer a:hover { opacity:1; color:var(--text-main); }

/* ===== Nav account dropdown ===== */
.nav-account { position:relative; }
.nav-account-btn { background:none; border:none; color:var(--text); cursor:pointer; display:flex; align-items:center; gap:5px; font-size:0.875rem; padding:4px 8px; border-radius:6px; white-space:nowrap; }
.nav-account-btn:hover { background:var(--bg2); }
.nav-account-btn svg { width:13px; height:13px; opacity:0.55; flex-shrink:0; }
.nav-account-dropdown { position:absolute; right:0; top:calc(100% + 6px); min-width:220px; background:var(--bg2); border:1px solid var(--border); border-radius:10px; box-shadow:0 8px 28px rgba(0,0,0,0.4); z-index:300; overflow:hidden; }
/* Dropdown menu items */
.nav-account-menu-item { display:flex; align-items:center; justify-content:space-between; width:100%; background:none; border:none; padding:12px 16px; font-size:0.9rem; color:var(--text); cursor:pointer; text-align:left; gap:12px; }
.nav-account-menu-item:hover { background:var(--bg2); }
.nav-account-menu-item svg { width:13px; height:13px; opacity:0.4; flex-shrink:0; }
/* Toggle switch (used in notifications modal) */
.account-toggle-label { display:flex; align-items:center; justify-content:space-between; cursor:pointer; font-size:0.88rem; color:var(--text); gap:10px; }
.account-toggle-wrap { flex-shrink:0; position:relative; display:inline-flex; align-items:center; }
.account-toggle-input { position:absolute; opacity:0; width:0; height:0; }
.account-toggle-track { display:inline-block; width:36px; height:20px; border-radius:10px; background:var(--bg3); position:relative; transition:background 0.2s; cursor:pointer; border:1px solid var(--border); }
.account-toggle-track::after { content:''; position:absolute; top:3px; left:3px; width:12px; height:12px; border-radius:50%; background:#fff; transition:left 0.2s; }
.account-toggle-input:checked + .account-toggle-track { background:var(--green); border-color:var(--green); }
.account-toggle-input:checked + .account-toggle-track::after { left:19px; }
.account-hint { margin:6px 0 0; font-size:0.78rem; color:var(--text-muted); line-height:1.45; }
/* Station request list (in modal) */
.station-req-list { display:flex; flex-direction:column; max-height:300px; overflow-y:auto; }
.station-req-row { display:flex; align-items:center; justify-content:space-between; padding:9px 0; border-bottom:1px solid var(--border); gap:10px; }
.station-req-row:last-child { border-bottom:none; }
.station-req-name { flex:1; font-size:0.9rem; }
.station-req-done { font-size:0.78rem; color:var(--text-muted); white-space:nowrap; }
/* Admin pending requests panel */
#admin-station-requests { background:var(--amber-bg); border:1px solid var(--amber); border-radius:8px; padding:14px 16px; margin-bottom:16px; }
.pending-req-header { display:flex; align-items:center; gap:8px; font-weight:600; font-size:0.9rem; margin-bottom:12px; color:var(--text); }
.pending-req-table { width:100%; border-collapse:collapse; font-size:0.85rem; }
.pending-req-table th { text-align:left; padding:6px 10px; font-size:0.72rem; font-weight:700; text-transform:uppercase; letter-spacing:0.05em; color:var(--text-muted); border-bottom:1px solid var(--border); }
.pending-req-table td { padding:10px; border-bottom:1px solid var(--border); vertical-align:middle; }
.pending-req-table tr:last-child td { border-bottom:none; }

/* ===== Demo banner ===== */
.demo-banner { background: #b45309; color: #fff; text-align: center; padding: 8px 16px; font-size: 0.9rem; font-weight: 600; letter-spacing: 0.3px; position: sticky; top: 0; z-index: 99; }
.nav-account-menu-demo.demo-mode-active { color: #f59e0b; }
.badge-demo { display:inline-block; padding:1px 6px; border-radius:4px; font-size:0.7rem; font-weight:700; letter-spacing:0.5px; text-transform:uppercase; background:#b45309; color:#fff; vertical-align:middle; }

/* ===== Logo search panel ===== */
.logo-search-panel { margin-top:8px; background:var(--bg2); border:1px solid var(--border); border-radius:6px; padding:10px 12px; }
.logo-search-loading { font-size:0.85rem; color:var(--text-muted); }
.logo-search-empty { font-size:0.85rem; color:var(--text-muted); }
.logo-search-header { font-size:0.8rem; color:var(--text-muted); margin-bottom:8px; }
.btn-link { background:none; border:none; color:var(--accent); cursor:pointer; font-size:inherit; padding:0; text-decoration:underline; }
.logo-search-grid { display:flex; flex-wrap:wrap; gap:8px; }
.logo-search-item { position:relative; display:flex; flex-direction:column; align-items:center; gap:4px; background:var(--bg3); border:2px solid transparent; border-radius:6px; padding:8px; cursor:pointer; width:80px; transition:border-color 0.15s; }
.logo-search-item:hover { border-color:var(--accent); }
.logo-search-item-saved { border-color:#22c55e; }
.logo-search-item-saved:hover { border-color:var(--accent); }
.logo-search-item img { width:48px; height:48px; object-fit:contain; border-radius:4px; }
.logo-search-item span { font-size:0.65rem; color:var(--text-muted); text-align:center; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; width:100%; }
.logo-search-saved-badge { position:absolute; top:3px; right:3px; font-size:0.55rem; font-weight:700; text-transform:uppercase; background:#22c55e; color:#fff; border-radius:3px; padding:1px 3px; line-height:1.2; }

/* ===== Version switcher (presenter view) ===== */
.version-switcher { display: flex; gap: 4px; margin-bottom: 6px; flex-wrap: wrap; }
.version-btn { padding: 3px 10px; font-size: 0.78rem; border-radius: 4px; border: 1px solid var(--border); background: var(--bg3); color: var(--text-muted); cursor: pointer; font-family: inherit; }
.version-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.version-btn:hover:not(.active) { background: var(--border); color: var(--text); }

/* ===== Versions editor UI (producer modal) ===== */
.versions-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.versions-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 0; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.version-tab { display: flex; align-items: center; gap: 4px; padding: 5px 10px 6px; border-radius: 6px 6px 0 0; border: 1px solid transparent; border-bottom: none; cursor: pointer; background: var(--bg3); color: var(--text-muted); font-size: 0.85rem; margin-bottom: -1px; }
.version-tab.active { background: var(--bg2); border-color: var(--border); color: var(--text); }
.version-tab:hover:not(.active) { background: var(--border); }
.version-tab-label { background: none; border: none; color: inherit; font-size: 0.85rem; font-family: inherit; cursor: pointer; padding: 0; min-width: 60px; max-width: 120px; outline: none; }
.version-tab-label:focus { outline: 1px dashed var(--accent); border-radius: 2px; }
.version-tab-remove { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 2px; opacity: 0.6; }
.version-tab-remove:hover { opacity: 1; color: var(--red, #ef4444); }
.version-editor-panel { border: 1px solid var(--border); border-top: none; border-radius: 0 0 6px 6px; background: var(--bg2); }
.version-editor-panel.hidden { display: none; }


/* ===== Version active window row ===== */
.version-window-row { display:flex; align-items:center; gap:6px; flex-wrap:wrap; padding:8px 10px; border-top:1px solid var(--border); background:var(--bg3); border-radius:0 0 6px 6px; }

/* ===== Reads group headers ===== */
.reads-group-header td { padding:6px 12px; font-size:0.72rem; font-weight:700; text-transform:uppercase; letter-spacing:0.6px; color:var(--text-muted); background:var(--bg3); border-bottom:1px solid var(--border); }

/* ===== Logo Library ===== */
.logo-library-drop-zone { border:2px dashed var(--border); border-radius:var(--radius); padding:32px 16px; text-align:center; cursor:pointer; transition:border-color 0.2s, background 0.2s; color:var(--text-muted); }
.logo-library-drop-zone:hover, .logo-library-drop-zone.dragover { border-color:var(--accent); background:rgba(102,34,204,0.08); }
.logo-library-staging-grid, .logo-library-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:12px; margin-top:16px; }
.logo-library-item { display:flex; flex-direction:column; gap:6px; padding:8px; background:var(--bg2); border-radius:var(--radius-sm); border:1px solid var(--border); }
.logo-library-item img { width:100%; height:70px; object-fit:contain; background:var(--bg3); border-radius:4px; }
.logo-library-item-actions { display:flex; gap:4px; }

/* ===== Show Hub ===== */
#view-hub .page { padding-bottom: 100px; /* room for persistent player */ }

/* Two independent flex columns — each stacks to natural content height */
#hub-modules-wrap { display: flex; gap: 16px; align-items: flex-start; max-width: 1400px; margin: 0 auto; }
.hub-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 680px) { #hub-modules-wrap { flex-direction: column; } .hub-col { width: 100%; } }
.hub-module { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.hub-module-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg3); }
.hub-module-icon { font-size: 1.1rem; }
.hub-module-title { font-size: 0.9rem; font-weight: 600; color: var(--text); flex: 1; }
.hub-module-action { flex-shrink: 0; }
.hub-module-body { padding: 14px 16px; }


/* Hub On Air Now */
.hub-onair-body { display: flex; flex-direction: column; gap: 12px; }
.hub-onair-listen-col .hub-listen-btn { gap: 8px; }
.hub-listen-btn { width: 100%; justify-content: center; gap: 8px; }
.hub-listen-btn--active { background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important; }
.hub-onair-info-col { min-width: 0; }

/* On Air row: presenter left, track right */
.hub-onair-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hub-onair-presenter-block { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 160px; }
.hub-onair-avatar-wrap { flex-shrink: 0; }
.hub-onair-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); display: block; }
.hub-onair-avatar-initials { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 1rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.hub-onair-presenter-info { min-width: 0; }
.hub-onair-presenter-name { font-size: 0.95rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-onair-presenter-desc { font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.hub-onair-live-chip { display: inline-flex; align-items: center; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #ef4444; background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.25); padding: 1px 7px; border-radius: 10px; }

.hub-onair-track-block { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 160px; padding-left: 16px; border-left: 1px solid var(--border); }
.hub-onair-artwork { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.hub-onair-artwork-empty { width: 48px; height: 48px; border-radius: 6px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: var(--text-muted); flex-shrink: 0; }
.hub-onair-track-info { min-width: 0; flex: 1; }
.hub-onair-now-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 1px; }
.hub-onair-track-title { font-size: 0.88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-onair-track-artist { font-size: 0.78rem; }

/* Hub upcoming reads (live reads module) */
#hub-module-live_reads .hub-module-body { padding: 0 16px 4px; }
.hub-upcoming-list { display: flex; flex-direction: column; }
.hub-upcoming-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.hub-upcoming-item:last-child { border-bottom: none; padding-bottom: 4px; }
.hub-upcoming-logo { height: 52px; width: 52px; object-fit: contain; border-radius: 6px; flex-shrink: 0; }
.hub-upcoming-content { flex: 1; min-width: 0; }
.hub-upcoming-top { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.hub-upcoming-badge { font-size: 0.72rem; font-weight: 700; background: var(--accent); color: #fff; padding: 2px 9px; border-radius: 8px; white-space: nowrap; flex-shrink: 0; }
.hub-upcoming-badge--now     { background: #ef4444; }
.hub-upcoming-badge--overdue { background: #f59e0b; color: #000; }
.hub-upcoming-badge--soon    { background: #f97316; }
.hub-upcoming-badge--upcoming{ background: var(--accent); }
.hub-upcoming-badge--later   { background: var(--bg3); color: var(--text-muted); }
.hub-upcoming-title { font-size: 0.9rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-upcoming-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hub-upcoming-time { font-size: 0.8rem; color: var(--text-muted); }
.hub-upcoming-station-badge { font-size: 0.7rem; font-weight: 700; color: #fff; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.hub-upcoming-client { font-size: 0.8rem; }
.hub-link-drag-over { outline: 2px solid var(--accent); border-radius: 6px; }
.hub-link-drag-handle:hover { color: var(--text) !important; }

/* Hub support module */
.hub-support-actions { display: flex; flex-direction: column; gap: 8px; }

/* Hub emergency controls */
.hub-emergency-btn { flex: 1; justify-content: center; font-size: 0.9rem; }
.hub-emergency-status { font-size: 0.78rem; font-weight: 700; }
.hub-emergency-playing { color: #ef4444; }
.hub-emergency-paused { color: var(--text-muted); }

/* Hub custom links / link buttons */
.hub-custom-links { display: flex; flex-direction: column; gap: 8px; }
.hub-link-btn { width: 100%; justify-content: flex-start; gap: 8px; }
.hub-station-pick-btn { width: 100%; }

/* Hub weather module */
.hub-weather-headline { font-size: 0.95rem; font-weight: 600; color: var(--text); border-left: 3px solid var(--accent); padding-left: 10px; margin-bottom: 14px; line-height: 1.5; }
.hub-weather-tabs { margin-bottom: 12px; }
.hub-weather-tab-nav { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.hub-weather-tab-btn { background: var(--bg3); border: 1px solid var(--border); border-radius: 4px; padding: 4px 12px; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.hub-weather-tab-btn:hover { background: var(--bg4, var(--bg3)); color: var(--text); }
.hub-weather-tab-btn--active { background: var(--accent); border-color: var(--accent); color: #fff; }
.hub-weather-tab-panel { font-size: 0.86rem; color: var(--text2); line-height: 1.55; }
.hub-weather-updated { font-size: 0.74rem; color: var(--text-muted); margin-top: 10px; }
.hub-weather-stale-badge { display: inline-block; font-size: 0.72rem; background: #7c3a00; color: #ffb347; border-radius: 4px; padding: 2px 8px; margin-bottom: 10px; }
.hub-loading { color: var(--text-muted); font-size: 0.875rem; }

/* ===== Traffic Camera View ===== */
.cameras-region-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.camera-region-btn { background: var(--bg3); border: 1px solid var(--border); border-radius: 20px; padding: 4px 14px; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; white-space: nowrap; }
.camera-region-btn:hover { background: var(--bg4, var(--bg3)); color: var(--text); border-color: var(--accent); }
.camera-region-btn--active { background: var(--accent); border-color: var(--accent); color: #fff; }
.cameras-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.camera-tile { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.camera-tile:hover { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(102,34,204,0.2); }
.camera-tile-img-wrap { position: relative; background: #000; aspect-ratio: 4/3; overflow: hidden; }
.camera-tile-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity 0.2s; }
.camera-tile-img--error { opacity: 0.3; }
.camera-tile-img-wrap::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.5) 100%); pointer-events: none; }
.camera-tile-name { font-size: 0.75rem; font-weight: 600; color: var(--text2); padding: 6px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Camera expanded modal */
.camera-modal { max-width: 860px; width: 95vw; }
.camera-modal .modal-header { display: flex; align-items: center; justify-content: space-between; }
.camera-modal-body { background: #000; display: flex; align-items: center; justify-content: center; min-height: 200px; }
.camera-modal-img { width: 100%; max-height: 70vh; object-fit: contain; display: block; }
.camera-modal-img--error { opacity: 0.2; min-height: 200px; }
.camera-modal-footer { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--bg3); }

/* Hub traffic module */
.hub-traffic-pinned { background: var(--bg3); border: 1px solid var(--border); border-left: 3px solid #ef4444; border-radius: 6px; padding: 12px 14px; margin-bottom: 14px; }
.hub-traffic-pinned-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #ef4444; margin-bottom: 8px; }
.hub-traffic-pinned-body p { font-size: 0.875rem; color: var(--text); line-height: 1.55; margin: 0 0 6px; }
.hub-traffic-pinned-body p:last-child { margin-bottom: 0; }
.hub-traffic-pinned-body br { display: none; }
.hub-traffic-scroll { max-height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; border: 1px solid var(--border); border-radius: 6px; }
.hub-traffic-item { padding: 11px 14px; border-bottom: 1px solid var(--border); }
.hub-traffic-item:last-child { border-bottom: none; }
.hub-traffic-item-title { font-size: 0.83rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.hub-traffic-item-body p { font-size: 0.82rem; color: var(--text2); line-height: 1.5; margin: 0 0 4px; }
.hub-traffic-item-body p:last-child { margin-bottom: 0; }
.hub-traffic-item-body br { display: none; }
.hub-traffic-item-body strong, .hub-traffic-item-body b { color: var(--text); }
.hub-traffic-item-body ul { margin: 4px 0 4px 16px; padding: 0; }
.hub-traffic-item-body li { font-size: 0.82rem; color: var(--text2); line-height: 1.5; margin-bottom: 2px; }

/* ===== Persistent Hub Audio Player ===== */
.hub-player {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 900;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 8px 16px;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.3);
}
.hub-player.hidden { display: none; }
.hub-player-inner { display: flex; align-items: center; gap: 12px; max-width: 900px; margin: 0 auto; }
.hub-player-controls { display: flex; gap: 6px; flex-shrink: 0; }
.hub-player-btn { background: var(--bg3); border: 1px solid var(--border); color: var(--text); border-radius: 50%; width: 36px; height: 36px; font-size: 0.9rem; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.hub-player-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.hub-player-btn-stop:hover { background: #ef4444; border-color: #ef4444; }
.hub-player-info { flex: 1; min-width: 0; }
.hub-player-track-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; overflow: hidden; }
.hub-player-live-badge { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: #ef4444; background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); padding: 1px 6px; border-radius: 8px; white-space: nowrap; flex-shrink: 0; }
.hub-player-track { font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-player-progress-bar { height: 4px; background: var(--border); border-radius: 2px; cursor: pointer; overflow: hidden; }
.hub-player-progress-bar--live { opacity: 0.3; cursor: default; }
.hub-player-progress-fill { height: 100%; width: 0%; background: var(--accent); border-radius: 2px; transition: width 0.5s linear; pointer-events: none; }
.hub-player-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 3px; }

/* ===== Studio Booking Calendar ===== */
.booking-calendar { overflow-x: auto; margin-top: 8px; }
.cal-table { width: 100%; border-collapse: collapse; min-width: 700px; table-layout: fixed; }
.cal-table th, .cal-table td { border: 1px solid var(--border); vertical-align: top; }
.cal-studio-th { width: 100px; background: var(--bg2); }
.cal-day-th { text-align: center; padding: 6px 4px; background: var(--bg2); font-size: 0.8rem; font-weight: 600; }
.cal-day-th.cal-today-th { background: #221050; }
.cal-day-num { display: block; font-weight: 400; font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.cal-studio-label { padding: 8px 10px; font-size: 0.82rem; font-weight: 600; background: var(--bg2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-time-col { width: 36px; padding: 0; background: var(--bg2); border-right: 1px solid var(--border); }
.cal-time-axis { position: relative; height: 720px; /* must match CAL_CELL_PX */ }
.cal-studio-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.cal-studio-tab {
  padding: 5px 14px; font-size: 0.82rem; font-family: inherit;
  background: var(--bg3); color: var(--text-muted);
  border: 1px solid var(--border); border-bottom: 3px solid transparent;
  border-radius: 6px 6px 0 0; cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.cal-studio-tab:hover { background: var(--bg2); color: var(--text); }
.cal-studio-tab.active {
  background: var(--bg2); color: var(--text); font-weight: 600;
  border-bottom-color: var(--tab-color, var(--accent));
}
.cal-studio-info {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 7px 10px; margin-bottom: 8px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.82rem; color: var(--text-muted); line-height: 1.5;
}
.cal-studio-info-icon { flex-shrink: 0; color: var(--accent); font-style: normal; }
.cal-time-label {
  position: absolute;
  right: 4px;
  font-size: 0.6rem;
  color: var(--text-dim);
  line-height: 1;
  transform: translateY(-50%);
  white-space: nowrap;
}
.cal-day-cell { padding: 0; }
.cal-day-cell.cal-today-cell { background: #180f38; }
.cal-cell-body {
  position: relative;
  height: 720px; /* 00:00–24:00 = 24h × 30px/h */
  overflow: hidden;
  /* gridline every 2 hours (60px) */
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 59px,
    var(--border) 59px,
    var(--border) 60px
  );
}
.booking-pill {
  position: absolute;
  left: 2px;
  right: 2px;
  background: var(--pill-color, var(--accent));
  border-radius: 3px;
  padding: 3px 5px;
  cursor: pointer;
  font-size: 0.72rem;
  line-height: 1.3;
  opacity: 0.9;
  transition: opacity 0.15s;
  overflow: hidden;
  z-index: 1;
}
.booking-pill:hover { opacity: 1; z-index: 2; }
.pill-time { font-weight: 700; font-size: 0.65rem; margin-bottom: 1px; }
.pill-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.pill-who { color: rgba(255,255,255,0.72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.67rem; }
.pill-recurring { font-size: 0.72rem; opacity: 0.9; }
.cal-add-btn {
  position: absolute;
  bottom: 2px;
  left: 2px;
  right: 2px;
  width: auto;
  padding: 3px;
  font-size: 0.75rem;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 3px;
  cursor: pointer;
  color: var(--text-dim);
  text-align: center;
  transition: background 0.1s, color 0.1s;
  z-index: 1;
}
.cal-add-btn:hover { background: var(--bg3); color: var(--text-muted); border-color: var(--text-dim); }

/* Daypart chips (recurring booking form) */
.daypart-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg3);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-family: inherit;
  line-height: 1.3;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
}
.daypart-chip:hover { border-color: var(--accent); color: var(--text); }
.daypart-chip.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.dp-chip-time { display: block; font-size: 0.68rem; margin-top: 2px; opacity: 0.75; }
.daypart-chip.selected .dp-chip-time { opacity: 0.85; }
.dp-chip-sub { font-size: 0.72rem; opacity: 0.75; }

/* ===== Holiday Planner ===== */
.holidays-tab-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.hol-tab-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.hol-tab-btn:hover { border-color: var(--accent); color: var(--text); }
.hol-tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.holidays-section-heading {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 20px 0 8px;
}
.holidays-section-heading:first-of-type { margin-top: 8px; }
.holidays-cover-heading { color: var(--accent); margin-top: 8px; }

/* Partial cover modal */
.cover-daypart-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.cover-daypart-heading {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}
.cover-rows-container { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; margin-bottom: 8px; }
.cover-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cover-day-checks { display: flex; gap: 4px; flex-wrap: wrap; }
.cover-day-check-label {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.78rem;
  color: var(--text2);
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.12s, background 0.12s;
}
.cover-day-check-label:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--text); }
.cover-day-check-label input { display: none; }
.cover-row-remove {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 2px 6px;
  line-height: 1;
}
.cover-row-remove:hover { color: var(--red) !important; }
.btn-add-cover-row {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 2px 0;
  margin-top: 2px;
}
.btn-add-cover-row:hover { text-decoration: underline; }

/* ===== Network broadcast mode bar ===== */
.network-mode-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 12px;
  flex-wrap: wrap;
}
.network-mode-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.network-mode-btn {
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.network-mode-btn:hover { background: var(--bg2); color: var(--text); }
.network-mode-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.network-status-badge {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: 4px;
}
.network-status-badge.ok { color: var(--green); }
.network-status-badge.split { color: var(--amber); }

/* ===== Network capture group button ===== */
.network-capture-wrap {
  border: 2px solid var(--accent);
  border-radius: 10px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.network-station-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.network-station-pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* ===== Hub Banner ===== */
.hub-banner {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  display: block;
}
.hub-banner a {
  display: block;
  line-height: 0;
}
.hub-banner-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  transition: opacity 0.15s;
}
.hub-banner a:hover .hub-banner-img { opacity: 0.9; }
