/* Tenon C2 design system v0.1: near-black ground, warm off-white ink, uppercase display, mono labels, square
   edges, one blue that means "in the air". Colour is a signal, never decoration. */
:root {
  --bg: #050607; --bg2: #0A0B0D; --surface: #0F1013; --surface2: #15161A;
  --line: rgba(241, 241, 236, 0.10); --line2: rgba(241, 241, 236, 0.22);
  --ink: #F1F1EC; --ink2: #C8C8C1; --muted: #8F9089;
  --accent: #009CFA; --accent2: #00D1FA; --warn: #F5A524; --fault: #FF5A4F;
  --sans: "Sora", "TenonSans", system-ui, sans-serif; --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --nav-w: 190px; --top-h: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }
[hidden] { display: none !important; }

/* ---- type */
.display { font-weight: 800; text-transform: uppercase; letter-spacing: -0.01em; line-height: 0.94; font-size: 44px; margin: 0; }
h1.title { font-weight: 800; text-transform: uppercase; font-size: 44px; line-height: 0.94; margin: 6px 0 0; letter-spacing: -0.01em; }
h2.heading { font-weight: 600; font-size: 20px; margin: 0; }
h2.heading .muted { font-weight: 500; }
.label { font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.data { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.numeral { font-weight: 700; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.muted { color: var(--muted); } .ink2 { color: var(--ink2); } .accent { color: var(--accent); } .warn { color: var(--warn); } .fault { color: var(--fault); }
.mono { font-family: var(--mono); }
.eyebrow { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.eyebrow::before { content: ""; width: 8px; height: 8px; background: var(--accent); flex: none; }
.eyebrow.plain::before { display: none; }

/* ---- shell */
.app { display: grid; grid-template-columns: var(--nav-w) 1fr; grid-template-rows: var(--top-h) 1fr; min-height: 100vh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 24px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: 0.08em; font-size: 18px; }
.brand svg { width: 28px; height: 24px; }
.brand .sub { font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: 0.18em; color: var(--muted); border-left: 1px solid var(--line2); padding-left: 12px; }
.topbar .precinct { font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink2); }
.topbar .spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 1px solid var(--line2); font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; }
.chip .dot { width: 8px; height: 8px; background: var(--muted); }
.chip.live .dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.chip.stale .dot { background: var(--warn); }
.bell { position: relative; width: 44px; height: 44px; border: 1px solid var(--line2); background: none; cursor: pointer; display: grid; place-items: center; }
.bell svg { width: 18px; height: 18px; }
.bell .count { position: absolute; top: -8px; right: -8px; min-width: 18px; height: 18px; padding: 0 4px; background: var(--warn); color: #000; font-family: var(--mono); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.bell .count.fault { background: var(--fault); }
.user { display: flex; align-items: center; gap: 10px; }
.avatar { width: 40px; height: 40px; background: var(--ink); color: #000; font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.user .name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.user .role { font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }

.nav { border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); }
.nav a { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; text-decoration: none; font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink2); border-left: 2px solid transparent; }
.nav a .n { color: var(--muted); }
.nav a.active { background: var(--surface2); border-left-color: var(--accent); color: var(--ink); }
.nav a.active .n { color: var(--accent); }
.nav .foot { margin-top: auto; padding: 16px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); line-height: 1.8; }
.nav .foot a { padding: 12px 0 0; display: flex; gap: 8px; align-items: center; color: var(--ink2); }

.main { padding: 28px 32px 48px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ---- components */
.btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 16px; height: 44px; padding: 0 18px; border: 1px solid var(--line2); background: none; color: var(--ink); font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface); } .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--ink); color: #000; border-color: var(--ink); } .btn.primary:hover { background: #fff; }
.btn.sm { height: 36px; padding: 0 14px; font-size: 11px; } .btn.xs { height: 32px; padding: 0 10px; font-size: 11px; letter-spacing: 0.12em; }
.btn.danger { border: 1px dashed var(--fault); color: var(--fault); } .btn.danger:hover { background: rgba(255, 90, 79, 0.08); }
.btn.warn { border: 1px dashed var(--warn); color: var(--warn); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.btn .arrow::after { content: "→"; }
.segment { display: inline-flex; border: 1px solid var(--line2); }
.segment button { height: 44px; padding: 0 18px; background: none; border: 0; border-right: 1px solid var(--line2); font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink2); cursor: pointer; }
.segment button:last-child { border-right: 0; }
.segment button.on { background: var(--ink); color: #000; }
.segment.sm button { height: 36px; padding: 0 12px; font-size: 11px; }
.segment button .c { color: var(--muted); margin-left: 8px; } .segment button.on .c { color: #333; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > .label { color: var(--muted); }
.input, select.input, textarea.input { height: 44px; padding: 0 14px; background: var(--bg2); border: 1px solid var(--line2); color: var(--ink); font-family: var(--mono); font-size: 13px; width: 100%; }
textarea.input { height: auto; padding: 10px 14px; min-height: 80px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); }
.input::placeholder { color: var(--muted); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.input.lg { height: 52px; font-size: 15px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.tag { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 10px; border: 1px solid var(--line2); font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink2); white-space: nowrap; }
.tag.airborne { color: var(--accent); border-color: var(--accent); background: rgba(0, 156, 250, 0.08); }
.tag.airborne::before { content: ""; width: 6px; height: 6px; background: var(--accent); }
.tag.ready, .tag.docked { color: var(--ink); }
.tag.charging, .tag.offline { color: var(--muted); border-color: var(--line); }
.tag.maintenance, .tag.warn { color: var(--warn); border: 1px dashed var(--warn); }
.tag.fault, .tag.locked { color: var(--fault); border: 1px dashed var(--fault); }
.tag.live { color: var(--accent); border-color: var(--accent); }
.tag.signed { color: var(--ink2); }
.prio { display: inline-grid; place-items: center; width: 34px; height: 24px; font-family: var(--mono); font-size: 11px; font-weight: 700; border: 1px solid var(--line2); color: var(--ink2); }
.prio.p1 { background: var(--warn); color: #000; border-color: var(--warn); } .prio.p2 { color: var(--warn); border-color: var(--warn); }
.basis { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--line2); font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; background: none; color: var(--ink2); cursor: pointer; }
.basis::before { content: "§"; color: var(--muted); } .basis.on { background: var(--ink); color: #000; } .basis.on::before { color: #333; }

.panel { border: 1px solid var(--line); background: var(--bg); }
.panel > .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel > .head .label { color: var(--muted); }
.panel > .body { padding: 18px; }
.panel.raised { background: var(--bg2); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); margin-bottom: 24px; }
.tile { padding: 22px 22px 20px; border-right: 1px solid var(--line); }
.tile:last-child { border-right: 0; }
.tile .label { margin-bottom: 14px; }
.tile .numeral { margin-bottom: 10px; }
.tile .sub { font-family: var(--mono); font-size: 12px; color: var(--ink2); }
.stats2 { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); }
.stats2 > div { padding: 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats2 > div:nth-child(2n) { border-right: 0; } .stats2 > div:nth-last-child(-n+2) { border-bottom: 0; }
.stats2 .v { font-weight: 700; font-size: 24px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stats2 .s { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; align-items: baseline; }
.kv dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-size: 14px; }
.kv dd.data { font-size: 13px; }
.kv.rows dt, .kv.rows dd { padding: 10px 0; border-bottom: 1px solid var(--line); }
.bar { height: 4px; background: var(--surface2); margin-top: 8px; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.bar.warn > i { background: var(--warn); } .bar.fault > i { background: var(--fault); }

table.grid { width: 100%; border-collapse: collapse; }
table.grid th { text-align: left; padding: 12px 14px; font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.grid td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tr.r { cursor: pointer; } table.grid tr.r:hover { background: var(--surface); } table.grid tr.sel { background: var(--surface2); }
table.grid td.data, table.grid td.mono { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
table.grid .strong { font-weight: 600; }
table.grid .empty td { color: var(--muted); padding: 28px 14px; text-align: center; }
.id { display: flex; align-items: center; gap: 10px; }
.id .glyph { width: 14px; height: 14px; flex: none; }
.id .sub { font-family: var(--mono); font-size: 11px; color: var(--muted); display: block; }

.batt { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; }
.batt i { width: 56px; height: 3px; background: var(--surface2); display: block; } .batt i b { display: block; height: 100%; background: var(--ink); }
.batt.warn b { background: var(--warn) !important; } .batt.warn { color: var(--warn); }

.list { display: flex; flex-direction: column; }
.alert { display: grid; grid-template-columns: 3px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.alert:last-child { border-bottom: 0; }
.alert > i { background: var(--line2); } .alert.warn > i { background: var(--warn); } .alert.fault > i { background: repeating-linear-gradient(to bottom, var(--fault) 0 4px, transparent 4px 7px); } .alert.live > i { background: var(--accent); }
.alert .t { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.alert.warn .t b { color: var(--warn); } .alert.fault .t b { color: var(--fault); } .alert.live .t b { color: var(--accent); }
.alert p { margin: 0; font-size: 13px; }
.timeline .ev { display: grid; grid-template-columns: 70px 12px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.timeline .ev:last-child { border-bottom: 0; }
.timeline .ev .at { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 2px; }
.timeline .ev .sq { width: 8px; height: 8px; margin-top: 6px; border: 1px solid var(--ink2); }
.timeline .ev.live .sq { background: var(--accent); border-color: var(--accent); } .timeline .ev.warn .sq { background: var(--warn); border-color: var(--warn); } .timeline .ev.fault .sq { background: var(--fault); border-color: var(--fault); } .timeline .ev.solid .sq { background: var(--ink); }
.timeline .ev b { font-weight: 600; display: block; } .timeline .ev small { color: var(--muted); font-size: 12px; }

.two { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.two.wide { grid-template-columns: 1fr 400px; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.card { border: 1px solid var(--line); padding: 22px 22px 18px; background: var(--bg); }
.card .top { display: flex; justify-content: space-between; margin-bottom: 14px; }
.card .nm { font-weight: 800; font-size: 20px; text-transform: uppercase; letter-spacing: -0.01em; line-height: 1.1; }
.card .lead { color: var(--ink2); margin-top: 4px; }
.card .segs { display: flex; gap: 4px; margin: 18px 0 12px; }
.card .segs i { flex: 1; height: 4px; background: var(--surface2); } .card .segs i.airborne { background: var(--accent); } .card .segs i.ready, .card .segs i.docked { background: var(--ink2); } .card .segs i.charging { background: repeating-linear-gradient(90deg, var(--warn) 0 3px, transparent 3px 5px); } .card .segs i.maintenance { background: repeating-linear-gradient(90deg, var(--warn) 0 2px, transparent 2px 4px); }
.card .foot { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--ink2); }
.card .foot span:last-child { color: var(--muted); }

/* ---- map */
.map { position: relative; height: 560px; background: var(--bg2); border: 1px solid var(--line); overflow: hidden; }
.map .leaflet-container { width: 100%; height: 100%; background: var(--bg2); font: inherit; }
.map .tiles-dark { filter: saturate(0.5) brightness(0.85); }
.map .tiles-osm { filter: invert(1) hue-rotate(180deg) saturate(0.25) brightness(0.62) contrast(1.15); }
.map .layers { position: absolute; top: 12px; right: 12px; z-index: 500; display: flex; gap: 6px; }
.map .layers button { height: 32px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line2); color: var(--ink2); font-size: 12px; cursor: pointer; }
.map .layers button.on { color: var(--ink); background: var(--surface2); border-color: var(--line2); }
.map .leaflet-control-zoom { border: 1px solid var(--line2) !important; border-radius: 0 !important; }
.map .leaflet-control-zoom a { background: var(--surface) !important; color: var(--ink) !important; border-radius: 0 !important; border-bottom: 1px solid var(--line2) !important; width: 40px !important; height: 40px !important; line-height: 40px !important; font-size: 20px !important; }
.map .leaflet-control-attribution { background: rgba(5, 6, 7, 0.7) !important; color: var(--muted) !important; font: 10px var(--mono) !important; }
.map .leaflet-control-attribution a { color: var(--muted) !important; }
.map .legend { position: absolute; left: 12px; bottom: 12px; z-index: 500; display: flex; gap: 16px; padding: 8px 12px; background: rgba(5, 6, 7, 0.85); border: 1px solid var(--line); font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink2); }
.map .legend span { display: inline-flex; align-items: center; gap: 6px; }
.map .legend svg { width: 10px; height: 10px; }
.map .coords { position: absolute; right: 12px; bottom: 12px; z-index: 500; font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--muted); background: rgba(5, 6, 7, 0.85); padding: 4px 8px; }
.marker { position: relative; width: 28px; height: 28px; }
.marker svg { position: absolute; inset: 0; width: 28px; height: 28px; overflow: visible; }
.marker .lbl { position: absolute; left: 34px; top: 4px; height: 20px; padding: 0 6px; background: var(--bg); color: var(--ink); border: 1px solid var(--line2); font: 700 10px/18px var(--mono); letter-spacing: 0.08em; white-space: nowrap; }
.marker.sel { outline: 1px solid var(--ink); } .marker.sel .lbl { background: var(--ink); color: #000; }
.marker.inc .lbl { color: var(--warn); border-color: transparent; background: none; font-weight: 500; left: 30px; top: 6px; }
.marker.home .lbl { color: var(--ink2); background: none; border: 0; font-weight: 500; left: 30px; top: 4px; }
.leaflet-marker-icon { background: none !important; border: 0 !important; }

/* ---- video */
.video { position: relative; background: #000; aspect-ratio: 16 / 9; border: 1px solid var(--line); overflow: hidden; }
.video video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.video .hud { position: absolute; inset: 0; pointer-events: none; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink2); }
.video .hud .tl, .video .hud .tr, .video .hud .bl, .video .hud .br { position: absolute; padding: 12px 16px; }
.video .hud .tl { top: 0; left: 0; } .video .hud .tr { top: 0; right: 0; } .video .hud .bl { bottom: 0; left: 0; } .video .hud .br { bottom: 0; right: 0; }
.video .hud .tl::before, .video .hud .tr::before, .video .hud .bl::before, .video .hud .br::before { content: ""; position: absolute; width: 16px; height: 16px; border: 1px solid var(--ink2); }
.video .hud .tl::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; } .video .hud .tr::before { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.video .hud .bl::before { bottom: 8px; left: 8px; border-right: 0; border-top: 0; } .video .hud .br::before { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
.video .hud .rec { color: var(--fault); } .video .hud .rec::before { content: "■ "; }
.video .hud .bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding: 12px 36px; }
.video .center { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; text-align: center; padding: 20px; }
.video .center .big { font-size: 13px; color: var(--ink2); margin-bottom: 8px; }
.video .cross { position: absolute; left: 50%; top: 50%; width: 1px; height: 24px; background: var(--ink2); opacity: 0.6; transform: translate(-50%, -50%); }
.video .cross::after { content: ""; position: absolute; left: 50%; top: 50%; width: 24px; height: 1px; background: var(--ink2); transform: translate(-50%, -50%); }
.vbar { display: flex; align-items: center; gap: 12px; padding: 12px 0 0; }
.vbar .link { margin-left: auto; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* ---- login */
.login { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100vh; }
.login .hero { position: relative; padding: 48px 64px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; border-right: 1px solid var(--line); background: radial-gradient(1200px 500px at 30% 70%, rgba(0, 156, 250, 0.05), transparent 60%), var(--bg); }
.login .hero .corner { position: absolute; top: 40px; left: 64px; right: 64px; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.login .hero .display { font-size: 72px; margin: 24px 0 28px; }
.login .hero .display .dim { color: var(--muted); }
.login .hero p { font-size: 18px; color: var(--ink2); max-width: 520px; margin: 0; }
.login .hero .grid { position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 160px 160px; opacity: 0.35; pointer-events: none; }
.login .hero svg.art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.login .hero .platforms { position: absolute; left: 64px; right: 64px; bottom: 40px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); }
.login .hero .platforms div { padding: 18px 22px; border-right: 1px solid var(--line); } .login .hero .platforms div:last-child { border-right: 0; }
.login .hero .platforms b { display: block; font-size: 16px; text-transform: uppercase; margin: 8px 0 4px; }
.login .hero .platforms span { color: var(--ink2); font-size: 13px; }
.login .form { display: flex; flex-direction: column; justify-content: center; padding: 48px 72px; }
.login .form .inner { width: 100%; max-width: 440px; margin: 0 auto; }
.login .form h1.title { font-size: 40px; margin: 28px 0 6px; }
.login .form .sub { color: var(--ink2); margin-bottom: 28px; }
.login .form .field { margin-bottom: 18px; }
.login .form .btn { margin-top: 8px; width: 100%; height: 52px; }
.login .form .note { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); line-height: 1.8; }
.error { border: 1px dashed var(--fault); color: var(--fault); padding: 10px 12px; font-family: var(--mono); font-size: 12px; margin-bottom: 16px; }
.notice { border: 1px solid var(--line2); color: var(--ink2); padding: 10px 12px; font-family: var(--mono); font-size: 12px; margin-bottom: 16px; }

/* ---- dialogs and toasts */
.scrim { position: fixed; inset: 0; background: rgba(5, 6, 7, 0.78); z-index: 100; display: grid; place-items: center; padding: 24px; }
.dialog { width: 100%; max-width: 560px; max-height: calc(100vh - 48px); overflow: auto; background: var(--bg); border: 1px solid var(--line2); }
.dialog > .head { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.dialog > .head h2 { margin: 6px 0 0; font-size: 22px; font-weight: 800; text-transform: uppercase; }
.dialog > .body { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.dialog > .foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 12px; }
.dialog.wide { max-width: 760px; }
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 16px; background: var(--surface2); border: 1px solid var(--line2); font-family: var(--mono); font-size: 12px; max-width: 420px; }
.toast.fault { border-color: var(--fault); color: var(--fault); } .toast.warn { border-color: var(--warn); color: var(--warn); } .toast.live { border-color: var(--accent); }
.drop { position: absolute; right: 0; top: 52px; width: 380px; background: var(--bg); border: 1px solid var(--line2); z-index: 60; max-height: 70vh; overflow: auto; }
.drop .head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.drop .alert { padding: 12px 16px; }
.perm { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); }
.perm:last-child { border-bottom: 0; }
.perm.off { color: var(--muted); }
.perm .ok { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink2); }
.perm.off .ok { color: var(--muted); }
.key { font-family: var(--mono); font-size: 12px; word-break: break-all; padding: 10px 12px; background: var(--bg2); border: 1px solid var(--line2); }
.hint { font-size: 12px; color: var(--muted); }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line2); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.blink { animation: blink 1.2s steps(2) infinite; } @keyframes blink { to { opacity: 0.3; } }
.qr { background: #fff; padding: 12px; width: fit-content; }
.minimap { height: 220px; border: 1px solid var(--line); background: var(--bg2); position: relative; }
.minimap .leaflet-container { height: 100%; background: var(--bg2); }
.clock { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.bigclock { font-weight: 800; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* ---- responsive */
@media (max-width: 1240px) { .cards, .tiles { grid-template-columns: repeat(2, 1fr); } .tiles .tile:nth-child(2) { border-right: 0; } .tiles .tile:nth-child(-n+2) { border-bottom: 1px solid var(--line); } .two, .two.wide { grid-template-columns: 1fr; } .login { grid-template-columns: 1fr; } .login .hero { display: none; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; } .nav { position: fixed; left: 0; top: var(--top-h); bottom: 0; width: 100%; max-width: 300px; background: var(--bg); z-index: 40; transform: translateX(-100%); transition: transform .15s; } .nav.open { transform: none; }
  .main { padding: 20px 16px 40px; } h1.title { font-size: 34px; } .cards, .tiles { grid-template-columns: 1fr; } .tile { border-right: 0; border-bottom: 1px solid var(--line); } .topbar { gap: 12px; padding: 0 16px; } .topbar .precinct, .topbar .hide-sm { display: none; }
  .map { height: 420px; } .login .form { padding: 32px 16px; } table.grid { display: block; overflow-x: auto; } .menu-btn { display: grid !important; }
}
.menu-btn { display: none; width: 40px; height: 40px; border: 1px solid var(--line2); background: none; place-items: center; cursor: pointer; }
.menu-btn i { width: 18px; height: 2px; background: var(--ink); box-shadow: 0 -6px 0 var(--ink), 0 6px 0 var(--ink); display: block; }
.basis.plain::before { display: none; }
