:root {
  --bg: #eef2f8;
  --surface: #ffffff;
  --surface-2: #f0f3f8;
  --border: #d9dfea;
  --text: #16191f;
  --muted: #5a6475;
  --accent: #21417c;        /* Central FM navy */
  --accent-ink: #ffffff;
  --accent-soft: #e3eaf7;
  --brand-orange: #f28c28;
  --danger: #d7263d;        /* cover / emergency / missed */
  --danger-soft: #fde6e9;
  --ok: #17803d;
  --ok-soft: #e3f4e8;
  --warn: #9a6200;
  --warn-soft: #fdf1d8;
  --info: #2457c5;
  --info-soft: #e5edfc;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 12px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1017;
    --surface: #181b21;
    --surface-2: #20242c;
    --border: #2d323c;
    --text: #e9ecf1;
    --muted: #9aa3b2;
    --accent: #8fb0ff;
    --accent-ink: #0f1a33;
    --accent-soft: #1d2a47;
    --brand-orange: #ff9d45;
    --danger: #ff5c70;
    --danger-soft: #3a1820;
    --ok: #4cc777;
    --ok-soft: #143221;
    --warn: #f0b546;
    --warn-soft: #362a12;
    --info: #7aa2ff;
    --info-soft: #1a2747;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--info); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 20px;
  background: var(--surface); border-bottom: 3px solid var(--brand-orange);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; white-space: nowrap; }
.brand-logo { height: 46px; width: auto; display: block; }
.brand-sub { color: var(--muted); font-weight: 600; padding-left: 10px; border-left: 1px solid var(--border); }
.auth-card .brand { flex-direction: column; align-items: flex-start; gap: 10px; }
.auth-card .brand-logo { height: 80px; }
.auth-card .brand-sub { border-left: none; padding-left: 0; }
.tabs { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.tabs a {
  text-decoration: none; color: var(--muted); font-weight: 500;
  padding: 7px 12px; border-radius: 8px; white-space: nowrap;
}
.tabs a:hover { background: var(--surface-2); color: var(--text); }
.tabs a.active { background: var(--accent-soft); color: var(--accent); }
.userbox { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
main { max-width: 1100px; margin: 0 auto; padding: 24px 20px 80px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; }

/* ---------- controls ---------- */
.btn {
  appearance: none; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 500; padding: 8px 14px; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.big { padding: 12px 20px; font-size: 1rem; font-weight: 600; }
.btn.sm { padding: 4px 10px; font-size: .85rem; }
.btn.link { border: none; background: none; color: var(--info); padding: 4px 6px; }
.btn.link:hover { text-decoration: underline; background: none; }
.btn.danger { color: var(--danger); }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--info); outline-offset: -1px; border-color: transparent; }
input[type=checkbox], input[type=radio] { width: auto; }
textarea { min-height: 140px; resize: vertical; }
label { display: block; font-weight: 500; font-size: .9rem; }
label > input, label > select, label > textarea { margin-top: 4px; }
.field { margin-bottom: 14px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 14px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; max-height: 220px; overflow: auto; }
.form-error { color: var(--danger); font-size: .9rem; margin: 6px 0 10px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form input[type=datetime-local] { width: auto; min-width: 220px; }
.inline-form input[name=note] { flex: 1; min-width: 160px; width: auto; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { margin-bottom: 4px; }
.auth-card p { margin: 0 0 18px; }

.read-list { display: grid; gap: 16px; }
.read-card { position: relative; border-left: 5px solid var(--danger); }
.read-card.done { border-left-color: var(--ok); }
.rc-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.client { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.progress { text-align: right; white-space: nowrap; }
.progress .count { font-size: 1.5rem; font-weight: 700; font-family: var(--mono); }
.progress .count.done { color: var(--ok); }
.script {
  white-space: pre-wrap; font-size: 1.15rem; line-height: 1.6;
  background: var(--surface-2); border-radius: 8px; padding: 14px 16px; margin-bottom: 10px;
}
.notes { font-size: .9rem; color: var(--warn); background: var(--warn-soft); padding: 8px 12px; border-radius: 8px; margin-bottom: 10px; white-space: pre-wrap; }
.rc-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 12px 0 4px; }
.custom-log { margin-top: 10px; padding: 12px; background: var(--surface-2); border-radius: 8px; }

.loglist { list-style: none; margin: 10px 0 0; padding: 0; border-top: 1px solid var(--border); }
.loglist li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.loglist li:last-child { border-bottom: none; }
.loglist .t { font-family: var(--mono); font-weight: 500; font-size: 1rem; }
.loglist .who { font-weight: 500; }
.loglist .acts { margin-left: auto; display: flex; gap: 2px; }

.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.live { background: var(--ok-soft); color: var(--ok); }
.badge.upcoming { background: var(--info-soft); color: var(--info); }
.badge.ended { background: var(--surface-2); color: var(--muted); }
.badge.edited { background: var(--warn-soft); color: var(--warn); }
.badge.short { background: var(--danger-soft); color: var(--danger); }

.date-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.date-nav input { width: auto; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td.nowrap, th.nowrap { white-space: nowrap; }
td.actions { white-space: nowrap; text-align: right; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }

.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 20px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.section-title { margin: 24px 0 10px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- dialog ---------- */
dialog.dlg {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 0; width: min(620px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
dialog.dlg::backdrop { background: rgba(10, 12, 16, .5); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.dlg-body { padding: 18px 20px; max-height: 70vh; overflow: auto; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
.secret { font-family: var(--mono); font-size: 1.1rem; background: var(--surface-2); padding: 10px 14px; border-radius: 8px; user-select: all; }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 1000; width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); font-weight: 500; animation: pop .18s ease-out; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  .topbar { padding: 10px 16px; gap: 8px; }
  .tabs { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .userbox { margin-left: auto; }
  main { padding: 16px 16px 80px; }
  .detail-grid { grid-template-columns: 1fr; }
  .script { font-size: 1.05rem; }
  .inline-form input[type=datetime-local] { min-width: 0; width: 100%; }
  .loglist .acts { margin-left: 0; }
}

/* ---------- dayparts (presenter view) ---------- */
.dp-list { display: grid; gap: 16px; }
.daypart { padding: 0; overflow: hidden; }
.dp-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.dp-head > div:first-child { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dp-time { font-family: var(--mono); color: var(--muted); font-size: .9rem; }
.dp-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.daypart.current { border: 2px solid var(--ok); }
.daypart.current .dp-head { background: var(--ok-soft); }
.daypart.past { opacity: .8; }
.dp-empty { margin: 0; padding: 14px 18px; }
.dp-reads { display: grid; }

.read-item { border-bottom: 1px solid var(--border); }
.read-item:last-child { border-bottom: none; }
.read-item > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; user-select: none;
}
.read-item > summary::-webkit-details-marker { display: none; }
.read-item > summary:hover { background: var(--surface-2); }
.ri-check {
  flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border);
  display: grid; place-items: center; font-size: .8rem; font-weight: 700; color: #fff;
}
.read-item.done .ri-check { background: var(--ok); border-color: var(--ok); }
.ri-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ri-name { font-weight: 600; }
.read-item.done .ri-name { color: var(--muted); }
.ri-count { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.ri-count.done { color: var(--ok); }
.chev { color: var(--muted); font-size: 1.3rem; line-height: 1; transition: transform .15s; }
.read-item[open] > summary .chev { transform: rotate(90deg); }
.read-item[open] > summary { background: var(--surface-2); }
.ri-body { padding: 4px 18px 16px 52px; }
.badge.prod { background: #ede4fb; color: #5b2bb5; }
.production { white-space: pre-wrap; font-size: .92rem; background: #f3edfd; color: #4a2296; border-left: 4px solid #7c4ddb; padding: 8px 12px; border-radius: 8px; margin-bottom: 10px; }
.info-note { color: var(--info); background: var(--info-soft); margin-bottom: 16px; }
@media (prefers-color-scheme: dark) {
  .badge.prod { background: #2c1f4a; color: #c7b0ff; }
  .production { background: #241a3b; color: #d9cbff; border-left-color: #9b7bff; }
}

/* ---------- read form ---------- */
.form-section { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 10px; padding-top: 14px; border-top: 1px solid var(--border); }
textarea.short { min-height: 70px; }
.label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.label-row .label { font-weight: 500; font-size: .9rem; }
.quick { display: flex; gap: 2px; }
.day-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pill span { display: inline-block; min-width: 52px; text-align: center; padding: 7px 10px; border: 1px solid var(--border); border-radius: 999px; font-weight: 500; }
.pill input:checked + span { background: var(--info); border-color: var(--info); color: #fff; }
.pill input:focus-visible + span { outline: 2px solid var(--info); outline-offset: 2px; }
.dp-picks { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.dp-pick { align-items: flex-start; }
.dp-pick input { margin-top: 4px; }

/* ---------- delivery grid ---------- */
table.grid td.c, table.grid th.c { text-align: center; }
.cell { display: inline-block; min-width: 44px; padding: 2px 8px; border-radius: 6px; font-family: var(--mono); font-weight: 600; font-size: .85rem; }
.cell.ok { background: var(--ok-soft); color: var(--ok); }
.cell.short { background: var(--danger-soft); color: var(--danger); }
.cell.pending { background: var(--surface-2); color: var(--muted); }

@media (max-width: 720px) {
  .ri-body { padding: 4px 14px 14px; }
  .read-item > summary { padding: 12px 14px; gap: 10px; }
  .dp-head { padding: 12px 14px; }
}
.daypart > .loglist { margin: 0; padding: 0 18px; border-top: none; }
.daypart { scroll-margin-top: 80px; }
@media (max-width: 720px) { .daypart { scroll-margin-top: 120px; } .daypart > .loglist { padding: 0 14px; } }

/* ---------- header emergency button ---------- */
.btn-emergency {
  background: #c8102e; color: #fff !important; font-weight: 700; text-decoration: none;
  padding: 7px 14px; border-radius: 8px; white-space: nowrap; letter-spacing: .02em;
}
.btn-emergency:hover, .btn-emergency.active { background: #a50d26; }

/* ---------- home ---------- */
.headlines { white-space: pre-wrap; margin-bottom: 16px; border-left: 5px solid var(--info); }
.home-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; }
.home-col { display: grid; gap: 16px; }
.home-card { padding: 16px 18px; }
.hc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.hc-head h2 { font-size: 1.05rem; }
.edit-btn { padding: 2px 6px; }
.prewrap { white-space: pre-wrap; }
.onair { display: flex; gap: 14px; align-items: center; }
.onair-title { font-size: 1.35rem; font-weight: 700; }
.show-img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-2); }
.show-img.sm { width: 44px; height: 44px; border-radius: 8px; }
.next-up { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.news-today { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.cover-note { color: #c8102e; font-weight: 600; font-size: .9rem; margin-top: 4px; }
.cover-note.inline { display: inline; margin-left: 6px; font-size: .82rem; }
.plain-note { color: var(--warn); font-size: .9rem; margin-top: 4px; }
.reads-stat { display: flex; gap: 28px; margin-bottom: 14px; }
.reads-stat > div { display: flex; flex-direction: column; }
.big-num { font-size: 2.2rem; font-weight: 700; font-family: var(--mono); line-height: 1.1; color: var(--accent); }
.big-num.ok { color: var(--ok); }
.big-num.muted { color: var(--muted); }
.legend { margin: 0 0 10px; }
.laydown { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.ld-day { background: var(--surface-2); border-radius: 8px; padding: 8px; font-size: .85rem; min-height: 70px; }
.ld-day.today { outline: 2px solid var(--info); background: var(--info-soft); }
.ld-name { font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.ld-text { white-space: pre-wrap; }
.whatson { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.whatson h3 { font-size: .9rem; margin-bottom: 4px; }
.wa-num { font-size: 1.5rem; font-weight: 700; font-family: var(--mono); }
.wa-num a { text-decoration: none; }
.mini-sched, .kv-list, .music { list-style: none; margin: 0; padding: 0; }
.mini-sched li { display: flex; gap: 10px; padding: 6px 8px; border-radius: 6px; }
.mini-sched li.live { background: var(--ok-soft); font-weight: 600; }
.mini-sched li.cover .ms-title { color: #c8102e; }
.ms-time { font-family: var(--mono); color: var(--muted); }
.kv-list li { display: flex; justify-content: space-between; padding: 4px 8px; border-radius: 6px; }
.kv-list li.today { background: var(--info-soft); }
.music li { padding: 5px 0; border-bottom: 1px solid var(--border); }
.music li:last-child { border-bottom: none; }

/* ---------- schedule ---------- */
.day-tabs { display: flex; gap: 4px; margin-bottom: 14px; overflow-x: auto; }
.day-tabs a { text-decoration: none; color: var(--muted); font-weight: 600; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); white-space: nowrap; }
.day-tabs a.active { background: var(--info); border-color: var(--info); color: #fff; }
.sched-day { padding: 0; overflow: hidden; }
.sched-day > .hc-head { padding: 14px 18px; margin: 0; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.sched-list { list-style: none; margin: 0; padding: 0; }
.sched-list li { display: flex; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.sched-list li.live { background: var(--ok-soft); }
.sched-list li.cover { box-shadow: inset 5px 0 0 #c8102e; }
.sl-time { font-family: var(--mono); font-weight: 600; width: 110px; flex: none; }
.sl-main { flex: 1; min-width: 0; }
.sl-title { font-weight: 600; }
.sl-title a { color: inherit; }
.show-img.placeholder { display: inline-block; }
.sched-foot { padding: 10px 18px; }
.warn { color: var(--warn); }

/* ---------- shows ---------- */
.show-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.show-card.inactive { opacity: .6; }
.promo { font-size: .95rem; }
.promo-meta { margin-top: 10px; }
.label { font-weight: 500; font-size: .9rem; }

/* ---------- emergency ---------- */
.emergency-head h1 { color: #c8102e; }
.em-list { display: grid; gap: 16px; margin-bottom: 12px; }
.em-card { border-left: 6px solid #c8102e; }
.em-card h2 { margin-bottom: 10px; }
.em-body { font-size: 1.05rem; line-height: 1.6; }
.em-body a.tel, .wa-num a.tel {
  display: inline-block; background: #c8102e; color: #fff; text-decoration: none; font-weight: 700;
  padding: 2px 10px; border-radius: 6px; margin: 2px 0;
}
.wa-num a.tel { background: none; color: var(--text); padding: 0; }
.em-edit { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
a.tel { white-space: nowrap; }

@media (prefers-color-scheme: dark) {
  .cover-note, .mini-sched li.cover .ms-title { color: #ff6b81; }
}
@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; }
  .laydown { grid-template-columns: 1fr; }
  .ld-day { min-height: 0; display: flex; gap: 10px; }
  .ld-name { width: 36px; flex: none; margin: 0; }
}
@media (max-width: 720px) {
  .whatson { grid-template-columns: 1fr; }
  .sched-list li { flex-wrap: wrap; padding: 12px 14px; gap: 10px; }
  .sl-time { width: auto; }
  .sched-list li .btn { margin-left: auto; }
  .show-grid { grid-template-columns: 1fr; }
  .btn-emergency { padding: 6px 10px; font-size: .85rem; }
}
.nav-more { position: relative; }
.nav-more > summary { list-style: none; cursor: pointer; color: var(--muted); font-weight: 500; padding: 7px 12px; border-radius: 8px; white-space: nowrap; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary:hover { background: var(--surface-2); color: var(--text); }
.nav-more > summary.active { background: var(--accent-soft); color: var(--accent); }
.nav-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 6px; display: grid; min-width: 170px; }
.nav-menu a { display: block; }
@media (max-width: 720px) { .nav-menu { position: fixed; top: auto; left: 16px; right: 16px; } }

/* ===== colour pass: coloured box headers ===== */
.home-card { padding: 0; overflow: hidden; }
.home-card > .hc-head { margin: 0; padding: 11px 16px; color: #fff; }
.home-card > .hc-head h2 { color: inherit; font-size: 1rem; letter-spacing: .01em; }
.home-card > .hc-head a, .home-card > .hc-head .edit-btn { color: inherit; opacity: .9; font-weight: 600; }
.home-card > .hc-head a:hover, .home-card > .hc-head .edit-btn:hover { opacity: 1; text-decoration: underline; }
.hc-body { padding: 14px 16px 16px; }
.tone-navy   > .hc-head { background: linear-gradient(90deg, #21417c, #2f5ba8); }
.tone-orange > .hc-head { background: linear-gradient(90deg, #e2711d, #f28c28); }
.tone-green  > .hc-head { background: linear-gradient(90deg, #128c4a, #25a35a); }
.tone-teal   > .hc-head { background: linear-gradient(90deg, #0b7a7c, #13a3a6); }
.tone-purple > .hc-head { background: linear-gradient(90deg, #5b3d8a, #7d58b8); }
.tone-pink   > .hc-head { background: linear-gradient(90deg, #c2255c, #e64980); }
.tone-amber  > .hc-head { background: linear-gradient(90deg, #d98200, #f0a202); }
.tone-yellow > .hc-head { background: linear-gradient(90deg, #e6b800, #f6d44c); color: #3b2f00; }
.tone-navy, .tone-orange, .tone-green, .tone-teal, .tone-purple, .tone-pink, .tone-amber, .tone-yellow { border-top: none; }

.home-head h1 { color: var(--accent); }
.wc { color: var(--brand-orange); }
.headlines { border-left-color: var(--brand-orange); background: linear-gradient(90deg, #fff7ef, var(--surface)); font-weight: 500; }
.home-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; margin-bottom: 16px; align-items: stretch; }
.big-num { color: var(--accent); }
.big-num.due { color: var(--brand-orange); }
.cover-pill { display: inline-block; margin-top: 6px; background: var(--danger); color: #fff; font-weight: 700; font-size: .82rem; padding: 3px 9px; border-radius: 6px; }
.cover-pill.sm { margin: 0 0 0 6px; font-size: .75rem; padding: 2px 7px; }

/* ===== week grid (sheet-style) ===== */
.week-card { margin-bottom: 16px; }
.week-card .toolbar { gap: 12px; }
.cover-key { background: #fff; color: var(--danger); font-weight: 700; font-size: .8rem; padding: 2px 9px; border-radius: 999px; }
.legend-key { font-size: .8rem; opacity: .9; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.wg-col { display: flex; flex-direction: column; gap: 6px; min-width: 130px; }
.wg-day { background: #21417c; color: #fff; font-weight: 700; text-align: center; padding: 7px 4px; border-radius: 8px; font-size: .9rem; line-height: 1.2; }
.wg-day span { display: block; font-weight: 500; font-size: .75rem; opacity: .8; }
.wg-col.today .wg-day { background: var(--brand-orange); }
.wg-slot {
  display: flex; flex-direction: column; gap: 2px; text-align: left; font: inherit; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; flex: 1;
}
button.wg-slot { cursor: pointer; }
button.wg-slot:hover { border-color: var(--accent); }
.wg-time { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.wg-show { font-weight: 600; font-size: .88rem; line-height: 1.25; }
.wg-note { font-size: .78rem; font-weight: 700; }
.wg-slot.live { background: #e3f4e8; border-color: #17803d; box-shadow: inset 0 0 0 1px #17803d; }
.wg-live { color: #17803d; font-family: Inter, sans-serif; font-size: .68rem; }
.wg-slot.noted { background: var(--warn-soft); border-color: var(--warn); }
.wg-slot.noted .wg-note { color: var(--warn); }
.wg-slot.cover { background: var(--danger); border-color: var(--danger); color: #fff; }
.wg-slot.cover .wg-time, .wg-slot.cover .wg-live { color: #ffe3e7; }
.wg-slot.cover .wg-note { color: #fff; background: rgba(0,0,0,.18); border-radius: 4px; padding: 1px 5px; align-self: flex-start; }
.wg-empty { color: var(--muted); font-size: .85rem; text-align: center; padding: 14px 4px; background: var(--surface-2); border-radius: 8px; }
.wg-news { font-size: .8rem; background: var(--info-soft); border-radius: 8px; padding: 6px 8px; text-align: center; font-weight: 600; }

/* schedule page: stronger cover rows */
.sched-list li.cover { background: var(--danger-soft); box-shadow: inset 6px 0 0 var(--danger); }
.cover-note { color: var(--danger); }
.existing-note { padding: 6px 10px; border-radius: 6px; background: var(--surface-2); margin-top: 6px; }
.existing-note.cover { background: var(--danger-soft); color: var(--danger); font-weight: 600; }

/* other pages pick up a little colour too */
.page-head h1 { color: var(--accent); }
.emergency-head h1 { color: var(--danger); }
.daypart .dp-head { background: var(--accent-soft); }
.show-card { border-top: 4px solid var(--brand-orange); }

@media (prefers-color-scheme: dark) {
  .headlines { background: linear-gradient(90deg, #2a1d10, var(--surface)); }
  .wg-day { background: #2f5ba8; }
  .wg-slot.live { background: #143221; border-color: #4cc777; box-shadow: inset 0 0 0 1px #4cc777; }
  .wg-live { color: #4cc777; }
  .wg-slot.cover { background: #c21f35; border-color: #c21f35; }
  .cover-key { background: #fff; }
}
@media (max-width: 1000px) {
  .home-top { grid-template-columns: 1fr 1fr; }
  .home-top > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .home-top { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: repeat(7, 150px); }
}

/* ---------- standard schedule editor ---------- */
.std-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; margin-bottom: 12px; }
.std-day { border-top: 4px solid var(--accent); }
.std-day h2 { margin-bottom: 10px; color: var(--accent); }
.std-rows { display: grid; gap: 6px; margin-bottom: 10px; }
.std-row { display: flex; gap: 6px; align-items: center; }
.std-row .std-time { width: 74px; text-align: center; flex: none; font-family: var(--mono); }
.std-row .std-title { flex: 1; min-width: 0; }
.missing-note { padding: 10px 18px; color: var(--warn); background: var(--warn-soft); font-size: .9rem; border-top: 1px solid var(--border); }

/* ---------- show cross promo cards with pictures ---------- */
.show-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.show-pic { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; flex: none; background: var(--accent-soft); box-shadow: 0 0 0 3px var(--brand-orange); }
.show-pic.blank { display: grid; place-items: center; font-size: 2rem; }
.show-info { min-width: 0; }
.show-info h2 { font-size: 1.1rem; margin-bottom: 2px; }
.show-owners { color: var(--accent); font-weight: 600; margin-top: 2px; }
.show-actions { margin: -2px 0 10px; }
.tiny-pic { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; vertical-align: middle; }

/* ---------- show pop-up ---------- */
.linkish { appearance: none; background: none; border: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.linkish:hover { text-decoration: underline; color: var(--accent); }
.onair-title.linkish { font-size: 1.35rem; font-weight: 700; }
.sl-title .linkish { font-weight: 600; }
button.wg-slot { cursor: pointer; }
.wg-slot:focus-visible, .linkish:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: 2px; }
.pop-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.pop-when { font-weight: 700; color: var(--accent); }
.pop-head .cover-pill, .pop-head .plain-note { margin-top: 6px; }
.pop-sub { font-size: .95rem; margin: 6px 0 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.pop-promo { background: var(--surface-2); border-left: 4px solid var(--brand-orange); border-radius: 8px; padding: 12px 14px; margin-bottom: 6px; }
.pop-actions { margin-top: 14px; }

/* ---------- news rota ---------- */
.wg-news.changed { background: var(--danger); color: #fff; }
.news-changed { color: var(--danger); }
.news-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.news-day { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; padding: 8px; border-radius: 8px; background: var(--surface-2); }
.news-day.changed { background: var(--danger-soft); }
.news-day input { margin: 0; }
.badge.news { background: var(--info-soft); color: var(--info); }

/* ---------- station shortcuts ---------- */
.shortcuts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.shortcut {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: #fff; font-weight: 700;
  padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); transition: transform .08s, filter .15s;
}
.shortcut:hover { filter: brightness(1.08); transform: translateY(-1px); }
.shortcut .ext { font-weight: 400; opacity: .8; }
.sc-0 { background: linear-gradient(135deg, #d98200, #f0a202); }
.sc-1 { background: linear-gradient(135deg, #21417c, #2f5ba8); }
.sc-2 { background: linear-gradient(135deg, #c2255c, #e64980); }
.sc-3 { background: linear-gradient(135deg, #0b7a7c, #13a3a6); }
.sc-4 { background: linear-gradient(135deg, #5b3d8a, #7d58b8); }
.sc-5 { background: linear-gradient(135deg, #128c4a, #25a35a); }
@media (max-width: 640px) { .shortcut { flex: 1 1 calc(50% - 10px); justify-content: center; padding: 12px; } }

/* ---------- What's on locally: event cards ---------- */
.ev-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ev-chip { appearance: none; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 5px 11px; border-radius: 999px; }
.ev-chip span { opacity: .6; margin-left: 2px; }
.ev-chip.on { background: #5b3d8a; border-color: #5b3d8a; color: #fff; }
.ev-list { display: grid; gap: 10px; }
.ev { display: flex; gap: 14px; padding: 12px; border-radius: 12px; background: var(--surface-2); border-left: 5px solid #7d58b8; }
.ev.ev-big { border-left-color: #e2711d; }
.ev.ev-open { border-left-color: #13a3a6; }
.ev.ev-charity { border-left-color: #e64980; }
.ev-date { flex: none; width: 58px; border-radius: 10px; overflow: hidden; text-align: center; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; align-self: flex-start; }
.ev-dow { background: #5b3d8a; color: #fff; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 0; }
.ev-big .ev-dow { background: #e2711d; } .ev-open .ev-dow { background: #0b7a7c; } .ev-charity .ev-dow { background: #c2255c; }
.ev-day { font-size: 1.5rem; font-weight: 800; line-height: 1.15; padding-top: 2px; }
.ev-mon { font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--muted); padding-bottom: 4px; }
.ev-main { flex: 1; min-width: 0; }
.ev-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 3px; }
.ev-type { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ev-when { font-size: .7rem; font-weight: 700; background: var(--brand-orange); color: #fff; padding: 1px 8px; border-radius: 999px; }
.ev-edit { margin-left: auto; padding: 0 4px; }
.ev-title { font-size: 1.05rem; line-height: 1.3; margin-bottom: 4px; }
.ev-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .88rem; font-weight: 600; color: var(--accent); }
.ev-syn { margin: 6px 0 0; font-size: .9rem; color: var(--muted); line-height: 1.45; }
.ev-link { display: inline-block; margin-top: 6px; font-size: .85rem; font-weight: 600; }
.ev-legacy { margin-top: 14px; padding: 10px 12px; border-radius: 8px; background: var(--warn-soft); font-size: .88rem; }
.ev-legacy .prewrap { margin: 8px 0; max-height: 160px; overflow: auto; }
.ev-type-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ev-type-pick .pill span { min-width: 0; }
.ev-type-pick .pill small { font-weight: 400; opacity: .8; }
.ev-paste { background: linear-gradient(135deg, #f3edfd, #fff4e6); border: 1px dashed #7d58b8; border-radius: 12px; padding: 12px; margin-bottom: 16px; }
.ev-paste label { font-weight: 700; }
.ev-paste textarea { min-height: 90px; margin-top: 6px; background: var(--surface); }
.ev-paste-result { margin-top: 8px; }
.ev-multi { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ev-multi > span:not(.muted) { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; }
.ok-text { color: var(--ok); font-weight: 600; }
input.filled, textarea.filled { background: #f0fbf3; border-color: #8fd3a5; }
@media (prefers-color-scheme: dark) {
  .ev-paste { background: linear-gradient(135deg, #241a3b, #2a1d10); }
  input.filled, textarea.filled { background: #143221; border-color: #2e7a49; }
}
.ev-by { font-size: .75rem; color: var(--muted); margin-top: 4px; }
.until-note { margin-top: 8px; font-size: .78rem; color: var(--muted); }
.ld-name span { font-weight: 500; opacity: .8; }

/* ---------- show prep ---------- */
.prep-book-pick select { min-width: 220px; }
.prep-days { align-items: center; flex-wrap: wrap; }
.prep-days input[type=date] { width: auto; margin-left: 6px; }
.prep-card { padding: 0; overflow: hidden; border-top: 4px solid var(--brand-orange); }
.prep-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 18px; background: var(--accent-soft); }
.prep-head h2 { font-size: 1rem; color: var(--accent); }
.prep-status { color: var(--muted); }
.prep-body { display: block; width: 100%; min-height: 420px; border: none; border-radius: 0; padding: 18px; font-size: 1.02rem; line-height: 1.6; resize: none; background: var(--surface); }
.prep-body:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent-soft); }
.prep-preview { padding: 18px; font-size: 1.02rem; line-height: 1.6; min-height: 420px; }
.prep-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }
.prep-conflict { margin: 12px 18px 0; padding: 12px; border-radius: 10px; background: var(--warn-soft); color: var(--text); }
.prep-conflict .c-peek { margin-top: 10px; padding: 10px; background: var(--surface); border-radius: 8px; max-height: 240px; overflow: auto; }
.section-h { font-size: 1rem; margin: 20px 0 10px; color: var(--accent); }
@media (max-width: 1380px) and (min-width: 721px) { .topbar .brand-sub { display: none; } .tabs a, .nav-more > summary { padding: 7px 10px; } }
@media (max-width: 1220px) and (min-width: 721px) {
  .topbar { gap: 10px; padding: 10px 14px; }
  .tabs { gap: 0; }
  .tabs a, .nav-more > summary { padding: 6px 8px; font-size: .88rem; }
  .btn-emergency { padding: 6px 10px; font-size: .88rem; }
  .brand-logo { height: 40px; }
}
