/* Content Engine - a production control room. Cool slate paper, condensed slate type, each channel's own colour. */
@font-face { font-family: "Archivo"; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url(/static/fonts/archivo-latin-wdth-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Archivo"; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url(/static/fonts/archivo-latin-ext-wdth-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root {
  --bg: #EDF0F3; --surface: #FFFFFF; --sunk: #E3E7EC; --ink: #16191D; --ink-2: #59616B; --line: #D3D8DE;
  --ready: #1C7C4C; --look: #A35F00; --failed: #B42318; --focus: #2557D6; --btn: #16191D; --btn-ink: #FFFFFF;
  --radius: 10px; --wide: 75%;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121519; --surface: #1B1F24; --sunk: #23282F; --ink: #E7EAEE; --ink-2: #9AA3AD; --line: #2B3138;
    --ready: #4CC38A; --look: #F2A54A; --failed: #F2766B; --focus: #7EA2FF; --btn: #E7EAEE; --btn-ink: #121519;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 "Archivo", system-ui, sans-serif; }
a { color: inherit; }
img, video { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* ------------------------------------------------ frame */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .in { max-width: 1120px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 22px; min-height: 58px; }
.mark { font-weight: 800; font-stretch: var(--wide); font-size: 22px; letter-spacing: .01em; text-decoration: none; white-space: nowrap; }
nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
nav a { text-decoration: none; padding: 8px 12px; border-radius: 8px; color: var(--ink-2); white-space: nowrap; }
nav a:hover { color: var(--ink); background: var(--sunk); }
nav a[aria-current] { color: var(--ink); background: var(--sunk); font-weight: 600; }
.top form { margin: 0; }
main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 80px; }
h1 { font-weight: 800; font-stretch: var(--wide); font-size: 40px; line-height: 1.05; margin: 6px 0 6px; letter-spacing: -.005em; }
h2 { font-weight: 800; font-stretch: var(--wide); font-size: 24px; line-height: 1.15; margin: 34px 0 12px; }
h3 { font-size: 16px; margin: 0 0 6px; }
.lede { color: var(--ink-2); margin: 0 0 22px; max-width: 70ch; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }

/* ------------------------------------------------ on air: the one loud thing */
.onair { --ch: #8A93A0; background: var(--ch); color: #101215; }
.onair .in { max-width: 1120px; margin: 0 auto; padding: 12px 16px 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 6px 18px; align-items: center; }
.onair .tally { font-weight: 800; font-stretch: var(--wide); font-size: 15px; display: flex; align-items: center; gap: 8px; }
.onair .tally::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #C8102E; box-shadow: 0 0 0 3px rgba(255,255,255,.55); animation: tally 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .onair .tally::before { animation: none; } }
@keyframes tally { 50% { opacity: .35; } }
.onair .what { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onair .pct { font-weight: 800; font-stretch: var(--wide); font-size: 22px; font-variant-numeric: tabular-nums; }
.onair .bar { grid-column: 1 / -1; height: 6px; background: rgba(0,0,0,.18); border-radius: 99px; overflow: hidden; }
.onair .bar i { display: block; height: 100%; width: 0; background: #101215; border-radius: 99px; transition: width .6s ease; }
.onair .stage { grid-column: 1 / -1; font-size: 13px; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onair a { color: inherit; font-weight: 600; }
.idle { background: var(--sunk); color: var(--ink-2); }
.idle .in { max-width: 1120px; margin: 0 auto; padding: 9px 16px; font-size: 14px; }

/* ------------------------------------------------ pieces */
.flash { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--focus); border-radius: 8px; padding: 10px 14px; margin: 0 0 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--btn); background: var(--btn); color: var(--btn-ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink-2); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.danger { background: transparent; color: var(--failed); border-color: var(--line); }
.btn:disabled { opacity: .5; cursor: default; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.verdict { display: inline-block; font-weight: 700; font-size: 13px; padding: 2px 10px; border-radius: 99px; border: 1.5px solid currentColor; white-space: nowrap; }
.v-READY { color: var(--ready); } .v-LOOK { color: var(--look); } .v-FAILED { color: var(--failed); }
.num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------ channel rows */
.channels { display: grid; gap: 10px; }
.ch { --ch: #888; display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-left: 8px solid var(--ch); border-radius: var(--radius); padding: 16px 18px; }
.ch .name { font-weight: 800; font-stretch: var(--wide); font-size: 26px; line-height: 1.05; }
.ch .meta { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--ink-2); font-size: 14px; margin-top: 6px; }
.ch .meta b { color: var(--ink); font-weight: 600; }
.counts { display: flex; gap: 14px; font-size: 14px; }
.counts span b { font-weight: 800; font-stretch: var(--wide); font-size: 20px; margin-right: 3px; }
.c-ready b { color: var(--ready); } .c-look b { color: var(--look); } .c-failed b { color: var(--failed); }
@media (max-width: 720px) { .ch { grid-template-columns: 1fr; } }

.callout { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 6px; }
.callout .big { font-weight: 800; font-stretch: var(--wide); font-size: 28px; }

/* ------------------------------------------------ lists */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.item { display: grid; grid-template-columns: 6px 1fr auto; gap: 14px; align-items: center; padding: 12px 16px 12px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item .sw { align-self: stretch; background: var(--ch, #888); border-radius: 0 3px 3px 0; }
.item .t { font-weight: 600; }
.item .s { color: var(--ink-2); font-size: 13px; }
.empty { padding: 18px; color: var(--ink-2); }
.st { font-size: 13px; font-weight: 600; }
.st-done { color: var(--ready); } .st-failed, .st-interrupted { color: var(--failed); } .st-cancelled { color: var(--ink-2); } .st-queued { color: var(--ink-2); } .st-running { color: var(--focus); }

/* ------------------------------------------------ forms */
form.stack { display: grid; gap: 16px; max-width: 640px; }
label.f { display: grid; gap: 6px; font-weight: 600; }
label.f span.h { font-weight: 400; color: var(--ink-2); font-size: 13px; }
input[type=text], input[type=password], input[type=number], input[type=time], select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; }
input[type=file] { font: inherit; }
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.pick { --ch: #888; display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--ch); border-radius: 8px; padding: 10px 12px; cursor: pointer; font-weight: 600; }
.pick input { width: 18px; height: 18px; accent-color: var(--ink); }
.inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.inline > * { flex: 1 1 140px; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
legend { font-weight: 600; margin-bottom: 8px; }

/* ------------------------------------------------ upload kit */
.video { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 22px; overflow: hidden; }
.video > header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 16px 18px 10px; flex-wrap: wrap; }
.video > header h2 { margin: 0; font-size: 24px; }
.video .body { padding: 0 18px 18px; display: grid; gap: 18px; }
.look-at { margin: 0; padding: 10px 14px 10px 30px; background: var(--sunk); border-radius: 8px; color: var(--look); }
.look-at.bad { color: var(--failed); }
.grid2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.thumbs figure { margin: 0; }
.thumbs img { border-radius: 6px; border: 1px solid var(--line); aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.thumbs figcaption { font-size: 12px; color: var(--ink-2); margin-top: 4px; display: flex; justify-content: space-between; gap: 6px; }
.field { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.field .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; background: var(--sunk); font-size: 13px; font-weight: 600; }
.field .val { padding: 10px 12px; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; font-size: 14px; }
.titles .t-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 8px 8px 12px; border-top: 1px solid var(--line); }
.titles .t-row:first-of-type { border-top: 0; }
.titles .t-row .sc { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.titles .main-t { font-weight: 700; }
.shorts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.short { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: grid; gap: 8px; align-content: start; }
.short video { aspect-ratio: 9/16; width: 100%; background: #000; border-radius: 6px; object-fit: contain; }
.player video { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 8px; }
.done-toggle { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.done-toggle input { width: 18px; height: 18px; accent-color: var(--ready); }
.is-up { opacity: .62; }
pre.log { background: #0F1216; color: #D6DCE3; border-radius: var(--radius); padding: 14px 16px; overflow: auto; max-height: 70vh; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }

/* ------------------------------------------------ login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .panel { width: 100%; max-width: 380px; }
.login h1 { font-size: 34px; margin: 0 0 4px; }

@media (max-width: 600px) {
  h1 { font-size: 32px; }
  .top .in { gap: 4px 10px; flex-wrap: wrap; padding-top: 8px; }
  nav { order: 3; flex-basis: 100%; margin: 0 -6px 6px; }
  nav a { padding: 6px 8px; }
  .mark { font-size: 18px; }
  .onair .in { grid-template-columns: 1fr auto; }
  .onair .tally { grid-column: 1 / -1; }
  .thumbs { grid-template-columns: 1fr 1fr; }
}
