/* streamsched: one rust accent, warm greys, lots of space. Phones get a bottom tab bar. */
:root {
  --bg: #f7f6f4; --card: #ffffff; --surface-2: #f1efec; --ink: #1f1c1a; --muted: #6b6560; --line: #e4e0db;
  --accent: #b4532a; --accent-ink: #fff; --accent-soft: #f6e7df;
  --ok: #2f7d4f; --ok-soft: #e3f2e8; --warn: #a86a00; --warn-soft: #faf0d9;
  --bad: #c0322a; --live: #d3382c; --live-soft: #fbe6e3;
  --shadow: 0 1px 2px rgba(40,30,20,.06), 0 4px 16px rgba(40,30,20,.05);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #161413; --card: #201d1b; --surface-2: #2a2624; --ink: #f2eeea; --muted: #a79f98; --line: #3a3532;
          --accent: #e07a4c; --accent-ink: #1a1210; --accent-soft: #3a2419;
          --ok: #5bc184; --ok-soft: #173023; --warn: #e2a93b; --warn-soft: #3a2c10;
          --bad: #ff6b5e; --live: #ff5a4b; --live-soft: #3d1a16; --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
       font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
main { max-width: 1080px; margin: 0 auto; padding: 32px 16px 96px; }
h1 { font-size: 28px; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 20px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600;
     margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.card h2 { margin-top: 2px; }

/* ---- top bar, account menu, bottom tabs */
.top { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 24px; height: 60px; padding: 0 16px; }
.brand { font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.brand img { display: block; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover, .nav a.on { color: var(--ink); background: var(--surface-2); }
.acct { position: relative; }
.acct summary { list-style: none; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; }
.acct summary::-webkit-details-marker { display: none; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: 12px; display: grid; place-items: center; text-transform: uppercase; }
.acct-menu { position: absolute; right: 0; top: 46px; z-index: 6; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); min-width: 220px; padding: 6px; display: grid; }
.acct-menu .who { padding: 8px 10px; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow-wrap: anywhere; }
.acct-menu a, .acct-menu button { text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 8px;
  color: var(--ink); text-decoration: none; width: 100%; font-weight: 400; }
.acct-menu a:hover, .acct-menu button:hover { background: var(--surface-2); }
.acct-menu form { margin: 0; }
.tabs { display: none; }
.tabs svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 700px) {
  .nav, .acct-name { display: none; }
  .top-in { justify-content: space-between; }
  .tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
    background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .tabs a { display: grid; justify-items: center; gap: 2px; padding: 8px 0 6px; font-size: 11px; color: var(--muted); text-decoration: none; font-weight: 500; }
  .tabs a.on { color: var(--accent); }
  main { padding: 20px 16px 100px; }
  h1 { font-size: 24px; }
}

/* ---- building blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; }
.card.flush { padding: 0; }
.auth { max-width: 420px; margin: 48px auto; }
.auth-logo { display: block; margin: 0 auto 8px; }
.notice { border-left: 4px solid var(--warn); }
.head, .page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head h1, .page-head h1 { margin: 0; }
.page-head { align-items: flex-end; margin-bottom: 32px; }
.sub { color: var(--muted); margin: 4px 0 0; }
.section { margin-bottom: 40px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cols > .card { margin: 0; }
.home-cols { display: grid; grid-template-columns: 3fr 2fr; gap: 32px; align-items: start; }
@media (max-width: 760px) { .cols, .home-cols { grid-template-columns: 1fr; } }

label { display: block; margin-bottom: 12px; font-weight: 500; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; margin-bottom: 6px; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 12px; font: inherit; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 14px; padding: 10px 12px; }
legend { padding: 0 4px; font-weight: 600; }
button, .btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; font: inherit; font-weight: 600;
  border-radius: 10px; cursor: pointer; background: var(--card); color: var(--ink); border: 1px solid var(--line); text-decoration: none; }
button:hover, .btn:hover { background: var(--surface-2); }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.primary:hover, .btn.primary:hover { filter: brightness(1.06); }
button.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
button.stop, .btn.stop { color: var(--live); border-color: var(--live); background: transparent; }
button.stop:hover { background: var(--live-soft); }
button.sm, .btn.sm { padding: 6px 12px; font-size: 14px; border-radius: 8px; }
button.link, .link { background: none; border: 0; color: var(--accent); padding: 0; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; }
button.link:hover, .link:hover { text-decoration: underline; background: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; }
.flash.ok { background: var(--ok-soft); }
.flash.err { background: var(--live-soft); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.bad { color: var(--bad); }
.grow { flex: 1; min-width: 200px; }
code { overflow-wrap: anywhere; }

/* badges and status dots */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px;
  font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.s-ready, .s-completed, .s-prepared, .badge.ok { background: var(--ok-soft); color: var(--ok); }
.s-live, .badge.live { background: var(--live-soft); color: var(--live); }
.s-failed, .s-dropped, .badge.fail { background: var(--live-soft); color: var(--bad); }
.s-reconnecting, .s-needs_processing, .s-processing, .s-stopping, .s-importing, .s-uploading, .s-uploaded,
.s-validating, .badge.warn { background: var(--warn-soft); color: var(--warn); }
.loc-on { background: var(--accent-soft); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot.live { background: var(--live); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 55%, transparent); }
                   70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .dot.live { animation: none; } }
.count { background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 0 8px; font-size: 12px; letter-spacing: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); white-space: nowrap; }
.chip form { margin: 0; display: inline; }

/* rows (lists inside cards) */
.row { display: flex; align-items: center; gap: 12px 16px; padding: 14px 0; border-top: 1px solid var(--line);
       color: inherit; text-decoration: none; flex-wrap: wrap; }
.row:first-of-type { border-top: 0; }
.card.flush .row { padding: 14px 18px; }
a.row:hover { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.row form { margin: 0; }
.row .t { font-weight: 600; }
.row .meta { color: var(--muted); font-size: 13px; }
.row-main { flex: 1; min-width: 180px; display: grid; gap: 6px; }
.when { font-weight: 700; width: 64px; flex: none; }
.when small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.tthumb { width: 112px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; flex: none; background: var(--surface-2); }
@media (max-width: 700px) { .row .tthumb { display: none; } }

/* thumbnails and the video grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px 20px; }
@media (max-width: 700px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; } }
.vcard { display: grid; gap: 8px; align-content: start; color: inherit; text-decoration: none; }
.vcard .t { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.vcard .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; }
.vthumbbox { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 16/9; background: var(--surface-2); }
.vthumbbox img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vcard:hover .vthumbbox img { filter: brightness(1.05); }
.dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.66); color: #fff; font-size: 11px;
  font-weight: 600; padding: 1px 6px; border-radius: 4px; }
.tile { padding: 0; overflow: hidden; color: inherit; text-decoration: none; margin: 0; }
.tile img, .nothumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: var(--surface-2); }
.tile-body { padding: 10px 12px; display: grid; gap: 4px; justify-items: start; }
.hero { width: 100%; border-radius: 10px; margin-bottom: 12px; }
.toolbar, .filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 24px; }
.toolbar input[type=search], .filters input { width: auto; flex: 1; max-width: 340px; min-width: 160px; margin: 0; }
.filters select { width: auto; margin: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 10px; }
.seg a { padding: 6px 12px; border-radius: 7px; color: var(--muted); font-weight: 500; font-size: 14px; text-decoration: none; }
.seg a.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
@media (max-width: 700px) { .toolbar input[type=search] { max-width: none; flex-basis: 100%; } }

/* home: on air cards, needs attention */
.live-card { display: grid; grid-template-columns: 240px 1fr; gap: 24px; box-shadow: var(--shadow); padding: 20px; }
.live-card .vthumbbox { align-self: start; }
.live-main { display: grid; gap: 12px; min-width: 0; }
.live-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.live-title { font-size: 22px; font-weight: 700; letter-spacing: -.01em; margin: 6px 0 0; color: inherit; text-decoration: none; display: block; }
.elapsed { color: var(--muted); }
.elapsed b { color: var(--ink); font-size: 20px; }
.meter { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--live); border-radius: 3px; transition: width 1s linear; }
@media (max-width: 700px) { .live-card { grid-template-columns: 1fr; padding: 16px; } .live-card .vthumbbox { display: none; } }
.att { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.att:first-of-type { border-top: 0; }
.att p { margin: 0 0 4px; font-size: 14px; }
.att-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.att-ic.warn { background: var(--warn-soft); color: var(--warn); }
.att-ic.fail { background: var(--live-soft); color: var(--live); }
.att-ic.info { background: var(--surface-2); color: var(--muted); }
.empty { color: var(--muted); padding: 8px 0; margin: 0; }

/* schedule: week strip and agenda */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 32px; }
.day { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px 4px; text-align: center;
  color: var(--ink); text-decoration: none; }
.day small { display: block; color: var(--muted); font-size: 12px; }
.day b { font-size: 18px; }
.day .pips { display: flex; justify-content: center; gap: 3px; height: 6px; margin-top: 4px; }
.day .pips i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.day.today { border-color: var(--accent); background: var(--accent-soft); }
.day.none { color: var(--muted); }

/* existing pages */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 12px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.dests { list-style: none; padding: 0; margin: 0 0 12px; }
.dests li { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.events { list-style: none; padding: 0; margin: 0; max-height: 600px; overflow: auto; }
.events li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.ev-warn { color: var(--warn); } .ev-error { color: var(--bad); }
details > summary { cursor: pointer; }
details.danger { margin-top: 16px; }
details.danger summary { color: var(--bad); }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 40px 16px; text-align: center; background: var(--card); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.progress .bar { height: 12px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 12px 0 6px; }
.progress .bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.uplist { list-style: none; padding: 0; margin: 0; }
.uplist li { margin: 0 0 14px; }
.uplist .bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 6px 0 4px; }
.uplist .bar span { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.qr svg { width: 220px; height: 220px; background: #fff; padding: 8px; border-radius: 8px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
@media (max-width: 600px) { .tbl { display: block; overflow-x: auto; } }
.inset { background: var(--bg); margin: 0 0 14px; }
.thumbprev { display: block; width: 100%; max-width: 320px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: var(--surface-2); margin: 6px 0 10px; }
.thumbprev[hidden] { display: none; }
.inline-edit summary { list-style: none; }
.inline-edit summary::-webkit-details-marker { display: none; }
.inline-edit[open] { order: 10; flex-basis: 100%; }
.vthumb { width: 135px; aspect-ratio: 9/16; object-fit: cover; border-radius: 8px; background: var(--surface-2); float: right; margin: 0 0 8px 12px; }
input.narrow { width: 5.5em; display: inline-block; margin: 0 4px; }
.trim { display: flex; flex-wrap: wrap; gap: 12px; }
.trim label { flex: 1 1 160px; }
.previews figure { flex: 1 1 200px; margin: 0; }
.previews img { width: 100%; aspect-ratio: 16/9; object-fit: contain; background: #000; border-radius: 8px; display: block; }
.plist { list-style: decimal; padding-left: 22px; }
.plist li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.plist li > .small { flex-basis: 100%; }
form.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
form.inline label { margin: 0; flex: 1; min-width: 200px; }
[hidden] { display: none !important; }
progress.minibar { display: block; width: 100%; height: 4px; margin: 6px 0; border: 0; border-radius: 2px;
  background: var(--surface-2); appearance: none; -webkit-appearance: none; overflow: hidden; }
progress.minibar::-webkit-progress-bar { background: var(--surface-2); }
progress.minibar::-webkit-progress-value { background: var(--accent); }
progress.minibar::-moz-progress-bar { background: var(--accent); }
.toolbar-search { display: flex; margin: 0; max-width: 340px; } .toolbar-search input[type=search] { max-width: none; }
@media (max-width: 700px) { .toolbar-search { max-width: none; flex-basis: 100%; } }
.inline-h { display: inline-flex; margin: 0 0 14px; }

[hidden] { display: none !important; }
