:root { --ink: #0b0c0e; --panel: #131518; --line: #2a2d33; --fg: #e8e8e8; --dim: #8a8f98; --hf: #ff8300; --red: #e5322d; --amber: #d9a400; --ok: #3fb950; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--ink); color: var(--fg); font: 15px/1.45 "Hanken Grotesk", system-ui, sans-serif; }
header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
header h1 { margin: 0; font: 700 15px/1 system-ui; letter-spacing: .16em; color: var(--hf); }
header a { color: var(--dim); font-size: 12px; letter-spacing: .1em; }
nav { display: flex; gap: 4px; }
.tab { border-color: var(--line); } .tab.on { border-color: var(--hf); color: var(--hf); }
.sp { flex: 1; }
.tabpane { padding: 16px; }
.ro { margin: 0 0 12px; }
main { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); padding: 16px; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px)); }
.card.wide { grid-column: 1 / -1; }
h2 { margin: 0 0 12px; font: 600 11px/1 ui-monospace, Menlo, monospace; letter-spacing: .18em; color: var(--dim); }
.hint { color: var(--dim); font-size: 13px; }
.hint.warn { color: var(--amber); }
label { display: block; margin-bottom: 10px; color: var(--dim); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 8px; background: var(--ink); color: var(--fg); border: 1px solid var(--line); font: inherit; }
fieldset { border: 1px solid var(--line); margin: 0 0 12px; padding: 8px 10px; }
legend { color: var(--dim); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding: 0 4px; }
.picks label { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--fg); margin: 4px 0; }
.picks input { width: auto; display: inline; margin: 0; }
button { padding: 8px 14px; background: transparent; color: var(--fg); border: 1px solid var(--hf); font: 600 12px system-ui; letter-spacing: .12em; cursor: pointer; }
button:hover { background: #ff830022; } button.danger { border-color: var(--red); color: #ff7a75; }
button.mini { padding: 2px 6px; font-size: 11px; }
.pill { padding: 3px 8px; border: 1px solid var(--line); font: 11px ui-monospace, monospace; letter-spacing: .08em; }
.pill.ok { border-color: var(--ok); color: var(--ok); } .pill.warn { border-color: var(--amber); color: var(--amber); }
.pill.bad { background: var(--red); border-color: var(--red); color: #fff; } .pill.hf { border-color: var(--hf); color: var(--hf); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--dim); font: 600 11px ui-monospace, monospace; letter-spacing: .12em; }
tr.dead td { color: var(--dim); }
.qrs { display: flex; gap: 24px; flex-wrap: wrap; }
figure { margin: 0; max-width: 300px; }
figure svg { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; background: #fff; shape-rendering: crispEdges; }
figcaption { margin-top: 8px; font-size: 14px; }
figcaption a { color: var(--hf); font-size: 12px; }
code { word-break: break-all; font-size: 12px; color: var(--dim); }
#audit { list-style: none; margin: 0; padding: 0; font: 12px/1.5 ui-monospace, Menlo, monospace; max-height: 70vh; overflow: auto; }
#audit li { padding: 2px 0; border-bottom: 1px solid #1c1f23; }
#audit li.bad { color: #ff7a75; } #audit .t { color: var(--dim); }
main.login { display: block; max-width: 360px; margin: 12vh auto; padding: 16px; }
.err { color: #ff7a75; min-height: 1.2em; }
.mail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 0 16px; }
.mail-grid .span2 { grid-column: 1 / -1; }
.mail-steps { margin: 14px 0 8px; padding-left: 22px; } .mail-steps li { margin-bottom: 12px; }
a.btn { display: inline-block; padding: 8px 14px; border: 1px solid var(--hf); color: var(--fg); text-decoration: none; font: 600 12px system-ui; letter-spacing: .12em; }
a.btn.disabled { opacity: .35; pointer-events: none; }
#mc-eml { color: var(--hf); }

/* fleet tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; margin-bottom: 16px; }
.tile { background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; }
.tile.off { opacity: .55; }
.tile.locked { border-color: var(--red); }
.tile h3 { margin: 0; padding: 10px 12px; display: flex; align-items: center; gap: 8px; font: 700 14px system-ui; letter-spacing: .06em; border-bottom: 1px solid var(--line); }
.tile h3 .slot { color: var(--dim); font: 11px ui-monospace, monospace; }
.thumb { position: relative; aspect-ratio: 16 / 9; background: #000; display: flex; align-items: center; justify-content: center; color: var(--dim); font-size: 12px; }
.thumb .age.stale { color: var(--amber); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .age { position: absolute; right: 6px; bottom: 6px; background: #000a; padding: 1px 5px; font: 11px ui-monospace, monospace; }
.mode { padding: 8px 12px; font: 700 18px system-ui; }
.mode.ok { color: var(--hf); } .mode.warn { color: var(--amber); }
.lockbar { margin: 0 12px 8px; padding: 4px 8px; background: var(--red); color: #fff; font-weight: 700; font-size: 13px; }
dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; padding: 0 12px 10px; font-size: 13px; }
dl.kv dt { color: var(--dim); font: 11px ui-monospace, monospace; letter-spacing: .08em; padding-top: 2px; }
dl.kv dd { margin: 0; font-variant-numeric: tabular-nums; }
.tile .acts { margin-top: auto; padding: 10px 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
a { color: var(--hf); }
.tile .cmd { margin: 0; padding: 0 12px 10px; }
#req-pill { cursor: pointer; animation: blink 1.4s steps(2, start) infinite; }
@keyframes blink { to { opacity: .45; } }
.req-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 0 16px; }
.steps { padding-left: 22px; } .steps li { margin-bottom: 6px; }
.tile.picked { border-color: var(--hf); }
#lmap { display: none; width: 100%; height: 360px; border: 1px solid var(--line); background: #0e1013; }
#map-card h2 { display: flex; align-items: center; gap: 10px; }
.leaflet-tooltip.kit-tip { background: #131518; color: #e8e8e8; border: 1px solid #2a2d33; font: 12px system-ui; box-shadow: none; }
.leaflet-tooltip.kit-tip::before { display: none; }
.leaflet-container a { color: #0078a8; }
#map { width: 100%; height: auto; background: #0e1013; border: 1px solid var(--line); }
#map text { fill: var(--fg); font: 12px system-ui; } #map circle.on { fill: var(--hf); } #map circle.off { fill: var(--dim); }
dialog#watch { width: min(96vw, 1100px); padding: 0; background: var(--panel); color: var(--fg); border: 1px solid var(--line); }
dialog#watch::backdrop { background: #000c; }
dialog#watch header { border-bottom: 1px solid var(--line); }
dialog#watch select { width: auto; margin: 0; }
#w-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
dialog#watch .hint { padding: 6px 12px; margin: 0; }
/* video HUD (hud.js): telemetry spread evenly round the border of the video, in the window and full screen */
.vwrap { position: relative; background: #000; }
.vwrap:fullscreen, .vwrap.vmax { width: 100vw; height: 100vh; }
.vwrap:-webkit-full-screen { width: 100vw; height: 100vh; }
.vwrap.vmax { position: fixed; inset: 0; z-index: 50; }
.vwrap:fullscreen #w-frame, .vwrap.vmax #w-frame { height: 100%; aspect-ratio: auto; }
.vwrap:-webkit-full-screen #w-frame { height: 100%; aspect-ratio: auto; }
.hud { position: absolute; inset: 0; pointer-events: none; --hud-fs: 13px; font: 600 var(--hud-fs)/1.15 ui-monospace, Menlo, monospace; }
.hud.sz-s { --hud-fs: 11px; } .hud.sz-l { --hud-fs: 17px; }
.vwrap:fullscreen .hud, .vwrap.vmax .hud { --hud-fs: 15px; }
.vwrap:fullscreen .hud.sz-s, .vwrap.vmax .hud.sz-s { --hud-fs: 12px; }
.vwrap:fullscreen .hud.sz-l, .vwrap.vmax .hud.sz-l { --hud-fs: 21px; }
.hud[hidden], .hud-panel[hidden], .hud-stale[hidden] { display: none !important; }
.hud-e { position: absolute; display: flex; justify-content: space-evenly; gap: 8px; }
.hud-e.top { top: 8px; left: 16%; right: 16%; }
.hud-e.bottom { bottom: 8px; left: 16%; right: 16%; }
.hud-e.left, .hud-e.right { top: 16%; bottom: 16%; flex-direction: column; }
.hud-e.left { left: 8px; align-items: flex-start; } .hud-e.right { right: 8px; align-items: flex-end; }
.hud-i { display: flex; flex-direction: column; align-items: center; padding: 3px 8px; background: #0b0c0eb3; border: 1px solid #ffffff1f;
  text-shadow: 0 1px 2px #000; white-space: nowrap; max-width: 34vw; overflow: hidden; }
.hud-e.left .hud-i { align-items: flex-start; } .hud-e.right .hud-i { align-items: flex-end; }
.hud-k { font-size: .62em; letter-spacing: .16em; color: var(--dim); }
.hud-v { color: var(--fg); font-weight: 700; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.hud-v.ok { color: var(--ok); } .hud-v.warn { color: var(--amber); } .hud-v.bad { color: #ff7a75; } .hud-v.dim { color: var(--dim); }
.hud.stale .hud-v { color: var(--dim); }
.hud-stale { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 4px 10px; border: 1px solid var(--amber);
  color: var(--amber); background: #0b0c0ecc; font-size: .8em; letter-spacing: .14em; }
.hud-ctl { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; z-index: 2; opacity: .55; transition: opacity .15s; }
.hud-ctl:hover, .hud-ctl:focus-within, .vwrap:hover .hud-ctl { opacity: 1; }
.hud-ctl button { background: #0b0c0ecc; }
.hud-panel { position: absolute; top: 36px; right: 8px; z-index: 3; width: min(300px, calc(100% - 16px)); max-height: calc(100% - 44px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line); padding: 10px; font-size: 13px; }
.hud-ph, .hud-pf { display: flex; align-items: center; gap: 6px; }
.hud-ph b { font: 600 11px ui-monospace, monospace; letter-spacing: .18em; color: var(--dim); }
.hud-sz { display: flex; gap: 2px; } .hud-panel button.on { background: var(--hf); color: #000; }
dialog#watch .hud-panel .hint { padding: 6px 0; font-size: 12px; }
.hud-list { list-style: none; margin: 0 0 8px; padding: 0; }
.hud-list li { display: flex; align-items: center; gap: 4px; padding: 2px 0; border-bottom: 1px solid var(--line); }
.hud-list li.off { color: var(--dim); }
.hud-list label { flex: 1; display: flex; align-items: center; gap: 8px; margin: 0; text-transform: none; letter-spacing: .04em; font-size: 13px; color: inherit; }
.hud-list input { width: auto; display: inline; margin: 0; }
.hud-list button { padding: 1px 6px; } .hud-list button:disabled { opacity: .3; cursor: default; }
@media (max-width: 600px) { .hud-e.top, .hud-e.bottom { left: 8px; right: 8px; } .hud-e.top { top: 40px; } .hud-i { max-width: 44vw; } }

/* live chat on /c/ (Twitch style) and the operator CHAT tab */
.chat [hidden], #chat-ops [hidden] { display: none !important; }
.stage { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.stage.nochat { grid-template-columns: minmax(0, 1fr); } .stage.nochat .chat { display: none; }
.chat { position: sticky; top: 0; height: calc(100vh - var(--hdr, 54px)); display: flex; flex-direction: column;
        background: var(--panel); border-left: 1px solid var(--line); padding: 12px; min-width: 0; }
.chat h2 { display: flex; align-items: center; gap: 8px; }
.chat-log { list-style: none; margin: 0; padding: 0; flex: 1; overflow-y: auto; font-size: 14px; line-height: 1.45;
            overflow-wrap: anywhere; }
.chat-log li { padding: 3px 2px; }
.chat-log .t { color: var(--dim); font: 11px ui-monospace, monospace; margin-right: 6px; }
.chat-log .n { font-weight: 700; }
.chat-log .tag { font: 600 10px ui-monospace, monospace; letter-spacing: .1em; border: 1px solid var(--hf); color: var(--hf);
                 padding: 0 4px; margin-right: 5px; }
.chat-log .n.op { color: var(--hf); }
.who0 { color: #6cb6ff; } .who1 { color: #56d364; } .who2 { color: #e3b341; } .who3 { color: #ff7b72; }
.who4 { color: #d2a8ff; } .who5 { color: #39c5cf; } .who6 { color: #ffa657; } .who7 { color: #f778ba; }
.chat-more { align-self: center; margin: 6px 0 0; }
.chat-who input, .chat-form input { margin: 0 0 6px; }
.chat-form { display: flex; gap: 6px; margin-top: 8px; } .chat-form input { margin: 0; flex: 1; min-width: 0; }
.chat-who { margin-top: 8px; }
.chat-foot { margin: 6px 0 0; min-height: 1.2em; } .chat-foot a { cursor: pointer; }
@media (max-width: 900px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .chat { position: static; height: 70vh; border-left: 0; border-top: 1px solid var(--line); }
}
#chat-ops .chat-log { max-height: 60vh; min-height: 240px; }
#chat-ops .chat-log li { display: flex; gap: 6px; align-items: baseline; }
#chat-ops .chat-log li .x { flex: 1; }
#chat-ops .chat-log .mail { color: var(--dim); font: 11px ui-monospace, monospace; }
#chat-ops .chat-log li.muted .n { text-decoration: line-through; }
#chat-ops h2 { display: flex; align-items: center; gap: 8px; }
#co-mutes { max-height: none; min-height: 0; }
