:root {
  --bg: #f4f5f7; --panel: #ffffff; --ink: #15171c; --muted: #616a76; --line: #e1e4e9;
  --chip: #eef0f4; --brand: #b31f24; --brand-ink: #fff; --focus: #2457d6;
  --ok: #0f7a4b; --warn: #a15c00; --bad: #b3261e; --info: #2457d6; --violet: #6b3fc4;
  --radius: 12px; --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 4px 16px rgb(0 0 0 / .04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1013; --panel: #171a1f; --ink: #e8ebf0; --muted: #98a1ad; --line: #2a2f37;
    --chip: #222730; --brand: #ff5a5f; --focus: #7aa2ff;
    --ok: #3ddc97; --warn: #ffb547; --bad: #ff6b6b; --info: #7aa2ff; --violet: #b69cff;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", "Noto Sans Kannada", "Noto Sans", sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
[hidden] { display: none !important; }

/* ---------- buttons, chips, badges ---------- */
.btn {
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px;
  padding: 7px 12px; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.ghost { border-color: transparent; background: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--chip); border-radius: 999px;
  padding: 5px 11px; cursor: pointer;
}
.chip.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: var(--panel); padding: 7px 12px; cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { color: #fff; }
.seg button.on.sev-minor { background: var(--ok); }
.seg button.on.sev-moderate { background: var(--warn); }
.seg button.on.sev-severe { background: #d0541a; }
.seg button.on.sev-critical { background: var(--bad); }
.seg button.on.sev-unknown { background: var(--muted); }
.badge {
  display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 9px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: color-mix(in srgb, currentColor 13%, transparent);
}
.st-reported { color: var(--warn); } .st-verified { color: var(--info); }
.st-dispatched, .st-en_route, .st-on_scene, .st-transported { color: var(--violet); }
.st-cleared { color: var(--ok); } .st-closed, .st-false_alarm { color: var(--muted); }
.sev-minor { color: var(--ok); } .sev-moderate { color: var(--warn); }
.sev-severe { color: #d0541a; } .sev-critical { color: var(--bad); } .sev-unknown { color: var(--muted); }
.badge.ai { color: var(--info); }
.pulse::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- layout ---------- */
.top {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.brand .logo { width: 26px; height: 26px; border-radius: 7px; background: var(--brand); display: grid; place-items: center; color: #fff; }
.demo-tag { font-size: 11px; font-weight: 600; color: var(--warn); border: 1px solid currentColor; border-radius: 6px; padding: 1px 6px; }
.who { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.who label { color: var(--muted); font-size: 12px; }
.who select, .who input { width: auto; min-width: 180px; max-width: 280px; }
.lang { display: flex; gap: 4px; }
.lang button { border: 1px solid var(--line); background: transparent; border-radius: 6px; padding: 4px 8px; cursor: pointer; }
.lang button.on { background: var(--ink); color: var(--panel); }
.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: calc(100vh - 56px); }
aside.list { border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; }
.list-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 8px; gap: 8px; }
.list-head h2 { margin: 0; font-size: 14px; }
#incident-list { list-style: none; margin: 0; padding: 0 8px 8px; overflow: auto; flex: 1; }
#incident-list li button {
  width: 100%; text-align: left; border: 1px solid transparent; background: transparent;
  border-radius: 10px; padding: 10px; cursor: pointer; display: grid; gap: 4px;
}
#incident-list li button:hover { background: var(--chip); }
#incident-list li button.sel { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, transparent); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.list-foot { padding: 10px 14px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
main { padding: 18px; overflow: auto; min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.card + .card { margin-top: 14px; }
.stack > * + * { margin-top: 14px; }
.head-card { display: grid; gap: 10px; margin-bottom: 14px; }
.head-card .id { font-size: 18px; font-weight: 700; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.field { display: grid; gap: 4px; }
.field > span { font-size: 12px; color: var(--muted); }
input[type=text], input[type=tel], input[type=number], input[type=password], select, textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; background: var(--panel); width: 100%;
}
textarea { min-height: 70px; resize: vertical; }
.check { display: flex; align-items: center; gap: 6px; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tab { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); }
.tab.on { color: var(--ink); border-color: var(--ink); font-weight: 600; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 10px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.facility { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.facility:last-child { border-bottom: 0; }
.map { width: 100%; height: 200px; border: 0; border-radius: 10px; margin-top: 10px; background: var(--chip); }
.snapshot { width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; }
.timeline { list-style: none; margin: 0; padding: 0; }
.out-list { list-style: none; margin: 10px 0 0; padding: 0; }
.out-item { padding: 10px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.out-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.out-time { margin-left: auto; }
.out-text { overflow-wrap: anywhere; }
.out-alert { color: var(--bad); } .out-prealert { color: var(--info); }
.out-stand_down, .out-prealert_cancelled { color: var(--muted); } .out-update { color: var(--violet); }
.back-btn { margin-bottom: 12px; width: auto; align-self: flex-start; justify-self: start; display: inline-block; }
#incident-list li button.btn {
  width: auto; display: inline-block; border: 1px solid var(--line); background: var(--panel);
  padding: 5px 10px; color: var(--ink);
}
.timeline li { display: grid; grid-template-columns: 70px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.note { padding: 8px 10px; border-radius: 8px; background: var(--chip); color: var(--muted); font-size: 13px; }
.note.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.empty { display: grid; place-items: center; min-height: 50vh; text-align: center; color: var(--muted); }
#login-form { color: var(--ink); }
dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--ink); max-width: 560px; width: calc(100% - 32px); padding: 18px; }
dialog::backdrop { background: rgb(0 0 0 / .4); }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 9px 16px; border-radius: 10px; z-index: 20; }
.toast.bad { background: var(--bad); color: #fff; }
.urlbox { word-break: break-all; padding: 10px; border-radius: 8px; background: var(--chip); }

@media (max-width: 820px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  aside.list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 40vh; }
  main { padding: 16px; }
  .who { margin-left: 0; }
}

/* ---------- caller page ---------- */
.caller { max-width: 460px; margin: 0 auto; padding: 24px 16px; }
.caller .card { padding: 22px; }
.caller h1 { font-size: 22px; margin: 6px 0 10px; }
.caller .big { width: 100%; padding: 14px; font-size: 17px; margin-top: 12px; }
.caller .msg { margin-top: 14px; }
.caller .msg.ok { color: var(--ok); } .caller .msg.bad { color: var(--bad); }

/* ---------- report: KPI row + table ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 14px 0; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.kpi .label { font-size: 12px; color: var(--muted); }
.kpi .value { font-size: 28px; font-weight: 700; line-height: 1.2; margin-top: 4px; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi { display: flex; flex-direction: column; }
.kpi > :nth-last-child(2) { margin-bottom: 10px; }
.kpi .explain { font-size: 12px; color: var(--muted); margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.report-section { container-type: inline-size; }
.report-section .kpis { margin: 4px 0 0; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* report stages: one card per stage, bars on a scale shared by all four */
.stages {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
}
.stage {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.stage-head { display: flex; align-items: flex-start; gap: 8px; min-height: 2.9em; }
.stage-no {
  flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--chip); font-weight: 600; font-size: 12px;
}
.stage-name { font-weight: 600; font-size: 13px; line-height: 1.35; }
.stage-value { font-size: 26px; font-weight: 700; line-height: 1.1; }
.stage-value .stage-typical { font-size: 12px; font-weight: 400; color: var(--muted); }
.stage-bar { position: relative; height: 8px; border-radius: 4px; background: var(--chip); }
.stage-bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.stage-bar .p90, .key.p90 { background: color-mix(in srgb, var(--info) 30%, var(--panel)); }
.stage-bar .med, .key.med { background: var(--info); }
.key { display: inline-block; width: 12px; height: 8px; border-radius: 4px; vertical-align: middle; }
.stage .explain { font-size: 12px; color: var(--muted); margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.report-table th, .report-table td { white-space: nowrap; padding: 10px 12px; }
.report-table thead th {
  background: var(--chip); font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 0;
}
.report-table thead th:first-child { border-radius: 8px 0 0 8px; }
.report-table thead th:last-child { border-radius: 0 8px 8px 0; }
.report-table th.stage-col .stage-no { display: inline-grid; width: 18px; height: 18px; font-size: 11px;
  margin-right: 6px; background: var(--panel); vertical-align: middle; }
.report-table td.stage-col { min-width: 110px; }
.report-table .num-val { font-variant-numeric: tabular-nums; font-weight: 600; }
.report-table .mini-bar { height: 4px; margin-top: 6px; border-radius: 2px; background: var(--chip); max-width: 120px; }
.report-table .mini-bar span { display: block; height: 100%; border-radius: 2px; background: var(--info); }
.report-table .inc-title { font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.report-table td .badge { margin-top: 2px; }
.report-table tbody tr:last-child td { border-bottom: 0; }
.report-table tr.clickable { cursor: pointer; }
.report-table tr.clickable:hover td { background: color-mix(in srgb, var(--info) 5%, transparent); }
/* four across, two by two, or one column: never three and an orphan */
@container (max-width: 760px) {
  .stages, .report-section .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 360px) {
  .stages, .report-section .kpis { grid-template-columns: minmax(0, 1fr); }
}
.table-wrap { overflow-x: auto; }

/* ---------- console map: the ground the home and incident views sit beside ---------- */
main.with-map { padding: 0; overflow: hidden; }
.map-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 400px;
  height: calc(100vh - 57px);
}
.bigmap { min-height: 0; height: 100%; background: var(--chip); z-index: 0; }
.map-side { overflow: auto; padding: 14px; border-left: 1px solid var(--line); background: var(--bg); }
.map-side .head-card { margin-bottom: 14px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bigmap .leaflet-tile-pane { filter: brightness(.75) invert(1) contrast(.9) hue-rotate(180deg); }
}
@media (max-width: 1100px) {
  main.with-map { overflow: auto; }
  .map-layout { grid-template-columns: minmax(0, 1fr); height: auto; }
  .bigmap { height: 60vh; }
  .map-side { border-left: 0; border-top: 1px solid var(--line); }
}

/* facilities: round badges; lit when they serve the open incident, faded when they don't */
.mk {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font: 700 12px/1 system-ui, sans-serif; color: #fff; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgb(0 0 0 / .35); transform: translate(-12px, -12px);
}
.mk-hospital { background: #c62828; } .mk-police { background: #1f4fbf; } .mk-fire { background: #d9620b; }
.mk-amb { background: #6b3fc4; } .mk-toll {
  background: #15171c; border-radius: 6px; width: auto; height: 22px; padding: 0 6px;
  font-size: 10px; letter-spacing: .06em; transform: translate(-50%, -11px);
}
.mk-on { width: 30px; height: 30px; font-size: 14px; transform: translate(-15px, -15px); box-shadow: 0 0 0 4px rgb(255 255 255 / .6), 0 2px 8px rgb(0 0 0 / .4); }
.mk-dim { opacity: .45; }

/* incident pins */
.pin {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: translate(-15px, -34px) rotate(-45deg);
  background: currentColor; border: 2px solid #fff; box-shadow: 0 2px 6px rgb(0 0 0 / .4);
  display: grid; place-items: center; cursor: pointer;
}
.pin > span { transform: rotate(45deg); color: #fff; font: 800 15px/1 system-ui, sans-serif; display: grid; place-items: center; }
.pin .inc-svg { width: 17px; height: 17px; display: block; }
.pin-sel .inc-svg { width: 22px; height: 22px; }
.inc-type { display: inline-flex; align-items: center; gap: 6px; }
.inc-ico { display: inline-grid; place-items: center; width: 1.15em; height: 1.15em; flex: none; }
.inc-ico .inc-svg { width: 100%; height: 100%; display: block; }
.inc-glyph { font-weight: 800; line-height: 1; }
.v-alert-symbol { display: grid; place-items: center; margin: 14px auto 0; width: 84px; height: 84px; border-radius: 50%; background: rgb(255 255 255 / .18); }
.v-alert-symbol .inc-svg { width: 52px; height: 52px; }
.v-alert-symbol .inc-glyph { font-size: 44px; color: #fff; }
.pin-sel { width: 38px; height: 38px; transform: translate(-19px, -42px) rotate(-45deg); outline: 4px solid rgb(255 255 255 / .55); }
.pin-closed { background: #8a929c; }

/* vehicles: emoji on a white disc, an arrow for heading, faded once stale */
.unit {
  position: relative; width: 42px; height: 42px; border-radius: 50%; background: #fff;
  display: grid; place-items: center; transform: translate(-21px, -21px);
  box-shadow: 0 0 0 3px var(--violet), 0 3px 10px rgb(0 0 0 / .35); cursor: pointer;
}
/* vehicles: a picture of the vehicle on a white disc, ringed in its service's colour */
.unit-ambulance { box-shadow: 0 0 0 3px #d32f2f, 0 3px 10px rgb(0 0 0 / .4); }
.unit-highway_patrol, .unit-police { box-shadow: 0 0 0 3px #1f4fbf, 0 3px 10px rgb(0 0 0 / .4); }
.unit svg { width: 34px; height: 34px; display: block; }
.unit-glyph { font-size: 19px; line-height: 1; }
.unit-live::before {
  content: ""; position: absolute; inset: -2px; border-radius: inherit; pointer-events: none;
  animation: unit-pulse 1.8s ease-out infinite; box-shadow: 0 0 0 0 currentColor;
}
.unit-live.unit-ambulance { color: rgb(211 47 47 / .55); }
.unit-live.unit-highway_patrol, .unit-live.unit-police { color: rgb(31 79 191 / .55); }
.unit-live.unit-stale::before { animation: none; }
@keyframes unit-pulse { to { box-shadow: 0 0 0 12px transparent; } }
@media (prefers-reduced-motion: reduce) { .unit-live::before { animation: none; } }
.unit-arrow {
  position: absolute; inset: -11px; pointer-events: none;
}
.unit-arrow::before {
  content: ""; position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 9px solid #15171c;
}
.unit-stale { opacity: .5; filter: grayscale(1); }
/* standing by at base: a little smaller, with a parked badge; the badge turns amber once given a job */
.unit-slot { position: absolute; }
.unit-standby { width: 38px; height: 38px; transform: translate(-19px, -19px); }
.unit-standby svg { width: 30px; height: 30px; }
.unit-standby .unit-glyph { font-size: 16px; }
.unit-standby::after {
  content: "P"; position: absolute; right: -6px; bottom: -6px; width: 15px; height: 15px; border-radius: 50%;
  background: #4b5563; color: #fff; font: 700 9px/15px system-ui, sans-serif; text-align: center;
  box-shadow: 0 0 0 2px #fff;
}
.unit-standby.unit-busy::after { content: "!"; background: #b45309; }
.unit-lastseen { opacity: .8; }
.unit-lastseen::after { content: "⏱"; background: #4b5563; font-size: 9px; }

/* home panel */
.home-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.home-stats > div { background: var(--chip); border-radius: 10px; padding: 10px 12px; }
.home-stats .value { font-size: 26px; font-weight: 700; line-height: 1.1; }
.live-list { list-style: none; margin: 0; padding: 0; }
.live-list li + li { border-top: 1px solid var(--line); }
.live-list button {
  width: 100%; display: flex; gap: 10px; align-items: center; text-align: left;
  border: 0; background: transparent; padding: 8px 2px; cursor: pointer; border-radius: 8px;
}
.live-list button:hover { background: var(--chip); }
.live-glyph { display: grid; place-items: center; width: 34px; flex: none; }
.live-glyph .unit, .legend-mark .unit { transform: none; position: relative; }
.legend-area { display: block; width: 30px; height: 8px; border-radius: 4px; background: rgb(245 158 11 / .75); }
.map-key {
  display: flex; align-items: center; gap: 8px; background: rgb(255 255 255 / .94); color: #15171c;
  padding: 6px 10px; border-radius: 8px; box-shadow: 0 1px 4px rgb(0 0 0 / .25); font-size: 12px; font-weight: 600;
}
.map-key-swatch { width: 26px; height: 8px; border-radius: 4px; background: rgb(245 158 11 / .75); flex: none; }
.leaflet-tooltip.pin-label { font-weight: 700; font-size: 13px; padding: 4px 8px; }
.leaflet-tooltip.near-label {
  background: rgb(255 255 255 / .92); border: 0; box-shadow: 0 1px 4px rgb(0 0 0 / .25);
  font-size: 11px; padding: 2px 6px;
}
.leaflet-tooltip.near-label::before { display: none; }
.outside-area { display: inline-block; white-space: nowrap; margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: var(--chip); font-size: 11px; }
.live-list li.live-busy strong { color: var(--brand); }
.unit-pick { display: grid; gap: 6px; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.legend li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.legend-mark { width: 34px; height: 34px; display: grid; place-items: center; flex: none; }
.legend-mark > * { transform: none !important; }
.legend-mark .pin { transform: rotate(-45deg) !important; width: 24px; height: 24px; }
.legend-mark .unit { width: 32px; height: 32px; }
.legend-mark .unit svg, .live-glyph .unit svg { width: 26px; height: 26px; }
.live-glyph .unit { width: 34px; height: 34px; }
.legend-beat { display: block; width: 30px; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--info) 45%, transparent); }

/* side-panel tables (responders, dispatch picks): each row as a 2x2 block, nothing squeezed */
.map-side table, .map-side tbody { display: block; }
.map-side tbody tr {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.map-side tbody tr:last-child { border-bottom: 0; }
.map-side tbody td { display: block; border: 0; padding: 0; min-width: 0; }
.map-side tbody td input:not([type=checkbox]), .map-side tbody td select { width: 100% !important; }

.map-views { display: flex; gap: 6px; }
.map-views .btn { box-shadow: 0 1px 4px rgb(0 0 0 / .25); }
.leaflet-tooltip.plaza-label { font-weight: 700; font-size: 13px; padding: 4px 8px; }
.sync-off { color: var(--danger, #c62828); font-weight: 600; }

/* crew page: where to go */
.where-big { margin: 0; font-size: 22px; font-weight: 800; }
.carriageway {
  margin: 6px 0 0; padding: 6px 10px; border-radius: 8px; background: #fff4e5; color: #8a4b00;
  font-weight: 700; display: inline-block;
}
.nav-btn { display: block; text-align: center; text-decoration: none; margin-top: 12px; font-size: 18px; }

/* vehicle crew app */
body.vehicle { background: var(--bg); min-height: 100vh; }
.v-head {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; align-items: center;
  justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.v-unit { display: flex; align-items: center; gap: 10px; }
.v-unit .unit, .v-standby-badge .unit { transform: none; position: relative; }
.v-main { max-width: 560px; margin: 0 auto; padding: 12px 12px calc(16px + env(safe-area-inset-bottom, 0px)); }
.v-main .card { padding: 18px; margin-bottom: 12px; }
.v-main .big { width: 100%; padding: 14px; font-size: 17px; margin-top: 10px; }
.v-pin { font-size: 28px; letter-spacing: .3em; text-align: center; width: 100%; }
.v-pick { font-size: 18px; width: 100%; padding: 10px; }
.v-standby { text-align: center; }
.v-standby h1 { font-size: 28px; margin: 10px 0 6px; }
.v-standby-badge { display: grid; place-items: center; }
.v-standby-badge .unit { width: 72px; height: 72px; }
.v-standby-badge .unit svg { width: 56px; height: 56px; }
.v-shift-on { padding: 8px 12px; margin-bottom: 10px; border-radius: 10px; background: #e8f5e9; color: #1b5e20; font-weight: 600; }
.v-jobbar { padding: 8px 4px; gap: 8px; flex-wrap: wrap; }
.v-jobbar p { margin: 0; }
.v-frame { display: block; width: 100%; height: calc(100vh - 150px); min-height: 520px; border: 0; border-radius: 12px; background: var(--panel); }
.v-foot { text-align: center; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; }
.v-alert {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
  background: #b71c1c; color: #fff; animation: v-flash 1s steps(2, jump-none) infinite;
}
.v-alert-inner { text-align: center; max-width: 420px; }
.v-alert-kicker { font-size: 18px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .9; }
.v-alert-type { font-size: 40px; font-weight: 800; margin: 10px 0; }
.v-alert-place { font-size: 20px; margin: 4px 0; }
.v-alert-btn { margin-top: 24px; width: 100%; padding: 18px; font-size: 22px; font-weight: 800; background: #fff; color: #b71c1c; border: 0; }
@keyframes v-flash { 50% { background: #7f0000; } }
@media (prefers-reduced-motion: reduce) { .v-alert { animation: none; } }
body.embedded .caller { padding-top: 8px; }
.live-row { display: flex; align-items: center; gap: 6px; }
.live-row > button { flex: 1; min-width: 0; }
.app-link { flex: none; text-decoration: none; white-space: nowrap; font-family: system-ui, sans-serif; }

/* incident: the responders sent */
.resp-list { display: grid; }
.resp { padding: 12px 0; border-bottom: 1px solid var(--line); }
.resp:first-child { padding-top: 4px; }
.resp:last-child { border-bottom: 0; }
.resp-head { display: flex; align-items: center; gap: 10px; }
.resp-who { flex: 1; min-width: 0; }
.resp-unit { margin-left: 8px; font-size: 12px; padding: 1px 6px; border-radius: 6px; background: var(--chip); }
.unit.resp-mark { transform: none; width: 34px; height: 34px; flex: none; }
.unit.resp-mark svg { width: 26px; height: 26px; }
.resp-actions { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding-left: 44px; }
.resp-set { display: grid; grid-template-columns: auto auto; align-items: center; gap: 4px 6px; }
.resp-set > span { grid-column: 1 / -1; }
.resp-set select { width: auto !important; }
.more-btn { margin-top: 12px; width: 100%; }
