/* Valence Live Studio — master control room look.
   Navy room, red tally for "on air", Valence blue for actions, amber for things that need you. */
:root {
  --room: #071426;
  --panel: #0C1E36;
  --raised: #12294A;
  --line: #1E3557;
  --line-soft: #172C4B;
  --ink: #E8EEF6;
  --muted: #8A9BB3;
  --faint: #5C6F8C;
  --blue: #1F5FD1;
  --blue-hi: #3B77E6;
  --tally: #E5484D;
  --amber: #F0A93B;
  --ok: #3FB27F;
  --r-sm: 6px;
  --r: 10px;
  --sans: 'Inter Tight', 'Inter', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--room); color: var(--ink); font: 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--blue-hi); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--blue-hi); outline-offset: 2px; }

/* ---------- buttons & inputs ---------- */
.btn { font: 500 14px var(--sans); color: var(--ink); background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #2C4A75; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-hi); }
.btn.danger { color: #FFB4B6; border-color: #5A2433; background: #2A1323; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
a.btn { display: inline-block; text-decoration: none; }
.linkish { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0; }
.linkish:hover { color: var(--ink); }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, select, textarea { font: 14px var(--sans); color: var(--ink); background: var(--room); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px; width: 100%; }
textarea { resize: vertical; min-height: 70px; }
input[type=checkbox] { width: auto; accent-color: var(--blue); }
.check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; }
.err { color: #FF9A9E; font-size: 13px; min-height: 1em; margin: 0; }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; display: grid; gap: 14px; }
.login-card .brand { font-size: 18px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 208px 1fr; grid-template-rows: 60px 1fr; min-height: 100%; }
.rail { grid-row: 1 / span 2; background: #06101F; border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; padding: 16px 10px; gap: 2px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; padding: 4px 10px 18px; letter-spacing: -0.01em; }
.tally-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tally); box-shadow: 0 0 0 4px rgba(229,72,77,.18); flex: none; }
.rail a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r-sm); color: var(--muted); text-decoration: none; font-weight: 500; }
.rail a svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.rail a:hover { color: var(--ink); background: var(--panel); }
.rail a.active { color: var(--ink); background: var(--raised); }
.rail-foot { margin-top: auto; padding: 10px; }
.topbar { display: flex; align-items: center; gap: 20px; padding: 0 24px; border-bottom: 1px solid var(--line-soft); background: var(--room); position: sticky; top: 0; z-index: 5; }
.onair-count { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.onair-count .pill { font-family: var(--mono); font-size: 13px; background: rgba(229,72,77,.14); color: #FF8F93; border: 1px solid rgba(229,72,77,.35); border-radius: 999px; padding: 3px 10px; }
.onair-count .pill.idle { background: var(--panel); color: var(--muted); border-color: var(--line); }
.clock { font-family: var(--mono); color: var(--muted); font-size: 14px; }
.top-actions { margin-left: auto; display: flex; gap: 8px; }
main { padding: 24px; min-width: 0; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.view-head p { margin: 4px 0 0; color: var(--muted); }

/* ---------- multiview: the signature — a wall of monitors with tally lights ---------- */
.wall { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.monitor { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; cursor: pointer; text-align: left; color: inherit; font: inherit; padding: 0; position: relative; }
.monitor:hover { border-color: #2C4A75; }
.monitor .tally { height: 4px; background: var(--line); }
.monitor.onair .tally { background: var(--tally); box-shadow: 0 0 14px rgba(229,72,77,.6); }
.monitor.warn .tally { background: var(--amber); }
.screen { position: relative; width: 100%; aspect-ratio: 16/9; background: #030912; overflow: hidden; }
.screen video, .screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.screen .empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); font-size: 13px; text-align: center; padding: 10px; }
.screen .bug { position: absolute; top: 8px; left: 8px; display: flex; align-items: center; gap: 6px; font: 600 11px var(--sans); background: rgba(3,9,18,.72); padding: 3px 8px; border-radius: 4px; }
.screen .bug .d { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.monitor.onair .screen .bug .d { background: var(--tally); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .monitor.onair .screen .bug .d { animation: none; } }
.screen .timeleft { position: absolute; right: 8px; bottom: 8px; font: 600 15px var(--mono); background: rgba(3,9,18,.78); padding: 2px 8px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.mon-body { padding: 10px 12px 12px; display: grid; gap: 6px; }
.mon-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mon-name { font-weight: 600; font-size: 14px; }
.mon-title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mon-next { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--tally); }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 4px; background: var(--raised); color: var(--muted); border: 1px solid var(--line); }
.chip.yt { color: #FFB0B2; }
.chip.warn { color: var(--amber); border-color: rgba(240,169,59,.4); background: rgba(240,169,59,.08); }
.cover { font-size: 12px; color: var(--muted); }
.cover.low { color: var(--amber); }

/* ---------- drawer (one slot) ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--panel); border-left: 1px solid var(--line); z-index: 20; display: flex; flex-direction: column; box-shadow: -20px 0 40px rgba(0,0,0,.35); }
.drawer-head { padding: 18px 20px; border-bottom: 1px solid var(--line-soft); display: grid; gap: 12px; }
.drawer-head .row { display: flex; align-items: center; gap: 10px; }
.drawer-head input.name { font-size: 18px; font-weight: 600; background: transparent; border-color: transparent; padding: 4px 6px; margin-left: -6px; }
.drawer-head input.name:hover, .drawer-head input.name:focus { border-color: var(--line); }
.drawer-body { overflow: auto; padding: 18px 20px 40px; display: grid; gap: 22px; align-content: start; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.nowcard { background: var(--room); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.nowcard .screen { border-bottom: 1px solid var(--line); }
.nowcard .inner { padding: 12px 14px; display: grid; gap: 8px; }
.warnline { font-size: 13px; color: var(--amber); }
.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.qitem { display: grid; grid-template-columns: 18px 72px 1fr auto; gap: 10px; align-items: center; background: var(--room); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px; }
.qitem.dragging { opacity: .5; }
.qitem.over { border-color: var(--blue-hi); }
.qitem .grip { cursor: grab; color: var(--faint); font-size: 14px; text-align: center; user-select: none; }
.qitem img, .qitem .noimg { width: 72px; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; background: #030912; }
.qitem .t { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qitem .meta { font-size: 12px; color: var(--muted); }
.qitem .acts { display: flex; gap: 4px; }
.platform-toggles { display: grid; gap: 8px; }
.empty-box { border: 1px dashed var(--line); border-radius: var(--r); padding: 20px; text-align: center; color: var(--muted); display: grid; gap: 10px; justify-items: center; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(2,6,14,.7); z-index: 30; display: grid; place-items: center; padding: 20px; }
.modal-card { width: min(760px, 100%); max-height: 90vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: grid; gap: 16px; }
.modal-card.narrow { width: min(460px, 100%); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; }
.pick-list { display: grid; gap: 6px; max-height: 280px; overflow: auto; }
.pick { display: grid; grid-template-columns: auto 80px 1fr auto; gap: 10px; align-items: center; padding: 7px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--room); cursor: pointer; color: var(--ink); }
.pick img { width: 80px; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; }
.pick:has(input:checked) { border-color: var(--blue-hi); background: #0E2445; }
.durations { display: flex; gap: 6px; flex-wrap: wrap; }
.durations button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- rundown ---------- */
.rundown { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; }
.rd-inner { min-width: 900px; position: relative; }
.rd-hours { display: grid; grid-template-columns: 120px 1fr; border-bottom: 1px solid var(--line); }
.rd-hours .scale { position: relative; height: 30px; }
.rd-hours .scale span { position: absolute; top: 8px; font: 12px var(--mono); color: var(--faint); transform: translateX(-50%); }
.rd-row { display: grid; grid-template-columns: 120px 1fr; border-bottom: 1px solid var(--line-soft); min-height: 46px; }
.rd-row:last-child { border-bottom: 0; }
.rd-label { padding: 12px; font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 8px; border-right: 1px solid var(--line-soft); }
.rd-track { position: relative; }
.rd-seg { position: absolute; top: 7px; bottom: 7px; border-radius: 5px; background: var(--raised); border: 1px solid #2A4670; font-size: 12px; padding: 0 8px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; cursor: pointer; color: var(--ink); }
.rd-seg.live { background: rgba(229,72,77,.18); border-color: rgba(229,72,77,.55); }
.rd-seg.paused { opacity: .5; border-style: dashed; }
.rd-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--tally); z-index: 2; pointer-events: none; }
.rd-gap { position: absolute; top: 7px; bottom: 7px; border-radius: 5px; margin-left: 4px; background: repeating-linear-gradient(135deg, rgba(240,169,59,.12) 0 6px, transparent 6px 12px); border: 1px dashed rgba(240,169,59,.45); color: var(--amber); font-size: 12px; display: flex; align-items: center; padding: 0 8px; white-space: nowrap; overflow: hidden; }

/* ---------- library ---------- */
.dropzone { border: 1.5px dashed #2C4A75; border-radius: var(--r); padding: 26px; text-align: center; background: var(--panel); display: grid; gap: 10px; justify-items: center; color: var(--muted); }
.dropzone.over { border-color: var(--blue-hi); background: #0E2445; }
.uploads { display: grid; gap: 6px; margin-top: 12px; }
.upl { display: grid; grid-template-columns: 1fr 160px auto; gap: 10px; align-items: center; font-size: 13px; }
.upl .bar > i { background: var(--blue-hi); }
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: grid; }
.card .screen img { object-fit: cover; }
.card .dur { position: absolute; right: 6px; bottom: 6px; font: 600 12px var(--mono); background: rgba(3,9,18,.8); padding: 1px 6px; border-radius: 4px; }
.card .body { padding: 10px 12px 12px; display: grid; gap: 8px; }
.card .name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .acts { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- panels (platforms, settings) ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; display: grid; gap: 14px; }
.panels { display: grid; gap: 16px; max-width: 860px; }
.dest { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.dest:first-of-type { border-top: 0; }
.dest .k { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.plat { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--raised); border: 1px solid var(--line); }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); font-size: 14px; }
.steps b { color: var(--ink); font-weight: 600; }
.copy { display: flex; gap: 6px; }
.copy input { font-family: var(--mono); font-size: 12px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.status .d { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.status.ok .d { background: var(--ok); } .status.bad .d { background: var(--tally); }
.logo-prev { height: 48px; background: #030912 url() center/contain no-repeat; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px; display: flex; align-items: center; }
.logo-prev img { max-height: 36px; }

/* ---------- activity ---------- */
.log { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.log-row { display: grid; grid-template-columns: 90px 70px 1fr; gap: 12px; padding: 9px 16px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.log-row:first-child { border-top: 0; }
.log-row .lv-error { color: #FF9A9E; } .log-row .lv-warn { color: var(--amber); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--raised); border: 1px solid var(--line); padding: 10px 16px; border-radius: var(--r-sm); z-index: 40; font-size: 14px; max-width: 90vw; }
.toast.bad { border-color: #5A2433; color: #FFB4B6; }

/* ---------- responsive ---------- */
@media (max-width: 1500px) { .wall { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .wall { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
  .rail { grid-row: auto; height: auto; position: static; flex-direction: row; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .rail .brand { padding: 4px 10px; }
  .rail .brand span:last-child { display: none; }
  .rail a span { display: none; }
  .rail-foot { margin: 0 0 0 auto; }
  .topbar { padding: 10px 16px; flex-wrap: wrap; gap: 10px; }
  main { padding: 16px; }
  .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid2 { grid-template-columns: 1fr; }
  .upl { grid-template-columns: 1fr 90px auto; }
}
@media (max-width: 480px) { .wall { grid-template-columns: 1fr; } }

/* stream keys + studio */
.keys { display: grid; gap: 8px; }
.keyline { display: grid; grid-template-columns: 90px 1fr 80px; gap: 10px; align-items: center; }
.keyline .kname { font-weight: 600; font-size: 14px; }
.keyline input { font-family: var(--mono); font-size: 13px; }
.keyrow { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: end; }
.studio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
.monitor-panel .screen { border-radius: 8px; border: 1px solid var(--line); }
.durations button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
@media (max-width: 1000px) { .studio { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .keyline { grid-template-columns: 70px 1fr; } .keyline .status { display: none; } .keyrow { grid-template-columns: 1fr; } }

/* library storage + selection */
.storage { margin-top: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 8px; font-size: 14px; }
.storage.low { border-color: rgba(240,169,59,.5); }
.sbar { height: 8px; background: var(--room); border-radius: 4px; overflow: hidden; display: flex; }
.sbar i { display: block; height: 100%; }
.sbar .v { background: var(--blue-hi); }
.sbar .o { background: #3A4D6B; }
.storage.low .sbar .v { background: var(--amber); }
.libbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.selbar { display: flex; align-items: center; gap: 12px; }
.card.sel { border-color: var(--blue-hi); }
.pickbox { position: absolute; top: 6px; left: 6px; background: rgba(3,9,18,.75); border-radius: 5px; padding: 5px; display: flex; cursor: pointer; }
.pickbox input { width: 16px; height: 16px; margin: 0; }
.durations button.on .faint { color: #CFE0FF; }

/* ---------- v1.4: roles, scheduling, lives table, analytics, assets, team ---------- */
body.ro .edit-only, body.not-admin .admin-only { display: none !important; }
.me { color: var(--muted); font-size: 13px; align-self: center; white-space: nowrap; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
#addMember.grid3 { grid-template-columns: 1fr 1.3fr 0.8fr auto; }
.whenbox .durations button.on { background: var(--amber); border-color: var(--amber); color: #1b1206; }
.whenbox .durations button[data-when="now"].on { background: var(--blue); border-color: var(--blue); color: #fff; }
.dupe { border: 1px solid rgba(240,169,59,.5); background: rgba(240,169,59,.08); color: var(--ink); border-radius: var(--r-sm); padding: 10px 12px; font-size: 13px; }
.dupe ul { margin: 6px 0; padding-left: 18px; color: var(--amber); }
.chip.sched { color: var(--amber); border-color: rgba(240,169,59,.45); background: rgba(240,169,59,.08); }
.chip.ok { color: #9BE3C0; border-color: rgba(63,178,127,.45); }
.monitor.sched .tally { background: var(--amber); }
.sched-t { color: var(--amber); }
.rd-seg.sched { background: rgba(240,169,59,.14); border: 1px dashed rgba(240,169,59,.6); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { font: 500 14px var(--sans); color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 12px; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-bottom-color: var(--blue-hi); }
.tab .count { font: 600 12px var(--mono); color: var(--faint); margin-left: 4px; }
.tab.on .count { color: var(--blue-hi); }

/* lives table */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 860px; }
.tbl th { text-align: left; font-weight: 600; color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 8px 12px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tbody tr:first-child td { border-top: 0; }
.tbl .th { width: 84px; }
.tbl .th img, .tbl .th .noimg { width: 72px; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; background: #030912; display: grid; place-items: center; font-size: 11px; color: var(--faint); }
.tbl .tt { max-width: 340px; }
.tbl .tt .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .tt .e { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .outs { max-width: 220px; }
.nowrap { white-space: nowrap; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.live { color: #fff; background: var(--tally); border-color: var(--tally); }
.badge.sched { color: var(--amber); border-color: rgba(240,169,59,.55); background: rgba(240,169,59,.1); }
.badge.done { color: #9BE3C0; border-color: rgba(63,178,127,.45); }
.badge.bad { color: #FF9A9E; border-color: #5A2433; background: #2A1323; }

/* analytics */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 2px; }
.kpi span { font-size: 12px; color: var(--muted); }
.kpi b { font: 600 24px var(--sans); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.kpi em { font-style: normal; font-size: 12px; color: var(--faint); }
.kpi.warn b { color: var(--amber); }
.chart { width: 100%; height: auto; display: block; }
.chart .gl { stroke: var(--line-soft); stroke-width: 1; }
.chart .ax { fill: var(--faint); font: 11px var(--mono); }
.chart .bar-r { fill: var(--blue-hi); }
.chart .bar-r:hover { fill: #6B9BF0; }
.an-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-top: 16px; }
.hbars { display: grid; gap: 8px; }
.hb { display: grid; grid-template-columns: 90px 1fr 90px 30px; gap: 10px; align-items: center; font-size: 13px; }
.hb.two { grid-template-columns: 1fr auto; }
.hb .track { height: 8px; background: var(--room); border-radius: 4px; overflow: hidden; }
.hb .track i { display: block; height: 100%; background: var(--tally); border-radius: 4px; }
.hb .mono { text-align: right; }

/* assets */
.checker { background-color: #1a2a40; background-image: linear-gradient(45deg, #22344f 25%, transparent 25%), linear-gradient(-45deg, #22344f 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #22344f 75%), linear-gradient(-45deg, transparent 75%, #22344f 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.astrow { display: grid; grid-template-columns: minmax(0, 360px) auto; gap: 12px; align-items: end; }

/* team */
.members { display: grid; }
.member { display: grid; grid-template-columns: 1fr 120px auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.member:first-child { border-top: 0; }
.member select { padding: 6px 8px; }

@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .an-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .grid3, #addMember.grid3 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member { grid-template-columns: 1fr; }
  .astrow { grid-template-columns: 1fr; }
  .me { display: none; }
}
.member .badge { justify-self: start; }
.astrow > label.btn { justify-self: start; }
#astForm .err:empty { display: none; }
/* the live's title is the main line on each monitor */
.monitor .mon-title { font-size: 15px; font-weight: 600; line-height: 1.3; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.6em; }
.monitor .mon-name { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.monitor .mon-title .muted { font-weight: 400; }
.alerts { position: fixed; top: 70px; right: 20px; z-index: 35; display: grid; gap: 8px; width: min(420px, calc(100vw - 40px)); }
.alert { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; background: #2A1323; border: 1px solid #A8323A; border-left: 4px solid var(--tally); border-radius: var(--r-sm); padding: 10px 12px; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.alert.info { background: var(--raised); border-color: var(--line); border-left-color: var(--amber); }
.alert b { font-size: 14px; }
