:root {
  --bg: #0b0e14;
  --panel: #141924;
  --panel-raised: #1b2232;
  --border: #2a3245;
  --text: #e8ebf2;
  --text-dim: #9aa4bd;
  --accent: #e69f00;       /* Okabe-Ito orange: star / primary action */
  --accent-text: #15110a;
  --focus: #56b4e9;        /* Okabe-Ito sky blue: focus rings only, never sole meaning-carrier */

  /* group colors (Okabe-Ito), always paired with an icon + text label, never color alone */
  --g-fire: #e69f00;
  --g-ems: #0072b2;
  --g-hospital: #009e73;
  --g-interop: #56b4e9;
  --g-emg: #cc79a7;
  --g-other: #8a8f9e;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
/* the bottom system-bar inset; app.js raises it where Android draws its gesture bar over the page but reports 0 */
:root { --safe-bottom: env(safe-area-inset-bottom, 0px); }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: var(--safe-bottom);
}
button { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.live { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--g-ems); animation: pulse 2s infinite; }
.live.stale .live-dot { background: var(--text-dim); animation: none; }
.live.stale .live-text::after { content: " (reconnecting…)"; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.icon-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--panel-raised); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; cursor: pointer; position: relative;
}
.icon-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.badge-count {
  position: absolute; top: -6px; right: -6px; background: var(--accent); color: var(--accent-text);
  font-size: 11px; font-weight: 700; border-radius: 999px; min-width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

#search-row { display: flex; gap: 8px; align-items: center; padding: 10px 14px 6px; background: var(--bg); }
#search {
  flex: 1 1 160px; min-width: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 9px 12px; font-size: 14px;
}
#search:focus-visible { outline: 2px solid var(--focus); }
.toggle-btn {
  position: relative; display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 12px; cursor: pointer; white-space: nowrap;
}
.toggle-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }

.star { font-size: 16px; line-height: 1; }
.star-on { color: var(--accent); }
.star-off { color: var(--text-dim); }
.toggle-btn[aria-pressed="true"] .star { color: var(--accent-text); }

#sticky { position: sticky; top: var(--nav-top, 0px); z-index: 10; background: var(--bg); border-bottom: 1px solid var(--border); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.new-pill {
  position: absolute; left: 50%; top: calc(100% + 40px); transform: translateX(-50%); z-index: 12;
  background: var(--focus); color: #06202b; font-weight: 700; font-size: 13px;
  border: none; border-radius: 999px; padding: 7px 16px; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.5);
}
.new-pill.inline { position: static; transform: none; display: block; margin: 8px 0 0; box-shadow: none; }

/* ---------- call table ---------- */
main#list-wrap { padding: 0 8px 20px; }
table.calls {
  width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px;
}
table.calls th {
  position: sticky; top: calc(var(--nav-top, 0px) + var(--sticky-h, 0px)); z-index: 5;
  background: var(--panel); color: var(--text-dim); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; text-align: left;
  padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.calls td {
  padding: 3px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle;
}
tr.call { cursor: pointer; scroll-margin-top: calc(var(--nav-top, 0px) + var(--sticky-h, 0px) + 64px); scroll-margin-bottom: 120px; }
#solo tr.call { scroll-margin-top: calc(var(--solo-head-h, 0px) + 34px); }
tr.call:hover td { background: var(--panel); }
tr.call:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
/* starred: accent bar + the filled ★ in its own column (never colour alone) */
tr.call.is-starred td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
/* the call in the player: thick bar + ❚❚/▶ icon on its play button */
tr.call.is-current td { background: var(--panel-raised); }
tr.call.is-current td:first-child { box-shadow: inset 4px 0 0 var(--focus); }
tr.call.is-anchor td { border-bottom-color: var(--focus); }
/* day separator: sticks under the column headers, so the day you're scrolling through is always on screen */
table.calls tr.day-sep th {
  top: calc(var(--nav-top, 0px) + var(--sticky-h, 0px) + var(--thead-h, 28px)); z-index: 4;
  background: var(--bg); color: var(--text); font-size: 13px; font-weight: 700; text-transform: none; letter-spacing: 0;
  padding: 8px 8px 4px; border-bottom: 2px solid var(--text-dim);
}
#solo table.calls tr.day-sep th { top: calc(var(--solo-head-h, 0px) + var(--solo-thead-h, 28px)) !important; }
.play-date { color: var(--text-dim); font-weight: 600; }

.c-time { width: 1%; }
.c-tg { font-weight: 600; max-width: 14em; overflow: hidden; text-overflow: ellipsis; }
.c-star { width: 1%; text-align: center; padding-left: 0 !important; padding-right: 0 !important; }
.c-group { width: 1%; }
.c-tag { width: 1%; color: var(--text-dim); font-size: 13px; }
.c-name { max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; color: var(--text-dim); font-size: 13px; }
.c-dur, .c-gap { width: 1%; color: var(--text-dim); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.c-units { max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-variant-numeric: tabular-nums; }

.play-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px;
  background: var(--panel-raised); border: 1px solid var(--border); border-radius: 6px;
  padding: 3px 8px; cursor: pointer; font-variant-numeric: tabular-nums; font-size: 13px; min-width: 8.6em;
}
.play-btn.no-audio { cursor: default; opacity: .6; border-style: dashed; }
.play-btn:hover { border-color: var(--focus); }
.play-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.play-icon { width: 1.1em; text-align: center; font-size: 11px; }
.play-btn[aria-pressed="true"] { border-color: var(--focus); color: var(--focus); font-weight: 700; }

.call-star-btn {
  background: none; border: none; cursor: pointer; font-size: 18px; padding: 2px 6px; line-height: 1;
}
.call-star-btn:focus-visible { outline: 2px solid var(--focus); border-radius: 4px; }
.note-mark { margin-left: 6px; color: var(--accent); font-weight: 400; }

.badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600;
  padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap;
}
td .badge { max-width: 9.5em; overflow: hidden; text-overflow: ellipsis; display: inline-block; }
.badge.g-fire { color: var(--g-fire); } .badge.g-ems { color: var(--g-ems); }
.badge.g-hospital { color: var(--g-hospital); } .badge.g-interop { color: var(--g-interop); }
.badge.g-emg { color: var(--g-emg); } .badge.g-other { color: var(--g-other); }
.badge.tag { color: var(--text-dim); border-style: dashed; }

#list-wrap .c-units { max-width: 16em; width: auto; }
@media (max-width: 1099px) { #list-wrap .c-units { display: none; } }

/* narrow screens: time, talkgroup, star, group (description/tag/length are in the call's detail) */
@media (max-width: 719px) {
  .c-tag, .c-name { display: none; }
  table.calls .c-tg { max-width: 0; width: 100%; }
}
@media (max-width: 479px) {
  main#list-wrap, #solo { padding-left: 2px; padding-right: 2px; }
  #list-wrap .c-dur { display: none; }
  table.calls td, table.calls th { padding-left: 3px; padding-right: 3px; }
  .play-btn { min-width: 0; padding: 3px 5px; gap: 4px; font-size: 12px; background: none; }
  .play-icon { width: auto; font-size: 10px; }
  table.calls .c-tg { font-size: 13px; }
  td .badge { max-width: 9.5em; padding: 1px 6px; font-size: 11px; }
  .call-star-btn { padding: 2px 3px; font-size: 17px; }
  .c-units { white-space: normal; }
  #solo .c-units { max-width: none; width: auto; }
}

/* ---------- shared player ---------- */
#player {
  position: fixed; left: 0; right: 0; bottom: var(--nav-bottom, 0px); z-index: 18;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px calc(8px + var(--safe-bottom));
  background: var(--panel); border-top: 2px solid var(--focus);
}
.player-info { flex: 1 1 180px; min-width: 0; }
#player-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#player-sub { color: var(--text-dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#player-audio { flex: 2 1 260px; height: 36px; min-width: 0; }
#toasts { position: fixed; right: 12px; top: 12px; z-index: 40; display: flex; flex-direction: column; gap: 8px;
  max-width: min(420px, calc(100vw - 24px)); }
.toast { background: var(--panel); border: 1px solid var(--focus); border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25); display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.toast-text { display: flex; flex-direction: column; gap: 2px; }
.toast-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.newtg { list-style: none; margin: 0; padding: 0; }
.newtg li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border, rgba(127,127,127,.2)); }
.newtg-name { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.player-opts { display: flex; gap: 6px; flex: 0 0 auto; }
#player-speed { min-width: 3.2em; font-variant-numeric: tabular-nums; }
/* --player-h = the player's real height (app.js): it wraps to 2-3 rows on a phone */
body.has-player { padding-bottom: calc(var(--nav-bottom, 0px) + var(--player-h, 110px)); }
body.has-player #solo, body.has-player .view, body.has-player #stats { padding-bottom: calc(var(--player-h, 110px) + 10px); }

/* ---------- incidents view ---------- */
#incidents > * { max-width: 900px; margin-left: auto; margin-right: auto; }
#incident-list { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; }
.incident-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.incident-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.incident-card { position: relative; }
.incident-top { padding-right: 34px; }
.incident-top .inc-star { position: absolute; top: 8px; right: 8px; }
.solo-top .inc-star { margin-left: auto; font-size: 22px; }
.heard { color: var(--text-dim); font-size: 12px; font-style: italic; }
.inc-pin-onplace { filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.star-note { margin: 4px 0; font-size: 14px; }
.star-note .star-on, .star-note > span[aria-hidden] { color: var(--accent); }
.sum-log ol { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
.sum-log li { margin: 3px 0; }
#alert-delays .late { color: var(--accent); font-weight: 600; }
.incident-type { font-size: 15px; }
.incident-addr { margin: 4px 0; font-size: 14px; }
.incident-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0 4px; }
.incident-text { font-size: 13px; color: var(--text-dim); margin: 6px 0 0; }
.incident-card details summary { cursor: pointer; font-size: 12px; }
.inc-pin { background: var(--panel); border: 2px solid var(--text); border-radius: 50%; display: flex !important;
  align-items: center; justify-content: center; font-size: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.6); }
.board { margin-top: 10px; }
.board-card { background: var(--panel); border: 1px solid var(--focus); border-radius: 10px; padding: 8px 12px; margin: 6px 0; cursor: pointer; }
.board-units { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.st { white-space: nowrap; font-weight: 600; }
.timeline ol { list-style: none; padding: 0; margin: 6px 0; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.timeline .tl-time { font-variant-numeric: tabular-nums; color: var(--text-dim); }
.timeline .play-btn { min-width: 0; min-height: 24px; padding: 1px 6px; }
.timeline q { font-size: 12px; }
.incident-summary { margin: 6px 0; font-size: 14px; }
.summary-live { color: var(--text-dim); font-size: 12px; white-space: nowrap; }
.alert-settings { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 10px; }
.alert-settings summary { cursor: pointer; font-weight: 600; }
.alert-settings textarea { width: 100%; background: var(--panel-raised); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px; font: inherit; }
.push-device { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; padding: 8px 10px;
  background: var(--panel-raised); border: 1px solid var(--border); border-radius: 8px; }
.push-device p { margin: 0; flex: 1 1 200px; }
.near-row { display: block; margin: 8px 0; font-size: 14px; }
.near-row input { width: 5em; display: inline-block; }
.places-list { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 6px; }
.places-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.place-form { display: flex; flex-wrap: wrap; gap: 6px; }
.place-form #place-where { flex: 1 1 200px; }
.place-form #place-name { flex: 0 1 150px; }
.poi-pin { background: var(--panel); color: var(--text); border: 2px solid var(--accent); border-radius: 14px;
  padding: 1px 8px 1px 4px; white-space: nowrap; display: flex !important; gap: 4px; align-items: center; font-size: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.6); }
.near { white-space: nowrap; font-size: 13px; color: var(--text-dim); }
.quiet-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.quiet-row .field-label { flex-basis: 100%; }
.quiet-row input { width: 8em; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 6px 0; }
.small-inline { font-size: 12px; margin: 2px 0; }
.review-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 10px; }
.review-card.is-focus { outline: 2px solid var(--focus); outline-offset: 2px; }
kbd { font: 12px/1 ui-monospace, monospace; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px;
  padding: 1px 4px; background: var(--panel-raised); }
.unit-btn.placeholder { font-style: italic; border-style: dotted; }
.log-evidence { margin: 6px 0 2px; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.check-line { font-size: 13px; margin: 4px 0; }
.bc-list { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-direction: column; gap: 6px; }
.bc-clips { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-left: 4px; }
.bc-list .play-btn, .unit-log .play-btn { min-width: 0; }
.inc-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.inc-bar #inc-day { flex: 1 1 140px; min-width: 0; }
.inc-bar #inc-q { flex: 1 1 180px; min-width: 0; }
.inc-bar #inc-cat { flex: 0 1 170px; min-width: 0; }
.inc-kinds { display: flex; gap: 6px; }
.inc-bar .icon-btn:disabled { opacity: .4; cursor: default; }
#inc-summary { margin-top: 6px; }
.inc-day-h { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); margin: 10px 2px 0; }
.unitboard { margin-top: 10px; }
.unitboard summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.unitboard-busy, .unitboard-today { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.unitboard-today { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); font-size: 14px; }
.unitboard-unit { width: 100%; text-align: left; background: var(--panel); color: inherit; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; cursor: pointer; font: inherit; }
.unitboard-inc { flex-basis: 100%; font-size: 13px; }
.unitboard-moves { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; font-size: 14px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.unitboard-moves li { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.move-at { font-size: 12px; color: var(--text-dim); border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; }
.heat-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; font-size: 14px; }
.incident-map { height: 340px; border-radius: 10px; margin: 10px auto 0; border: 1px solid var(--border); }
body.solo-open #solo { z-index: 17; }

/* ---------- review view ---------- */
#review-list { display: flex; flex-direction: column; gap: 10px; padding: 10px 0; }
.review-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.review-card h3 { margin: 0 0 4px; font-size: 15px; font-variant-numeric: tabular-nums; }
.review-card .why { margin: 0 0 8px; font-size: 13px; color: var(--text-dim); }
.review-card .clips { margin: 0 0 6px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.review-card .clips li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.review-card q { flex: 1 1 200px; }
.review-card .then { flex-basis: 100%; padding-left: 1.2em; font-size: 13px; color: var(--text-dim); }
.review-card .then .play-btn { margin-left: 6px; }
.section-h { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); margin: 16px 6px 6px; }
.small { font-size: 12px; margin: 0 6px 6px; }
#unit-stats { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.stats-lead { margin: 0 0 10px; font-size: 15px; }
.stats { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13px; }
.stats dt { color: var(--text-dim); white-space: nowrap; }
.stats dd { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stat-bar { width: 90px; height: 8px; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; background: var(--panel-raised); }
.stat-bar > span { display: block; height: 100%; background: var(--text-dim); }
.unit-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.unit-log li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; padding: 6px 8px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px; }
.unit-log .log-when { color: var(--text-dim); font-variant-numeric: tabular-nums; min-width: 9em; }
.unit-log .log-what { flex: 1 1 260px; }
.unit-log li.is-undone .log-what { text-decoration: line-through; }
.conf { display: flex; align-items: center; gap: 8px; margin: 2px 0 6px; font-size: 13px; }
.conf-bar { width: 120px; height: 8px; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; background: var(--panel-raised); }
.conf-bar > span { display: block; height: 100%; background: var(--text-dim); }
.conf-high .conf-bar > span { background: var(--g-hospital); }
.conf-medium .conf-bar > span { background: var(--accent); }
strong.sign { text-decoration: underline; text-underline-offset: 2px; color: var(--accent); }
.transcript { padding: 0 16px 12px; font-size: 14px; }
.transcript h3 { font-size: 12px; text-transform: uppercase; color: var(--text-dim); letter-spacing: .04em; margin: 0 0 6px; }
.transcript p { margin: 0 0 6px; }
#review > * { max-width: 900px; margin-left: auto; margin-right: auto; }

/* ---------- solo view ---------- */
#solo {
  position: fixed; inset: var(--nav-top, 0px) 0 var(--nav-bottom, 0px); z-index: 15; overflow: auto; background: var(--bg);
  padding: 0 8px 20px;
}
body.solo-open, body.view-open { overflow: hidden; }
#solo-head {
  position: sticky; top: 0; z-index: 6; background: var(--bg);
  padding: calc(10px + env(safe-area-inset-top)) 6px 8px; border-bottom: 1px solid var(--border);
}
.solo-table th { top: var(--solo-head-h, 0px) !important; }
.solo-top { display: flex; align-items: center; gap: 10px; }
.solo-title { min-width: 0; }
.solo-title h2 { margin: 0; font-size: 17px; }
.solo-name { color: var(--text-dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.solo-meta { font-size: 13px; color: var(--text); margin: 2px 0 8px; }
.solo-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.solo-controls .primary-btn { padding: 9px 16px; }
.solo-controls button[disabled] { opacity: .45; cursor: default; }
.solo-gap { font-size: 13px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
.solo-gap select {
  background: var(--panel-raised); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 6px;
}
.solo-live { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 13px; padding: 10px 6px; }

/* conversation: who said what (wraps), a ↪ + bar where it moves to another talkgroup, the people followed */
#solo .c-said { width: 100%; white-space: normal; font-size: 14px; padding-top: 5px; padding-bottom: 5px; }
#solo .c-said p { margin: 0 0 3px; }
#solo .c-said p:last-child { margin-bottom: 0; }
#solo td.c-tg { font-size: 13px; max-width: 12em; }
#solo td.tg-moved { color: var(--focus); box-shadow: inset 0 2px 0 var(--focus); }
.people { display: grid; gap: 4px; margin: 0 0 8px; font-size: 13px; }
.people > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.people-label { color: var(--text-dim); margin-right: 4px; }
.person { display: inline-flex; align-items: stretch; border: 1px solid var(--text-dim); border-radius: 999px; overflow: hidden; }
.person.console { border-style: dashed; }
.person button { background: none; border: none; color: var(--text); font: inherit; cursor: pointer; padding: 3px 9px; }
.person .person-name { font-weight: 600; }
.person .person-act { border-left: 1px solid var(--border); padding: 3px 9px; font-weight: 700; }
.person button:hover { background: var(--panel-raised); }
.person button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
@media (max-width: 479px) {
  #solo td.c-tg { max-width: 5.5em; font-size: 12px; }
  #solo .c-said { font-size: 13px; }
}

#sentinel { height: 1px; }
.empty, .loading { text-align: center; color: var(--text-dim); padding: 30px 0; }

#unit-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 22; }
#unit-sheet { z-index: 23; }

/* radio units: a number, or (named) the name + the number small; dashed = not named yet */
.unit-list { display: flex; flex-wrap: wrap; gap: 4px; }
.unit-btn {
  display: inline-flex; align-items: baseline; gap: 4px; margin: 1px 4px 1px 0;
  background: none; border: 1px dashed var(--border); border-radius: 6px; padding: 1px 6px; cursor: pointer;
  font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text);
}
.unit-btn.named { border-style: solid; border-color: var(--text-dim); font-weight: 600; }
.unit-btn:hover { border-color: var(--focus); }
.unit-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.unit-id { color: var(--text-dim); font-weight: 400; font-size: 11px; }
.dim { color: var(--text-dim); }
.field-label { display: block; font-size: 12px; color: var(--text-dim); margin: 8px 0 4px; }
.text-input {
  width: 100%; background: var(--panel-raised); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px; font: inherit;
}
.text-input:focus-visible, .note-row textarea:focus-visible { outline: 2px solid var(--focus); }

#sheet-backdrop, #detail-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 20;
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 85vh; overflow: auto;
  background: var(--panel); border-top: 1px solid var(--border); border-radius: 14px 14px 0 0;
  padding: 0 0 calc(14px + var(--safe-bottom));
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.sheet-head h2 { font-size: 16px; margin: 0; }
.sheet-body { padding: 14px 16px; }
.sheet-body section { margin-bottom: 18px; }
.sheet-body h3 { font-size: 12px; text-transform: uppercase; color: var(--text-dim); margin: 0 0 8px; letter-spacing: .04em; }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px 0; gap: 10px; }

#tag-select, #tg-select {
  width: 100%; background: var(--panel-raised); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px; font-size: 14px;
}

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 12px; cursor: pointer; background: var(--panel-raised); color: var(--text-dim); font-size: 13px;
}
.chip[aria-pressed="true"] { background: currentColor; }
.chip[aria-pressed="true"] .chip-label { color: var(--bg); font-weight: 700; }
.chip.g-fire[aria-pressed="true"] { color: var(--g-fire); } .chip.g-ems[aria-pressed="true"] { color: var(--g-ems); }
.chip.g-hospital[aria-pressed="true"] { color: var(--g-hospital); } .chip.g-interop[aria-pressed="true"] { color: var(--g-interop); }
.chip.g-emg[aria-pressed="true"] { color: var(--g-emg); } .chip.g-other[aria-pressed="true"] { color: var(--g-other); }

.text-btn { background: none; border: none; color: var(--text-dim); cursor: pointer; text-decoration: underline; padding: 10px 0; }
.primary-btn { background: var(--accent); color: var(--accent-text); border: none; border-radius: 8px; padding: 11px 20px; font-weight: 700; cursor: pointer; }

.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
.primary-btn.secondary { background: var(--panel-raised); color: var(--text); border: 1px solid var(--accent); }

.detail-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; padding: 0 16px 14px; }
.detail-grid dt { color: var(--text-dim); }
.detail-grid dd { margin: 0; }
.note-row { padding: 0 16px 16px; }
.note-row textarea {
  width: 100%; min-height: 60px; background: var(--panel-raised); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px; font: inherit; resize: vertical;
}
.note-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

@media (min-width: 700px) {
  main#list-wrap, #search-row, .quick-row, #solo > * { max-width: 1200px; margin-left: auto; margin-right: auto; }
  .sheet { left: 50%; transform: translateX(-50%); width: min(480px, 100vw); border-radius: 14px; bottom: 20px; max-height: 80vh; }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}

/* ---------- stats ---------- */
#ask > * { max-width: 900px; margin-left: auto; margin-right: auto; }
.ask-form textarea { width: 100%; resize: vertical; font: inherit; }
.ask-answer { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin: 10px auto; }
.ask-answer h3 { margin: 0 0 6px; font-size: 15px; }
.ask-answer p { line-height: 1.5; }
.cite { font: inherit; font-size: 12px; border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; margin: 0 2px;
  background: transparent; color: inherit; cursor: pointer; white-space: nowrap; }
.cite:hover, .cite:focus-visible { border-color: var(--focus); }
.cite[aria-pressed="true"] { border-color: var(--focus); background: var(--bg); }
.ask-steps { margin: 4px 0 0; padding-left: 20px; }
.ask-steps li { margin: 1px 0; }
.ask-looked summary { cursor: pointer; }
.ask-tx { border-left: 3px solid var(--focus); background: var(--bg); border-radius: 0 8px 8px 0; padding: 8px 12px; margin: 8px 0; font-size: 14px; }
.ask-tx h4 { margin: 0 0 6px; font-size: 13px; }
.ask-tx p { margin: 0 0 6px; line-height: 1.45; }
#stats { position: fixed; inset: var(--nav-top, 0px) 0 var(--nav-bottom, 0px); z-index: 17; overflow: auto; background: var(--bg); padding: 0 8px 30px; }
#stats > * { max-width: 900px; margin-left: auto; margin-right: auto; }
.stats-head { position: sticky; top: 0; z-index: 6; background: var(--bg); padding: calc(10px + env(safe-area-inset-top)) 6px 10px;
  border-bottom: 1px solid var(--border); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 12px 0; }
.tile { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; }
.tile b { font-size: 22px; font-variant-numeric: tabular-nums; }
.tile span { color: var(--text-dim); font-size: 12px; }
.chart { margin: 14px 0; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.chart figcaption { font-weight: 600; margin-bottom: 6px; }
.chart svg { width: 100%; height: auto; display: block; stroke: none; }  /* not the icon outline style */
.chart svg * { stroke: none; }
.chart .bar { fill: var(--focus); }
.chart .bar:hover { fill: var(--text); }
.chart svg .axis { stroke: var(--border); stroke-width: 1; }
.chart .tick { fill: var(--text-dim); font-size: 10px; }
table.mini { border-collapse: collapse; font-size: 13px; width: 100%; }
table.mini th, table.mini td { text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--border); }
table.mini td:last-child, table.mini th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.ranks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 10px; }
.hm-wrap { overflow-x: auto; }
table.heat { border-collapse: separate; border-spacing: 2px; font-size: 10px; color: var(--text-dim); }
table.heat th { font-weight: 400; padding: 0 2px; }
.hm { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
td.hm { display: table-cell; width: 12px; height: 14px; }
.hm.s0 { background: var(--panel-raised); }
.hm.s1 { background: color-mix(in srgb, var(--focus) 25%, var(--panel-raised)); }
.hm.s2 { background: color-mix(in srgb, var(--focus) 50%, var(--panel-raised)); }
.hm.s3 { background: color-mix(in srgb, var(--focus) 75%, var(--panel-raised)); }
.hm.s4 { background: var(--focus); }
.hm-legend { display: flex; align-items: center; gap: 3px; margin-top: 6px; }

/* filter sheet: search the named units, then pick one */
.unit-picked { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 600; }
.unit-picked .text-btn { margin-left: auto; font-weight: 400; }
.unit-results { list-style: none; margin: 6px 0 0; padding: 0; max-height: 40vh; overflow-y: auto; }
.unit-results li { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--border); }
.unit-results li.dim { padding: 8px 2px; border: 0; }
.unit-pick {
  flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; text-align: left;
  background: none; border: 0; color: var(--text); font: inherit; padding: 9px 2px; cursor: pointer;
}
.unit-pick:hover, .unit-pick:focus-visible { background: var(--panel-raised); }
.unit-pick .placeholder { font-style: italic; }
.unit-meta { flex-basis: 100%; font-size: 12px; color: var(--text-dim); }
.near-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.near-pick select { width: auto; padding: 6px 8px; }
#near-place, #inc-near-place { flex: 1 1 140px; min-width: 0; }
.alert-kinds { border: 0; padding: 0; margin: 6px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.alert-kinds legend { padding: 0; margin-bottom: 2px; width: 100%; }

/* ---------- navigation: the views, always one tap away ---------- */
:root { --nav-h: 58px; }
#nav { position: fixed; left: 0; right: 0; z-index: 19; background: var(--panel); display: flex; align-items: center; }
.nav-brand { font-size: 17px; margin: 0; font-weight: 600; white-space: nowrap; }
.nav-tabs { display: flex; flex: 1; }
.nav-tab { position: relative; background: none; border: 0; color: var(--text-dim); cursor: pointer; display: flex;
  align-items: center; justify-content: center; gap: 6px; }
.nav-tab[aria-current="page"] { color: var(--text); font-weight: 700; }
.nav-tab:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.nav-tab .badge-count { top: 2px; right: auto; left: calc(50% + 6px); }
/* phones: a tab bar at the bottom, in thumb reach; the current tab is underlined (not colour alone) */
@media (max-width: 719px) {
  :root { --nav-bottom: calc(var(--nav-h) + var(--safe-bottom)); }
  body { padding-bottom: var(--nav-bottom); }
  #nav { bottom: 0; height: var(--nav-bottom); padding-bottom: var(--safe-bottom); border-top: 1px solid var(--border); }
  .nav-brand { display: none; }
  #player { padding-bottom: 8px; }  /* sits on the tab bar, which already clears the system bar */
  .nav-tab { flex: 1; flex-direction: column; gap: 1px; height: var(--nav-h); font-size: 11px; }
  .nav-icon { font-size: 20px; line-height: 1; }
  .nav-tab[aria-current="page"] { box-shadow: inset 0 3px 0 var(--accent); }
  #sticky { padding-top: env(safe-area-inset-top); }
  .view-head, #solo-head, .stats-head { padding-top: calc(10px + env(safe-area-inset-top)) !important; }
}
/* wider: a slim bar at the top */
@media (min-width: 720px) {
  :root { --nav-top: 52px; }
  body { padding-top: var(--nav-top); }
  #nav { top: 0; height: var(--nav-top); padding: 0 14px; gap: 16px; border-bottom: 1px solid var(--border); }
  .nav-tabs { justify-content: flex-end; gap: 4px; }
  .nav-tab { padding: 7px 12px; border-radius: 8px; font-size: 15px; }
  .nav-tab:hover { background: var(--panel-raised); color: var(--text); }
  .nav-tab[aria-current="page"] { background: var(--panel-raised); box-shadow: inset 0 -3px 0 var(--accent); }
  .nav-tab .badge-count { top: -4px; left: auto; right: -4px; }
}

/* the full-screen views (Incidents, Units, Ask, Settings) */
.view { position: fixed; inset: var(--nav-top, 0px) 0 var(--nav-bottom, 0px); z-index: 16; overflow: auto;
  background: var(--bg); padding: 0 8px 24px; overscroll-behavior: contain; }
.view > * { max-width: 900px; margin-left: auto; margin-right: auto; }
.view-head { position: sticky; top: 0; z-index: 6; background: var(--bg); padding: 10px 6px 8px; border-bottom: 1px solid var(--border); }
.view-head .solo-top { justify-content: space-between; }
.view-head .solo-name { white-space: normal; }

/* segmented tabs inside a view: the selected one is filled and bold */
.seg { display: flex; gap: 4px; margin-top: 8px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.seg-btn { flex: 1; background: none; border: 0; border-radius: 7px; padding: 7px 6px; cursor: pointer; color: var(--text-dim);
  white-space: nowrap; font-size: 14px; }
.seg-btn[aria-selected="true"] { background: var(--panel-raised); color: var(--text); font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent); }
.seg-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.seg-n { font-size: 12px; color: var(--text-dim); font-weight: 400; }

/* calls: quick filters under the search, one line that scrolls sideways */
.quick-row { display: flex; gap: 6px; padding: 0 14px 8px; overflow-x: auto; scrollbar-width: none; }
.quick-row::-webkit-scrollbar { display: none; }
.quick-row .chip { flex: 0 0 auto; padding: 5px 11px; }
.quick-row .chip.all[aria-pressed="true"] { background: var(--text); }
.quick-row .chip.all[aria-pressed="true"] .chip-label { color: var(--bg); }
.chip.active { color: var(--text); border-color: var(--focus); background: var(--panel-raised); }
.chip.active .x { color: var(--text-dim); margin-left: 2px; }
.quick-sep { flex: 0 0 1px; background: var(--border); margin: 3px 2px; }
#filter-btn { position: relative; }
#filter-btn .badge-count { top: -6px; right: -6px; }
@media (max-width: 599px) {
  .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #search-row { padding: 8px 8px 6px; gap: 6px; }
  #search-row .toggle-btn { padding: 9px 10px; }
  .quick-row { padding: 0 8px 8px; }
  .live:not(.stale) .live-text { display: none; }
}
/* phones: what was said, under the talkgroup (the Description column doesn't fit) */
.row-sub { display: none; font-size: 12px; font-weight: 400; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 719px) { .row-sub { display: block; } }

/* units view */
.unit-stats { margin-top: 6px; font-size: 13px; }
.unit-stats details summary { cursor: pointer; list-style: none; }
.unit-stats details summary::-webkit-details-marker { display: none; }
.unit-stats details summary::after { content: " ▾ details"; color: var(--text-dim); font-size: 12px; }
.unit-stats details[open] summary::after { content: " ▴ less"; }
.unit-stats .stats { margin-top: 8px; padding: 10px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
.unit-stats .stats-lead { margin: 0; font-size: 14px; display: inline; }
.utab { padding-top: 6px; }
details.help { margin: 8px 6px 4px; }
details.help summary { cursor: pointer; color: var(--text-dim); font-size: 13px; }
details.help p { margin: 6px 0 0; }

/* incidents: one panel at a time; wide screens show the map next to the list */
.inc-panel { display: none; }
#inc-body[data-tab="now"] [data-panel="now"], #inc-body[data-tab="list"] [data-panel="list"],
#inc-body[data-tab="map"] [data-panel="map"], #inc-body[data-tab="units"] [data-panel="units"] { display: block; }
#inc-body { padding-top: 4px; }
#board-list { display: flex; flex-direction: column; gap: 0; padding: 4px 0; }
#inc-body[data-tab="map"] .incident-map { height: calc(100dvh - var(--nav-top, 0px) - var(--nav-bottom, 0px) - var(--inc-head-h, 220px) - 70px); min-height: 280px; }
.inc-bar .near-pick { flex: 1 1 220px; }
.inc-bar .near-pick select { flex: 0 0 auto; }
@media (min-width: 1100px) {
  #incidents > * { max-width: 1400px; }
  #inc-body[data-tab="list"] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
  #inc-body[data-tab="list"] [data-panel="map"] { display: block; position: sticky; top: calc(var(--inc-head-h, 220px) + 4px); }
  #inc-body[data-tab="list"] .incident-map { height: calc(100dvh - var(--nav-top, 0px) - var(--inc-head-h, 220px) - 70px); min-height: 300px; margin-top: 0; }
  #inc-body[data-tab="list"] .heat-bar { margin-top: 10px; }
  .seg-btn[data-itab="map"] { display: none; }
}
.incident-card.flash { outline: 2px solid var(--focus); outline-offset: 2px; }

/* settings */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-top: 12px; }
.card-h { font-size: 16px; margin: 0 0 6px; }
.alert-group { border: 0; border-top: 1px solid var(--border); margin: 10px 0 0; padding: 6px 0 0; }
.alert-group legend { padding: 0 6px 0 0; font-weight: 600; color: var(--text); font-size: 13px; }
.alert-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.alert-cols label { display: block; }
.alert-cols textarea, #settings textarea { width: 100%; background: var(--panel-raised); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px; font: inherit; resize: vertical; }
.save-bar { position: sticky; bottom: -12px; display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  margin: 10px -14px -12px; padding: 10px 14px; background: var(--panel); border-top: 1px solid var(--border); border-radius: 0 0 12px 12px; }
.save-bar p { margin: 0; flex: 1; }
#alert-save.dirty::after { content: " •"; }
.places-map { height: 300px; border-radius: 10px; border: 1px solid var(--border); margin-top: 10px; }
@media (min-width: 720px) {
  .inc-bar #inc-day { flex: 0 1 180px; }
  .inc-bar #inc-q { flex: 1 1 220px; }
  #inc-near-place { flex: 0 1 220px; }
  .inc-bar .near-pick { flex: 0 1 auto; }
}
.heat-bar label { display: flex; align-items: center; gap: 6px; }
.heat-bar select { width: auto; padding: 6px 8px; }

/* ---------- incident page (solo mode "inc"): map + CAD card, then the calls ---------- */
#solo.inc-mode #solo-head { position: static; }
#solo.inc-mode .solo-table th { top: 0 !important; }
#solo.inc-mode table.calls tr.day-sep th { top: var(--solo-thead-h, 28px) !important; }
#solo.inc-mode tr.call { scroll-margin-top: 40px; }
.incident-card { cursor: pointer; }
.incident-card .inc-open { padding: 6px 14px; }
.inc-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 8px 0; font-size: 13px; }
.inc-state { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.inc-state.live { color: var(--text); }
.inc-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 10px; }
@media (min-width: 900px) { .inc-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); } }
.inc-page-map { height: 260px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); z-index: 0; }
@media (min-width: 900px) { .inc-page-map { height: auto; min-height: 320px; } }
.inc-nomap { display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px; height: auto; min-height: 80px; }
.inc-pin-main { border-color: var(--accent); font-size: 20px; }
.inc-pin-other { opacity: .8; font-size: 13px; }
.cad { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.cad-fields { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 0 0 8px; font-size: 14px; }
.cad-fields dt { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
.cad-fields dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.cad-grid-wrap { overflow-x: auto; margin: 6px 0; }
.cad-grid { border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; width: 100%; }
.cad-grid th, .cad-grid td { padding: 3px 5px; border-bottom: 1px solid var(--border); text-align: center; white-space: nowrap; }
.cad-grid thead th { color: var(--text-dim); font-weight: 600; letter-spacing: .04em; font-size: 11px; }
.cad-grid tbody th { text-align: left; font-weight: 600; }
.cad-grid td.cad-cur { background: var(--panel-raised); font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent); }
.cad-t { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline dotted; font: inherit; }
.cad-t:focus-visible { outline: 2px solid var(--focus); }
.cad-narr summary { cursor: pointer; font-size: 12px; color: var(--text-dim); }
.cad-narr p { font-size: 13px; color: var(--text-dim); margin: 6px 0 0; }
.inc-others { margin-top: 10px; }
.inc-others h3 { font-size: 13px; margin: 0 0 4px; color: var(--text-dim); font-weight: 600; }
.inc-others ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.inc-others .text-btn { text-align: left; font-size: 13px; padding: 4px 0; text-decoration: none; color: var(--text); }
#solo-head a.toggle-btn { text-decoration: none; color: inherit; }

/* The public copy (app/public.py, body.public): nothing that edits or is the owner's */
body.public .owner-only, body.public .call-star-btn, body.public .c-star, body.public #detail-star,
body.public #detail-note, body.public #detail-save-note, body.public .star-note, body.public .note-mark,
body.public .log-undo, body.public .log-requeue { display: none !important; }
.public-note { margin: 0; padding: 4px 16px; font-size: 12px; text-align: center; color: var(--text-dim);
  border-bottom: 1px solid var(--border); background: var(--bg); }
body:not(.public) .public-only { display: none !important; }
.public-note a { color: inherit; }

/* Alerts (public copy): account, plans, areas, devices, webhooks */
.acct-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.acct-row .text-input { flex: 1 1 220px; min-width: 0; }
.acct-banner { margin-top: 12px; font-size: 14px; }
.acct-banner.ok { border-color: var(--g-hospital); }
.acct-banner.warn { border-color: var(--accent); }
.plan-badge { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--panel-raised);
  border: 1px solid var(--accent); vertical-align: middle; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 6px 0; }
.plan { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: var(--panel-raised);
  display: flex; flex-direction: column; gap: 4px; }
.plan.current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.plan h4 { margin: 0; font-size: 15px; }
.plan .price { font-size: 20px; font-weight: 700; }
.plan .price small { font-size: 12px; font-weight: 400; color: var(--text-dim); }
.plan ul { margin: 2px 0 6px; padding-left: 18px; font-size: 13px; flex: 1; }
.plan button { width: 100%; padding: 9px 10px; }
.acct-list { list-style: none; padding: 0; margin: 6px 0; display: flex; flex-direction: column; gap: 6px; }
.acct-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--panel-raised); font-size: 14px; }
.acct-list li .grow { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.acct-list.options li { cursor: pointer; }
.acct-list.options li:hover, .acct-list.options li:focus-visible { border-color: var(--accent); outline: none; }
.rule-form { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 4px; display: flex; flex-direction: column; gap: 2px; }
.rule-form .text-input { width: 100%; }
.rule-form .acct-row .text-input { width: auto; }
#rule-miles { width: 80px; }
.secret-box { margin: 8px 0; padding: 10px; border: 1px dashed var(--accent); border-radius: 8px; font-size: 13px; }
.secret-box code { display: block; margin: 6px 0; padding: 6px 8px; background: var(--bg); border-radius: 6px; overflow-wrap: anywhere; user-select: all; }
.legal-links { margin: 16px 2px; }
.legal-links a { color: var(--text-dim); }
