/* Fernseher: app-specific rules on top of the station frame (app.css).
   Colour roles as in the station's DESIGN.md: the red lamp (.pill.on) only for "on now"; steel blue
   (--accent) for controls, links and picks; amber (--warn) for overlaps, stale data and anything that
   needs attention; green (--ok) only for measured readings. No inline styles: the CSP forbids them, so
   grid positions are classes (.c1-.c48 start slot, .w1-.w48 width in 5-minute slots, generated below). */

.pill, .notice, .chip.reason { forced-color-adjust: none; }
.seg a { font-family: var(--display); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-right: 1px solid var(--line); padding: 8px 12px; min-height: 44px; display: inline-flex; align-items: center; white-space: nowrap; }
.seg a:last-child { border-right: 0; }
.seg a:hover { color: var(--fg); text-decoration: none; }
.seg a.on { background: var(--accent); color: var(--accent-ink); }
.seg form, form.seg { margin: 0; }
.warn-text { color: var(--warn); }
.warn-text a { color: inherit; text-decoration: underline; }
.reading { color: var(--muted); }
.reading .val { color: var(--ok); }
.notice form { margin-left: auto; }
.chips, .row.tight { align-items: center; }
.chip.online { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); color: var(--accent); }
.chip.on-variant { border-color: var(--accent); color: var(--fg); font-weight: 400; }
a.chip:hover { border-color: var(--accent); text-decoration: none; }
form.pick { margin: 0; }
.btn.picked { border-color: var(--accent); color: var(--fg); }

/* ── Sign-in ─────────────────────────────────────────────── */
.nx-signin { text-transform: none; letter-spacing: .02em; font-size: 14px; }
.nx-signin img { width: 1.1rem; height: 1.1rem; object-fit: contain; flex: none; }
.signin-card { max-width: 520px; }

/* ── Time bar ────────────────────────────────────────────── */
.timebar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.timebar form { margin: 0; }

/* ── Test card: shown where there is nothing to show ─────── */
.testcard { border: 1px solid var(--line); background: var(--bg2); padding: 0 0 22px; display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; }
.testcard .bars { display: grid; grid-template-columns: repeat(7, 1fr); width: 100%; height: 54px; }
.testcard .bars i:nth-child(1) { background: #8d8d93; } .testcard .bars i:nth-child(2) { background: #8e8a4c; }
.testcard .bars i:nth-child(3) { background: #4c8a8e; } .testcard .bars i:nth-child(4) { background: #4f8752; }
.testcard .bars i:nth-child(5) { background: #85508a; } .testcard .bars i:nth-child(6) { background: #8a4d4f; }
.testcard .bars i:nth-child(7) { background: #4d5490; }
.testcard p, .testcard h1 { max-width: 46em; padding-inline: 16px; }

/* ── The grid ────────────────────────────────────────────── */
.epg-scroll { overflow-x: auto; border: 1px solid var(--line); background: var(--bg); overscroll-behavior-x: contain; }
.epg { min-width: 1060px; }
.epg-row { display: grid; grid-template-columns: 136px repeat(48, minmax(0, 1fr)); border-bottom: 1px solid var(--line); min-height: 66px; }
.epg-row:last-child { border-bottom: 0; }
.epg-row > * { grid-row: 1; min-width: 0; }
.epg-ruler { min-height: 30px; background: var(--bg2); }
.epg-ruler .tick { font-size: 12px; color: var(--muted); padding: 6px 6px; border-left: 1px solid var(--line); }
.epg .ch { grid-column: 1; position: sticky; left: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--bg2); border-right: 1px solid var(--line); color: var(--fg); }
.epg .ch:hover { text-decoration: none; background: var(--panel); }
.epg .ch .num { font-size: 12px; color: var(--muted); }
.epg .ch .name { font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; line-height: 1.2; overflow-wrap: anywhere; }
.epg-ruler .ch { z-index: 2; }
.cell { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border-left: 1px solid var(--line); background: var(--panel-grad); color: var(--fg); overflow: hidden; }
.cell:hover, .cell:focus-visible { background: color-mix(in srgb, var(--panel) 55%, var(--line)); text-decoration: none; }
.cell .t { font-size: 12px; color: var(--muted); }
.cell .ti { font-size: 14px; font-weight: 500; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cell .st { font-size: 12.5px; color: var(--muted); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell .lamps { display: flex; gap: 4px; flex-wrap: wrap; margin-top: auto; }
.cell .lamps .chip { font-size: 10.5px; padding: 0 5px; }
.cell.now { background: linear-gradient(180deg, #1c1c21 0%, #151518 100%); }
.cell.past { opacity: .55; }
.cell.is-picked { box-shadow: inset 3px 0 0 var(--accent); }
.cell.is-picked .t { color: var(--accent); }
.cell.cut-l { border-left-style: dashed; }

/* ── Lists (list view, channel day, search, planner) ─────── */
.lineup-list { display: flex; flex-direction: column; gap: 22px; }
.chan-block h2 { display: flex; align-items: baseline; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.chan-block h2 .num { font-size: 13px; color: var(--muted); font-weight: 400; }
.chan-block h2 a { color: var(--fg); }
.ev-list, .plan-list { border: 1px solid var(--line); background: var(--panel); }
.ev-row, .plan-row { display: grid; grid-template-columns: 8.5em minmax(0, 1fr) auto; gap: 6px 14px; align-items: start; padding: 10px 12px 10px 14px; border-bottom: 1px solid var(--line); }
.ev-row:last-child, .plan-row:last-child { border-bottom: 0; }
.ev-row .when, .plan-row .when { font-size: 14px; color: var(--fg); padding-top: 2px; }
.ev-row .when .to, .plan-row .when .to { color: var(--muted); }
.ev-row .when .d, .plan-row .when .d { color: var(--muted); }
.ev-row .what, .plan-row .what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ev-row .title, .plan-row .title { color: var(--fg); font-weight: 500; font-size: 16px; }
.ev-row .subtitle, .plan-row .subtitle { font-size: 14px; color: var(--muted); }
.ev-row .meta, .plan-row .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.ev-row .meta:empty { display: none; }
.chan { font-size: 12px; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.ev-row.now, .plan-row.now { background: color-mix(in srgb, var(--panel) 70%, var(--line)); }
.ev-row.past { opacity: .6; }
.ev-row.is-picked { box-shadow: inset 3px 0 0 var(--accent); }
.plan-row, .ev-list.with-day .ev-row { grid-template-columns: 12.5em minmax(0, 1fr) auto; }
.plan-row .when { white-space: nowrap; }
.plan-row.lost .when { color: var(--warn); }
.chip.reason { color: var(--fg); }
.chip.r-as_selected, .chip.r-parallel { color: var(--muted); }
.chip.r-rerun, .chip.r-mediathek, .chip.r-mediathek_expected { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); color: var(--accent); }
.chip.r-unplanned { border-color: var(--warn); color: var(--warn); }
.searchbar { max-width: 620px; flex-wrap: nowrap; }
.searchbar input { flex: 1; }

/* ── Programme page ──────────────────────────────────────── */
.detail { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.description { white-space: pre-line; }
.media-list li, .airings li { display: flex; flex-direction: column; gap: 3px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.media-list li:first-child, .airings li:first-child { padding-top: 0; }
.media-list li:last-child, .airings li:last-child { border-bottom: 0; padding-bottom: 0; }
.airings li { flex-direction: row; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.media-list .src { font-size: 12px; letter-spacing: .06em; color: var(--muted); }
.media-list .mt-title { font-size: 15px; }
.media-list .ext { font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.share .linkbox code { font-size: 14px; }

@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .epg { min-width: 900px; }
  .epg-row { grid-template-columns: 96px repeat(48, minmax(0, 1fr)); }
  .epg .ch { flex-direction: column; align-items: flex-start; gap: 0; padding: 6px 8px; }
  .epg .ch .name { font-size: 11.5px; }
  .ev-row, .plan-row, .ev-list.with-day .ev-row { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 10px 10px 12px; }
  .ev-row .when, .plan-row .when { grid-column: 1 / -1; padding-top: 0; }
  .timebar { flex-direction: column; align-items: stretch; }
  .notice { flex-wrap: wrap; }
  .notice form { margin-left: 0; }
}

/* ── Downloads and playback ──────────────────────────────── */
.chip.status.s-failed { border-color: var(--warn); color: var(--warn); }
.chip.status.s-running, .chip.status.s-queued { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); color: var(--accent); }
.chip.status.s-done { color: var(--fg); }
/* Download progress is a measured reading: green. */
.meter { display: inline-block; width: 90px; height: 6px; background: var(--line); vertical-align: middle; }
.meter i { display: block; height: 100%; background: var(--ok); }
.meter i.w0 { width: 0%; } .meter i.w10 { width: 10%; } .meter i.w20 { width: 20%; } .meter i.w30 { width: 30%; }
.meter i.w40 { width: 40%; } .meter i.w50 { width: 50%; } .meter i.w60 { width: 60%; } .meter i.w70 { width: 70%; }
.meter i.w80 { width: 80%; } .meter i.w90 { width: 90%; } .meter i.w100 { width: 100%; }
.screen { border: 1px solid var(--line); background: #000; }
.screen video { display: block; width: 100%; max-height: 72vh; background: #000; }

/* ── Grid positions (generated: 48 five-minute slots) ────── */
.c1 { grid-column-start: 2; } .c2 { grid-column-start: 3; } .c3 { grid-column-start: 4; } .c4 { grid-column-start: 5; } .c5 { grid-column-start: 6; } .c6 { grid-column-start: 7; }
.c7 { grid-column-start: 8; } .c8 { grid-column-start: 9; } .c9 { grid-column-start: 10; } .c10 { grid-column-start: 11; } .c11 { grid-column-start: 12; } .c12 { grid-column-start: 13; }
.c13 { grid-column-start: 14; } .c14 { grid-column-start: 15; } .c15 { grid-column-start: 16; } .c16 { grid-column-start: 17; } .c17 { grid-column-start: 18; } .c18 { grid-column-start: 19; }
.c19 { grid-column-start: 20; } .c20 { grid-column-start: 21; } .c21 { grid-column-start: 22; } .c22 { grid-column-start: 23; } .c23 { grid-column-start: 24; } .c24 { grid-column-start: 25; }
.c25 { grid-column-start: 26; } .c26 { grid-column-start: 27; } .c27 { grid-column-start: 28; } .c28 { grid-column-start: 29; } .c29 { grid-column-start: 30; } .c30 { grid-column-start: 31; }
.c31 { grid-column-start: 32; } .c32 { grid-column-start: 33; } .c33 { grid-column-start: 34; } .c34 { grid-column-start: 35; } .c35 { grid-column-start: 36; } .c36 { grid-column-start: 37; }
.c37 { grid-column-start: 38; } .c38 { grid-column-start: 39; } .c39 { grid-column-start: 40; } .c40 { grid-column-start: 41; } .c41 { grid-column-start: 42; } .c42 { grid-column-start: 43; }
.c43 { grid-column-start: 44; } .c44 { grid-column-start: 45; } .c45 { grid-column-start: 46; } .c46 { grid-column-start: 47; } .c47 { grid-column-start: 48; } .c48 { grid-column-start: 49; }
.w1 { grid-column-end: span 1; } .w2 { grid-column-end: span 2; } .w3 { grid-column-end: span 3; } .w4 { grid-column-end: span 4; } .w5 { grid-column-end: span 5; } .w6 { grid-column-end: span 6; }
.w7 { grid-column-end: span 7; } .w8 { grid-column-end: span 8; } .w9 { grid-column-end: span 9; } .w10 { grid-column-end: span 10; } .w11 { grid-column-end: span 11; } .w12 { grid-column-end: span 12; }
.w13 { grid-column-end: span 13; } .w14 { grid-column-end: span 14; } .w15 { grid-column-end: span 15; } .w16 { grid-column-end: span 16; } .w17 { grid-column-end: span 17; } .w18 { grid-column-end: span 18; }
.w19 { grid-column-end: span 19; } .w20 { grid-column-end: span 20; } .w21 { grid-column-end: span 21; } .w22 { grid-column-end: span 22; } .w23 { grid-column-end: span 23; } .w24 { grid-column-end: span 24; }
.w25 { grid-column-end: span 25; } .w26 { grid-column-end: span 26; } .w27 { grid-column-end: span 27; } .w28 { grid-column-end: span 28; } .w29 { grid-column-end: span 29; } .w30 { grid-column-end: span 30; }
.w31 { grid-column-end: span 31; } .w32 { grid-column-end: span 32; } .w33 { grid-column-end: span 33; } .w34 { grid-column-end: span 34; } .w35 { grid-column-end: span 35; } .w36 { grid-column-end: span 36; }
.w37 { grid-column-end: span 37; } .w38 { grid-column-end: span 38; } .w39 { grid-column-end: span 39; } .w40 { grid-column-end: span 40; } .w41 { grid-column-end: span 41; } .w42 { grid-column-end: span 42; }
.w43 { grid-column-end: span 43; } .w44 { grid-column-end: span 44; } .w45 { grid-column-end: span 45; } .w46 { grid-column-end: span 46; } .w47 { grid-column-end: span 47; } .w48 { grid-column-end: span 48; }

/* Clips: editor and list */
.chip.status.send-failed { border-color: var(--warn); color: var(--warn); }
.chip.status.send-queued, .chip.status.send-sending { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); color: var(--accent); }
.chip.status.send-sent { color: var(--ok); }
.cut-parts { list-style: decimal-leading-zero; padding-left: 2.4em; margin: 0; display: grid; gap: 10px; }
.cut-part { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.cut-part::marker { font-family: var(--mono); color: var(--muted); }
.input-time { width: 9ch; }
fieldset.checks { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
fieldset.checks legend { width: 100%; margin-bottom: 4px; }
.clip-file { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.clip-file video { width: min(100%, 420px); background: #000; border: 1px solid var(--line); }
.clip-file audio { width: min(100%, 420px); }
