:root {
  --blue: #3C50E0; --blue-600: #2E3FC4; --blue-50: #EEF0FD; --blue-100: #DADFFA; --navy: #07167B; --teal: #0B4C7C;
  --ink: #313231; --body: #484848; --muted: #6B6B6B; --line: #DFDFE1; --line2: #C9C9CC; --bg: #F7F7F8; --white: #fff;
  --surface: #fff; --topbar: #07167B; --accent-ink: #07167B; --live: #07167B; --mapbg: #E9EAEE; --label: rgba(255,255,255,.92); --shadow: rgba(15,20,40,.18);
  --alert: #C8322B; --alert-50: #FBECEB; --ok: #1F7A4D; --ok-50: #E6F4EC; --warn: #8A5A00; --warn-50: #FFF4DB;
  --display: 'Manrope', system-ui, sans-serif; --sans: 'Inter', system-ui, sans-serif; --r: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: var(--sans); color: var(--ink); background: var(--bg); font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }
h1, h2, h3 { font-family: var(--display); color: var(--ink); margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.err { color: var(--alert); min-height: 1em; margin: 4px 0; }
:focus-visible { outline: 3px solid rgba(60, 80, 224, .45); outline-offset: 1px; }

/* buttons and fields */
.btn { height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line2); background: var(--surface); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-600); }
.btn.danger { background: var(--alert); border-color: var(--alert); color: #fff; }
.btn.ghost { border-color: transparent; background: none; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.wide { width: 100%; height: 44px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.fld { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.fld > span:not(.ss), .fld > .lbl { font-size: 12px; font-weight: 600; color: var(--body); }
.fld .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
input[type=text], input[type=password], input[type=number], input[type=email], input[type=date], input[type=month], input[type=search], input[type=tel], input[type=time], input[type=datetime-local], input:not([type]), select, textarea {
  height: 38px; border: 1px solid var(--line2); border-radius: 8px; padding: 0 10px; background: var(--surface); width: 100%; }
textarea { height: auto; min-height: 90px; padding: 8px 10px; resize: vertical; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; background: var(--blue-50);
  color: var(--accent-ink); font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.chip.off { background: var(--surface); border-color: var(--line2); color: var(--muted); }
.chip.red { background: var(--alert-50); color: var(--alert); }
.chip.green { background: var(--ok-50); color: var(--ok); }
.chip.amber { background: var(--warn-50); color: var(--warn); }
.chip.delivery { height: auto; min-height: 26px; padding-top: 4px; padding-bottom: 4px; white-space: normal; overflow-wrap: anywhere; }
.chip button { border: none; background: none; cursor: pointer; padding: 0; color: inherit; }
button.chip { cursor: pointer; }

/* login */
body.login { display: flex; align-items: center; justify-content: center; background: linear-gradient(115deg, #3C50E0 0%, #07167B 100%); }
.loginbox { width: min(400px, calc(100% - 32px)); background: var(--surface); border-radius: 16px; padding: 32px; box-shadow: 0 20px 60px rgba(7, 22, 123, .35); }
.loginbox h1 { font-size: 26px; margin: 18px 0 4px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 18px; color: var(--accent-ink); }
.mark { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(115deg, #3C50E0, #07167B); display: inline-block; }

/* shell */
.shell { display: flex; flex-direction: column; height: 100vh; }
.topbar { height: 56px; background: var(--topbar); color: #fff; display: flex; align-items: center; gap: 16px; padding: 0 16px; flex: none; }
.topbar .brand { color: #fff; }
.topbar .mark { background: var(--surface); opacity: .9; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav button { height: 36px; padding: 0 14px; border-radius: 8px; border: none; background: none; color: rgba(255,255,255,.75); font-weight: 600; cursor: pointer; }
.topbar nav button.on, .topbar nav button:hover { background: rgba(255,255,255,.12); color: #fff; }
.topbar .grow { flex: 1; }
.topbar select { width: auto; max-width: 260px; height: 34px; background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
.topbar select option { color: var(--ink); }
.topbar .who { font-size: 13px; color: rgba(255,255,255,.85); }
.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.conn i { width: 9px; height: 9px; border-radius: 50%; background: #5BD18B; display: inline-block; }
.conn.off i { background: #FF8A80; }
.main { flex: 1; min-height: 0; display: flex; }

/* dispatch */
.dispatch { flex: 1; display: grid; grid-template-columns: 300px minmax(0, 1fr) 380px; min-height: 0; }
.col { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface); }
.col:last-child { border-right: none; border-left: 1px solid var(--line); }
.colhead { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.colhead h2 { font-size: 15px; }
.scroll { overflow-y: auto; flex: 1; min-height: 0; }
.gtile { border-bottom: 1px solid var(--line); padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.gtile:hover { background: var(--bg); }
.gtile.target { background: var(--blue-50); box-shadow: inset 4px 0 0 var(--blue); }
.gtile.unmon { opacity: .55; }
.gtile .top { display: flex; align-items: center; gap: 8px; }
.gnum { width: 28px; height: 28px; border-radius: 7px; background: var(--bg); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.gtile.target .gnum { background: var(--blue); border-color: var(--blue); color: #fff; }
.gname { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.talkstrip { background: var(--navy); color: #fff; border-radius: 8px; padding: 6px 10px; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.talkstrip.me { background: var(--blue); }
.lvl { flex: 1; height: 6px; background: rgba(255,255,255,.25); border-radius: 3px; overflow: hidden; }
.lvl b { display: block; height: 100%; background: var(--surface); transition: width .1s; }
.lastline { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.iconbtn { width: 30px; height: 30px; border-radius: 7px; border: 1px solid transparent; background: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--body); flex: none; }
.iconbtn:hover { background: var(--bg); border-color: var(--line); }
.iconbtn.on { color: var(--blue); }
.center { display: flex; flex-direction: column; min-height: 0; }
#map { flex: 1; min-height: 0; background: var(--mapbg); }
.pttbar { flex: none; display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--line); }
.pttbtn { height: 64px; min-width: 260px; border-radius: 14px; border: 2px solid var(--blue); background: var(--surface); color: var(--accent-ink); font-family: var(--display);
  font-size: 18px; font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; user-select: none; touch-action: none; }
.pttbtn.talking { background: var(--blue); color: #fff; }
.pttbtn:disabled { border-color: var(--line2); color: var(--muted); cursor: not-allowed; }
.pttinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: 1 0 auto; padding: 0 10px; font-size: 13px; height: 44px; border: none; background: none; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tabs button.on { color: var(--accent-ink); border-bottom-color: var(--blue); }
.count { min-width: 20px; height: 20px; border-radius: 10px; background: var(--line); color: var(--ink); font-size: 11px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.count.red { background: var(--alert); color: #fff; }
.acard { margin: 10px; border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.acard.open { border: 2px solid var(--alert); background: var(--alert-50); }
.acard.escalated { animation: pulse 1s infinite alternate; }
@keyframes pulse { from { box-shadow: 0 0 0 0 rgba(200, 50, 43, .0); } to { box-shadow: 0 0 0 6px rgba(200, 50, 43, .25); } }
.acard .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acard h3 { font-size: 16px; }
.urow { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.urow:hover { background: var(--bg); }
.urow .grow { flex: 1; min-width: 0; }
.urow .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #5BBF7A; flex: none; }
.dot.off { background: var(--line2); }
.dot.alarm { background: var(--alert); }
.dot.talk { background: var(--blue); }
.msgs { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.bubble { max-width: 85%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; align-self: flex-start; }
.bubble.me { align-self: flex-end; background: var(--blue-50); border-color: var(--blue-100); }
.bubble .from { font-size: 11px; color: var(--muted); }
.composer { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.callbar { background: var(--teal); color: #fff; padding: 8px 16px; display: flex; align-items: center; gap: 12px; }
.listenbar { background: var(--alert); color: #fff; padding: 8px 16px; display: flex; align-items: center; gap: 12px; font-weight: 600; }
.marker { width: 30px; height: 30px; border-radius: 50%; background: var(--blue); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35);
  color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.marker.off { background: #7B7B7B; }
.marker.alarm { background: var(--alert); animation: pulse 1s infinite alternate; }
.mlabel { background: var(--label); border-radius: 6px; padding: 2px 6px; font-size: 11px; font-weight: 600; white-space: nowrap; border: 1px solid var(--line); }

/* pages (history, admin) */
.page { flex: 1; display: flex; min-height: 0; }
.side { width: 230px; flex: none; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; padding: 8px 0 24px; }
.side h4 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 16px 16px 6px; font-weight: 700; }
.side button { display: block; width: 100%; text-align: left; border: none; background: none; padding: 8px 16px; cursor: pointer; color: var(--body); font-weight: 500; }
.side button:hover { background: var(--bg); }
.side button.on { background: var(--blue-50); color: var(--accent-ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--blue); }
.content { flex: 1; overflow-y: auto; padding: 24px 28px 60px; min-width: 0; }
.content h1 { font-size: 22px; margin-bottom: 4px; }
.headrow { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters .fld { margin: 0; }
.filters input, .filters select { width: auto; min-width: 140px; }
table.t { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
table.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; background: var(--bg); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: none; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--blue-50); }
table.t td.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 28px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line2); border-radius: var(--r); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 18px; }
.panel h2 { font-size: 16px; margin-bottom: 12px; }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.formgrid .full { grid-column: 1 / -1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: var(--surface); box-shadow: -10px 0 40px rgba(0,0,0,.15); z-index: 1000;
  display: flex; flex-direction: column; }
.drawer .dh { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.drawer .db { flex: 1; overflow-y: auto; padding: 20px; }
.drawer .df { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.scrim { position: fixed; inset: 0; background: rgba(7, 22, 123, .25); z-index: 999; }
.matrix { width: 100%; border-collapse: collapse; font-size: 12px; }
.matrix th, .matrix td { border-bottom: 1px solid var(--line); padding: 6px; text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; font-weight: 600; }
.multi { border: 1px solid var(--line2); border-radius: 8px; max-height: 180px; overflow-y: auto; padding: 6px 10px; background: var(--surface); }
.multi label { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; z-index: 2000; max-width: 90vw; }
.toast.err { background: var(--alert); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.kpi b { display: block; font-family: var(--display); font-size: 24px; color: var(--accent-ink); }
.note { background: var(--blue-50); border-radius: 10px; padding: 10px 14px; color: var(--accent-ink); margin-bottom: 14px; }
.note.warn { background: var(--warn-50); color: var(--warn); }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 22px; letter-spacing: .2em; font-weight: 700; color: var(--accent-ink); }
pre.invite { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-family: var(--sans); }
#histmap, .pickmap { background: var(--mapbg); }
#histmap { height: 420px; border-radius: var(--r); border: 1px solid var(--line); margin-top: 12px; }
@media (max-width: 1100px) { .dispatch { grid-template-columns: 240px minmax(0, 1fr) 320px; } }
@media (max-width: 860px) {
  /* one column on tablets: every row takes its own height so the PTT bar is never drawn under the Operations column */
  .dispatch { grid-template-columns: 1fr; grid-auto-rows: max-content; overflow-y: auto; }
  .center { min-height: auto; }
  .col { max-height: 50vh; } #map { min-height: 320px; }
  .pttbar { flex-wrap: wrap; } .pttbtn { min-width: 0; flex: 1 1 220px; }
  .page { flex-direction: column; } .side { width: 100%; max-height: 180px; }
  .formgrid { grid-template-columns: 1fr; } .topbar { flex-wrap: wrap; height: auto; padding: 8px; }
}

/* in-page dialogs (browser prompt/confirm boxes are not used) */
.modal { position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; padding: 16px; }
.modal .mbox { background: var(--surface); border-radius: 14px; box-shadow: 0 20px 60px rgba(7,22,123,.25); width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal .mbox h2 { font-size: 18px; }
.modal .mb { display: flex; flex-direction: column; gap: 10px; }
.modal .mf { display: flex; justify-content: flex-end; gap: 8px; }
.modal-scrim { position: fixed; inset: 0; z-index: 1499; background: rgba(7,22,123,.28); }
.qr { display: block; margin: 0 auto; width: 200px; height: 200px; image-rendering: pixelated; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 15px; letter-spacing: .08em; word-break: break-all; background: var(--bg); padding: 8px 10px; border-radius: 8px; }
/* broadcast */
.bcastbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--navy); color: #fff; font-weight: 600; }
.bcastbtn { height: 64px; border-radius: 14px; border: 2px solid var(--navy); background: var(--surface); color: var(--accent-ink); font-family: var(--display); font-weight: 700; padding: 0 18px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; touch-action: none; user-select: none; }
.bcastbtn.talking { background: var(--navy); color: #fff; }
.bcastbtn:disabled { opacity: .5; cursor: default; }
/* alerts */
.acard.alert { border-left: 4px solid var(--warn); }
.acard.alert.acked { opacity: .65; border-left-color: var(--line2); }
.zone-label { background: var(--label); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 11px; font-weight: 600; color: var(--accent-ink); box-shadow: none; }
/* pictures in messages */
.bubble img.pic { display: block; max-width: 220px; max-height: 220px; border-radius: 8px; margin-top: 6px; cursor: zoom-in; }
.composer .attach { flex: none; }
.urow .pick { flex: none; }
.ubar { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--bg); }
.pickmap { height: 260px; border-radius: 10px; border: 1px solid var(--line); }
.bars-h { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding: 6px 0; }
.bars-h div { flex: 1; background: var(--blue); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.bars-h div span { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); }
.ctlunread { font-size: 13px; margin-bottom: 8px; color: var(--ink, inherit); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--blue, #3C50E0); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.ugroup { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 12px; background: var(--bg); border: 0; border-bottom: 1px solid var(--line); font: 700 12px var(--sans, inherit); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); text-align: left; }
.ugroup .cnt { display: inline-flex; min-width: 22px; height: 18px; padding: 0 6px; border-radius: 9px; align-items: center; justify-content: center; background: var(--line); color: var(--ink); font-size: 11px; letter-spacing: 0; }
.ugroup.alarm { background: var(--alert, #C8322B); color: #fff; }
.ugroup.alarm .cnt { background: rgba(255,255,255,.25); color: #fff; }
button.ugroup.off { cursor: pointer; }
button.ugroup.off:hover { color: var(--ink); }
.urow.inalarm { background: color-mix(in srgb, var(--alert, #C8322B) 8%, transparent); }
.urow { flex-wrap: wrap; row-gap: 6px; }
.urow .grow { min-width: 120px; flex: 1; }
.urow .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
button.ugroup.grp { cursor: pointer; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink); }
button.ugroup.grp:hover { background: color-mix(in srgb, var(--blue, #3C50E0) 6%, var(--bg)); }
button.ugroup.grp.off { color: var(--muted); }
.ubar input[type=search] { flex: 1; min-width: 0; height: 30px; }
.iconbtn.kebab { font-size: 20px; line-height: 1; font-weight: 700; }
.umenu { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 4px 40px; }
.umenu .mh { flex-basis: 100%; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.umenu button { height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 13px var(--sans, inherit); cursor: pointer; }
.umenu button:hover { border-color: var(--blue, #3C50E0); }
.umenu button.cur { background: var(--blue, #3C50E0); border-color: var(--blue, #3C50E0); color: #fff; }
.umenu select { flex-basis: 100%; height: 32px; }
.topbar nav button { display: inline-flex; align-items: center; gap: 6px; }
.navcount { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--alert, #C8322B); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.navcount[hidden] { display: none; }
#navpanel { position: fixed; top: 60px; width: 440px; max-width: calc(100vw - 16px); max-height: calc(100vh - 80px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(15, 20, 40, .22); z-index: 1000; overflow: hidden; }
#navpanel .aphead { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); }
#navpanel .aphead h2 { margin: 0; font-size: 16px; }
#navpanel .apbody { overflow: auto; }
#navpanel .apbody.messages { display: flex; flex-direction: column; min-height: 420px; }
#navpanel .apbody.messages .msgs { flex: 1; min-height: 240px; max-height: 52vh; overflow: auto; }
.umenu .uinfo { flex-basis: 100%; font-size: 13px; color: var(--ink); }
.umenu .uinfo .lowbat { color: var(--alert, #C8322B); font-weight: 700; }
.brand .logo { height: 26px; width: auto; display: block; }
.brandlogo { display: flex; justify-content: center; margin-bottom: 8px; }
.brandlogo img { height: 110px; width: auto; }
.trackchip { display: flex; align-items: center; gap: 8px; background: var(--surface); color: var(--ink); border-radius: 8px; padding: 6px 6px 6px 12px; box-shadow: 0 2px 8px rgba(0,0,0,.18); font-size: 13px; }
.trackchip button { width: 26px; height: 26px; border: 0; border-radius: 6px; background: var(--bg); color: var(--ink); font-size: 16px; cursor: pointer; }
.gattrib { background: rgba(255,255,255,.85); color: #202124; font: 11px/1.4 var(--sans, system-ui); padding: 2px 6px; border-radius: 4px 0 0 0; max-width: 60vw; }
.gattrib b { font-weight: 700; }

/* searchable dropdowns (searchselect.js): the real <select> stays in the form, hidden */
.ss { position: relative; display: block; width: 100%; min-width: 0; }
.ss > select.ss-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.ss-btn { display: flex; align-items: center; gap: 8px; width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 8px; background: var(--surface); cursor: pointer; text-align: left; }
.ss-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.ss-btn:disabled { opacity: .55; cursor: not-allowed; }
.ss-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-caret { flex: none; width: 12px; height: 12px; color: var(--muted); }
.ss-pop { position: fixed; z-index: 3000; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 10px 30px rgba(20, 24, 40, .18); overflow: hidden; color: var(--ink); }
.ss-pop .ss-search { flex: none; height: 36px; margin: 6px; width: calc(100% - 12px); border: 1px solid var(--line2); border-radius: 7px; padding: 0 10px; }
.ss-list { list-style: none; margin: 0; padding: 0 4px 6px; overflow-y: auto; min-height: 0; }
.ss-list li { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-list li.on { background: var(--blue-50); }
.ss-list li[aria-selected="true"] { font-weight: 700; color: var(--accent-ink); }
.ss-list li[aria-disabled="true"] { color: var(--muted); cursor: default; }
.ss-list li.ss-grp { cursor: default; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.ss-list li.ss-none { cursor: default; color: var(--muted); }
.ss-filter { height: 34px !important; margin-bottom: 6px; }
.topbar .ss { width: auto; max-width: 260px; }
.topbar .ss-btn { height: 34px; background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
.topbar .ss-caret { color: rgba(255,255,255,.8); }
.filters .ss { width: auto; min-width: 160px; }
.umenu .ss { flex-basis: 100%; }
.umenu .ss-btn { height: 32px; }
.ss[hidden] { display: none; }

/* ===== dispatch redesign (0.11.0) ===== */
/* top bar: account menu */
.userwrap { position: relative; }
.whobtn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 4px; border-radius: 18px; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.08); color: #fff; cursor: pointer; font-weight: 600; font-size: 13px; }
.whobtn:hover, .whobtn[aria-expanded="true"] { background: rgba(255,255,255,.16); }
.whobtn .av { width: 28px; height: 28px; border-radius: 50%; background: #fff; color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; }
.whobtn .wn { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 1200; width: 240px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(15,20,40,.22); padding: 6px; }
.usermenu[hidden] { display: none; }
.usermenu .um-h { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.usermenu .um-h span { font-size: 12px; color: var(--muted); }
.usermenu button { display: block; width: 100%; text-align: left; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: none; cursor: pointer; font-weight: 500; }
.usermenu button:hover, .usermenu button:focus-visible { background: var(--blue-50); }
.usermenu #logout { color: var(--alert); }

/* on air strip */
.onair { flex: none; display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 14px; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; font-size: 13px; }
.onair.live { background: var(--live); color: #fff; border-bottom-color: var(--live); }
.onair.live .muted { color: rgba(255,255,255,.7); }
.oatag { flex: none; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.oatag.live { background: #C8322B; color: #fff; border-color: #C8322B; }
.oa { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; border-radius: 18px; background: rgba(255,255,255,.1); }
.oa.me { background: var(--blue); }
.oa b { font-weight: 700; white-space: nowrap; }
.oach { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: rgba(255,255,255,.16); white-space: nowrap; }
.oa .lvl { width: 64px; flex: none; }
.oa .t { font-variant-numeric: tabular-nums; min-width: 34px; }
.oabtn { width: 26px; height: 26px; border-radius: 13px; border: 0; background: rgba(255,255,255,.16); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.oabtn svg, .abtn svg, .gmenu svg, .gflag svg { width: 15px; height: 15px; }
.ondot { width: 8px; height: 8px; border-radius: 50%; background: #5BD18B; flex: none; animation: ondot 1s infinite alternate; }
@keyframes ondot { from { opacity: 1; } to { opacity: .35; } }

/* map, markers and the alarm banner */
.mapwrap { position: relative; flex: 1; min-height: 0; display: flex; }
.mapwrap #map { flex: 1; }
.fitbtn { width: 34px; height: 34px; border-radius: 8px; border: 2px solid rgba(0,0,0,.2); background: var(--surface); color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; background-clip: padding-box; }
.fitbtn:hover { background: var(--bg); }
.mkwrap { background: none; border: 0; }
.mk { position: absolute; left: 0; top: 0; transform: translate(-11px, -50%); display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 4px; border-radius: 12px; background: var(--surface); border: 1px solid rgba(7,22,123,.18); box-shadow: 0 2px 6px rgba(15,20,40,.25); white-space: nowrap; font: 600 12px var(--sans); color: var(--ink); cursor: pointer; }
.mk i { width: 14px; height: 14px; border-radius: 50%; background: var(--blue); border: 2px solid var(--surface); box-shadow: 0 0 0 1px rgba(7,22,123,.25); flex: none; }
.mk.off { opacity: .8; color: var(--muted); }
.mk.off i { background: #9A9AA0; }
.mk.talk { background: var(--navy); color: #fff; border-color: var(--navy); }
.mk.talk i { background: #5BD18B; animation: talkring 1.1s infinite; }
.mk.alarm { background: var(--alert); color: #fff; border-color: var(--alert); }
.mk.alarm i { background: var(--surface); animation: alarmring 1s infinite; }
@keyframes talkring { 0% { box-shadow: 0 0 0 0 rgba(91,209,139,.8); } 100% { box-shadow: 0 0 0 10px rgba(91,209,139,0); } }
@keyframes alarmring { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.9); } 100% { box-shadow: 0 0 0 12px rgba(255,255,255,0); } }
#alarmbar { position: absolute; left: 58px; right: 58px; top: 10px; z-index: 900; pointer-events: none; }
.abar { pointer-events: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px 10px 14px; border-radius: 12px; background: var(--alert); color: #fff; box-shadow: 0 10px 30px rgba(200,50,43,.35); }
.abar.acc { background: #8E2420; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.abar.esc { animation: pulse 1s infinite alternate; }
.abar-tag { flex: none; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: #fff; color: var(--alert); padding: 5px 9px; border-radius: 6px; }
.abar.acc .abar-tag { color: #8E2420; }
.abar-txt { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.abar-txt b { font-size: 16px; font-family: var(--display); }
.abar-txt span, .abar-st { font-size: 12px; }
.abar-act { display: flex; gap: 6px; flex-wrap: wrap; }
.abtn { height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.75); background: rgba(0,0,0,.16); color: #fff; font: 600 13px var(--sans); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.abtn:hover { background: rgba(0,0,0,.3); }
.abtn.pri { background: #fff; color: var(--alert); border-color: #fff; font-weight: 800; padding: 0 16px; }
.abtn.more { border-style: dashed; }
.abtn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* PTT groups: compact rows with an options menu */
.gtile { padding: 8px 10px 8px 12px; gap: 4px; }
.gtile .top { gap: 6px; }
.gtile .gnum { min-width: 26px; width: auto; padding: 0 4px; height: 26px; font-size: 12px; }
.gtile.live { box-shadow: inset 4px 0 0 #5BD18B; }
.gtile.target.live { box-shadow: inset 4px 0 0 var(--blue); }
.gcount { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 11px; font-weight: 600; color: var(--body); display: inline-flex; align-items: center; justify-content: center; }
.gflag { display: inline-flex; align-items: center; color: var(--muted); }
.gflag.txt { font-size: 11px; font-weight: 600; }
.gtile .kebab { width: 26px; height: 26px; color: var(--muted); }
.gline { display: flex; align-items: center; gap: 6px; min-height: 22px; padding-left: 32px; font-size: 12px; color: var(--muted); }
.gline.on { color: var(--accent-ink); }
.gline.on b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.gline.on .lvl { background: var(--blue-100); max-width: 70px; }
.gline.on .lvl b { background: var(--blue); }
.gline.me { color: var(--blue); font-weight: 700; }
.gline .t { font-variant-numeric: tabular-nums; }
.iconbtn.sm { width: 22px; height: 22px; }
.iconbtn.sm svg { width: 13px; height: 13px; }
.gmenu { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 2px 32px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 6px 18px rgba(15,20,40,.1); cursor: default; }
.gmenu button { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; border: 0; border-radius: 7px; background: none; text-align: left; cursor: pointer; font-size: 13px; color: var(--ink); }
.gmenu button:hover, .gmenu button:focus-visible { background: var(--blue-50); }
.gmenu button[aria-checked="true"] svg { color: var(--blue); }
.colhead .muted.small { font-size: 11px; }

/* users: talking and alarm */
.urow.talking { background: var(--blue-50); }
.dot.talk { animation: ondot .8s infinite alternate; }
.ugroup.alarm { background: var(--alert-50); color: var(--alert); border-bottom-color: var(--line); }
.ugroup.alarm .cnt { background: var(--alert); color: #fff; }
.urow.inalarm { background: var(--alert-50); box-shadow: inset 3px 0 0 var(--alert); }

/* slimmer PTT bar */
.pttbar { gap: 12px; padding: 8px 14px; }
.pttbtn { height: 52px; min-width: 220px; font-size: 17px; border-radius: 12px; }
.pttinfo { flex-direction: row; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.pttinfo b { color: var(--accent-ink); }
.keybtn { flex: none; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--body); font-size: 12px; font-weight: 600; cursor: pointer; }
.keybtn:hover { border-color: var(--line2); }
.bcastbtn { height: 40px; padding: 0 14px; border-radius: 10px; border-width: 1px; font-size: 14px; margin-left: 6px; position: relative; }
.bcastbtn::before { content: ''; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.bcastbtn svg { width: 18px; height: 18px; }
.zone-label { opacity: .92; }
@media (max-width: 860px) { #alarmbar { left: 8px; right: 8px; top: auto; bottom: 8px; } .mapwrap { min-height: 320px; } .whobtn .wn { display: none; } }


/* ===== dark theme (default for the console: dim control rooms) ===== */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0D1120; --surface: #151A2B; --line: #262D45; --line2: #363E5C;
  --ink: #E8EBF4; --body: #C3C8D8; --muted: #8C94AD;
  --blue: #5468FF; --blue-600: #4458F0; --blue-50: #1B2350; --blue-100: #283373;
  --topbar: #0A0E1B; --accent-ink: #AEB8FF; --live: #1D2A7A; --mapbg: #1A1F30; --label: rgba(21,26,43,.92); --shadow: rgba(0,0,0,.5);
  --alert: #E5484D; --alert-50: #3A1719; --ok: #46C287; --ok-50: #10301F; --warn: #E5B04A; --warn-50: #33270C;
}
:root[data-theme="dark"] .topbar { border-bottom: 1px solid var(--line); }
:root[data-theme="dark"] .whobtn .av { background: var(--blue); color: #fff; }
:root[data-theme="dark"] .mk { border-color: var(--line2); box-shadow: 0 2px 8px rgba(0,0,0,.6); }
:root[data-theme="dark"] .mk.talk { background: #2C3FD6; border-color: #2C3FD6; }
:root[data-theme="dark"] .mk.off { opacity: .75; }
:root[data-theme="dark"] .abar.acc, :root[data-theme="dark"] .gabar.acc { background: #6E1C1A; }
/* banner red darkened in dark mode so white 13 px button text passes WCAG AA (about 6:1 on #B8262C) */
:root[data-theme="dark"] .abar.open, :root[data-theme="dark"] .gabar.open { background: #B8262C; }
:root[data-theme="dark"] .bcastbtn { border-color: var(--blue); }
:root[data-theme="dark"] .bcastbtn.talking { background: #2C3FD6; border-color: #2C3FD6; }
:root[data-theme="dark"] .bcastbar { background: #1D2A7A; }
:root[data-theme="dark"] .abar-tag, :root[data-theme="dark"] .abtn.pri { color: #B3261E; }
:root[data-theme="dark"] .oatag:not(.live) { background: var(--bg); }
:root[data-theme="dark"] .toast { background: #E8EBF4; color: #0D1120; }
:root[data-theme="dark"] .modal { background: rgba(0,0,0,.6); }
:root[data-theme="dark"] .gattrib { background: rgba(21,26,43,.85); color: #C3C8D8; }
:root[data-theme="dark"] .leaflet-bar a, :root[data-theme="dark"] .leaflet-control-layers { background: var(--surface); color: var(--ink); border-color: var(--line2); }
:root[data-theme="dark"] .leaflet-bar a:hover { background: var(--blue-50); }
:root[data-theme="dark"] .leaflet-control-attribution { background: rgba(21,26,43,.8); color: var(--muted); }
:root[data-theme="dark"] .leaflet-control-attribution a { color: var(--accent-ink); }
:root[data-theme="dark"] .leaflet-popup-content-wrapper, :root[data-theme="dark"] .leaflet-popup-tip { background: var(--surface); color: var(--ink); }
:root[data-theme="dark"] .leaflet-tooltip { background: var(--surface); color: var(--ink); border-color: var(--line2); }
:root[data-theme="dark"] .zone-label { color: var(--accent-ink); }
/* street maps without a dark style (OpenStreetMap, the preview's site plan) are dimmed */
:root[data-theme="dark"] .leaflet-tile.osm, :root[data-theme="dark"] .leaflet-image-layer { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }
:root[data-theme="dark"] input[type="color"] { background: var(--surface); }
:root[data-theme="dark"] ::placeholder { color: #6E7690; }
:root[data-theme="dark"] .brandlogo img { content: url(brand/voix-logo-white.png); }
:root[data-theme="dark"] body.login { background: radial-gradient(circle at 30% 20%, #1B2566 0%, #0D1120 60%); }

/* slim alarm bar under the top bar on History and Administration (the dispatch screen has its own banner) */
.galarm { flex: none; }
.galarm[hidden] { display: none; }
.gabar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 16px; background: var(--alert); color: #fff; font-size: 13px; }
.gabar.acc { background: #8E2420; }
.gabar.esc { animation: pulse 1s infinite alternate; }
.gabar .abar-tag { padding: 3px 8px; font-size: 11px; }
.gabar.acc .abar-tag { color: #8E2420; }
.ga-txt { flex: 1; min-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.ga-txt b { font-family: var(--display); font-size: 14px; }
.ga-act { display: flex; gap: 6px; flex-wrap: wrap; }
.gabar .abtn { height: 28px; }
:root[data-theme="dark"] .gabar.acc .abar-tag { color: #6E1C1A; }
ul.problems { margin: 6px 0 0; padding-left: 20px; }
.gtile:focus-visible, table.t tr.click:focus-visible { outline: 3px solid rgba(84, 104, 255, .6); outline-offset: -3px; }
.keybtn[aria-pressed="true"] { border-color: var(--blue); color: var(--accent-ink); }
.frow { display: flex; gap: 12px; } .frow .fld { flex: 1; min-width: 0; }
:root[data-theme="dark"] .leaflet-container { background: var(--mapbg); }
