@font-face { font-family: 'Archivo Variable'; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%; src: url(fonts/archivo-latin-wdth-normal.woff2) format('woff2-variations'); }
@font-face { font-family: 'Archivo Variable'; font-style: italic; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%; src: url(fonts/archivo-latin-wdth-italic.woff2) format('woff2-variations'); }

:root {
  --night: #0b1230;
  --night-2: #18214d;
  --night-line: #2a3568;
  --night-text: #aeb9e2;
  --paper: #f1f3f9;
  --sheet: #ffffff;
  --ink: #131933;
  --ink-2: #505978;
  --line: #d3d9e8;
  --blue: #1e63f0;
  --blue-deep: #1549bd;
  --sun: #f27a1a;
  --sun-deep: #b4530a;
  --civ: #2877e0;
  --fd: #d23a2e;
  --le: #56678c;
  --com: #8448d1;
  --ok: #1c8a57;
  --bad: #c22f22;
  --on-ink: #ffffff;
  --ph: #8a92ad;
  --alert-bg: #fbe9e6;
  --alert-ink: #6d1810;
  --link: #1e63f0;
  --talk: #fdebd9;
  color-scheme: light;
  --ui: 'Archivo Variable', 'Segoe UI', Arial, sans-serif;
  --mono: 'Cascadia Mono', Consolas, 'DejaVu Sans Mono', Menlo, monospace;
}

:root[data-theme='dark'] {
  --night: #070b1f;
  --night-2: #131b40;
  --night-line: #232d5c;
  --paper: #0e142c;
  --sheet: #171f42;
  --ink: #e9edfb;
  --ink-2: #9ca7cf;
  --line: #29335f;
  --blue: #2f6ff2;
  --blue-deep: #4a84ff;
  --sun-deep: #ffa257;
  --le: #6f81aa;
  --com: #a573ee;
  --ok: #2fae74;
  --bad: #e5594a;
  --on-ink: #0e142c;
  --ph: #6f7aa3;
  --alert-bg: #3a1512;
  --alert-ink: #ffc9c2;
  --link: #8fb2ff;
  --talk: #3a2413;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; height: 100%; }
body { margin: 0; height: 100%; font-family: var(--ui); color: var(--ink); background: var(--paper); line-height: 1.45; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.5; }
#app { height: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.rail :focus-visible, .mast :focus-visible, .gate :focus-visible { outline-color: #fff; }

.wide { font-stretch: 122%; font-weight: 800; font-style: italic; letter-spacing: -0.01em; line-height: 1.05; }
.quiet { color: var(--ink-2); }
.hint { color: var(--ink-2); font-size: 0.875rem; max-width: 62ch; padding-top: 0.75rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.75rem; }

.btn { display: inline-block; border: 1px solid var(--ink); background: transparent; color: var(--ink); padding: 0.4rem 0.85rem; border-radius: 2px; font-weight: 600; font-size: 0.9375rem; text-decoration: none; line-height: 1.3; white-space: nowrap; }
.btn:hover:not(:disabled) { background: var(--ink); color: var(--on-ink); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn.ghost { border-color: var(--line); }
.btn.warn { border-color: var(--bad); color: var(--bad); }
.btn.warn:hover:not(:disabled) { background: var(--bad); color: #fff; }
.btn.small { padding: 0.15rem 0.55rem; font-size: 0.8125rem; }
.rail .btn { border-color: var(--night-text); color: #fff; }
.rail .btn:hover:not(:disabled) { background: #fff; color: var(--night); }
.rail .btn.primary { border-color: var(--blue); }
.link { border: 0; background: none; padding: 0; color: var(--link); text-decoration: underline; text-underline-offset: 2px; font-size: inherit; text-align: left; }
.alert { border-left: 3px solid var(--bad); padding: 0.6rem 0.9rem; background: var(--alert-bg); color: var(--alert-ink); font-weight: 700; }

.tag { display: inline-block; padding: 0.05rem 0.45rem; font-size: 0.75rem; font-weight: 700; color: #fff; border-radius: 2px; background: var(--le); }
.tag.civ { background: var(--civ); }
.tag.fd { background: var(--fd); }
.tag.com { background: var(--com); }

.gate { min-height: 100vh; background: var(--night); color: #fff; display: flex; align-items: center; gap: 3rem; padding: 3rem 9vw; }
.gate img { width: 132px; height: 132px; flex: none; }
.gate h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); margin-bottom: 1rem; }
.gate p { color: var(--night-text); max-width: 44ch; margin-bottom: 0.4rem; font-size: 1.125rem; }
.gate .btn { margin-top: 1.25rem; padding: 0.8rem 1.4rem; font-size: 1.0625rem; }

.simple { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; }
.mast { background: var(--night); color: #fff; display: flex; align-items: center; gap: 1.25rem; padding: 0.6rem 1.5rem; }
.mast img { width: 44px; height: 44px; flex: none; }
.mast h1 { font-size: 1.75rem; }
.mast .link { color: var(--night-text); font-size: 0.9375rem; white-space: nowrap; }
.mast .end { display: flex; gap: 0.9rem; margin-left: auto; align-items: center; }
.live-dot { width: 9px; height: 9px; flex: none; background: var(--ok); }
.live-dot.down { background: var(--bad); }
.find { flex: 0 1 19rem; }
.find input { width: 100%; border: 0; border-bottom: 1.5px solid var(--night-text); border-radius: 0; background: var(--night-2); color: #fff; padding: 0.45rem 0.6rem; }
.find input::placeholder { color: var(--night-text); }
.find input:focus { outline: none; border-bottom-color: #fff; }

.duty { display: flex; align-items: center; gap: 0.75rem; }
.duty form { display: flex; gap: 0.4rem; }
.duty input, .duty select { border: 0; border-bottom: 1.5px solid var(--night-text); border-radius: 0; background: var(--night-2); color: #fff; padding: 0.4rem 0.55rem; }
.duty input { width: 7rem; text-transform: uppercase; }
.duty .btn { border-color: var(--night-text); color: #fff; }
.duty .btn:hover:not(:disabled) { background: #fff; color: var(--night); }
.duty .btn.primary { border-color: var(--blue); }
.duty .unit { font-size: 1.25rem; font-weight: 800; font-stretch: 112%; }
.codes { display: flex; gap: 0.25rem; }
.code { border: 1px solid var(--night-line); background: transparent; color: var(--night-text); padding: 0.25rem 0.55rem; border-radius: 2px; font-weight: 700; font-size: 0.8125rem; }
.code:hover { border-color: #fff; color: #fff; }
.code.on { background: #fff; border-color: #fff; color: var(--night); }
.code.on.t-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.code.on.t-warn { background: var(--sun); border-color: var(--sun); color: #fff; }
.code.on.t-move { background: var(--blue); border-color: var(--blue); color: #fff; }

.board { display: grid; grid-template-columns: 19rem minmax(0, 1fr) 26rem; min-height: 0; }
.floor { min-width: 0; }
.rail { background: var(--night-2); color: #fff; overflow-y: auto; padding: 1.25rem 1.25rem 3rem; }
.rail h2 { font-size: 1.0625rem; font-weight: 700; }
.rail .head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 0.6rem; border-bottom: 1px solid var(--night-line); }
.rail .quiet { color: var(--night-text); padding-top: 0.75rem; }
.count { font-weight: 500; color: var(--ink-2); margin-left: 0.35rem; }
.rail .count { color: var(--night-text); }

.call { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid transparent; border-bottom: 1px solid var(--night-line); background: none; color: #fff; padding: 0.7rem 0 0.7rem 0.8rem; margin-left: -0.8rem; width: calc(100% + 0.8rem); }
.call:hover { background: var(--night); }
.call.sel { border-left-color: var(--sun); background: var(--night); }
.call .top { display: flex; align-items: baseline; gap: 0.5rem; }
.call .top b { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call .top span, .call .top time { font-size: 0.8125rem; color: var(--night-text); font-variant-numeric: tabular-nums; }
.call .at { display: block; font-size: 0.875rem; color: var(--night-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call .on { display: block; font-size: 0.8125rem; font-weight: 600; margin-top: 0.15rem; }
.call .on.none { color: #ffd0a6; }
.pri { display: inline-block; min-width: 1.6rem; text-align: center; font-size: 0.75rem; font-weight: 800; border-radius: 2px; padding: 0.05rem 0.3rem; background: var(--le); color: #fff; }
.pri.p1 { background: var(--bad); }
.pri.p2 { background: var(--sun); }
.pri.p3 { background: var(--blue); }

.floor { overflow-y: auto; padding: 1.5rem 2rem 0; }
.floor::after { content: ''; display: block; height: 4rem; }
.block { margin-bottom: 2.5rem; }
.block > h2, .side h2 { font-size: 1.0625rem; font-weight: 700; padding-bottom: 0.5rem; border-bottom: 2px solid var(--ink); margin-bottom: 0.25rem; }
.block > h2 { display: flex; align-items: baseline; }
.block > h2 small { font-weight: 500; font-size: 0.8125rem; color: var(--ink-2); margin-left: auto; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; }

.list { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.list th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 0.8125rem; padding: 0.6rem 0.75rem 0.4rem 0; }
.list td { padding: 0.5rem 0.75rem 0.5rem 0; border-top: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.list td .link { max-width: 13rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.list td.wrap { white-space: normal; }
.list td:first-child { padding-left: 0.6rem; border-left: 3px solid transparent; }
.list th:first-child { padding-left: 0.6rem; }
.list tr.talking td { background: var(--talk); }
.list tr.talking td:first-child { border-left-color: var(--sun); }
.list tr.emergency td { background: var(--alert-bg); color: var(--alert-ink); }
.list tr.emergency td:first-child { border-left-color: var(--bad); }
.list .unit { font-weight: 800; font-stretch: 112%; margin-right: 0.4rem; }
.list .acts { text-align: right; white-space: nowrap; padding-right: 0; }
.list .acts .btn { margin-left: 0.3rem; }
.list select { border: 0; border-bottom: 1.5px solid transparent; background: transparent; font-weight: 700; padding: 0.15rem 0.1rem; border-radius: 0; }
.list select:hover, .list select:focus { border-bottom-color: var(--ink-2); }
.t-ok { color: var(--ok); }
.t-warn { color: var(--sun-deep); }
.t-move { color: var(--link); }
.t-off { color: var(--ink-2); }
.nowtag { color: var(--sun-deep); font-weight: 700; font-size: 0.8125rem; margin-right: 0.35rem; }
.where { color: var(--ink-2); font-size: 0.875rem; }

.heard { display: grid; grid-template-columns: 4.5rem 5rem minmax(0, 1fr) auto; gap: 0.6rem; padding: 0.35rem 0; border-bottom: 1px solid var(--line); font-size: 0.9375rem; }
.heard time, .heard i { font-style: normal; color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 0.875rem; }
.watch { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.1rem 0.7rem; align-items: baseline; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.watch b { font-family: var(--mono); font-weight: 700; color: var(--sun-deep); }
.watch small { grid-column: 1 / 3; color: var(--ink-2); font-size: 0.8125rem; }
.read { display: grid; grid-template-columns: 4.5rem 6.5rem minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: 0.6rem; align-items: baseline; padding: 0.45rem 0; border-bottom: 1px solid var(--line); font-size: 0.9375rem; }
.read time, .read .who { color: var(--ink-2); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.read .why { color: var(--ink-2); }
.read.hit { box-shadow: inset 3px 0 0 var(--sun); padding-left: 0.7rem; }
.read.hit .why { color: var(--bad); font-weight: 700; }
.side .read { grid-template-columns: 7.5rem minmax(0, 1fr); }
.side .read .who { grid-column: 1 / -1; }
.add { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.add input:first-child { flex: 1; }

input, select, textarea { border: 0; border-bottom: 1.5px solid var(--ink-2); border-radius: 0; background: var(--sheet); padding: 0.45rem 0.6rem; min-width: 0; font-weight: 500; }
input:focus, textarea:focus { outline: none; border-bottom-color: var(--link); box-shadow: 0 1.5px 0 var(--link); }
input::placeholder, textarea::placeholder { color: var(--ph); font-weight: 400; }
textarea { width: 100%; resize: vertical; }
.side input, .side select, .side textarea { background: var(--paper); }
.short { width: 6.5rem; }

.side { background: var(--sheet); border-left: 1px solid var(--line); overflow-y: auto; padding: 1.5rem 1.5rem 0; }
.side::after { content: ''; display: block; height: 4rem; }
.side h2 { border-bottom-width: 1px; }
.side h3 { font-size: 0.9375rem; font-weight: 700; font-stretch: 112%; color: var(--ink-2); padding-bottom: 0.45rem; border-bottom: 1px solid var(--line); margin-top: 2rem; }
.side .back { display: block; margin-bottom: 1rem; font-size: 0.875rem; }
.title { border-left: 3px solid var(--le); padding-left: 0.85rem; margin-left: -0.85rem; }
.title.p1 { border-left-color: var(--bad); }
.title.p2 { border-left-color: var(--sun); }
.title.p3 { border-left-color: var(--blue); }
.title .meta { font-size: 0.8125rem; font-weight: 700; color: var(--ink-2); }
.title h1 { font-size: 1.75rem; margin: 0.15rem 0 0.4rem; overflow-wrap: anywhere; }
.title p { max-width: 46ch; }
.title .desc { color: var(--ink-2); white-space: pre-wrap; margin-top: 0.4rem; }
.crew { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.9rem; }
.crew span { border: 1px solid var(--ink-2); border-radius: 2px; padding: 0.1rem 0.5rem; font-size: 0.8125rem; font-weight: 700; }
.lab { display: block; font-size: 0.8125rem; font-weight: 600; margin: 0.9rem 0 0.3rem; }
.lab + input, .lab + select, .lab + textarea, .lab + div > input { width: 100%; }
.tick { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.9rem; font-weight: 600; font-size: 0.9375rem; }
.tick input { width: 1.05rem; height: 1.05rem; accent-color: var(--blue); }
.say { display: flex; gap: 0.5rem; margin-top: 1rem; }
.say input { flex: 1; }
.log { margin-top: 1.25rem; }
.log div { display: grid; grid-template-columns: 4.25rem 4.25rem minmax(0, 1fr); gap: 0.5rem; padding: 0.35rem 0; border-top: 1px solid var(--line); font-size: 0.9375rem; }
.log time { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 0.875rem; }
.log b { font-weight: 700; }
.log .k-radio, .log .k-radio b { color: var(--ink-2); font-weight: 400; }
.log .k-record span { color: var(--link); font-weight: 600; }
.dept { margin-bottom: 2.25rem; }
.side h3.tight { margin-top: -0.75rem; }
.gap { height: 3rem; border-bottom: 1px solid var(--line); margin-bottom: 2.25rem; }
.dept h2 { display: flex; align-items: center; gap: 0.6rem; }
.dept h2::before { content: ''; width: 0.7rem; height: 0.7rem; background: var(--le); }
.dept.d-fire h2::before { background: var(--fd); }
.dept.d-other h2::before { background: var(--civ); }
.kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; margin-top: 0.9rem; }
.kinds .btn { text-align: left; }

.item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.7rem; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 0.55rem 0; }
.item:hover { background: var(--paper); }
.item b { font-weight: 700; }
.item span { color: var(--ink-2); font-size: 0.9375rem; }
.item em { font-style: normal; font-weight: 700; font-size: 0.8125rem; text-transform: capitalize; }
.item.s-active em { color: var(--bad); }
.item small { color: var(--ink-2); margin-left: auto; font-size: 0.8125rem; }
.plate { font-family: var(--mono); letter-spacing: 0.08em; }
.marks { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.5rem 0; }
.marks span { background: var(--bad); color: #fff; font-weight: 800; font-size: 0.75rem; padding: 0.1rem 0.45rem; border-radius: 2px; }
.facts { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 0.35rem 0.75rem; margin-top: 1rem; }
.facts dt { color: var(--ink-2); font-size: 0.8125rem; font-weight: 600; padding-top: 0.1rem; }
.facts dd.long { white-space: pre-wrap; }
.paper-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border-bottom: 2px solid var(--ink); padding-bottom: 0.5rem; }
.paper-head b { font-family: var(--mono); }
.sum td { font-weight: 700; border-top: 1.5px solid var(--ink); }
.chosen { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; margin-bottom: 0.3rem; font-weight: 700; }
.chosen:empty, .hits:empty { display: none; }
.hits { border-left: 3px solid var(--sun); padding-left: 0.75rem; margin-top: 0.3rem; }
.charge { display: grid; grid-template-columns: auto minmax(0, 1fr) 4rem auto; gap: 0.5rem; align-items: center; padding: 0.3rem 0; }
.toast { position: fixed; left: 1.5rem; bottom: 1.5rem; background: var(--night); color: #fff; border-left: 3px solid var(--ok); padding: 0.6rem 1rem; max-width: 30rem; font-weight: 600; }
.toast.bad { border-left-color: var(--bad); }

@media (max-width: 100rem) {
  .board { grid-template-columns: 16rem minmax(0, 1fr) 22rem; }
  .floor { padding: 1.25rem 1.25rem 0; }
  .side { padding: 1.25rem 1.25rem 0; }
  .pair { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .list .where { display: none; }
  .mast { gap: 0.9rem; padding: 0.6rem 1rem; }
  .find { flex-basis: 13rem; }
}
@media (max-width: 68rem) {
  .board { grid-template-columns: 15rem minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
  .rail { grid-row: 1 / 3; }
  .side { border-left: 0; border-top: 1px solid var(--line); }
  .mast { flex-wrap: wrap; }
}

body[data-mode="tecs"] { background: #020a04; }
.tecs { --g: #3fe06a; --gd: #1f8a3c; --am: #ffb000; --rd: #ff4d3d; height: 100%; display: flex; flex-direction: column; padding: 10px 16px; font: 15px/1.38 var(--mono); color: var(--g); text-transform: uppercase; overflow: hidden; }
.tecs ::selection { background: var(--g); color: #020a04; }
.t-head { display: flex; white-space: pre; }
.t-head .fill { flex: 1; }
.t-rule { overflow: hidden; white-space: nowrap; color: var(--gd); height: 1.38em; flex: none; }
.t-body { flex: 1; overflow-y: auto; padding: 4px 0; scrollbar-width: thin; scrollbar-color: var(--gd) transparent; }
.ln { white-space: pre; min-height: 1.38em; }
.ln.wrap { white-space: pre-wrap; padding-left: 3ch; max-width: 100ch; }
.tecs .rev { background: var(--g); color: #020a04; }
.tecs .hi { color: #b6ffc8; }
.tecs .dim { color: var(--gd); }
.tecs .warn { color: var(--am); }
.tecs .alarm { color: var(--rd); }
.tecs .alarm.rev { background: var(--rd); color: #020a04; }
.tecs .s-AVL { color: #b6ffc8; }
.tecs .s-ENR, .tecs .s-TRN { color: #7fd4ff; }
.tecs .s-ONS, .tecs .s-TRF, .tecs .s-BSY { color: var(--am); }
.tecs .s-OOS { color: var(--gd); }
.tecs button.go, .tecs .pf { all: unset; cursor: pointer; white-space: pre; }
.tecs button.go:hover { text-decoration: underline; }
.t-msg { color: var(--am); min-height: 1.38em; white-space: pre; overflow: hidden; }
.t-msg.bad { color: var(--rd); }
.t-msg::before { content: "MSG: "; color: var(--gd); }
.t-line { display: flex; }
.t-line span { white-space: pre; }
.tecs input, .tecs select, .tecs textarea { background: transparent; border: 0; border-bottom: 1px solid var(--gd); border-radius: 0; padding: 0 2px; font: inherit; color: #b6ffc8; text-transform: uppercase; caret-color: var(--g); }
.tecs input:focus, .tecs select:focus, .tecs textarea:focus { outline: none; box-shadow: none; background: rgba(63, 224, 106, 0.12); border-bottom-color: var(--g); }
.tecs select option { background: #020a04; color: var(--g); }
.t-cmd { flex: 1; border-bottom: 0 !important; }
.t-keys { display: flex; flex-wrap: wrap; gap: 0 2.2ch; color: var(--gd); margin-top: 2px; }
.pf b { color: var(--g); font-weight: 400; }
.pf:hover { color: var(--g); }
.f-row { display: flex; gap: 1ch; align-items: flex-start; padding-left: 3ch; margin-bottom: 2px; }
.f-row span { white-space: pre; }
.f-row input, .f-row textarea { width: 46ch; }
.f-row i { font-style: normal; color: var(--gd); }
