/* Brandwag UI. Light operations-console styling: restrained palette, dense
   tables, clear hierarchy. Fonts: IBM Plex Sans / IBM Plex Mono. */

:root {
  --navy: #14213d;
  --navy-2: #1f2f52;
  --navy-3: #2b3d66;
  --accent: #c2410c;
  --accent-2: #9a3412;
  --ink: #1b1f24;
  --ink-2: #3f4650;
  --muted: #6b7280;
  --line: #d9dee5;
  --line-2: #e6e9ee;
  --bg: #f3f4f6;
  --bg-2: #f8f9fb;
  --panel: #ffffff;
  --ok: #166534;
  --warn: #92400e;
  --danger: #b91c1c;
  --radius: 4px;
  --topbar-h: 56px;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h2 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin: 28px 0 10px; padding-left: 10px; border-left: 3px solid var(--accent); line-height: 1.2; }
h2:first-child { margin-top: 0; }
h2 small { text-transform: none; letter-spacing: 0; font-weight: 400; }
small, .muted { color: var(--muted); }
.warn { color: var(--warn); }
.ok { color: var(--ok); }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
ul.plain { list-style: none; padding: 0; margin: 0; }

/* Top bar */
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: stretch; gap: 32px;
  padding: 0 24px;
  background: var(--navy);
  color: #fff;
  position: sticky; top: 0; z-index: 1000;
}
.brand { display: flex; align-items: center; color: #fff; white-space: nowrap; }
.brand:hover { text-decoration: none; }
/* Wordmark: three chevrons (top one orange) beside the name in condensed capitals. Scales with font-size. */
.wordmark { display: inline-flex; align-items: center; gap: .45em; font-size: 22px; line-height: 1; }
.wordmark .wm-mark { height: 1.15em; width: auto; display: block; }
.wordmark .wm-text { font-family: "Barlow Condensed", "Arial Narrow", var(--font); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; transform: translateY(.03em); }
.mainnav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.mainnav a {
  display: flex; align-items: center;
  color: rgba(255,255,255,.72); padding: 0 12px; white-space: nowrap;
  border-bottom: 3px solid transparent; border-top: 3px solid transparent;
  font-weight: 500;
}
.mainnav a:hover { color: #fff; text-decoration: none; }
.mainnav a.active { color: #fff; border-bottom-color: var(--accent); }
.userbox { display: flex; align-items: center; gap: 14px; }
.userbox .username { color: rgba(255,255,255,.8); font-size: 13px; }
.userbox form { margin: 0; }
.topbar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.35); background: transparent; }
.topbar .btn-ghost:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.6); }

/* Layout */
.container { max-width: 1180px; margin: 0 auto; padding: 24px; }
.container.narrow { max-width: 440px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 18px; }
.page-head h1 small { font-size: 13px; font-weight: 400; margin-left: 8px; }
.flash { background: #ecfdf3; color: #166534; border-bottom: 1px solid #bbf7d0; padding: 10px 24px; font-weight: 500; }
.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }
.error ul { margin: 0; padding-left: 18px; }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; white-space: nowrap;
  background: var(--panel); color: var(--ink);
  border: 1px solid #c9d0d9; border-radius: 3px;
  padding: 7px 14px; font: inherit; font-weight: 500; line-height: 1.2;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--bg-2); border-color: #aeb7c3; text-decoration: none; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn-danger { color: var(--danger); border-color: #f1b7b7; }
.btn-danger:hover { background: #fef2f2; border-color: var(--danger); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-row form { margin: 0; }

/* Forms */
.form .field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 5px; }
.field label small { font-weight: 400; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--panel); border: 1px solid #c9d0d9; border-radius: 3px;
  padding: 7px 10px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(20,33,61,.14); }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--navy); }
input::placeholder { color: #9aa3ae; }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0; cursor: pointer; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 20px; }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.narrow-form { max-width: 640px; }
.delete-row { margin-top: 12px; display: flex; justify-content: flex-end; }

/* Responder picker (incident form) */
.picker { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); padding: 12px; margin-bottom: 14px; }
.picker-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.picker-tools select { flex: 1 1 200px; width: auto; }
.picker-tools input[type="search"] { flex: 2 1 200px; width: auto; }
.picker-list { max-height: 300px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; }
.picker-list .rp-empty { margin: 0; padding: 12px; }
.rp-group { border-bottom: 1px solid var(--line-2); }
.rp-group:last-child { border-bottom: 0; }
.rp-head, .rp-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; margin: 0; cursor: pointer; }
.rp-head { background: var(--bg-2); border-bottom: 1px solid var(--line-2); }
.rp-head .badge { margin-left: auto; }
.rp-row { padding-left: 34px; }
.rp-row:hover, .rp-head:hover { background: #eef1f5; }
.rp-row small { margin-left: 2px; }
.picker-selected { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.chip { display: inline-block; background: var(--panel); border: 1px solid var(--line); border-radius: 2px; padding: 2px 8px; font-size: 13px; }
.picker .hint { margin-top: 10px; }
ul.responders li { margin-bottom: 4px; }

/* Dialogs */
dialog.dlg { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; width: min(460px, 92vw); box-shadow: 0 20px 50px rgba(20,33,61,.25); }
dialog.dlg::backdrop { background: rgba(20,33,61,.45); }
dialog.dlg h2 { margin-bottom: 14px; }
dialog.dlg form { margin: 0; }
dialog.dlg .error { margin: 0 0 12px; }

/* Accounts and invitations */
.account-card { margin-top: 16px; }
.copy-row { display: flex; gap: 6px; }
.copy-row input { font-family: var(--mono); font-size: 12px; }
.invite-inline { font-family: var(--mono); font-size: 11px; padding: 3px 6px; margin-top: 4px; max-width: 340px; }
table.users td.actions { display: flex; gap: 4px; flex-wrap: wrap; }
table.users td.actions form { margin: 0; }
table.users tr.inactive td { color: var(--muted); }
.map-presets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.map-presets .btn.on { background: var(--navy); border-color: var(--navy); color: #fff; }
table.vehicles select { padding: 5px 8px; }
.bolo-link { font-size: 12px; }

/* Photos */
.photo-field input[type="file"] { padding: 6px; }
.photo-preview { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.photo-preview img { height: 72px; width: 96px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); }
.photos-card { margin-top: 16px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.photo { margin: 0; }
.photo img { width: 100%; height: 150px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); display: block; }
.photo figcaption { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 4px; }
.photo figcaption form { margin: 0; }
.popup-photo img { width: 100%; max-height: 160px; object-fit: cover; border-radius: 3px; margin-bottom: 6px; display: block; }
.camera-fields { margin-bottom: 14px; }
.camera-fields h2 { border-left-color: #1d4ed8; }

/* Push-to-talk radio */
.radio-btn { position: relative; }
.radio-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.35); margin-right: 7px; }
.radio-btn.on .radio-dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.25); }
.radio-btn.rx .radio-dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(194,65,12,.35); animation: radio-blink .8s infinite; }
@keyframes radio-blink { 50% { opacity: .35; } }
.radio-panel { position: fixed; right: 16px; bottom: 16px; width: min(340px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(20,33,61,.25); padding: 14px; z-index: 1100; }
.radio-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.radio-head strong { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.radio-switch { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.radio-switch input { width: 16px; height: 16px; }
.radio-status { margin: 0 0 10px; font-size: 13px; color: var(--muted); min-height: 1.4em; }
.radio-status.on { color: var(--ok); }
.radio-status.tx { color: var(--accent-2); font-weight: 500; }
.radio-status.rx { color: var(--navy); font-weight: 500; }
.radio-status.err { color: var(--danger); }
.ptt { width: 100%; padding: 18px 12px; font: inherit; font-size: 16px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: var(--navy); border: 0; border-radius: 6px; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; box-shadow: inset 0 -4px 0 rgba(0,0,0,.25); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ptt .ptt-sub { font-size: 11px; font-weight: 400; letter-spacing: .06em; opacity: .7; text-transform: none; }
.ptt:disabled { background: #c9d0d9; cursor: not-allowed; box-shadow: none; }
.ptt.talking { background: var(--accent); box-shadow: 0 0 0 4px rgba(194,65,12,.3); transform: translateY(2px); }
.ptt.locked { background: var(--accent-2); animation: ptt-pulse 1.2s infinite; }
@keyframes ptt-pulse { 50% { box-shadow: 0 0 0 8px rgba(194,65,12,.15); } }
.mobile-only { display: none; }
.radio-foot { display: flex; justify-content: space-between; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.radio-foot .btn { font-size: 12px; }

/* Full-screen radio page: the panel docks into the page and the button grows. */
.radio-main { max-width: 520px; margin: 0 auto; padding: 14px; }
.radio-page-hint { margin: 0 0 10px; font-size: 13px; }
.radio-panel.docked { position: static; width: auto; box-shadow: none; margin: 0 auto; max-width: 520px; }
.radio-panel.docked .ptt { padding: 56px 12px; font-size: 24px; }
.radio-panel.docked .radio-log { max-height: 40vh; }
@media (max-width: 360px) {
  .radio-main { padding: 6px; }
  .radio-panel.docked { padding: 8px; }
  .radio-panel.docked .ptt { padding: 40px 8px; font-size: 20px; }
  .radio-page-hint { display: none; }
}

/* Bottom navigation (phones) and standalone home-screen app */
.bottomnav { display: none; }
@supports (padding: env(safe-area-inset-top)) {
  .topbar { padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
}
.radio-log { list-style: none; margin: 12px 0 0; padding: 0; max-height: 180px; overflow-y: auto; font-size: 12px; border-top: 1px solid var(--line-2); }
.radio-log li { display: flex; align-items: center; gap: 6px; padding: 5px 0; border-bottom: 1px solid var(--line-2); }
.radio-log li strong { color: var(--navy); }
.radio-log li.mine strong { color: var(--accent-2); }
.radio-log li .btn { margin-left: auto; padding: 2px 8px; font-size: 11px; }

/* Responder directory table */
table.directory .indent { padding-left: 32px; }
table.directory tr.org-row td { background: var(--bg-2); border-top: 1px solid var(--line); }
table.directory tr.inactive td { color: var(--muted); }
table.directory td.actions a { font-weight: 500; }

/* Filters and tables */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.filters input[type="search"] { flex: 2 1 240px; }
.filters select { flex: 1 1 150px; width: auto; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-2); }
table.data th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--bg-2); white-space: nowrap; }
table.data tbody tr:hover { background: var(--bg-2); }
table.data tr:last-child td { border-bottom: 0; }
table.data td a { font-weight: 500; }
table.vehicles { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
table.vehicles input { padding: 5px 8px; }
table.vehicles td:last-child { width: 1%; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.reg { font-family: var(--mono); font-weight: 500; letter-spacing: .06em; background: #eef1f5; border: 1px solid var(--line); padding: 1px 6px; border-radius: 2px; color: var(--ink); }
.reg.big { font-size: 18px; vertical-align: middle; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 2px; text-transform: uppercase; letter-spacing: .06em; background: #f3f4f6; color: #4b5563; border: 1px solid #e5e7eb; vertical-align: middle; }
.badge-open, .badge-active { background: #fff1e6; color: #9a3412; border-color: #f5c9a8; }
.badge-closed, .badge-resolved, .badge-working { background: #ecfdf3; color: #166534; border-color: #bbf7d0; }
.badge-cancelled, .badge-missing { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.badge-damaged { background: #fffbeb; color: #92400e; border-color: #fde68a; }

.danger-zone { border-color: #f1b7b7; }
.danger-zone h2 { border-left-color: var(--danger); }

/* Detail pages */
dl { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 0; }
dt { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding-top: 3px; }
dd { margin: 0; }
.detail .card { margin-bottom: 16px; }

/* Location picker and mini maps */
.pick-map-wrap { margin: 6px 0 18px; }
.pick-map { height: 320px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); }
.pick-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pick-tools .pick-search { flex: 1 1 220px; }
.pick-coords { display: flex; gap: 10px; margin-top: 8px; }
.pick-coords label { flex: 1; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.pick-coords input { font-family: var(--mono); margin-top: 4px; }
.mini-map { height: 320px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); }

/* Map page */
body.fullmap { overflow: hidden; }
.map-main { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - var(--topbar-h)); height: calc(100dvh - var(--topbar-h)); }
.map-panel { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; padding: 18px 18px 24px; }
.map-panel section { margin-bottom: 22px; }
.map-panel h2 { margin-top: 0; }
.map-panel label { display: block; font-size: 13px; margin: 6px 0; }
.map-panel label.check { margin: 4px 0; }
.map-panel select { margin-top: 4px; }
.map-panel .count { color: var(--muted); font-size: 12px; margin-left: 6px; }
#map { position: relative; background: #e9ecef; }
.panel-toggle { display: none; position: absolute; top: 12px; left: 12px; z-index: 801; }
.map-add { display: none; position: absolute; top: 12px; right: 12px; z-index: 801; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
@media (max-width: 700px) { .map-add { display: inline-flex; } }
.nearest-list { padding-left: 20px; margin: 10px 0 0; font-size: 13px; }
.nearest-list li { margin-bottom: 8px; }
.nearest-list .dist { font-family: var(--mono); font-weight: 600; color: var(--accent-2); }
.nearest-list a { margin-right: 6px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; margin: 0 12px 6px 0; color: var(--ink-2); }
.legend-item i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; }

/* Map marker icons */
.mk { display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 600; font-size: 11px; font-family: var(--font); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.45); }
.mk svg { width: 70%; height: 70%; fill: currentColor; display: block; }
.legend-item svg { width: 14px; height: 14px; fill: #fff; padding: 2px; border-radius: 50%; box-sizing: content-box; }
.mk-hydrant, .icon-hydrant { background: #c2410c !important; }
.mk-camera, .icon-camera { background: #1d4ed8 !important; }
.mk-other { background: #64748b; }
.mk-bolo, .icon-bolo { background: #14213d !important; }
.mk-unverified { opacity: .65; border-style: dashed; }
.mk-origin { background: #fff; color: var(--ink); border-color: var(--ink); }
.mk-cluster { background: var(--navy); font-size: 13px; border: 2px solid #fff; box-shadow: 0 0 0 3px rgba(194,65,12,.85), 0 2px 6px rgba(0,0,0,.4); }
.mk-patroller, .icon-patroller { background: #15803d !important; font-size: 11px; letter-spacing: .02em; }
.mk-patroller.mk-me { box-shadow: 0 0 0 3px rgba(21,128,61,.35), 0 1px 3px rgba(0,0,0,.45); }
.mk-patroller.mk-stale { opacity: .55; }

/* Groups and message feeds */
.feed-main { max-width: 760px; }
.feed { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.msg { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; max-width: 92%; align-self: flex-start; }
.msg.mine { align-self: flex-end; background: #eef2f8; border-color: #d6dde9; }
.msg header { display: flex; align-items: baseline; gap: 8px; font-size: 12px; margin-bottom: 4px; }
.msg header strong { color: var(--navy); font-size: 13px; }
.msg header form { margin-left: auto; margin-bottom: 0; }
.msg header .btn { padding: 0 6px; min-height: 0; line-height: 1.4; }
.msg p { margin: 0; }
.msg-ref { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 3px; background: var(--bg-2); font-size: 13px; font-weight: 500; }
.msg-photos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.msg-photos img { height: 110px; width: 150px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); }
.composer { position: sticky; bottom: calc(var(--bottomnav-h, 0px) + env(safe-area-inset-bottom, 0px) + 8px); }
.composer .field { margin-bottom: 8px; }
.composer-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.composer-tools select { flex: 1 1 160px; width: auto; padding: 5px 8px; font-size: 13px; }
.composer-tools .btn-primary { margin-left: auto; }
.file-btn { cursor: pointer; }
.member-list { columns: 2; column-gap: 20px; margin-bottom: 10px; }
.member-list .check { break-inside: avoid; }
.more-list { display: flex; flex-direction: column; padding: 0; }
.more-list a { display: flex; flex-direction: column; padding: 14px 16px; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.more-list a:last-child { border-bottom: 0; }
.more-list a:hover { background: var(--bg-2); text-decoration: none; }
.radio-channel { width: auto; flex: 1 1 90px; min-width: 0; padding: 4px 8px; font-size: 13px; }
.radio-duty { margin-left: 0; }
.clip-ref { font-size: 11px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 2px; padding: 1px 6px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radio-linker { margin-top: 10px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.radio-linker-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 6px; }
.radio-linker select { margin-bottom: 8px; }
/* Licence disc scanner */
.dlg-disc { width: min(520px, 94vw); }
.disc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.disc-head h2 { margin: 0; }
.disc-view { position: relative; background: #000; border-radius: 4px; overflow: hidden; aspect-ratio: 4 / 3; }
.disc-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.disc-guide { position: absolute; left: 8%; right: 8%; top: 30%; bottom: 30%; border: 2px solid rgba(255,255,255,.8); border-radius: 4px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); pointer-events: none; }
.disc-fields { grid-template-columns: 120px 1fr; margin: 8px 0; }
.disc-raw { font-size: 11px; white-space: pre-wrap; word-break: break-all; background: var(--bg-2); padding: 6px; border-radius: 3px; max-height: 120px; overflow: auto; }
.copy-row .disc-scan { white-space: nowrap; }
table.vehicles .copy-row { gap: 4px; }
table.vehicles .copy-row .btn { padding: 4px 8px; }

/* Vehicle check page */
.scan-main { max-width: 640px; }
.scan-card { padding: 12px; }
.scan-card .disc-view { position: relative; }
.scan-start { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; }
.scan-manual { display: flex; gap: 8px; margin: 10px 0; }
.scan-manual input { font-family: var(--mono); font-size: 18px; letter-spacing: .08em; }
.scan-tools { justify-content: space-between; }
.scan-loc { margin: 0; font-size: 13px; }
.scan-result { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.verdict { border-radius: 6px; padding: 16px 18px; color: #fff; }
.verdict.red { background: #b91c1c; }
.verdict.amber { background: #b45309; }
.verdict.green { background: #15803d; }
.verdict-head { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .9; }
.verdict-reg { font-family: var(--mono); font-size: 32px; font-weight: 600; letter-spacing: .08em; line-height: 1.2; }
.verdict-why { font-size: 14px; margin-top: 4px; }
.scan-list li { margin-bottom: 8px; }
.patrol-active { border-color: #bbf7d0; background: #f0fdf4; }
.patrol-active h2 { border-left-color: var(--ok); }
tr.patrol-open td { background: #f0fdf4; }
.model-photo { width: 100%; border-radius: 4px; border: 1px solid var(--line); display: block; margin-bottom: 6px; }
.model-photo.small { width: 100%; max-width: 320px; margin-top: 8px; }
.scan-register { margin-top: 8px; }
.flag-card { border-color: #f5c9a8; }
.flag-card h2 { border-left-color: #b45309; }
.scan-map { height: 220px; }
.scan-actions { justify-content: flex-start; }

.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 12px 16px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--navy); border: 2px solid #fff; }
.timeline li.status::before { background: var(--accent); }
.timeline li.system::before { background: var(--muted); }
.timeline time { font-size: 12px; color: var(--muted); }
.timeline .who { font-weight: 600; font-size: 13px; }
.clips li { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.clips audio { height: 32px; max-width: 220px; }
.export-link { font-size: 13px; margin-left: auto; }
.leaflet-popup-content-wrapper { border-radius: 4px; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.leaflet-popup-content { margin: 10px 14px; font: 13px/1.45 var(--font); color: var(--ink); }
.leaflet-popup-content strong { font-size: 14px; }
.leaflet-container { font: inherit; }
.leaflet-bar a { color: var(--ink); }

/* Sign-in pages */
body.auth { background: var(--navy); }
body.auth .topbar { display: none; }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.auth-brand { color: #fff; margin-bottom: 26px; }
.auth-brand .wordmark { font-size: 40px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 18px; margin-bottom: 14px; }
.auth-foot { color: rgba(255,255,255,.55); font-size: 12px; margin-top: 18px; }

@media (max-width: 700px) {
  :root { --bottomnav-h: 58px; }
  body { padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px)); }
  body.fullmap { padding-bottom: 0; }
  .topbar { padding-left: 14px; padding-right: 14px; gap: 10px; }
  .wordmark { font-size: 19px; }
  .mainnav { display: none; }
  .userbox { margin-left: auto; gap: 6px; }
  .userbox .username { display: none; }
  .mobile-only { display: inline-flex; }
  .bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--panel); border-top: 1px solid var(--line); }
  .bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10px; font-weight: 500; color: var(--muted); text-decoration: none; letter-spacing: .02em; }
  .bottomnav a svg { width: 22px; height: 22px; fill: currentColor; }
  .bottomnav a.active { color: var(--accent); }
  .container { padding: 14px; }
  .card { padding: 14px; }
  .page-head h1 { font-size: 19px; }
  input, select, textarea { font-size: 16px; } /* stops iOS zooming into fields */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }
  .map-main { grid-template-columns: 1fr; grid-template-rows: 1fr auto; height: calc(100dvh - var(--topbar-h) - env(safe-area-inset-top, 0px) - var(--bottomnav-h) - env(safe-area-inset-bottom, 0px)); }
  .map-panel { grid-row: 2; border-right: 0; border-top: 1px solid var(--line); max-height: 48vh; }
  .map-panel.collapsed { display: none; }
  .panel-toggle { display: inline-flex; }
  dl { grid-template-columns: 100px 1fr; }
  .radio-panel { left: 10px; right: 10px; width: auto; bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px) + 10px); }
  .radio-panel.docked { left: auto; right: auto; bottom: auto; }
  .member-list { columns: 1; }
  .msg { max-width: 100%; }
  .ptt { padding: 24px 12px; font-size: 18px; }
  .photos { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .flash { padding: 10px 14px; }
}
@media (max-width: 700px) and (display-mode: standalone) {
  .userbox form { display: none; } /* log out lives in Settings for the home-screen app */
}
