/* ResponseWire — night console UI. Dark first, phone first. */

@font-face { font-family: 'Geist'; font-weight: 100 900; font-style: normal; font-display: swap; src: url(/fonts/Geist-Variable.woff2) format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-weight: 100 900; font-style: normal; font-display: swap; src: url(/fonts/GeistMono-Variable.woff2) format('woff2'); }

/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #0a0c10;
  --bg-2: #0d1016;
  --surface: #10131a;
  --raised: #161a22;
  --raised-2: #1d222c;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #e9edf3;
  --text-2: #c4cbd6;
  --muted: #8b93a1;
  --brand: #ff5a36;
  --brand-ink: #ffffff;
  --live: #ffb020;
  --live-soft: rgba(255, 176, 32, 0.12);
  --ok: #3dd68c;
  --ok-soft: rgba(61, 214, 140, 0.12);
  --danger: #ff6b5e;
  --danger-soft: rgba(255, 107, 94, 0.12);
  --link: #8cc2ff;
  --focus: #8cc2ff;
  --cat-fire: #ff6a3d;
  --cat-ems: #4ea1ff;
  --cat-mva: #e7b84a;
  --cat-rescue: #3dd68c;
  --cat-hazmat: #c58af9;
  --cat-police: #8a97ff;
  --cat-other: #8fa3b8;
  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.02) inset;
  --shadow-float: 0 24px 60px -24px rgba(0, 0, 0, 0.85);
  --overlay: rgba(4, 6, 9, 0.66);
  --glass: rgba(16, 19, 25, 0.86);

  --font-body: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-display: var(--font-body);
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --top-h: 64px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

/* Day */
:root[data-theme='light'] {
  --bg: #f4f5f7; --bg-2: #eceef2; --surface: #ffffff; --raised: #f1f3f6; --raised-2: #e7eaef;
  --line: rgba(14, 18, 26, 0.09); --line-strong: rgba(14, 18, 26, 0.17);
  --text: #0e1116; --text-2: #394150; --muted: #5d6573; --brand: #dc3d1c; --brand-ink: #ffffff;
  --live: #9a5700; --live-soft: rgba(214, 138, 0, 0.13); --ok: #0f7a45; --ok-soft: rgba(15, 122, 69, 0.1);
  --danger: #b42318; --danger-soft: rgba(180, 35, 24, 0.09); --link: #1553b6; --focus: #1553b6;
  --cat-fire: #d4451a; --cat-ems: #1c6fd1; --cat-mva: #946800; --cat-rescue: #16804a; --cat-hazmat: #8436c0; --cat-police: #4052c8; --cat-other: #5d6573;
  --shadow-1: 0 1px 2px rgba(14, 18, 26, 0.05); --shadow-float: 0 24px 50px -24px rgba(14, 18, 26, 0.35);
  --overlay: rgba(14, 18, 26, 0.35); --glass: rgba(255, 255, 255, 0.9);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #f4f5f7; --bg-2: #eceef2; --surface: #ffffff; --raised: #f1f3f6; --raised-2: #e7eaef;
    --line: rgba(14, 18, 26, 0.09); --line-strong: rgba(14, 18, 26, 0.17);
    --text: #0e1116; --text-2: #394150; --muted: #5d6573; --brand: #dc3d1c; --brand-ink: #ffffff;
    --live: #9a5700; --live-soft: rgba(214, 138, 0, 0.13); --ok: #0f7a45; --ok-soft: rgba(15, 122, 69, 0.1);
    --danger: #b42318; --danger-soft: rgba(180, 35, 24, 0.09); --link: #1553b6; --focus: #1553b6;
    --cat-fire: #d4451a; --cat-ems: #1c6fd1; --cat-mva: #946800; --cat-rescue: #16804a; --cat-hazmat: #8436c0; --cat-police: #4052c8; --cat-other: #5d6573;
    --shadow-1: 0 1px 2px rgba(14, 18, 26, 0.05); --shadow-float: 0 24px 50px -24px rgba(14, 18, 26, 0.35);
    --overlay: rgba(14, 18, 26, 0.35); --glass: rgba(255, 255, 255, 0.9);
    color-scheme: light;
  }
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.5 var(--font-body); letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  padding-bottom: calc(var(--tab-h) + var(--safe-b));
}
a { color: var(--link); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 650; line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 0.5rem; }
h1 { font-size: 2rem; letter-spacing: -0.03em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 0.75rem; }
small, .small { font-size: 0.86rem; }
.muted { color: var(--muted); }
.mono, .num, time, .kv, .clock b { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 600 0.7rem/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.eyebrow.live { color: var(--live); }
.eyebrow.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: beacon 2s ease-out infinite; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--brand) 40%, transparent); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ------------------------------------------------------------------ top bar */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) 14px 0;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; flex: none; }
.brand-mark { width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--brand); display: grid; place-items: center; }
.brand-mark svg { width: 20px; height: 20px; }
.brand-word { font-weight: 650; font-size: 1rem; letter-spacing: -0.01em; line-height: 1.1; }
.brand-word span { display: block; font-weight: 450; font-size: 0.75rem; letter-spacing: 0; color: var(--muted); margin-top: 1px; }
.topbar .spacer { flex: 1; }
.topnav { display: none; gap: 4px; margin-left: 18px; }
.topnav a { padding: 8px 14px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.topnav a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 5%, transparent); }
.topnav a[aria-current='page'] { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); font-weight: 560; }
.live-count {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px 0 11px; border-radius: 999px;
  background: var(--live-soft); border: 1px solid color-mix(in srgb, var(--live) 30%, transparent);
  color: var(--live); font-weight: 600; font-size: 0.82rem; text-decoration: none; white-space: nowrap;
}
.live-count::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: beacon 2s ease-out infinite; }
.live-count.quiet { background: var(--raised); color: var(--muted); border-color: var(--line); }
.live-count.quiet::before { animation: none; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; flex: none; position: relative;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer;
  text-decoration: none; font: 600 0.78rem var(--font-body);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 9px; background: transparent; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.icon-btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.icon-btn.on { color: var(--live); border-color: color-mix(in srgb, var(--live) 40%, var(--line)); background: var(--live-soft); }
.icon-btn[data-armed] { width: auto; padding: 0 10px; color: var(--brand-ink); background: var(--danger); border-color: var(--danger); }
.icon-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.icon-btn[aria-pressed='false'] { color: var(--muted); }
.avatar {
  display: none; width: 36px; height: 36px; border-radius: 50%; flex: none; margin-left: 4px;
  place-items: center; text-decoration: none; font-size: 0.8rem; font-weight: 650; letter-spacing: 0.02em;
  background: color-mix(in srgb, var(--link) 18%, var(--surface)); color: var(--link);
}
.avatar[aria-current='page'] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--link); }

/* ------------------------------------------------------------------ tab bar (phone) */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 30; display: flex; justify-content: space-around;
  padding: 6px 6px calc(6px + var(--safe-b));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar:empty { display: none; }
.tab {
  position: relative; flex: 1; max-width: 110px; min-height: 50px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: 0.7rem; font-weight: 550; border-radius: 12px;
}
.tab svg { width: 22px; height: 22px; }
.tab[aria-current='page'] { color: var(--text); }
.tab[aria-current='page'] svg { color: var(--brand); }

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .topbar { padding-left: 24px; padding-right: 24px; gap: 8px; }
  .topnav { display: flex; }
  .avatar { display: grid; }
  .tabbar { display: none; }
  .brand-mark { width: 34px; height: 34px; }
}

/* ------------------------------------------------------------------ layout */
main { max-width: 780px; margin: 0 auto; padding: 22px 16px 48px; outline: none; }
main.wide { max-width: 1200px; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 960px) { .grid-2 { grid-template-columns: 1.1fr 0.9fr; align-items: start; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 18px; box-shadow: var(--shadow-1); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 28px 0 12px; }
.section-title h2 { margin: 0; }
.boot { padding: 64px 0; text-align: center; color: var(--muted); }
.page-head { margin: 6px 0 20px; }
.page-head h1 { font-size: 2rem; margin: 0; }
.page-head p { color: var(--muted); margin: 6px 0 0; }

/* ------------------------------------------------------------------ board header (feed) */
.board { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 16px; }
.board h1 { font-size: clamp(1.7rem, 6vw, 2rem); margin: 0; line-height: 1.08; font-weight: 680; letter-spacing: -0.03em; }
.board p { margin: 0; color: var(--muted); font-size: 0.86rem; }
.board-tools { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.seg { display: inline-flex; flex: none; padding: 3px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); }
.seg button, .seg label {
  display: inline-flex; align-items: center; justify-content: center; margin: 0;
  min-height: 34px; padding: 0 13px; border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); font: 500 0.84rem var(--font-body); cursor: pointer; white-space: nowrap;
}
.seg button[aria-pressed='true'], .seg label:has(input:checked) { background: var(--raised-2); color: var(--text); font-weight: 560; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset; }
.seg-radio { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
.seg-radio input { position: absolute; opacity: 0; pointer-events: none; }
.seg-radio label:has(input:focus-visible) { outline: 2px solid var(--focus); }
.searchbar { display: flex; gap: 8px; flex: 1; min-width: 0; margin: 0; }
.search { position: relative; flex: 1; min-width: 0; }
.search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input[type=search] { min-height: 40px; padding: 8px 12px 8px 36px; font-size: 16px; border-radius: 11px; background: var(--surface); }
.filter-btn { width: 40px; height: 40px; border-radius: 11px; }
.filter-btn .count { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); font: 600 0.68rem/18px var(--font-mono); text-align: center; padding: 0 5px; }
.cat-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.cchip {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--text-2);
  font: 500 0.8rem var(--font-body); cursor: pointer;
}
.cchip i { width: 7px; height: 7px; border-radius: 2px; background: var(--cat); }
.cchip .mono { color: var(--muted); font-size: 0.75rem; }
.cchip:hover { border-color: color-mix(in srgb, var(--text) 30%, transparent); }
.cchip[aria-pressed='true'] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.cchip[aria-pressed='true'] .mono { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.filter-panel { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; padding: 14px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.filter-panel label { font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.filter-panel .clear { grid-column: 1 / -1; justify-self: start; }
@media (min-width: 700px) { .filter-panel { grid-template-columns: repeat(4, 1fr); } }
.notice-line { display: flex; gap: 10px; align-items: flex-start; font-size: 0.78rem; line-height: 1.5; color: var(--muted); margin: 22px 2px 0; }
.notice-line svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }

/* ------------------------------------------------------------------ board card */
.list { display: grid; gap: 8px; }
.ticket {
  --cat: var(--cat-other);
  position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 14px; align-items: start;
  padding: 14px; color: var(--text); text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.ticket:hover { border-color: var(--line-strong); background: color-mix(in srgb, var(--raised) 60%, var(--surface)); }
.ticket:active { transform: scale(0.995); }
.ticket.fresh { border-color: color-mix(in srgb, var(--cat) 45%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cat) 9%, transparent); }
.cat-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--cat) 14%, transparent); color: var(--cat); }
.cat-ico svg { width: 21px; height: 21px; stroke-width: 2.2; }
.ticket .body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ticket .top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ticket h3 { font-size: 0.97rem; font-weight: 620; letter-spacing: -0.01em; margin: 0; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-new { flex: none; font: 600 0.62rem/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 6px; border-radius: 5px; background: var(--cat); color: #07101c; }
.ticket .where { margin: 0; color: var(--text-2); font-size: 0.9rem; line-height: 1.35; }
.ticket .town-line { margin: 0; color: var(--muted); font-size: 0.8rem; }
.ticket .town-line .mono { font-size: 0.76rem; }
.ticket .summary { margin: 4px 0 0; color: var(--text-2); font-size: 0.86rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ticket .flag.unrev { margin-top: 6px; }
.ticket .clock { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; padding-top: 2px; min-width: 34px; }
.ticket .clock b { font-size: 1.35rem; font-weight: 600; line-height: 1; color: var(--live); }
.ticket .clock span { font-size: 0.7rem; color: var(--muted); }
.ticket .clock.done b { font-size: 0.95rem; color: var(--text-2); }
.ticket.closed .cat-ico { background: var(--raised); color: var(--muted); }
.ticket.arrived { animation: arrive 2.4s ease-out 1; }
.cat-fire { --cat: var(--cat-fire); } .cat-ems { --cat: var(--cat-ems); } .cat-mva { --cat: var(--cat-mva); }
.cat-rescue { --cat: var(--cat-rescue); } .cat-hazmat { --cat: var(--cat-hazmat); } .cat-police { --cat: var(--cat-police); } .cat-other { --cat: var(--cat-other); }

.plates { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.plate {
  display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 6px;
  background: var(--raised-2); color: var(--text-2);
  font: 500 0.72rem/1 var(--font-mono); white-space: nowrap;
}
.plate.more { color: var(--muted); }
.state { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 0.74rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.state.active { color: var(--live); background: var(--live-soft); }
.state.active::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: beacon 2s ease-out infinite; }
.state.closed, .state.merged { color: var(--muted); background: var(--raised); }
.state.draft { color: var(--live); background: var(--live-soft); }
.state.rejected { color: var(--danger); background: var(--danger-soft); }
.flag { display: inline-flex; align-items: center; gap: 6px; font-size: 0.74rem; font-weight: 600; }
.flag.unrev { color: var(--live); padding: 2px 8px; border-radius: 999px; border: 1px dashed color-mix(in srgb, var(--live) 50%, transparent); align-self: flex-start; }
.flag.cat { color: var(--text-2); }
.flag.cat::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--cat); }

@keyframes beacon { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
@keyframes arrive { 0% { border-color: var(--live); box-shadow: 0 0 0 4px var(--live-soft); } 100% { border-color: var(--line); box-shadow: none; } }
@media (prefers-reduced-motion: reduce) {
  .live-count::before, .state.active::before, .eyebrow.live::before { animation: none; }
  .ticket.arrived { animation: none; }
  .ticket { transition: none; }
}

/* ------------------------------------------------------------------ incident detail */
.back { display: inline-flex; align-items: center; gap: 6px; height: 36px; color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 0.88rem; }
.back svg { width: 17px; height: 17px; }
.hero { position: relative; padding: 22px 20px 20px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); }
.hero-ico { position: absolute; top: 20px; right: 20px; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: color-mix(in srgb, var(--cat, var(--cat-other)) 14%, transparent); color: var(--cat, var(--cat-other)); }
.hero-ico svg { width: 23px; height: 23px; stroke-width: 2.2; }
.hero .flags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-right: 56px; }
.hero .flag.cat { color: var(--text); padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--cat, var(--cat-other)) 14%, transparent); }
.hero h1 { font-size: clamp(2rem, 7vw, 2.75rem); margin: 14px 0 8px; line-height: 1.02; font-weight: 690; letter-spacing: -0.035em; }
.hero .addr { font-size: 1.15rem; color: var(--text); font-weight: 550; margin: 0; }
.hero .town { color: var(--muted); margin: 2px 0 0; font-size: 0.94rem; }
.hero .note { font-size: 0.8rem; color: var(--muted); margin: 8px 0 0; }
.hero .times { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.hero .times div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 4px; padding: 11px 13px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); min-width: 0; }
.hero .times b { font: 600 1.25rem/1.05 var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero .times span { font-size: 0.74rem; color: var(--muted); }
.hero .times div.live b { color: var(--live); }
.hero .plates { margin-top: 14px; gap: 6px; }
.hero .plate { height: 26px; padding: 0 10px; font-size: 0.78rem; color: var(--text); }
@media (max-width: 420px) { .hero .times b { font-size: 1.05rem; } }
.caveat { display: flex; gap: 10px; align-items: flex-start; font-size: 0.8rem; line-height: 1.5; color: var(--muted); padding: 12px 14px; border-radius: var(--r-md); background: transparent; border: 1px dashed var(--line-strong); margin: 0; }
.caveat svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--live); }
.block h2 { font-size: 0.72rem; font-family: var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 14px; }
.dispatch-text { font-size: 1.02rem; line-height: 1.5; margin: 0; }
.heard { margin-top: 14px; padding: 12px 14px; border-radius: var(--r-md); background: var(--bg-2); border: 1px solid var(--line); }
.heard .when { font-size: 0.78rem; color: var(--muted); margin-bottom: 4px; }
.heard q { font-size: 0.96rem; color: var(--text); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 64px 1fr; padding: 0 0 18px; }
.timeline li::before { content: ''; position: absolute; left: 74px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); box-shadow: 0 0 0 3px var(--surface); }
.timeline li::after { content: ''; position: absolute; left: 77.5px; top: 20px; bottom: 2px; width: 1px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline time { font-size: 0.78rem; line-height: 1.6; color: var(--muted); text-align: right; }
.timeline .entry { padding-left: 30px; min-width: 0; font-size: 0.95rem; line-height: 1.5; color: var(--text-2); }
.timeline .entry small { display: block; font-size: 0.74rem; font-weight: 600; margin-bottom: 2px; }
.timeline .entry strong { color: var(--text); font-weight: 560; }

.map { height: 240px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.map-note { font-size: 0.8rem; color: var(--muted); margin-top: 8px; }

/* ------------------------------------------------------------------ audio player */
.player {
  display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px;
  margin-top: 10px; padding: 6px 12px 6px 6px; max-width: 460px;
  border-radius: 12px; background: var(--raised); border: 1px solid var(--line);
}
.player button {
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--text); color: var(--bg);
}
.player button svg { width: 15px; height: 15px; }
.player .track { position: relative; height: 26px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.player .rail { position: relative; width: 100%; height: 4px; border-radius: 2px; background: var(--line-strong); overflow: hidden; }
.player .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--cat, var(--brand)); border-radius: 2px; }
.player .t { font: 500 0.76rem var(--font-mono); color: var(--muted); min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.player.loading button { opacity: 0.7; }
.player.error .t { color: var(--danger); }

/* ------------------------------------------------------------------ forms */
label { display: block; font-weight: 550; font-size: 0.86rem; margin-bottom: 6px; color: var(--text); }
.field { margin-bottom: 14px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 0.82rem; margin-top: 5px; }
.field .err, .err { color: var(--danger); font-size: 0.82rem; margin-top: 5px; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=tel], input[type=datetime-local], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 13px; border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: var(--bg-2); color: var(--text);
  font: 400 16px/1.35 var(--font-body); /* 16px+ avoids iOS zoom on focus */
  -webkit-appearance: none; appearance: none; transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b93a1' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
textarea { min-height: 100px; resize: vertical; line-height: 1.45; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--text) 22%, transparent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }
input[type=range] { accent-color: var(--brand); }
.check {
  display: flex; align-items: center; gap: 11px; min-height: 46px; padding: 10px 13px; margin: 0;
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: transparent; font-weight: 500; font-size: 0.9rem; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.check:hover { border-color: color-mix(in srgb, var(--text) 25%, transparent); }
.check:has(input:checked) { border-color: color-mix(in srgb, var(--brand) 55%, transparent); background: color-mix(in srgb, var(--brand) 9%, transparent); }
.check input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; margin: 0; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
.switch {
  -webkit-appearance: none; appearance: none; flex: none; position: relative; margin: 0; cursor: pointer;
  width: 50px; height: 30px; border-radius: 999px; background: var(--raised-2); border: 1px solid var(--line-strong);
  transition: background 0.18s ease, border-color 0.18s ease;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--muted); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); transition: transform 0.18s ease, background 0.18s ease;
}
.switch:checked { background: var(--brand); border-color: var(--brand); }
.switch:checked::after { transform: translateX(20px); background: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--raised); color: var(--text);
  font: 560 0.92rem var(--font-body); cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}
.btn:hover { border-color: color-mix(in srgb, var(--text) 28%, transparent); background: var(--raised-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); background: var(--brand); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: transparent; }
.btn.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--raised); }
.btn.ghost.danger { color: var(--danger); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 0.84rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; }
.linklike { background: none; border: 0; color: var(--link); font: inherit; cursor: pointer; padding: 0; text-decoration: none; }
.linklike:hover { text-decoration: underline; }
.linklike.danger { color: var(--danger); }

.segmented { display: inline-grid; grid-auto-flow: column; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 3px; }
.segmented button { min-height: 34px; padding: 0 13px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: 500 0.86rem var(--font-body); cursor: pointer; }
.segmented button[aria-pressed='true'] { background: var(--raised-2); color: var(--text); font-weight: 560; }
.filters { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; margin-bottom: 10px; }
.filters .full { grid-column: 1 / -1; }

/* ------------------------------------------------------------------ status / notices */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); color: var(--text-2); font-size: 0.88rem; border: 1px solid var(--line); }
.notice.warn { background: var(--live-soft); border-color: color-mix(in srgb, var(--live) 30%, transparent); color: var(--text); }
.notice.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--text); }
.notice.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: var(--text); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; white-space: nowrap; background: var(--raised); color: var(--text-2); }
.pill.active, .pill.approved { background: var(--ok-soft); color: var(--ok); }
.pill.draft, .pill.pending { background: var(--live-soft); color: var(--live); }
.pill.rejected { background: var(--danger-soft); color: var(--danger); }
.pill.closed, .pill.merged { background: var(--raised); color: var(--muted); }
.pill.cat { background: color-mix(in srgb, var(--cat) 14%, transparent); color: var(--text); }
.pill.cat::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: var(--cat); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: var(--raised); color: var(--muted); font-size: 0.74rem; font-weight: 600; }
.tag.unrev { background: var(--live-soft); color: var(--live); }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); font-size: 0.9rem; }
.empty strong { display: block; color: var(--text); font-size: 1.1rem; font-weight: 620; margin-bottom: 4px; }

/* ------------------------------------------------------------------ data (review/admin) */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 7px 16px; font-size: 0.9rem; margin: 0; font-family: var(--font-body); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 4px 10px; border-radius: 8px; background: var(--raised); border: 1px solid var(--line); font-size: 0.82rem; font-weight: 550; }
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; }
.tile .label { color: var(--muted); font-size: 0.8rem; font-weight: 500; }
.tile .value { font: 600 1.55rem/1.1 var(--font-mono); margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; letter-spacing: -0.01em; }
.tile .sub { color: var(--muted); font-size: 0.78rem; margin-top: 4px; }
.tile.bad .value { color: var(--danger); }
.tile.good .value { color: var(--ok); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; font-size: 0.74rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: var(--bg-2); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--raised) 60%, transparent); }
.subnav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 16px; scrollbar-width: none; }
.subnav a { flex: none; min-height: 34px; display: inline-flex; align-items: center; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 0.84rem; }
.subnav a:hover { color: var(--text); }
.subnav a[aria-current='page'] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.tx { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; background: var(--surface); }
.tx + .tx { margin-top: 8px; }
.tx .raw { font-size: 0.92rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
details.box { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
details.box > summary { min-height: 46px; display: flex; align-items: center; padding: 0 14px; cursor: pointer; font-weight: 560; list-style: none; }
details.box > summary::-webkit-details-marker { display: none; }
details.box > .inner { padding: 0 14px 14px; }

/* ------------------------------------------------------------------ dialogs, toast */
dialog { border: 1px solid var(--line-strong); border-radius: var(--r-xl); padding: 0; background: var(--surface); color: var(--text); width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-float); }
dialog::backdrop { background: var(--overlay); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog .inner { padding: 22px; }
dialog h2 { font-size: 1.2rem; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); z-index: 60;
  transform: translateX(-50%) translateY(16px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px; font-weight: 560; font-size: 0.88rem;
  transition: opacity 0.2s ease, transform 0.2s ease; max-width: calc(100vw - 32px); box-shadow: var(--shadow-float);
}
@media (min-width: 900px) { .toast { bottom: 24px; } }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); color: #fff; }

/* ------------------------------------------------------------------ auth */
.auth { max-width: 420px; margin: 20px auto 24px; }
.auth-head { margin: 18px 0 22px; }
.auth-head .brand-mark { width: 48px; height: 48px; border-radius: 14px; margin-bottom: 20px; }
.auth-head .brand-mark svg { width: 28px; height: 28px; }
.auth-head h1 { font-size: 2rem; margin: 0; font-weight: 680; }
.auth-head p { color: var(--muted); margin: 6px 0 0; }
.auth .card { padding: 22px; }
.auth .fine { margin-top: 18px; font-size: 0.8rem; color: var(--muted); line-height: 1.5; }
.auth .links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; font-weight: 500; font-size: 0.9rem; }
.load-more { margin-top: 12px; }

/* ------------------------------------------------------------------ read-along transcript */
.words { font-size: 0.96rem; color: var(--text); line-height: 1.6; }
.words .w { border-radius: 4px; padding: 1px 1px; cursor: pointer; transition: background 0.12s ease, color 0.12s ease; }
.words.playing .w { color: var(--muted); }
.words.playing .w.past { color: var(--text-2); }
.words .w.on { color: var(--bg); background: var(--live); }
.words .w.redacted { font-style: italic; color: var(--muted); cursor: default; }
@media (prefers-reduced-motion: reduce) { .words .w { transition: none; } }

.glass {
  background: var(--glass) !important;
  -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px);
  border: 1px solid var(--line-strong) !important;
}

/* ------------------------------------------------------------------ board: map + list */
main.board-page { max-width: none; padding: 0; }
.command { position: relative; }
.cmd-mapwrap { position: sticky; top: calc(var(--top-h) + var(--safe-t)); z-index: 0; height: 44vh; min-height: 280px; }
.cmd-map { position: absolute; inset: 0; background: var(--bg-2); }
.cmd-panel {
  position: relative; z-index: 1; margin-top: -24px;
  padding: 10px 14px 40px; border-radius: 24px 24px 0 0;
  background: var(--bg); box-shadow: 0 -20px 40px -20px rgba(0, 0, 0, 0.6);
  border-top: 1px solid var(--line-strong);
  min-height: 60vh;
}
.grip { width: 38px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto 14px; }
.map-tone { position: absolute; z-index: 500; left: 12px; right: 12px; top: 12px; }
.map-tone:empty { display: none; }
.map-legend { display: none; }
@media (max-width: 520px) { .board-tools { flex-wrap: wrap; } .board-tools .seg { width: 100%; } .board-tools .seg button { flex: 1; } }
@media (min-width: 1100px) {
  .command { display: grid; grid-template-columns: 468px 1fr; }
  .cmd-mapwrap { order: 2; height: calc(100vh - var(--top-h) - var(--safe-t)); }
  .cmd-panel {
    order: 1; margin: 0; border-radius: 0; box-shadow: none; border-top: 0; border-right: 1px solid var(--line);
    padding: 24px 16px 32px; min-height: calc(100vh - var(--top-h));
  }
  .cmd-panel .board, .cmd-panel .board-tools, .cmd-panel .cat-chips, .cmd-panel .filter-panel { margin-left: 8px; margin-right: 8px; }
  .cmd-panel .notice-line { margin-left: 10px; margin-right: 10px; }
  .grip { display: none; }
  .map-tone { right: auto; left: 20px; top: 20px; width: 360px; }
  .map-legend {
    position: absolute; z-index: 500; left: 20px; bottom: 26px; display: flex; gap: 14px; padding: 9px 14px; border-radius: 12px;
    background: var(--glass); border: 1px solid var(--line-strong); font-size: 0.75rem; color: var(--text-2);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  .map-legend span { display: inline-flex; align-items: center; gap: 6px; }
  .map-legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--cat); }
}

/* Leaflet, restyled to match. */
.leaflet-container { background: var(--bg-2); font-family: var(--font-body); }
.leaflet-control-attribution { background: color-mix(in srgb, var(--bg) 70%, transparent) !important; color: var(--muted) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--text-2) !important; }
.leaflet-bar { border: 1px solid var(--line-strong) !important; border-radius: 12px !important; overflow: hidden; box-shadow: none !important; }
.leaflet-bar a {
  background: var(--glass) !important; color: var(--text) !important;
  border-color: var(--line) !important; width: 38px !important; height: 38px !important; line-height: 38px !important;
}
.cmd-map .leaflet-top.leaflet-right { top: 12px; right: 8px; }
@media (min-width: 1100px) { .cmd-map .leaflet-top.leaflet-right { top: 20px; right: 16px; } }

/* Map pins: category colour, live calls pulse. Approximate locations are open rings. */
.pin { position: relative; display: block; width: 40px; height: 40px; }
.pin i {
  position: absolute; inset: 12px; border-radius: 50%; background: var(--cat, var(--cat-other)); border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cat, var(--cat-other)) 50%, transparent), 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease;
}
.pin.approx i { inset: 9px; background: color-mix(in srgb, var(--cat, var(--cat-other)) 22%, transparent); border: 2px dashed var(--cat, var(--cat-other)); box-shadow: none; }
.pin.live::before { content: ''; position: absolute; inset: 12px; border-radius: 50%; background: var(--cat, var(--cat-other)); animation: ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite; }
.pin.focus i { transform: scale(1.3); border-color: var(--text); box-shadow: 0 0 0 6px color-mix(in srgb, var(--cat, var(--cat-other)) 25%, transparent); }
@keyframes ping { 0% { transform: scale(1); opacity: 0.55; } 100% { transform: scale(2.6); opacity: 0; } }

/* New dispatch card, floating over the map */
.tone {
  --cat: var(--brand);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 13px 14px 13px 16px; border-radius: var(--r-lg); text-decoration: none; color: var(--text);
  background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid color-mix(in srgb, var(--cat) 40%, transparent); box-shadow: var(--shadow-float);
}
.tone-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--cat); color: var(--cat); animation: beacon 1.6s ease-out infinite; }
.tone-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tone-text small { color: var(--cat); font: 600 0.66rem/1.4 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; }
.tone-text strong { font-size: 0.97rem; font-weight: 620; }
.tone-text span { color: var(--text-2); font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tone-open { padding: 7px 12px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 0.8rem; font-weight: 600; }

.ticket.flash { animation: arrive 1.6s ease-out 1; }

/* Loading placeholders */
.ticket.sk { pointer-events: none; min-height: 96px; }
.ticket.sk .clock { display: none; }
.ticket.sk::before { content: ''; width: 42px; height: 42px; border-radius: 12px; background: var(--raised); }
.ticket.sk .body i {
  display: block; height: 11px; border-radius: 6px; margin: 6px 0;
  background: linear-gradient(90deg, var(--raised), var(--raised-2), var(--raised)); background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.ticket.sk .body i:nth-child(1) { width: 60%; height: 15px; }
.ticket.sk .body i:nth-child(2) { width: 80%; }
.ticket.sk .body i:nth-child(3) { width: 40%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ------------------------------------------------------------------ incident page */
main.detail-page { padding-top: 0; max-width: 820px; }
.detail { position: relative; }
.detail-main { position: relative; min-width: 0; }
.detail-top { position: absolute; z-index: 3; top: 12px; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.detail-top > * { pointer-events: auto; }
.detail-top .back { margin: 0; padding: 0 12px 0 8px; border-radius: 999px; height: 38px; color: var(--text); }
.detail-map {
  position: relative; height: 300px; margin: 0 -16px; overflow: hidden; background: var(--bg-2);
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent);
  mask-image: linear-gradient(to bottom, #000 60%, transparent);
}
.detail-map .nomap { position: absolute; inset: 0; background: radial-gradient(500px 200px at 50% 30%, color-mix(in srgb, var(--cat, var(--brand)) 16%, transparent), transparent 70%); }
.hero.over { margin-top: -72px; z-index: 2; view-transition-name: incident; }
/* No location heard: a banner in the call type's colour with the dispatch audio up front. */
.radio-banner {
  position: relative; overflow: hidden; margin: 0 -16px; min-height: 260px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 18px; padding: 64px 20px 92px;
  background: color-mix(in srgb, var(--cat, var(--brand)) 11%, var(--bg));
  border-bottom: 1px solid color-mix(in srgb, var(--cat, var(--brand)) 25%, transparent);
}
.radio-banner::after {
  content: ''; position: absolute; right: -60px; top: 50%; width: 320px; height: 320px; translate: 0 -50%; border-radius: 50%; pointer-events: none;
  border: 2px solid color-mix(in srgb, var(--cat, var(--brand)) 14%, transparent);
  box-shadow: 0 0 0 40px color-mix(in srgb, var(--cat, var(--brand)) 4%, transparent), 0 0 0 80px color-mix(in srgb, var(--cat, var(--brand)) 3%, transparent);
}
.rb-ico { position: relative; z-index: 1; width: 64px; height: 64px; flex: none; border-radius: 18px; display: grid; place-items: center; background: color-mix(in srgb, var(--cat, var(--brand)) 20%, transparent); color: var(--cat, var(--brand)); }
.rb-ico svg { width: 32px; height: 32px; stroke-width: 2.2; }
.rb-text { position: relative; z-index: 1; flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 8px; }
.rb-text .eyebrow { color: var(--cat, var(--brand)); }
.rb-timer { display: flex; align-items: baseline; gap: 8px; }
.rb-timer b { font: 600 2rem/1 var(--font-mono); color: var(--live); letter-spacing: -0.02em; }
.rb-timer.done b { color: var(--text); }
.rb-timer span { font-size: 0.86rem; color: var(--muted); }
.rb-play {
  position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px 0 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--cat, var(--brand)); color: var(--bg); font: 620 0.98rem var(--font-body);
  box-shadow: 0 12px 30px -12px color-mix(in srgb, var(--cat, var(--brand)) 80%, transparent);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.rb-play:hover { filter: brightness(1.08); }
.rb-play:active { transform: scale(0.98); }
.rb-play svg { width: 18px; height: 18px; }
.rb-play.playing { background: var(--text); box-shadow: none; }
@media (max-width: 560px) { .rb-play { width: 100%; } }
@media (min-width: 900px) { .radio-banner { margin: 0; border-radius: 0 0 var(--r-xl) var(--r-xl); border: 1px solid color-mix(in srgb, var(--cat, var(--brand)) 22%, transparent); border-top: 0; padding-left: 28px; padding-right: 28px; } }
.detail-side { margin-top: 14px; }
@media (min-width: 900px) {
  .detail-map { margin: 0; border-radius: 0 0 var(--r-xl) var(--r-xl); height: 340px; }
}
@media (min-width: 1100px) {
  main.detail-page { max-width: 1360px; padding: 0 24px 40px; }
  .detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 28px; align-items: start; }
  .detail-side { position: sticky; top: calc(var(--top-h) + 16px); margin-top: 16px; height: calc(100vh - var(--top-h) - 32px); }
  .detail-side .chat { height: 100%; display: flex; flex-direction: column; }
  .detail-side .chat-log { flex: 1; max-height: none; min-height: 0; }
}

/* Tone-out: the initial dispatch, with a live waveform and read-along text */
.toneout { position: relative; padding: 18px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); }
.toneout-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.toneout-head h2 { margin: 0; font: 600 0.72rem var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--cat, var(--muted)); }
.toneout-head span { font: 500 0.8rem var(--font-mono); color: var(--muted); }
.toneout .note { font-size: 0.78rem; color: var(--muted); margin: 8px 0 0; }
.player.scope {
  position: relative; display: grid; grid-template-columns: 52px 1fr; grid-template-rows: 56px auto; gap: 8px 14px;
  max-width: none; border-radius: 14px; padding: 12px 14px 12px 12px; margin: 0 0 14px;
  background: var(--bg-2); border: 1px solid var(--line);
}
.player.scope canvas { grid-column: 2; grid-row: 1; width: 100%; height: 56px; display: block; }
.player.scope button { grid-column: 1; grid-row: 1 / span 2; width: 52px; height: 52px; align-self: center; }
.player.scope button svg { width: 20px; height: 20px; }
.player.scope .track { grid-column: 2; grid-row: 2; height: 14px; }
.player.scope .t { position: absolute; right: 14px; top: 10px; font-size: 0.74rem; color: var(--muted); }
.heard-text { font-size: 0.96rem; line-height: 1.65; margin-bottom: 4px; color: var(--text-2); }
.heard-text .words { font-size: inherit; }
.heard-text q { color: var(--text); }
.toneout .dispatch-text { color: var(--text-2); font-size: 0.96rem; border-top: 1px solid var(--line); padding-top: 12px; }
.clean-dispatch { font: 500 1.12rem/1.45 var(--font-body); color: var(--text); margin: 0 0 6px; }
.ai-note { margin: 0 0 14px !important; }
.heard-label { font-size: 0.74rem; color: var(--muted); font-weight: 550; margin: 2px 0 6px; }

/* Page transition: ticket morphs into the incident header */
::view-transition-old(incident), ::view-transition-new(incident) { animation-duration: 0.3s; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.2s; }
@media (prefers-reduced-motion: reduce) {
  .pin.live::before, .tone-dot, .ticket.sk .body i { animation: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* Night map: invert OpenStreetMap tiles into a dark, low-saturation basemap. */
.leaflet-tile { filter: saturate(0.4) contrast(0.95); }
.map-night .leaflet-tile { filter: invert(1) hue-rotate(180deg) brightness(0.78) contrast(0.92) saturate(0.25); }
.leaflet-tile-container img.leaflet-tile { width: 256.6px !important; height: 256.6px !important; }

/* Admin: auto-close times */
.close-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 14px; margin-bottom: 6px; }
.close-times .field { margin-bottom: 8px; display: flex; flex-direction: column; gap: 4px; }
.close-times .with-unit { display: flex; align-items: center; gap: 8px; }
.close-times input { width: 90px; }

/* Initial dispatch as a readout */
.dispatch-card { margin: 0 0 8px; }
.dc-sentence { font: 450 1.2rem/1.5 var(--font-body); color: var(--text-2); margin: 0; max-width: 62ch; text-wrap: pretty; letter-spacing: -0.01em; }
.dc-sentence strong { color: var(--text); font-weight: 620; }
.dc-sentence .u { color: var(--cat, var(--brand)); font-weight: 600; white-space: nowrap; font-family: var(--font-mono); font-size: 0.92em; }
.dc-sentence em { font-style: normal; color: var(--text); font-weight: 560; }
.dc-cross {
  display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin: 12px 0 0; padding: 9px 12px;
  border-radius: 10px; font-size: 0.94rem; color: var(--text); background: var(--bg-2); border: 1px solid var(--line);
}
.dc-cross span { font: 600 0.68rem var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* Updates timeline, keyed to the call's category */
.updates { border-radius: var(--r-xl); }
.updates .timeline li::before { background: var(--cat, var(--line-strong)); }
.updates .timeline li.k-also::before { background: var(--link); }
.updates .timeline li.k-correction::before { background: var(--live); }
.updates .timeline li.k-closure::before { background: var(--ok); }
.updates .timeline .entry small { color: color-mix(in srgb, var(--cat, var(--muted)) 80%, var(--text)); }
.updates .timeline li.k-also .entry small { color: var(--link); }
.updates .timeline li.k-correction .entry small { color: var(--live); }
.updates .timeline li.k-closure .entry small { color: var(--ok); }

/* ------------------------------------------------------------------ maintenance mode */
.maint-strip {
  display: flex; align-items: center; gap: 10px; padding: 8px 16px; font-size: 0.88rem;
  background: var(--live-soft); color: var(--text); border-bottom: 1px solid color-mix(in srgb, var(--live) 30%, transparent);
}
.maint-strip[hidden] { display: none; }
.maint-strip svg { width: 18px; height: 18px; color: var(--live); flex: none; }
.maint-strip span { flex: 1; }
.maint-strip a { font-weight: 600; }
body[data-page='maintenance'] .topbar, body[data-page='maintenance'] .tabbar, body[data-page='maintenance'] .maint-strip { display: none; }

.maint {
  position: fixed; inset: 0; z-index: 40; overflow: auto; display: grid; place-items: center;
  padding: calc(var(--safe-t) + 32px) 16px calc(var(--safe-b) + 32px);
  background:
    radial-gradient(ellipse 70% 55% at 50% 38%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%),
    radial-gradient(ellipse 120% 80% at 50% 110%, color-mix(in srgb, var(--cat-ems) 10%, transparent), transparent 60%),
    var(--bg);
}
.maint-bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.maint-grid {
  position: absolute; inset: -2px;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 16%, transparent) 1px, transparent 1.5px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 55% at 50% 40%, #000 20%, transparent 75%);
}
.maint-sweep {
  position: absolute; left: 50%; top: 38%; width: 180vmax; height: 180vmax; translate: -50% -50%;
  background: conic-gradient(from 0deg, transparent 0 300deg, color-mix(in srgb, var(--brand) 18%, transparent) 350deg, transparent 360deg);
  -webkit-mask-image: radial-gradient(circle, #000 0, transparent 38%);
  mask-image: radial-gradient(circle, #000 0, transparent 38%);
  animation: maint-spin 7s linear infinite;
}
.maint-core { position: relative; width: min(560px, 100%); text-align: center; }
.maint-core > * { animation: maint-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.maint-core > :nth-child(2) { animation-delay: 0.08s; }
.maint-core > :nth-child(3) { animation-delay: 0.16s; }
.maint-core > :nth-child(4) { animation-delay: 0.24s; }
.maint-core > :nth-child(n + 5) { animation-delay: 0.32s; }

.maint-beacon { position: relative; width: 150px; height: 150px; margin: 0 auto 26px; display: grid; place-items: center; }
.maint-beacon .brand-mark {
  position: relative; z-index: 1; width: 72px; height: 72px; border-radius: 20px;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 18%, transparent), 0 18px 50px -10px color-mix(in srgb, var(--brand) 70%, transparent);
  animation: maint-breathe 3s ease-in-out infinite;
}
.maint-beacon .brand-mark svg { width: 42px; height: 42px; }
.maint-beacon .ring {
  position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--brand) 75%, transparent);
  animation: maint-ping 3s cubic-bezier(0.1, 0.6, 0.3, 1) infinite; opacity: 0;
}
.maint-beacon .ring:nth-child(2) { animation-delay: 1s; }
.maint-beacon .ring:nth-child(3) { animation-delay: 2s; }

.maint-status {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 5px 12px; border-radius: 999px;
  font: 700 0.74rem var(--font-body); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--live); background: var(--live-soft); border: 1px solid color-mix(in srgb, var(--live) 30%, transparent);
}
.maint-status .blip { width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: maint-blink 1.6s ease-in-out infinite; }
.maint h1 { font-family: var(--font-display); font-size: clamp(2.1rem, 7vw, 3.4rem); line-height: 1.02; margin: 4px 0 12px; letter-spacing: -0.01em; }
.maint-msg { color: var(--text-2); font-size: 1.08rem; line-height: 1.55; margin: 0 auto 22px; max-width: 460px; white-space: pre-line; }
.maint-count { display: grid; grid-template-columns: repeat(4, minmax(0, 76px)); justify-content: center; gap: 8px; margin: 0 auto 8px; }
.maint-count div { padding: 10px 4px 8px; border-radius: var(--r-md); background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--line); }
.maint-count b { display: block; font: 700 1.9rem/1 var(--font-display); }
.maint-count span { display: block; margin-top: 4px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.maint-until { color: var(--muted); font-size: 0.9rem; margin: 0 0 20px; }
.maint-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.maint-fine { color: var(--muted); font-size: 0.86rem; margin: 6px 0 0; }
.maint-preview {
  position: fixed; top: calc(var(--safe-t) + 12px); left: 50%; translate: -50% 0; z-index: 2; width: min(620px, calc(100% - 32px));
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-1); font-size: 0.9rem; text-align: left;
}
.maint-preview span { flex: 1; }

@keyframes maint-ping { 0% { transform: scale(0.9); opacity: 0.75; } 100% { transform: scale(2.1); opacity: 0; } }
@keyframes maint-breathe { 50% { transform: scale(1.04); } }
@keyframes maint-spin { to { rotate: 360deg; } }
@keyframes maint-blink { 50% { opacity: 0.25; } }
@keyframes maint-rise { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) {
  .maint-sweep, .maint-beacon .ring, .maint-beacon .brand-mark, .maint-status .blip, .maint-core > * { animation: none; }
  .maint-beacon .ring { opacity: 0.3; }
  .maint-beacon .ring:nth-child(2) { transform: scale(1.45); opacity: 0.18; }
  .maint-beacon .ring:nth-child(3) { transform: scale(1.9); opacity: 0.08; }
}

.maint-switch { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.maint-switch .grow { flex: 1; min-width: 220px; }
.maint-switch h2 { margin: 0; }
.maint-switch-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--raised); color: var(--muted); flex: none; }
.maint-switch-icon svg { width: 24px; height: 24px; }
.maint-switch.on { border-color: color-mix(in srgb, var(--live) 45%, var(--line)); background: color-mix(in srgb, var(--live) 7%, var(--surface)); }
.maint-switch.on .maint-switch-icon { background: var(--live-soft); color: var(--live); }

/* ------------------------------------------------------------------ what's new */
.icon-btn.news { position: relative; }
.icon-btn.news .dot { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px var(--bg); }
.releases { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; display: grid; gap: 14px; }
.releases::before { content: ''; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: var(--line); }
.release { position: relative; }
.release-dot { position: absolute; left: -21px; top: 20px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.release.unseen .release-dot { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 20%, transparent); }
.release .card { margin: 0; }
.release-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.release-head .spacer { flex: 1; }
.release h2 { margin: 10px 0 6px; font-size: 1.25rem; }
.release .ver { font: 700 0.82rem var(--font-body); padding: 3px 9px; border-radius: 7px; background: var(--raised); border: 1px solid var(--line); }
.rtag { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.rtag.new { background: var(--ok-soft); color: var(--ok); }
.rtag.improved { background: color-mix(in srgb, var(--cat-ems) 15%, transparent); color: var(--cat-ems); }
.rtag.fixed { background: var(--live-soft); color: var(--live); }
.md { color: var(--text-2); line-height: 1.55; }
.md p { margin: 0 0 8px; }
.md ul { margin: 0 0 8px; padding-left: 20px; }
.md li { margin: 3px 0; }
.md h3 { margin: 12px 0 6px; font-size: 1rem; color: var(--text); }
.md strong { color: var(--text); }
.whats-new-row { text-decoration: none; color: var(--text); }
.whats-new-row svg { width: 20px; height: 20px; color: var(--brand); }

/* ------------------------------------------------------------------ admin: users */
.pill.ea { background: color-mix(in srgb, var(--cat-hazmat) 15%, transparent); color: var(--cat-hazmat); }
.user-filters { margin-bottom: 10px; }
.user-filters .chip { cursor: pointer; color: var(--text-2); font: 600 0.88rem var(--font-body); min-height: 36px; padding: 0 12px; }
.user-filters .chip[aria-pressed='true'] { background: color-mix(in srgb, var(--brand) 14%, var(--raised)); border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); color: var(--text); }
.user-dlg { width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.user-dlg .section-title h3 { margin: 0; font-size: 1rem; }
.activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.activity li { display: flex; justify-content: space-between; gap: 12px; font-size: 0.92rem; padding: 6px 0; border-bottom: 1px solid var(--line); }
.activity li:last-child { border-bottom: 0; }

/* ------------------------------------------------------------------ admin: transcription test */
.trial-steps { margin: 6px 0 0; padding-left: 20px; color: var(--text-2); line-height: 1.5; }
.trial-steps li { margin: 4px 0; }
.trial-progress { height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; margin-bottom: 10px; }
.trial-progress span { display: block; height: 100%; background: var(--brand); transition: width 0.4s ease; }
.trial-board td.best { color: var(--ok); font-weight: 700; }
.trial-clip.done { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.trial-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 12px; margin-top: 12px; align-items: start; }
.trial-form .grow2 { grid-column: span 2; }
.trial-form .actions { grid-column: 1 / -1; }
.trial-form .field { margin-bottom: 10px; }
.trial-form label:not(.inline-check) { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 5px; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--text-2); cursor: pointer; }
.inline-check input { width: 18px; height: 18px; accent-color: var(--brand); }
.trial-results { margin-top: 12px; }
.ok-mark { color: var(--ok); font-weight: 700; }
.bad-mark { color: var(--danger); font-weight: 700; }
.held-mark { color: var(--live); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; }
@media (max-width: 560px) { .trial-form .grow2 { grid-column: auto; } }


/* ------------------------------------------------------------------ new-call sound */
.sound-card { display: flex; flex-direction: column; gap: 18px; }
.sound-head { display: flex; align-items: center; gap: 12px; }
.sound-head .grow { flex: 1; min-width: 0; }
.sound-head h2 { margin: 0; font-size: 1rem; }
.sound-head p { margin: 2px 0 0; font-size: 0.8rem; color: var(--muted); }
.sound-ico { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.sound-ico svg { width: 20px; height: 20px; }
.sound-card legend, .sound-card label.eyebrow { margin-bottom: 10px; }
.tone-list { display: grid; gap: 6px; }
@media (min-width: 600px) { .tone-list { grid-template-columns: 1fr 1fr; } }
.tone-opt {
  display: flex; align-items: center; gap: 12px; margin: 0; padding: 8px 8px 8px 12px; border-radius: 14px;
  border: 1px solid var(--line-strong); cursor: pointer; font-size: 0.9rem; font-weight: 500;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.tone-opt span { flex: 1; }
.tone-opt input { width: 17px; height: 17px; margin: 0; accent-color: var(--brand); }
.tone-opt:has(input:checked) { border-color: color-mix(in srgb, var(--brand) 55%, transparent); background: color-mix(in srgb, var(--brand) 8%, transparent); font-weight: 560; }
.play-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--raised); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.play-btn svg { width: 12px; height: 12px; }
.play-btn:hover { background: var(--raised-2); }
.vol-row { display: flex; align-items: center; gap: 10px; }
.vol-row svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.vol-row input { flex: 1; min-height: 32px; }
.vol-row .mono { width: 40px; text-align: right; font-size: 0.8rem; color: var(--text-2); }
.sound-card.off fieldset, .sound-card.off .vol-row { opacity: 0.45; }

/* Alerts page: towns and types read as toggle chips */
.check-grid .check { min-height: 40px; border-radius: 999px; padding: 6px 14px; font-size: 0.86rem; }
.check-grid .check input { width: 16px; height: 16px; }

/* ------------------------------------------------------------------ incident chat */
.chat { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 16px 0; }
.chat-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.chat-count { font-size: 0.74rem; padding: 2px 7px; border-radius: 6px; background: var(--raised-2); color: var(--text-2); font-weight: 500; }
.chat-tools { display: flex; gap: 6px; }
.chat-rules { margin: 8px 16px 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 0.78rem; line-height: 1.5; color: var(--muted); }
.chat-log { max-height: 460px; min-height: 160px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 2px; padding: 10px; }
.chat-log > :first-child { margin-top: auto; }
.chat-empty { padding: 28px 8px; text-align: center; }
.msg { position: relative; display: flex; gap: 10px; padding: 9px 10px; border-radius: 12px; }
.msg:hover { background: color-mix(in srgb, var(--raised) 70%, transparent); }
.msg.mine { background: var(--raised); }
.msg.r-admin:not(.removed) { background: color-mix(in srgb, var(--brand) 7%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 22%, transparent); }
.av { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 0.72rem; font-weight: 650; letter-spacing: 0.02em; }
.av-0 { background: color-mix(in srgb, var(--cat-ems) 18%, var(--surface)); color: var(--cat-ems); }
.av-1 { background: color-mix(in srgb, var(--cat-hazmat) 18%, var(--surface)); color: var(--cat-hazmat); }
.av-2 { background: color-mix(in srgb, var(--cat-rescue) 18%, var(--surface)); color: var(--cat-rescue); }
.av-3 { background: color-mix(in srgb, var(--cat-mva) 18%, var(--surface)); color: var(--cat-mva); }
.av-4 { background: color-mix(in srgb, var(--cat-police) 18%, var(--surface)); color: var(--cat-police); }
.av-5 { background: color-mix(in srgb, var(--cat-fire) 18%, var(--surface)); color: var(--cat-fire); }
.av-admin { background: var(--brand); color: var(--brand-ink); }
.msg.removed .av { background: var(--raised); color: var(--muted); }
.msg-body { flex: 1; min-width: 0; }
.msg-meta { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 0.84rem; }
.msg-meta strong { color: var(--text); font-weight: 600; }
.msg.removed .msg-meta strong { color: var(--muted); }
.msg-meta time { color: var(--muted); font-size: 0.7rem; }
.msg-actions { position: absolute; top: 6px; right: 8px; display: flex; gap: 12px; padding: 3px 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: 0.76rem; opacity: 0; transition: opacity 0.12s ease; }
@media (hover: none) { .msg-actions { position: static; margin-left: auto; padding: 0; border: 0; background: none; } }
.msg-actions .linklike { color: var(--muted); }
.msg-actions .linklike.danger { color: var(--danger); }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { opacity: 1; }
@media (hover: none) { .msg-actions { opacity: 1; } }
.msg p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; font-size: 0.9rem; color: var(--text-2); }
.msg.removed p.gone { color: var(--muted); font-style: italic; font-size: 0.84rem; }
.msg details { margin-top: 4px; color: var(--muted); }
.chat-role { font-size: 0.66rem; font-weight: 650; padding: 1px 7px; border-radius: 999px; background: var(--raised-2); color: var(--text-2); }
.chat-role.r-responder { background: color-mix(in srgb, var(--cat-ems) 15%, transparent); color: var(--cat-ems); }
.chat-role.r-reviewer { background: var(--ok-soft); color: var(--ok); }
.chat-role.r-admin { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); }
.chat-form { padding: 12px 14px 14px; border-top: 1px solid var(--line); margin: 0; }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 5px 5px 5px 13px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line-strong); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.composer:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }
.composer textarea { flex: 1; min-height: 38px; max-height: 160px; padding: 8px 0; border: 0; background: transparent; resize: none; box-shadow: none; border-radius: 0; }
.composer textarea:focus { box-shadow: none; background: transparent; }
.send { width: 38px; height: 38px; flex: none; border-radius: 10px; border: 0; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; cursor: pointer; }
.send svg { width: 17px; height: 17px; stroke-width: 2.4; }
.send[disabled] { opacity: 0.5; }
.composer-hint { display: flex; justify-content: space-between; gap: 10px; margin-top: 7px; font-size: 0.72rem; color: var(--muted); }
@media (hover: none) { .composer-hint span:first-child { visibility: hidden; } }
.chat-note { margin: 0; padding: 12px 16px 16px; border-top: 1px solid var(--line); font-size: 0.84rem; }
.chat-cell { max-width: 420px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Small phones: keep the header on one line. */
@media (max-width: 440px) {
  .topbar { gap: 6px; padding-left: 12px; padding-right: 12px; }
  .brand-word span { display: none; }
  .live-count { padding: 0 10px; font-size: 0.78rem; }
  .icon-btn { width: 36px; height: 36px; }
  .topbar .icon-btn.news { display: none; }
}

/* ------------------------------------------------------------------ major incidents */
.ticket.major {
  border-color: color-mix(in srgb, var(--danger) 55%, transparent);
  background: color-mix(in srgb, var(--danger) 6%, var(--surface));
  animation: major-glow 2.4s ease-in-out infinite;
}
@keyframes major-glow {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 10%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--danger) 18%, transparent); }
}
.badge-major {
  flex: none; font: 650 0.62rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 7px; border-radius: 5px; background: var(--danger); color: #fff; white-space: nowrap;
}
.pin.major i { inset: 8px; box-shadow: 0 0 0 3px var(--danger), 0 0 18px 4px color-mix(in srgb, var(--danger) 60%, transparent); }
.pin.major::before { inset: 6px; background: var(--danger); }
.major-strip {
  display: flex; align-items: center; gap: 12px; margin: -4px 56px 14px 0; padding: 10px 12px; border-radius: 12px;
  background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
}
.major-strip > svg { width: 20px; height: 20px; flex: none; color: var(--danger); }
.major-strip div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.major-strip strong { font: 650 0.82rem var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--danger); }
.major-strip span { font-size: 0.78rem; color: var(--muted); }
.major-add {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; cursor: pointer;
  border: 1px dashed color-mix(in srgb, var(--danger) 45%, transparent); background: transparent; color: var(--danger); font: 600 0.72rem var(--font-body);
}
.major-add svg { width: 12px; height: 12px; }
@media (prefers-reduced-motion: reduce) { .ticket.major { animation: none; } }

/* Street suggestions under the Location box (review forms). */
.suggest { position: relative; }
.suggest-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-float); max-height: 300px; overflow-y: auto; }
.suggest-list li { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.suggest-list li[aria-selected="true"], .suggest-list li:hover { background: var(--raised, var(--bg-2)); }
.suggest-list .town { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }

/* Alerts: towns grouped by county, each with a select-all box. */
.county-group { border: 0; padding: 0; margin: 14px 0 0; }
.county-group legend { padding: 0; margin-bottom: 8px; }
.county-check { gap: 8px; align-items: center; }
.county-check .muted { margin-left: 2px; }

/* Post an update (people with All Updates, reviewers, admins). */
.post-update { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.post-update textarea { width: 100%; margin-top: 6px; min-height: 64px; }
