/* Dispatch console: dense, keyboard-first, built like a real CAD position. */
body.cad { font: 400 13px/1.35 "IBM Plex Sans Condensed", var(--font-body); overflow: hidden; }
#app { height: 100vh; display: flex; flex-direction: column; min-width: 1180px; }

.titlebar { display: flex; align-items: center; gap: 0; background: #ffffff; border-bottom: 1px solid var(--line-amber); height: 30px; }
.brand { font: 700 13px var(--font-mono); letter-spacing: .12em; color: #f4fbf6; background: var(--green); height: 100%; display: flex; align-items: center; padding: 0 12px; }
.tb-item { font: 600 12px var(--font-mono); padding: 0 12px; border-right: 1px solid var(--line); height: 100%; display: flex; align-items: center; color: var(--fg-2); white-space: nowrap; }
.tb-item.clock { color: var(--term); font-size: 14px; }
#link.on { color: var(--ok); } #link.off { color: var(--p1); }
.marquee { flex: 1; overflow: hidden; white-space: nowrap; height: 100%; display: flex; align-items: center; padding: 0 10px; font: 600 12px var(--font-mono); color: var(--term); }
.marquee span { display: inline-block; padding-left: 100%; animation: scroll 40s linear infinite; }
.marquee span:empty { animation: none; }
@keyframes scroll { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .marquee span { animation: none; padding-left: 0; } }
.tb-btn { height: 100%; border: 0; border-left: 1px solid var(--line); background: none; font: 600 11px var(--font-mono); padding: 0 12px; color: var(--muted); }

.fkeys { display: flex; gap: 2px; padding: 3px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.fkeys button { height: 28px; padding: 0 9px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); font: 600 11px var(--font-mono); letter-spacing: .04em; color: var(--fg); }
.fkeys button b { color: var(--amber); margin-right: 4px; }
.fkeys button:hover { background: var(--surface-2); }
.fk-sel { margin-left: auto; align-self: center; font: 600 11px var(--font-mono); color: var(--term); padding: 0 8px; }

/* desk: the call window top left, Unit Status over the AVL map on the right, Pending and Active events in a band under the call window */
.desk { flex: 1; min-height: 0; display: grid; gap: 3px; padding: 3px; background: #dcd9cf;
  grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1.2fr) minmax(170px, 0.95fr);
  grid-template-areas: "call units" "call map" "band map"; }
.w-call { grid-area: call; overflow: hidden; } .w-units { grid-area: units; } .w-map { grid-area: map; } .band { grid-area: band; }
.win { min-height: 0; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); }
.win-h { margin: 0; height: 22px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 8px; background: #e9ece4; border-bottom: 1px solid var(--line); font: 700 11px var(--font-mono); letter-spacing: .12em; color: var(--fg-2); }
.win-h span { color: var(--term); font-weight: 600; letter-spacing: .04em; }
.tbl-wrap { flex: 1; min-height: 0; overflow: auto; }
.band { min-height: 0; display: grid; gap: 3px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.band-tabs { padding: 0; gap: 0; }
.band-tabs button { height: 100%; padding: 0 10px; border: 0; border-right: 1px solid var(--line); background: none; font: 700 11px var(--font-mono); letter-spacing: .12em; color: var(--muted); }
.band-tabs button.on { background: var(--bg); color: var(--fg-2); box-shadow: inset 0 2px 0 var(--amber); }
.band-tabs button span { color: var(--term); font-weight: 600; letter-spacing: .04em; }

.grid-t { width: 100%; border-collapse: collapse; font: 500 12px/1.2 var(--font-mono); }
.grid-t th { position: sticky; top: 0; z-index: 1; background: #f1efe8; color: var(--muted); font-weight: 600; font-size: 10.5px; letter-spacing: .08em; text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid-t td { padding: 3px 6px; border-bottom: 1px solid #e7e5dd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.grid-t tbody tr { cursor: default; }
.grid-t tbody tr:hover td { background: #f3f6f0; }
.grid-t tbody tr.sel td { background: #e3efe6 !important; color: var(--term); }
.grid-t tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.grid-t .p1 { color: var(--p1); font-weight: 700; } .grid-t .p2 { color: var(--p2); font-weight: 700; } .grid-t .p4 { color: var(--p4); }
.grid-t tr.overdue td { background: #fbe6e2; }
.grid-t tr.overdue .wait { color: var(--p1); font-weight: 700; }
.grid-t .geo-u { color: var(--p1); }
.grid-t td.none { color: var(--p1); }
.grid-t tr.empty-row td { color: var(--muted); font-style: italic; text-align: center; padding: 10px; }

/* unit status rows tinted by status */
.u-available td.st { color: var(--ok); }
.u-dispatched td.st { color: var(--s-dp); }
.u-enroute td.st { color: #2563a8; }
.u-onscene td.st { color: var(--s-os); }
.u-transporting td.st, .u-athospital td.st { color: #7a4fa0; }
.u-busy td.st { color: var(--fg-2); }
.u-dispatched td { background: #fbf4df; } .u-enroute td { background: #e8f0fa; } .u-onscene td { background: #f9e9e0; }
tr.check td { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { background: #fbe6e2; color: var(--p1); } }
@media (prefers-reduced-motion: reduce) { tr.check td { animation: none; background: #fbe6e2; } }
.agency-row td { background: #f4f2ec !important; color: var(--amber); font-size: 10.5px; letter-spacing: .12em; padding: 3px 6px; }

/* detail window */
.tabs { display: flex; gap: 0; background: var(--bg-2); border-bottom: 1px solid var(--line); flex: none; }
.tabs button { height: 24px; padding: 0 12px; border: 0; border-right: 1px solid var(--line); background: none; font: 600 11px var(--font-mono); letter-spacing: .06em; color: var(--muted); }
.tabs button.on { background: var(--bg); color: var(--term); box-shadow: inset 0 2px 0 var(--amber); }
.detail-body { flex: 1; min-height: 0; overflow: auto; padding: 8px 10px; }
.empty { padding: 14px; color: var(--muted); font-style: italic; }
.badge { font: 700 10px var(--font-mono); padding: 1px 5px; border-radius: 2px; margin-left: 6px; vertical-align: 1px; }
.badge.v { background: #e1f0e6; color: var(--ok); border: 1px solid var(--green); }
.badge.xy { background: var(--warn-bg); color: var(--term); border: 1px solid #d9b25a; }
.badge.u { background: var(--bad-bg); color: var(--p1); border: 1px solid var(--bad); }
.hazard { background: var(--bad-bg); border: 1px solid var(--bad); color: var(--p1); font: 700 12px var(--font-mono); padding: 5px 8px; margin-bottom: 8px; }
.log { font: 500 12px/1.45 var(--font-mono); }
/* event tab: header stays put, only the log scrolls */
.detail-body.ev { display: flex; flex-direction: column; overflow: hidden; }
.detail-body.ev .log { flex: 1; min-height: 60px; overflow: auto; }
.detail-body.ev > * { flex-shrink: 0; }
.detail-body.ev > .log { flex-shrink: 1; }
.log .r { display: grid; grid-template-columns: 64px 120px minmax(0, 1fr); gap: 8px; padding: 1px 0; }
.log .r time { color: var(--muted); }
.log .r .who { color: var(--term-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log .r.note .txt { color: var(--term); }
.log .r.system .txt { color: var(--fg-2); }
.log .r.cad .txt { color: #1d5d9b; }
.subh { font: 700 10.5px var(--font-mono); letter-spacing: .12em; color: var(--muted); margin: 10px 0 4px; }
.entry { flex: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto 200px auto; gap: 6px; align-items: center; padding: 5px 8px; border-top: 1px solid var(--line); background: var(--bg-2); }
.entry .lbl { font: 700 11px var(--font-mono); color: var(--term-dim); }
.entry input, .entry select { min-height: 28px; padding: 3px 8px; border-radius: 2px; font: 500 12px var(--font-mono); }
.btn.small { min-height: 28px; border-radius: 2px; font: 700 11px var(--font-mono); letter-spacing: .06em; }
.w-map .map { flex: 1; }

.cmdline { flex: none; display: flex; align-items: center; gap: 8px; padding: 4px 8px; background: #ffffff; border-top: 1px solid var(--line-amber); }
.cmdline label { font: 700 13px var(--font-mono); color: var(--amber); }
.cmdline input { flex: 1; min-height: 28px; border: 0; background: transparent; font: 600 14px var(--font-mono); color: var(--term); text-transform: uppercase; padding: 2px 0; }
.cmdline input:focus { outline: none; }
.cmd-out { flex: none; max-height: 30vh; overflow: auto; padding: 0 8px; background: #ffffff; font: 500 12px/1.45 var(--font-mono); color: var(--fg-2); }
.cmd-out:not(:empty) { padding: 4px 8px 8px; border-top: 1px dashed var(--line); }
.cmd-out .bad { color: var(--p1); }
.cmd-out pre, .detail-body pre { margin: 6px 0; white-space: pre-wrap; font: 500 12px/1.45 var(--font-mono); color: var(--term); padding: 6px 8px; border: 1px solid var(--line); background: #f6f4ee; }
.cmd-out pre.hit, .detail-body pre.hit { color: var(--p1); border-color: var(--bad); background: #fdecea; }
.cmd-out pre .ret-top { color: var(--p1); font-weight: 800; }
.cmd-out table td { padding: 1px 16px 1px 0; vertical-align: top; }

/* ---------- call window: new event entry and the selected event, in one place ---------- */
.cw-h { height: 26px; gap: 10px; }
.cw-title { font: 700 12.5px var(--font-mono); letter-spacing: .08em; color: var(--term); white-space: nowrap; }
.w-call.is-new .cw-h { background: #f3ead9; border-bottom-color: #d9c39c; }
.w-call.is-new .cw-title { color: var(--clay); }
.w-call.is-closed .cw-h { background: #e6e6e1; }
.w-call.is-closed .cw-title { color: var(--muted); }
.cw-title.p1 { color: var(--p1); } .cw-title.p2 { color: var(--p2); }
.cw-meta { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; overflow: hidden; white-space: nowrap; font: 600 11px var(--font-mono); color: var(--fg-2) !important; letter-spacing: .04em; }
.cw-meta i { font-style: normal; color: var(--muted); font-weight: 500; }
.cw-meta .badge { margin-left: 0; }
.cw-meta .cw-elapsed b { color: var(--term); }
.cw-hint { color: var(--muted) !important; font-weight: 500 !important; }
.cw-newbtn { height: 19px; padding: 0 8px; border: 1px solid var(--line-amber); border-radius: 2px; background: var(--surface); font: 700 10.5px var(--font-mono); letter-spacing: .08em; color: var(--fg); }
.cw-newbtn b { color: var(--clay); margin-right: 3px; }
.cw-newbtn:hover { background: var(--warn-bg); }

.cw-confirm { flex: none; display: flex; align-items: center; gap: 8px; padding: 4px 8px; background: var(--bad-bg); border-bottom: 1px solid var(--bad); font: 700 12px var(--font-mono); letter-spacing: .06em; color: var(--p1); }
.cw-confirm span { margin-right: auto; }
.cw-hazard { flex: none; margin: 0; border-width: 0 0 1px; padding: 4px 8px; }

.cw-form { flex: none; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); grid-template-rows: auto auto; gap: 0 10px; padding: 6px 8px 0; border-bottom: 1px solid var(--line); background: var(--bg); }
.cw-fields { display: grid; gap: 3px 6px; align-items: end;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 62px 82px;
  grid-template-areas: "type type pri ag" "tinfo tinfo tinfo tinfo" "loc loc verify pick" "geo geo geo geo" "caller caller cb cb"; }
.a-type { grid-area: type; } .a-pri { grid-area: pri; } .a-ag { grid-area: ag; } .a-tinfo { grid-area: tinfo; }
.a-loc { grid-area: loc; } .a-verify { grid-area: verify; } .a-pick { grid-area: pick; } .a-geo { grid-area: geo; }
.a-caller { grid-area: caller; } .a-cb { grid-area: cb; }
.cf { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cf > span { font: 600 10px var(--font-mono); letter-spacing: .1em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-k { font-style: normal; font-weight: 500; letter-spacing: .02em; color: #8a958c; margin-left: 6px; }
.cw-form input, .cw-form select, .cw-form textarea { min-height: 26px; height: 26px; padding: 2px 6px; border-radius: 2px; border: 1px solid #c8cbc0; background: var(--surface); font: 500 13px var(--font-mono); text-transform: uppercase; }
.cw-form input::placeholder, .cw-form textarea::placeholder { text-transform: none; color: #9aa39b; font-family: var(--font-body); font-size: 12px; }
.cw-form select { padding: 0 4px; }
.cw-form textarea { height: auto; text-transform: none; resize: none; }
.cw-form input:focus, .cw-form select:focus, .cw-form textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 1px var(--green); background: #fbfdf9; }
.cw-form :disabled { background: var(--bg-2); color: var(--fg-2); opacity: 1; cursor: default; }
.cw-form .btn.small { min-height: 26px; height: 26px; padding: 0 6px; border-radius: 2px; }
.cf.dirty > span { color: var(--clay); }
.cf.dirty > span::after { content: " · CHANGED"; }
.cf.dirty input, .cf.dirty select { border-color: var(--clay); background: #fdf6f0; }
.cf.conflict > span::after { content: " · UPDATED ELSEWHERE"; color: var(--p1); }
.cf.conflict input, .cf.conflict select { border-color: var(--bad); box-shadow: inset 3px 0 0 var(--bad); }
.a-pick.dirty { border-color: var(--clay); color: var(--clay); }
.typeinfo { color: var(--term-dim); font-size: 11px; min-height: 14px; line-height: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.geo { font-size: 11.5px; line-height: 1.3; padding: 3px 6px; border: 1px solid var(--line); background: var(--bg-2); min-height: 24px; }
.geo.ok { color: var(--ok); border-color: var(--green); background: #eef5ef; }
.geo.xy { color: var(--term); border-color: #d9b25a; background: var(--warn-bg); }
.geo.bad { color: var(--p1); border-color: var(--bad); background: #fdf1ee; }
.geo .btn.small { min-height: 22px; height: 22px; margin: 3px 4px 0 0; font-size: 10.5px; }

.cw-narr { display: flex; flex-direction: column; min-height: 0; }
.cw-narr .cf { flex: 1; min-height: 0; }
.cw-narr textarea { flex: 1; min-height: 120px; font-size: 12.5px; line-height: 1.4; }
.cw-narr-text { flex: 1; min-height: 60px; max-height: 158px; overflow: auto; padding: 4px 7px; border: 1px solid var(--line); background: var(--bg-2); font-size: 12.5px; line-height: 1.4; color: var(--term); white-space: pre-wrap; }
.cw-narr-text.none { color: var(--muted); font-style: italic; }
.cw-bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; padding: 5px 0; }
.cw-msg { flex: 1; min-width: 0; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .03em; }
.cw-msg.changed { color: var(--clay); font-weight: 600; }
.cw-msg.warn { color: var(--p1); font-weight: 600; background: var(--bad-bg); border: 1px solid var(--bad); padding: 2px 6px; }
.cw-msg .linkish { margin-left: 8px; font: 600 11px var(--font-mono); color: var(--p1); }
.cw-bar .btn.small { min-height: 26px; height: 26px; border-radius: 2px; font: 700 11px var(--font-mono); letter-spacing: .06em; padding: 0 12px; }
.kbd { font-style: normal; font-weight: 500; opacity: .75; margin-left: 4px; font-size: 10px; }

.cw-tabs { flex: none; border-top: 0; }
/* the DISPATCH list takes the place of the tab body, so the comment line and the action strip always stay on screen */
.w-call.recs-open .cw-body { display: none; }
.cw-tabs button span { color: var(--clay); }
.cw-body { flex: 1; min-height: 0; overflow: auto; padding: 6px 10px; }
.cw-tip { padding: 6px 0 2px; font-size: 12px; }
.keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 18px; margin: 12px 0 0; font-size: 11.5px; }
.keys div { display: flex; gap: 8px; }
.keys dt { color: var(--term); font-weight: 700; min-width: 86px; }
.keys dd { margin: 0; color: var(--muted); }

.cw-rec { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; border-top: 2px solid var(--green); background: #f4f8f3; }
.cw-rec-h { flex: none; display: flex; align-items: center; gap: 12px; padding: 3px 8px; font: 700 11px var(--font-mono); letter-spacing: .08em; color: var(--term); }
.cw-rec-h .muted { font-weight: 500; letter-spacing: .02em; margin-right: auto; }
.cw-rec-h .linkish { font: 600 11px var(--font-mono); }
.cw-rec-b { flex: 1; min-height: 0; overflow: auto; }
.rec-t td .btn.small { min-height: 20px; height: 20px; padding: 0 8px; font-size: 10.5px; }
.rec-t td { padding: 2px 6px; }
.rec-t td:last-child { text-align: right; }

.cw-cmt { flex: none; grid-template-columns: auto minmax(0, 1fr) auto; padding: 4px 8px; }
.cw-actions { flex: none; display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-top: 1px solid var(--line); background: #e9ece4; min-height: 36px; }
.cw-actions .btn.small { min-height: 26px; height: 26px; border-radius: 2px; font: 700 11px var(--font-mono); letter-spacing: .06em; padding: 0 10px; }
.cw-actions .btn b { opacity: .8; margin-right: 3px; }
.cw-actions select { width: 190px; min-height: 26px; height: 26px; padding: 0 6px; border-radius: 2px; font: 500 12px var(--font-mono); background: var(--surface); }
.cw-units { flex: 1; min-width: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; }
.uc-none { font: 600 11px var(--font-mono); color: var(--p1); align-self: center; letter-spacing: .04em; white-space: nowrap; }
.uchip { flex: none; display: inline-flex; align-items: stretch; height: 26px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); font: 600 11px var(--font-mono); overflow: hidden; }
.uchip > * { display: flex; align-items: center; padding: 0 5px; }
.uc-cs { border: 0; background: none; font: 700 12px var(--font-mono); color: var(--fg); }
.uc-st { color: #fff; font-weight: 700; letter-spacing: .04em; }
.uchip.st-dispatched .uc-st { background: var(--s-dp); } .uchip.st-enroute .uc-st { background: var(--s-er); }
.uchip.st-onscene .uc-st { background: var(--s-os); } .uchip.st-transporting .uc-st, .uchip.st-athospital .uc-st { background: var(--s-tr); }
.uchip.st-busy .uc-st { background: #6b7770; } .uchip.st-available .uc-st { background: var(--green); }
.uchip.me { outline: 2px solid var(--term); outline-offset: -1px; }
.uc-t { color: var(--muted); font-weight: 500; }
.uc-a { border: 0; border-left: 1px solid var(--line); background: var(--surface-2); font: 700 10px var(--font-mono); color: var(--fg-2); letter-spacing: .04em; }
.uc-a:hover { background: #e3efe6; color: var(--term); }
.cw-closedinfo { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
/* the location column takes the room that is left and ellipsizes, so the timers on the right always show */
.grid-t td.loc { width: 100%; max-width: 0; }
.pin.call.pick::before { background: var(--clay); border-style: dashed; }
.w-call.is-closed .cf-k { display: none; }
.uc-none.past { color: var(--muted); }

/* ---------- title bar additions ---------- */
.tb-btn:hover { background: var(--surface-2); color: var(--fg); }
.tb-checks { color: var(--p1); font-weight: 700; background: var(--bad-bg); animation: ckpulse 1.2s ease-in-out infinite; }
.tb-checks b { display: inline-block; min-width: 18px; margin-left: 4px; padding: 1px 4px; border-radius: 2px; background: var(--p1); color: #fff; text-align: center; }
@keyframes ckpulse { 50% { background: #f6cfc8; } }
.checks-pop { position: fixed; z-index: 60; width: 540px; max-width: calc(100vw - 8px); background: var(--surface); border: 1px solid var(--bad); box-shadow: 0 6px 18px rgba(20, 32, 26, .18); }
.ck-h { display: flex; align-items: baseline; gap: 10px; padding: 5px 8px; background: var(--bad-bg); border-bottom: 1px solid var(--bad); font: 700 11px var(--font-mono); letter-spacing: .08em; color: var(--p1); }
.ck-h .muted { font-weight: 500; letter-spacing: .02em; }
.checks-pop .grid-t td .btn.small { min-height: 22px; height: 22px; padding: 0 8px; font-size: 10.5px; }
.ck-over { color: var(--p1); font-weight: 700; }
.ck-f { display: flex; justify-content: flex-end; padding: 5px 8px; border-top: 1px solid var(--line); }
.fkeys button .fk-n { display: inline-block; margin-left: 4px; padding: 0 4px; border-radius: 2px; background: var(--clay); color: #fff; font-size: 10px; }

/* ---------- the emergency alarm bar: full width under the title bar ---------- */
.alarm { flex: none; display: flex; flex-direction: column; background: var(--p1); border-bottom: 2px solid #7d1a14; }
.al-row { display: flex; align-items: center; gap: 12px; min-height: 34px; padding: 3px 8px; color: #fff; font: 700 14px var(--font-mono); letter-spacing: .05em; white-space: nowrap; overflow: hidden; }
.al-row + .al-row { border-top: 1px solid rgba(255, 255, 255, .35); }
.al-row.live { animation: alarm 0.9s steps(2) infinite; }
@keyframes alarm { 50% { background: #7d1a14; } }
.al-row.acked { background: #c9473f; font-size: 13px; }
.al-tag { padding: 2px 7px; background: #fff; color: var(--p1); font-size: 12px; letter-spacing: .12em; border-radius: 2px; }
.al-row.acked .al-tag { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .7); }
.al-cs { font-size: 17px; letter-spacing: .06em; }
.al-name, .al-loc { overflow: hidden; text-overflow: ellipsis; }
.al-loc { flex: 1; min-width: 0; }
.al-t { font-weight: 500; }
.al-by { font-weight: 500; font-size: 11.5px; }
.al-ev, .al-btn { flex: none; height: 26px; padding: 0 10px; border: 1px solid rgba(255, 255, 255, .8); border-radius: 2px; background: transparent; color: #fff; font: 700 11.5px var(--font-mono); letter-spacing: .08em; }
.al-ev:hover, .al-btn:hover { background: rgba(255, 255, 255, .18); }
.al-btn.al-ack { background: #fff; color: var(--p1); min-width: 64px; font-size: 13px; }
.al-btn.al-ack:hover { background: #fdecea; }
.al-btn.al-clr.armed { background: #14201a; border-color: #14201a; }
@media (prefers-reduced-motion: reduce) { .al-row.live { animation: none; } .tb-checks { animation: none; } }

/* unit rows: an open emergency, an overdue status check */
tr.emerg td { background: #f6cfc8 !important; color: var(--p1); font-weight: 700; }
tr.emerg td:first-child { box-shadow: inset 4px 0 0 var(--p1); }
.u-em, .u-ck { margin-left: 5px; padding: 0 4px; border-radius: 2px; font: 700 9.5px/14px var(--font-mono); letter-spacing: .06em; vertical-align: 1px; }
.u-em { background: var(--p1); color: #fff; }
.u-ck { height: 16px; border: 1px solid var(--bad); background: #fff; color: var(--p1); animation: ckpulse 1.2s ease-in-out infinite; }
.u-ck:hover { background: var(--p1); color: #fff; }
@media (prefers-reduced-motion: reduce) { .u-ck { animation: none; } }

/* ---------- right column: Unit status | Messages ---------- */
.w-units .band-tabs button.has-new span { color: #fff; background: var(--clay); padding: 0 4px; border-radius: 2px; }
.msgs { flex: 1; min-height: 0; display: grid; grid-template-columns: 128px minmax(0, 1fr); }
.msg-convs { min-height: 0; overflow: auto; border-right: 1px solid var(--line); background: var(--bg-2); display: flex; flex-direction: column; }
.mc { flex: none; display: flex; align-items: center; gap: 4px; min-height: 26px; padding: 0 8px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font: 600 11.5px var(--font-mono); letter-spacing: .04em; color: var(--fg-2); }
.mc:hover { background: var(--surface-2); }
.mc.on { background: var(--bg); color: var(--term); box-shadow: inset 3px 0 0 var(--amber); }
.mc.new .mc-k { color: var(--clay); font-weight: 700; }
.mc-k { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-n { padding: 0 5px; border-radius: 2px; background: var(--clay); color: #fff; font-size: 10px; }
.msg-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.msg-thread { flex: 1; min-height: 0; overflow: auto; padding: 4px 8px; font-size: 12px; line-height: 1.4; }
.mr { display: grid; grid-template-columns: 62px 112px minmax(0, 1fr); gap: 6px; padding: 2px 0; border-bottom: 1px dotted #e1dfd6; }
.mr time { color: var(--muted); }
.mr-who { color: var(--term-dim); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr.out .mr-who, .mr.out .mr-t { color: var(--term); }
.mr.new { background: var(--warn-bg); }
.mr-t { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-compose { flex: none; display: grid; grid-template-columns: 118px minmax(0, 1fr) auto; gap: 4px; padding: 4px 6px; border-top: 1px solid var(--line); background: var(--bg-2); }
.msg-compose select, .msg-compose input { min-height: 26px; height: 26px; padding: 2px 6px; border-radius: 2px; border: 1px solid #c8cbc0; background: var(--surface); font: 500 12px var(--font-mono); }
.msg-compose .btn.small { min-height: 26px; height: 26px; padding: 0 12px; }

/* ---------- call window: hits, the link strip, linked events ---------- */
.cw-hits { flex: none; display: flex; flex-direction: column; }
.hit { display: flex; align-items: center; gap: 10px; min-height: 26px; padding: 3px 8px; font: 700 12px var(--font-mono); letter-spacing: .04em; border-bottom: 1px solid; }
.hit > b { flex: none; padding: 2px 7px; border-radius: 2px; color: #fff; letter-spacing: .12em; font-size: 11.5px; }
.hit-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hit.war { background: #fdecea; border-color: var(--bad); color: var(--p1); }
.hit.war > b { background: var(--p1); animation: hitflash 1s steps(2) 6; }
.hit.bolo { background: #fbeee6; border-color: var(--clay); color: var(--clay); }
.hit.bolo > b { background: var(--clay); }
@keyframes hitflash { 50% { background: #7d1a14; } }
@media (prefers-reduced-motion: reduce) { .hit.war > b { animation: none; } }
.hit-a { flex: none; height: 20px; padding: 0 8px; border: 1px solid currentColor; border-radius: 2px; background: var(--surface); color: inherit; font: 700 10px var(--font-mono); letter-spacing: .08em; }
.cw-link { background: #f3ead9; border-bottom-color: #d9c39c; color: var(--clay); }
.cw-link span { margin-right: 0; white-space: nowrap; }
.cw-link select { flex: 1; min-width: 0; min-height: 26px; height: 26px; padding: 0 6px; border-radius: 2px; border: 1px solid #c8cbc0; background: var(--surface); font: 500 12px var(--font-mono); color: var(--fg); }
#cw-linkbtn.on { background: #f3ead9; border-color: var(--clay); color: var(--clay); }
.cw-lnk { flex: none; font: 700 11px var(--font-mono); letter-spacing: .04em; color: var(--clay) !important; }
button.cw-lnk { padding: 1px 6px; border: 1px solid var(--clay); border-radius: 2px; background: #fbeee6; }
.cw-lnk .linkish { font: 700 11px var(--font-mono); color: var(--clay); padding: 0; }
.hazard.caution { background: var(--warn-bg); border-color: #d9b25a; color: var(--p2); }

/* premise tab: the dispatcher premise file */
.pm-h { display: flex; align-items: center; gap: 6px; }
.pm-tog { margin-left: auto; font: 600 10.5px var(--font-mono); letter-spacing: .02em; }
.pf { display: grid; grid-template-columns: minmax(0, 0.9fr) 96px minmax(0, 1.6fr) 72px 98px auto; gap: 4px; align-items: center; padding: 4px 6px; margin-bottom: 4px; border: 1px solid var(--line); background: var(--bg-2); }
.pf-l { font: 700 10.5px var(--font-mono); letter-spacing: .06em; color: var(--term-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf select, .pf input { min-height: 26px; height: 26px; padding: 2px 6px; border-radius: 2px; border: 1px solid #c8cbc0; background: var(--surface); font: 500 12px var(--font-mono); }
.pf .btn.small { min-height: 26px; height: 26px; padding: 0 12px; }
.pm-list .grid-t td .btn.small { min-height: 20px; height: 20px; padding: 0 8px; font-size: 10.5px; }
.pm-d { color: var(--p1); font-weight: 700; } .pm-c { color: var(--p2); font-weight: 700; }
.pm-list .grid-t td.pm-text { width: 46%; max-width: none; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.35; }
.pm-list .grid-t td.loc { width: auto; max-width: 240px; }
.pm-note { font-size: 11px; padding: 4px 0; }
.btn.armed { background: var(--p1) !important; color: #fff !important; border-color: var(--p1) !important; }

/* ---------- sheets: BOLO, warrants, daily log ---------- */
dialog.sheet { padding: 0; border: 1px solid var(--line-amber); border-radius: 3px; background: var(--bg); color: var(--fg); width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 64px); box-shadow: 0 12px 40px rgba(20, 32, 26, .28); font: 400 13px/1.35 "IBM Plex Sans Condensed", var(--font-body); }
dialog.sheet[open] { display: flex; flex-direction: column; }
dialog.sheet-wide { width: min(1360px, calc(100vw - 32px)); }
dialog.sheet::backdrop { background: rgba(20, 32, 26, .38); }
.sheet-h { flex: none; display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 4px 6px 4px 12px; background: #e9ece4; border-bottom: 1px solid var(--line); }
.sheet-h h2 { margin: 0; font: 700 13px var(--font-mono); letter-spacing: .12em; color: var(--term); white-space: nowrap; }
.sheet-sub { flex: 1; min-width: 0; font: 500 11px var(--font-mono); color: var(--muted); letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-h select, .sheet-h input { width: auto; min-height: 26px; height: 26px; padding: 2px 6px; border-radius: 2px; border: 1px solid #c8cbc0; background: var(--surface); font: 500 12px var(--font-mono); }
.sheet-h .sheet-q { width: 280px; }
.sheet-h .btn.small { min-height: 26px; height: 26px; padding: 0 10px; }
.sheet-x { height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); font: 700 10.5px var(--font-mono); letter-spacing: .08em; color: var(--muted); }
.sheet-body { flex: 1; min-height: 0; overflow: auto; padding: 0 0 6px; }
.sheet-pad { padding: 0 12px; }
.sheet-bar { display: flex; align-items: center; gap: 6px; padding: 6px 0 2px; }
.sheet-bar .err { flex: 1; color: var(--p1); font-size: 11.5px; font-weight: 600; }
.sheet-bar .btn.small { min-height: 28px; height: 28px; padding: 0 14px; }

.bolo-form { flex: none; padding: 8px 12px 6px; border-bottom: 1px solid var(--line); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; margin-bottom: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 4px 16px; font: 700 11.5px var(--font-mono); letter-spacing: .1em; color: var(--muted); background: var(--surface); border-right: 1px solid var(--line); }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--green); color: #f4fbf6; }
.seg input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: -2px; }
.bf-grid { display: grid; grid-template-columns: 170px minmax(0, 1fr) 150px; gap: 5px 8px; align-items: end; }
.bf-wide { grid-column: span 2; }
.bf-all { grid-column: 1 / -1; }
.bolo-form input, .bolo-form select, .bolo-form textarea { min-height: 28px; height: 28px; padding: 3px 7px; border-radius: 2px; border: 1px solid #c8cbc0; background: var(--surface); font: 500 13px var(--font-mono); }
.bolo-form input[name=plate] { text-transform: uppercase; }
.bolo-form textarea { height: auto; min-height: 48px; resize: vertical; }
.bolo-form input:focus, .bolo-form select:focus, .bolo-form textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.bolo-form[data-kind=vehicle] .k-person, .bolo-form[data-kind=person] .k-vehicle, .bolo-form[data-kind=general] .k-person, .bolo-form[data-kind=general] .k-vehicle { display: none; }
.bf-prev { grid-column: span 2; align-self: center; min-height: 28px; padding: 5px 8px; border: 1px dashed var(--line-amber); background: #fbfaf6; color: var(--term); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#t-bolos td.bl-text { max-width: 360px; } #t-bolos td.bl-subj { max-width: 260px; }
#t-bolos td .btn.small, .war-t td .btn.small { min-height: 20px; height: 20px; padding: 0 8px; font-size: 10.5px; }

.war-t tr.w-act td:first-child b { color: var(--p1); }
.war-t tr.w-off td { color: var(--muted); }
.war-t td.w-ch { max-width: 360px; }
.war-t td.w-btns { text-align: right; }
.war-t td.w-btns .btn + .btn { margin-left: 4px; }
.w-st { padding: 1px 5px; border-radius: 2px; font-size: 10.5px; font-weight: 700; border: 1px solid var(--line); }
.w-st.active { background: var(--bad-bg); color: var(--p1); border-color: var(--bad); }
.w-st.served { background: #e1f0e6; color: var(--ok); border-color: var(--green); }

.log-sheet { padding: 8px 12px 12px; }
.lg-head { display: flex; align-items: baseline; gap: 14px; padding-bottom: 6px; border-bottom: 2px solid var(--fg); font: 600 12px var(--font-mono); letter-spacing: .06em; }
.lg-head b { font-size: 13px; letter-spacing: .1em; }
.lg-head .muted { margin-left: auto; font-weight: 500; font-size: 11px; }
.lg-t td.n, .lg-t th:nth-child(n+6) { text-align: right; }
.lg-d th:nth-child(n+2) { text-align: left; }
.lg-d th:last-child { text-align: right; }
.lg-t tfoot td { font-weight: 700; border-top: 1px solid var(--fg); background: #f1efe8; padding: 4px 6px; }
.lg-d { max-width: 640px; }
.lg-sign { display: flex; gap: 40px; margin-top: 28px; font-size: 11.5px; color: var(--fg-2); }

@media print {
  body.print-log { overflow: visible; background: #fff; }
  body.print-log #app, body.print-log #toasts, body.print-log dialog.sheet:not(#d-log) { display: none !important; }
  body.print-log #d-log { position: static; inset: auto; margin: 0; display: block; width: auto; max-width: none; max-height: none; border: 0; box-shadow: none; background: #fff; }
  body.print-log #d-log::backdrop { display: none; }
  body.print-log #d-log .sheet-h { display: none; }
  body.print-log #d-log .sheet-body { overflow: visible; }
  body.print-log .grid-t th { position: static; }
  body.print-log .grid-t td { white-space: normal; max-width: none; }
}
