/* Palette keyed to Stadia alidade_smooth_dark: neutral smoke greys, quiet accents. */
:root {
  --bg: #121415;
  --surface: #1a1d1f;
  --surface-2: #232729;
  --line: #2f3437;
  --ink: #e3e6e4;
  --ink-soft: #aab1ae;
  --ink-faint: #7d8582;
  --accent: #e8705f;
  --ok: #6fb28b;
  --bad: #e06a5e;
  --warn: #d9a24a;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Public Sans", system-ui, sans-serif; font-size: 14.5px; line-height: 1.5;
}
.mono { font-family: "Spline Sans Mono", monospace; }
.muted { color: var(--ink-faint); }
.small { font-size: 12px; }
.hidden { display: none !important; }

header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 10px; }
.mark { color: var(--accent); font-size: 18px; }
h1 { font-family: "Saira", sans-serif; font-size: 19px; margin: 0; font-weight: 700; letter-spacing: 0.01em; }
h1 .thin { font-weight: 500; color: var(--ink-soft); }
.head-right { display: flex; align-items: center; gap: 14px; font-size: 12px; }

.banner {
  background: #3a2422; color: #f1b9ad; border-bottom: 1px solid #5c342d;
  padding: 10px 22px; font-weight: 500;
}

main { padding: 18px 22px 60px; max-width: 1500px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; }
.tile .num { font-family: "Saira", sans-serif; font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .lbl { font-family: "Spline Sans Mono", monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); }
.tile.ok .num { color: var(--ok); }
.tile.bad .num { color: var(--bad); }
.tile.warn .num { color: var(--warn); }
.tile.dim .num { color: var(--ink-faint); }

.grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.panel-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.panel-head h2 { font-family: "Saira", sans-serif; font-size: 15px; margin: 0; font-weight: 600; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; }

#map { height: 440px; background: #121415; }
.map-panel { min-height: 440px; }

.cells { max-height: 400px; overflow-y: auto; padding: 8px 0; }
.cell-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 16px; border-bottom: 1px solid var(--surface-2); cursor: pointer;
}
.cell-row:hover { background: var(--surface-2); }
.cell-row .cid { font-family: "Spline Sans Mono", monospace; font-size: 13px; }
.cell-row .counts { display: flex; gap: 6px; }

.pill {
  font-family: "Spline Sans Mono", monospace; font-size: 11px; font-weight: 600;
  padding: 1px 8px; border-radius: 99px;
}
.pill.up { background: #1a2b21; color: var(--ok); }
.pill.down { background: #38201c; color: var(--bad); }
.pill.off { background: #24292c; color: var(--ink-faint); }
.warn-pill { background: #33280f; color: var(--warn); margin-left: 8px; }
.idle .panel-head { border-left: 3px solid var(--warn); }

.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--surface-2); white-space: nowrap; }
thead th {
  font-family: "Spline Sans Mono", monospace; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--ink-faint); background: var(--surface-2);
  position: sticky; top: 0;
}
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--surface-2); }
td .sub { display: block; font-size: 11.5px; color: var(--ink-faint); }

input, select, button {
  font: inherit; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px;
}
input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button { cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: #16100e; font-weight: 600; }
button.ghost { background: transparent; }
button.danger { background: #38201c; border-color: #5c342d; color: var(--bad); font-size: 12px; padding: 4px 9px; }
button.danger:hover { background: #47261f; }

dialog {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; padding: 22px; width: min(420px, 92vw);
}
dialog::backdrop { background: rgba(5, 8, 12, 0.7); }
dialog h2 { font-family: "Saira", sans-serif; margin: 0 0 6px; }
dialog input { width: 100%; margin: 12px 0; }
dialog .row { display: flex; justify-content: flex-end; gap: 8px; }

.leaflet-container { font: inherit; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface-2); color: var(--ink); }
.popup h3 { margin: 0 0 4px; font-family: "Saira", sans-serif; font-size: 14px; }
.popup .kv { font-size: 12px; color: var(--ink-soft); }
