/* GMRPC CAD portal. Dark control-room theme by default, light theme when the device asks for it. */
:root {
  color-scheme: dark;
  --bg: #0e141b; --panel: #151d26; --panel2: #1b2530; --line: #2a3644; --text: #e6edf3; --muted: #93a1b0;
  --accent: #3d7bd9; --accent-text: #fff; --good: #3d9a50; --warn: #d9a400; --bad: #e5484d;
  --g1: #e5484d; --g2: #e5a000; --g3: #3d7bd9; --g4: #8a97a6;
  --shadow: 0 10px 40px rgba(0, 0, 0, .5);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #eef2f6; --panel: #ffffff; --panel2: #f4f7fa; --line: #d5dde6; --text: #16202a; --muted: #5b6875;
    --accent: #2563c9; --shadow: 0 10px 40px rgba(20, 30, 40, .18);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); }
/* The page fills the window: header on top, the board or admin pages take the rest, whatever is on them. */
#app { height: 100%; display: flex; flex-direction: column; }
#app > * { flex: none; }
#app > .board, #app > .admin-wrap, #app > .center { flex: 1 1 auto; min-height: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--bad); margin: 6px 0; }
.empty { color: var(--muted); padding: 14px; text-align: center; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* buttons and pills */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 14px;
  border-radius: 8px; border: 1px solid transparent; background: var(--accent); color: var(--accent-text);
  font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: .5; cursor: default; filter: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--panel2); }
.btn.small { min-height: 28px; padding: 3px 10px; font-size: 13px; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.ghost.danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.btn.discord { background: #5865f2; color: #fff; padding: 10px 22px; font-size: 15px; }
button.icon { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 6px; }
button.icon:hover { background: var(--panel2); color: var(--text); }
button.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: color-mix(in srgb, var(--s, var(--muted)) 22%, transparent); border: 1px solid var(--s, var(--line)); }
.pill.ok { --s: var(--good); }
.pill.bad { --s: var(--bad); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 6px; font-size: 12px;
  background: var(--panel2); border: 1px solid var(--line); font-family: var(--mono); white-space: nowrap; }
.chip.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); font-family: var(--font); }
.chip.big { font-size: 13px; padding: 3px 8px; }
.chip .x { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 2px; font-size: 15px; line-height: 1; }
.chip .x:hover { color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.badge { background: var(--accent); color: #fff; font-weight: 800; letter-spacing: .5px; padding: 2px 7px; border-radius: 5px; font-size: 13px; }
.callsign { font-family: var(--mono); font-weight: 700; padding: 2px 8px; border-radius: 6px; border-left: 4px solid var(--c, var(--accent));
  background: var(--panel2); white-space: nowrap; }

/* login */
.center { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.login { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 32px; max-width: 420px; width: 100%; text-align: center; box-shadow: var(--shadow); }
.brand-big { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.brand-big .badge { font-size: 22px; }
.splash { padding: 40px; text-align: center; color: var(--muted); }

/* header */
.top { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; }
.tabs { display: flex; gap: 4px; }
.tab { background: none; border: 0; padding: 8px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tab.on, .tab:hover { color: var(--text); background: var(--panel2); }
.grow { flex: 1; }
.myunit { display: flex; align-items: center; gap: 8px; }
.state-select { border: 1px solid var(--s, var(--line)); background: color-mix(in srgb, var(--s, transparent) 18%, var(--panel2)); border-radius: 8px; padding: 5px 8px; max-width: 220px; }
.user { display: flex; align-items: center; gap: 8px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; flex: none; }
.avatar.blank { background: var(--line); display: inline-block; }

/* board */
.board { display: grid; grid-template-columns: minmax(300px, 360px) 1fr minmax(260px, 320px); }
.panel { background: var(--panel); overflow: auto; min-height: 0; }
.panel.incidents { border-right: 1px solid var(--line); }
.panel.units { border-left: 1px solid var(--line); }
.panel.mapwrap { background: #0b1016; position: relative; overflow: hidden; }
.panel-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.panel-head h2 { flex: 1; margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.count { font-size: 12px; color: var(--muted); background: var(--panel2); border-radius: 99px; padding: 0 8px; font-weight: 600; }
.list { list-style: none; margin: 0; padding: 0; }
.mobile-tabs { display: none; }

.inc-row, .unit-row { width: 100%; display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: none; border: 0;
  border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; }
.inc-row:hover, .unit-row:hover { background: var(--panel2); }
.grade { flex: none; font-weight: 800; font-size: 12px; padding: 2px 6px; border-radius: 5px; color: #fff; background: var(--g2); }
[data-grade="1"] .grade, .grade[data-grade="1"] { background: var(--g1); }
[data-grade="3"] .grade, .grade[data-grade="3"] { background: var(--g3); }
[data-grade="4"] .grade, .grade[data-grade="4"] { background: var(--g4); }
.inc-main, .unit-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.inc-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inc-sub, .unit-sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inc-meta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.age { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.branch-group h3 { margin: 0; padding: 8px 12px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted);
  border-left: 4px solid var(--c); background: var(--panel2); }
.unit-row { align-items: center; box-shadow: inset 4px 0 0 var(--s); }
.unit-row .state { font-weight: 600; font-size: 13px; }

/* map */
.map { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; }
.map:active { cursor: grabbing; }
.map.picking { cursor: crosshair; }
.map-plane { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.map-plane img { display: block; user-select: none; pointer-events: none; }
.map-layer { position: absolute; inset: 0; }
.map-zoom { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 4px; z-index: 3; }
.map-zoom button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 18px; }
.map-zoom button:hover { background: var(--panel2); }
.map-hint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 3; background: var(--accent); color: #fff;
  padding: 6px 14px; border-radius: 8px; font-weight: 600; box-shadow: var(--shadow); }
.marker { position: absolute; transform: translate(-50%, -50%) scale(var(--inv, 1)); display: flex; align-items: center; gap: 4px;
  background: none; border: 0; padding: 0; cursor: pointer; transform-origin: 0 50%; }
.marker .tag { font: 700 12px/1 var(--mono); padding: 3px 5px; border-radius: 4px; background: rgba(10, 15, 20, .85); color: #fff; white-space: nowrap; }
.map.far .marker .tag { display: none; }
.marker.unit { transform-origin: 7px 50%; transform: translate(-7px, -50%) scale(var(--inv, 1)); }
.marker.unit .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); border: 3px solid var(--s); box-shadow: 0 0 0 1px #000; }
.marker.unit.panic .dot { animation: pulse 1s infinite; border-color: var(--bad); }
.marker.incident { transform-origin: 8px 50%; transform: translate(-8px, -50%) scale(var(--inv, 1)); }
.marker.incident .diamond { width: 14px; height: 14px; transform: rotate(45deg); background: var(--g2); border: 2px solid #fff; box-shadow: 0 0 0 1px #000; }
.marker.incident[data-grade="1"] .diamond { background: var(--g1); }
.marker.incident[data-grade="3"] .diamond { background: var(--g3); }
.marker.incident[data-grade="4"] .diamond { background: var(--g4); }
.marker.on .tag { background: var(--accent); }
.marker.on .dot, .marker.on .diamond { outline: 3px solid var(--accent); outline-offset: 2px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(229, 72, 77, .35); } }

/* dialogs and forms */
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.dialog { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; width: min(460px, 100%); max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; box-shadow: var(--shadow); }
.dialog.wide { width: min(900px, 100%); }
.dialog-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { flex: 1; margin: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dialog-body { padding: 16px; overflow: auto; }
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field .label { font-weight: 600; font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; }
input:not([type="checkbox"]):not([type="color"]), select, textarea { width: 100%; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); }
input[type="color"] { width: 60px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); padding: 2px; }
textarea { resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.span2 { grid-column: span 2; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row > select, .row > input { flex: 1; min-width: 140px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.checks { display: flex; flex-wrap: wrap; gap: 12px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* incident view */
.inc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.inc-cols { display: grid; grid-template-columns: 1fr 1.2fr; gap: 18px; }
.incident h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 14px 0 6px; }
.inc-right h3 { margin-top: 0; }
.details { white-space: pre-wrap; background: var(--panel2); border-radius: 8px; padding: 8px 10px; margin: 10px 0 0; }
.comments { list-style: none; margin: 0; padding: 0; max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
.comment { display: grid; grid-template-columns: 44px 1fr; gap: 0 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: 0; }
.comment .when { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; grid-row: span 2; padding-top: 1px; }
.comment .who { font-size: 12px; font-weight: 700; font-family: var(--mono); }
.comment .who:empty { display: none; }
.comment .text { white-space: pre-wrap; word-break: break-word; }
.comment.system .text { color: var(--muted); font-style: italic; }
.composer { display: flex; gap: 6px; margin-top: 8px; }
.incident > .actions { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }

/* admin */
.admin-wrap { display: grid; grid-template-columns: 200px 1fr; }
.admin-nav { background: var(--panel); border-right: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.admin-nav button { text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; }
.admin-nav button.on, .admin-nav button:hover { background: var(--panel2); color: var(--text); }
.admin-body { padding: 16px 20px; overflow: auto; }
.admin-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 12px; }
.admin-head h2 { margin: 0; font-size: 18px; }
.admin-head p { margin: 0; flex-basis: 100%; order: 3; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); margin-top: 10px; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); background: var(--panel2); position: sticky; top: 0; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.off td { opacity: .5; }
table.data td.detail { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.actions-cell { white-space: nowrap; text-align: right !important; }
.person { display: flex; align-items: center; gap: 8px; }
.swatch { display: inline-block; padding: 1px 8px; border-radius: 5px; color: #fff; font-family: var(--mono); font-size: 12px; text-shadow: 0 0 2px #000; }
.memberships { display: flex; flex-direction: column; gap: 6px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-top: 12px; }
.card h3 { margin: 0 0 8px; }
.perm-list { display: grid; gap: 6px; }

/* home and profile pages */
#app > .page-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
.pad { padding: 20px; }
.home, .profile { max-width: 1240px; margin: 0 auto; padding: 20px 20px 40px; display: flex; flex-direction: column; gap: 16px; }
.profile { max-width: 900px; }
.greet { display: flex; align-items: center; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; }
.greet h1 { margin: 0 0 2px; font-size: 22px; }
.greet-unit { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.insignia { flex: none; width: 54px; height: 72px; border-radius: 8px 8px 4px 4px; display: grid; place-items: end center; padding-bottom: 10px;
  background: linear-gradient(180deg, #1a1f26, #0b0e12); border: 1px solid var(--line); box-shadow: inset 0 -26px 0 color-mix(in srgb, var(--c) 30%, transparent); }
.insignia span { color: #e8d48a; font-weight: 800; font-size: 13px; letter-spacing: .3px; text-shadow: 0 1px 0 #000; }
.home-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.home-side { display: flex; flex-direction: column; gap: 16px; }
.card-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 16%, var(--panel)); border-radius: 10px 10px 0 0; }
.card-head h2 { flex: 1; margin: 0; font-size: 15px; }
.home .card, .profile .card { padding: 0; margin: 0; }
.notices { padding: 4px 16px 12px; max-height: 70vh; overflow: auto; }
.notice { padding: 12px 0; border-bottom: 1px solid var(--line); }
.notice:last-child { border-bottom: 0; }
.notice header { display: flex; align-items: flex-start; gap: 8px; }
.notice h3 { flex: 1; margin: 0; font-size: 17px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notice .chip.pin { color: var(--warn); font-family: var(--font); }
.notice-tools { display: flex; gap: 6px; }
.notice-meta { color: var(--muted); font-size: 12px; margin: 2px 0 8px; }
.notice-body { line-height: 1.55; overflow-wrap: anywhere; }
.notice-body a { color: var(--accent); }
.actions-list { list-style: none; margin: 0; padding: 8px 16px 12px; }
.actions-list li a { display: flex; align-items: center; gap: 8px; padding: 6px 0; color: var(--text); text-decoration: none; }
.actions-list li a:hover { color: var(--accent); }
.count-badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--good); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 16px 16px; }
.stat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; text-align: left; }
.stat:hover { border-color: var(--accent); }
.stat b { font-size: 26px; line-height: 1; }
.stat span { color: var(--muted); font-size: 12px; }
.section-title { font-size: 15px; margin: 8px 0 10px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile { min-height: 112px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 4px; padding: 14px; border-radius: 10px;
  border: 0; background: var(--c); color: #fff; text-align: left; cursor: pointer; position: relative; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.tile:hover { filter: brightness(1.1); }
.tile-name { font-weight: 800; font-size: 16px; }
.tile-desc { font-size: 12px; opacity: .85; }
.tile.soon { background: color-mix(in srgb, var(--c) 18%, var(--panel)); color: var(--text); cursor: default; border: 1px dashed color-mix(in srgb, var(--c) 55%, var(--line)); box-shadow: none; }
.tile.soon:hover { filter: none; }
.tile.soon .tile-desc { color: var(--muted); opacity: 1; }
.tile-phase { position: absolute; top: 10px; right: 10px; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
.user button.name { background: none; border: 0; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.user button.name:hover, .user button.name.on { background: var(--panel2); }
.profile-card { display: flex; gap: 18px; padding: 18px 20px !important; }
.profile-card h1 { margin: 0 0 10px; font-size: 24px; }
.profile-rank { color: var(--muted); font-weight: 600; }
.connection { display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
.conn-name { font-weight: 700; }
.chip.ok { color: var(--good); border-color: color-mix(in srgb, var(--good) 50%, var(--line)); font-family: var(--font); }
.chip.here { margin-left: 8px; font-family: var(--font); color: var(--accent); }
.sessions { list-style: none; margin: 0; padding: 4px 16px 12px; }
.sessions li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sessions li:last-child { border-bottom: 0; }
@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; }
  .home, .profile { padding: 12px 12px 32px; }
  .greet { padding: 12px; }
  .greet h1 { font-size: 18px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .profile-card { flex-direction: column; }
  #app > .page-wrap { overflow: visible; }
}

/* PNC */
.pnc { max-width: 1240px; margin: 0 auto; padding: 20px 20px 40px; display: flex; flex-direction: column; gap: 14px; }
.pnc-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.pnc-head h1 { margin: 0; font-size: 24px; }
.pnc-head p { margin: 2px 0 0; }
.pnc-head.record { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; }
.pnc-head .muted code { margin-right: 8px; }
.pnc-photo { width: 92px; height: 116px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.pnc-photo.none { display: grid; place-items: center; color: var(--muted); font-size: 12px; background: var(--panel2); }
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.subtabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 14px; cursor: pointer; font-weight: 600; color: var(--muted); }
.subtabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.pad-card { padding: 16px !important; margin: 0 !important; }
.pnc-search .row + .row { margin-top: 8px; }
.pnc-search input[type=search] { flex: 1; }
.pnc-table tbody tr { cursor: pointer; }
.pnc-table tbody tr:hover td { background: var(--panel2); }
.chip.pncmark { color: #fff; background: #b4232a; border-color: #b4232a; font-family: var(--font); font-weight: 700; }
.mt { margin-top: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px 10px; }
.marker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px 12px; }
.pnc-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.pnc-two h3 { margin: 0 0 10px; font-size: 15px; }
.marker-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.marker-list li { display: flex; align-items: center; gap: 8px; }
.pnc-notes { max-height: 60vh; margin-top: 10px; }
.pnc-notes .comment { grid-template-columns: 110px 1fr; }
input:disabled, select:disabled, textarea:disabled { opacity: .75; cursor: default; }
@media (max-width: 900px) {
  .pnc { padding: 12px 12px 32px; }
  .grid3, .pnc-two { grid-template-columns: 1fr; }
}

/* PNC vehicles */
.plate { display: inline-block; font-family: "Arial Narrow", Arial, sans-serif; font-weight: 800; letter-spacing: 1px; color: #111;
  background: #f5c400; border: 1px solid #222; border-radius: 4px; padding: 1px 8px; white-space: nowrap; }
.plate.big { font-size: 26px; padding: 2px 12px; }
.anpr-line { margin-top: 6px; color: var(--warn); font-weight: 700; }
.status-tiles { display: flex; gap: 8px; flex-wrap: wrap; }
.status-tile { display: flex; flex-direction: column; gap: 2px; min-width: 130px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); }
.status-tile.good { border-left: 4px solid var(--good); }
.status-tile.bad { border-left: 4px solid var(--bad); }
.label-row { display: flex; align-items: center; gap: 8px; }
.btn.tiny { min-height: 22px; padding: 1px 8px; font-size: 12px; }
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.pick { display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; }
.pick:hover { border-color: var(--accent); }
.driver-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.driver-list li { display: flex; align-items: center; gap: 10px; }
.driver-list li .btn { margin-left: auto; }
a.chip { text-decoration: none; color: var(--text); }

/* toasts */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 8px;
  box-shadow: var(--shadow); max-width: 360px; transition: opacity .4s; }
.toast.good { border-left-color: var(--good); }
.toast.bad { border-left-color: var(--bad); }
.toast.panic { background: var(--bad); color: #fff; font-weight: 700; border-color: var(--bad); }
.toast.out { opacity: 0; }

/* phones and narrow windows: one panel at a time */
@media (max-width: 900px) {
  .top { gap: 8px; padding: 0 10px; height: auto; min-height: 56px; flex-wrap: wrap; padding-block: 8px; }
  .user .name { display: none; }
  #app { height: auto; min-height: 100%; }
  .board { display: flex; flex-direction: column; height: auto; min-height: calc(100vh - 56px); }
  .mobile-tabs { display: flex; gap: 4px; padding: 8px 10px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 4; }
  .mobile-tabs button { flex: 1; padding: 8px; border-radius: 8px; border: 1px solid var(--line); background: none; cursor: pointer; font-weight: 600; }
  .mobile-tabs button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
  .board > .panel { display: none; border: 0; }
  .board.tab-incidents > .incidents, .board.tab-units > .units { display: block; }
  .board.tab-map > .mapwrap { display: block; height: calc(100vh - 120px); }
  .inc-cols, .grid2 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .admin-wrap { display: block; height: auto; }
  .admin-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-body { padding: 12px 16px; }
}
