:root {
  /* Neutral graphite chrome. Bright color is reserved for map data and state. */
  --bg: #0b0e12;
  --panel: #10151b;
  --panel-raised: #151b23;
  --panel-hover: #1a222c;
  --panel-sunken: #0c1015;
  --panel-glass: rgba(16, 21, 27, .96);
  --line: #29323d;
  --line-strong: #3a4653;
  --line-soft: rgba(58, 70, 83, .5);
  --text: #edf1f5;
  --muted-strong: #b9c2cb;
  --muted: #929eaa;
  --faint: #697582;

  /* Selected or current: mode, tab, layer, keyboard focus, selected object.
     Never used for map data. */
  --selected: #7488f5;
  --selected-soft: rgba(116, 136, 245, .12);
  --selected-line: rgba(116, 136, 245, .42);
  --selected-text: #aab6fb;
  /* Primary action: near-white fill, dark text. */
  --action: #e8ecf1;
  --action-hover: #ffffff;
  --action-text: #0b0e12;

  /* Semantic state. */
  --success: #4eb783;
  --warning: #d3a34d;
  --danger: #dd6872;
  --danger-soft: rgba(221, 104, 114, .1);
  --danger-line: rgba(221, 104, 114, .7);
  --danger-text: #f0a8ae;
  --historical: #a48aef;

  /* Earlier token names; they resolve to the roles above. */
  --panel-2: var(--panel-raised);
  --panel-3: var(--panel-hover);
  --line-bright: var(--line-strong);
  --accent: var(--selected);
  --accent-2: var(--success);

  /* Geometry contract. */
  --topbar-h: 52px;
  --control-h: 36px;
  --control-compact: 32px;
  --icon-hit: 36px;
  --icon-size: 17px;
  --search-h: 40px;
  --radius-control: 7px;
  --radius-panel: 9px;
  --radius-float: 10px;
  --radius-sm: var(--radius-control);
  --gap-xs: 4px;
  --gap-sm: 6px;
  --gap-md: 10px;
  --gap-lg: 16px;

  --shadow-sm: 0 4px 14px rgba(0, 0, 0, .28);
  --shadow: 0 14px 40px rgba(0, 0, 0, .42);
  --shadow-xl: 0 24px 80px rgba(0, 0, 0, .58);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { width:100%; height:100%; margin:0; background:var(--bg); color:var(--text); }
button, input, select, textarea { font:inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color:inherit; }
.hidden { display:none !important; }
.muted { color:var(--muted); }

.app-shell { overflow:hidden; display:grid; grid-template-rows:64px 48px 1fr; }
.brand-block { display:flex; align-items:center; gap:10px; min-width:0; }
.brand-block strong { display:block; font-size:13px; font-weight:650; letter-spacing:.005em; }
.brand-copy span { display:block; color:var(--muted); font-size:11px; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.brand-mark { width:30px; height:30px; display:grid; place-items:center; flex:none; border-radius:var(--radius-control); background:var(--panel-raised); color:var(--text); font-size:10px; font-weight:750; letter-spacing:.05em; }
.ghost-button,.mini-button { border:1px solid var(--line); background:transparent; border-radius:var(--radius-control); cursor:pointer; }
.ghost-button { padding:7px 10px; color:var(--muted); }
.ghost-button:hover,.mini-button:hover { border-color:var(--line-strong); background:var(--panel-hover); color:var(--text); }


/* Mini buttons take the 32px compact geometry. */
.mini-button { min-height:var(--control-compact); display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:0 10px; color:var(--muted-strong); font-size:12px; font-weight:550; }
.mini-button:disabled { opacity:.5; cursor:default; }
.empty-state { padding:28px 16px; text-align:center; color:var(--muted); font-size:12px; line-height:1.5; }
.map-wrap { position:relative; min-width:0; min-height:0; }
#map { position:absolute; inset:0; background:var(--bg); }
#map.site-coordinate-picker, #map.site-coordinate-picker *,
#map.prediction-coordinate-picker, #map.prediction-coordinate-picker * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='10' fill='none' stroke='%230b0e12' stroke-width='4'/%3E%3Cpath d='M16 1v7M31 16h-7M16 31v-7M1 16h7' fill='none' stroke='%230b0e12' stroke-width='4' stroke-linecap='round'/%3E%3Ccircle cx='16' cy='16' r='3' fill='%230b0e12'/%3E%3Ccircle cx='16' cy='16' r='10' fill='none' stroke='%23f1f7fa' stroke-width='2'/%3E%3Cpath d='M16 1v7M31 16h-7M16 31v-7M1 16h7' fill='none' stroke='%23f1f7fa' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='16' cy='16' r='1.5' fill='%23f1f7fa'/%3E%3C/svg%3E") 16 16, crosshair !important;
}
.leaflet-container { background:var(--bg); font-family:inherit; }
.leaflet-control-attribution { background:rgba(11,14,18,.78)!important; color:var(--muted)!important; }
.leaflet-control-attribution a { color:var(--muted-strong)!important; }
.metric-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:7px; }
.metric-tile { padding:10px 12px; border:1px solid var(--line); border-radius:var(--radius-control); background:var(--panel-sunken); }
.metric-tile span { display:block; color:var(--muted); font-size:11.5px; }
.metric-tile strong { display:block; margin-top:4px; font-size:13px; }


.toast-stack { position:fixed; right:18px; bottom:18px; z-index:8000; display:grid; gap:8px; width:min(380px,calc(100% - 36px)); }
.toast { padding:12px 14px; border:1px solid var(--line-bright); border-radius:10px; background:var(--panel-2); box-shadow:var(--shadow); font-size:12px; animation:toast-in .18s ease; }
.toast.error { border-color:rgba(221,104,114,.55); }
.toast-message { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 40vh; overflow: auto; user-select: text; }
.toast-actions { display: flex; flex-wrap: wrap; gap: var(--gap-sm); margin-top: var(--gap-md); }
.toast-stack { max-height: calc(100vh - 36px); overflow-y: auto; }
.toast.success { border-color:rgba(78,183,131,.5); }
/* A passive notice can overlap a dialog's buttons.  It should not intercept
   their clicks; error notices remain interactive for Copy and Dismiss. */
body:has(#modal-root .modal-backdrop) .toast-stack { pointer-events: none; }
body:has(#modal-root .modal-backdrop) .toast.error { pointer-events: auto; }
@keyframes toast-in { from { transform:translateY(8px); opacity:0; } }

code { padding:2px 5px; border-radius:5px; background:var(--panel-sunken); color:var(--muted-strong); }


@media (max-width: 650px) {
  .brand-copy span { display:none; }
  .selection-card { top:56px; }
}


/* The map provider editor contains several controls per row. Keep each
   control inside its column instead of allowing long tile URLs to widen or
   overlap neighboring cells. Narrow viewports intentionally scroll this
   table horizontally. */
.map-layer-admin { min-width:0; }
.map-layer-admin > .admin-title-row { align-items:flex-start; }
.map-layer-admin > .admin-title-row > div { min-width:0; flex:1 1 auto; }
.map-layer-admin > .admin-title-row > button { flex:none; }
.map-layer-admin .table-wrap { overflow-x:auto; }
.map-layer-admin table { min-width:1040px; table-layout:fixed; }
.map-layer-admin th:nth-child(1), .map-layer-admin td:nth-child(1) { width:11%; }
.map-layer-admin th:nth-child(2), .map-layer-admin td:nth-child(2) { width:17%; }
.map-layer-admin th:nth-child(3), .map-layer-admin td:nth-child(3) { width:33%; }
.map-layer-admin th:nth-child(4), .map-layer-admin td:nth-child(4) { width:16%; }
.map-layer-admin th:nth-child(5), .map-layer-admin td:nth-child(5) { width:15%; }
.map-layer-admin th:nth-child(6), .map-layer-admin td:nth-child(6) { width:8%; }
.map-layer-admin td { vertical-align:top; white-space:normal; }
.map-layer-admin .table-input, .map-layer-admin td select { box-sizing:border-box; width:100%; min-width:0; }
.map-layer-admin .map-layer-source-cell .table-input { display:block; margin-bottom:7px; }
.map-layer-admin .map-layer-source-cell .table-input:last-child { margin-bottom:0; }
.map-layer-admin .compact-number-pair { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:center; gap:5px; }
.map-layer-admin .compact-number-pair .table-input { min-width:0; }
.map-layer-admin .map-layer-zoom-cell > .table-input { margin-top:7px; }
.map-layer-admin .map-layer-state-cell .compact-check { display:flex; margin-bottom:8px; white-space:normal; line-height:1.25; }
.map-layer-admin .map-layer-state-cell .compact-check:last-child { margin-bottom:0; }
.map-layer-admin .map-layer-actions-cell { white-space:normal; }
.map-layer-admin .map-layer-actions-cell .danger-button { white-space:nowrap; }

/* Historical backhaul playback. The current live stream continues in RAM while
   the map is pinned to one persisted five-minute frame. */
.history-control { position:absolute; z-index:520; padding:8px 10px; border:1px solid var(--line); border-radius:var(--radius-float); background:var(--panel-glass); box-shadow:var(--shadow); backdrop-filter:blur(14px); }
.history-row { display:flex; align-items:center; gap:8px; min-width:0; }
.history-row-secondary { margin-top:8px; padding-top:8px; border-top:1px solid var(--line); }
.history-row-secondary>strong { min-width:180px; color:var(--text); font-size:12px; font-weight:600; font-variant-numeric:tabular-nums; }
.history-control.is-historical #history-time { color:var(--historical); }
.history-row-secondary>.muted { flex:1; min-width:120px; overflow:hidden; color:var(--muted); font-size:11.5px; text-overflow:ellipsis; white-space:nowrap; }
.history-live,.history-step,.history-jumps button,.history-stat,.history-datetime { height:var(--control-compact); flex:none; border:1px solid var(--line); border-radius:var(--radius-control); background:var(--panel); color:var(--muted-strong); font-size:12px; font-weight:550; }
.history-live,.history-step,.history-jumps button { display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:0 10px; cursor:pointer; }
.history-step { padding:0 8px; font-variant-numeric:tabular-nums; }
.history-step .icon { width:14px; height:14px; }
.history-live:hover,.history-step:hover:not(:disabled),.history-jumps button:hover:not(:disabled) { border-color:var(--line-strong); background:var(--panel-hover); color:var(--text); }
.history-live.active { border-color:rgba(78,183,131,.45); background:rgba(78,183,131,.12); color:var(--text); }
.live-dot { width:6px; height:6px; border-radius:50%; background:var(--faint); }
.history-live.active .live-dot { background:var(--success); }
.history-step:disabled,.history-jumps button:disabled { opacity:.4; cursor:not-allowed; }
.history-slider { flex:1; min-width:100px; cursor:ew-resize; --range-fill:var(--faint); }
.history-control.is-historical .history-slider { --range-fill:var(--historical); }
.history-stat { width:140px; padding:0 8px; }
.history-datetime { width:184px; padding:0 8px; color-scheme:dark; font-variant-numeric:tabular-nums; }
.history-jumps { display:flex; gap:4px; margin-left:auto; }
.history-selection-banner { display:grid; gap:3px; margin:12px 0 0; padding:9px 10px; border:1px solid rgba(164,138,239,.35); border-radius:var(--radius-control); background:rgba(164,138,239,.07); }
.history-selection-banner strong { color:#d6cbfa; font-size:12px; font-weight:600; }
.history-selection-banner span { color:var(--muted); font-size:11.5px; line-height:1.45; }
.history-selection-banner.empty { border-color:var(--line); background:var(--panel-raised); }

@media (max-width: 1050px) {
  .history-row-secondary>.muted { display:none; }
}
@media (max-width: 720px) {
  .history-row { flex-wrap:wrap; }
  .history-slider { order:5; flex-basis:100%; }
  .history-stat { margin-left:auto; }
  .history-row-secondary>strong { min-width:0; flex:1; }
  .history-datetime { width:166px; }
  .history-jumps { width:100%; margin-left:0; }
  .history-jumps button { flex:1; }
}

/* --------------------------------------------------------------------------
   v0.15 professional application shell and administration system
   -------------------------------------------------------------------------- */
html { color-scheme: dark; }
body { font-size: 14px; text-rendering: optimizeLegibility; }
[hidden] { display: none !important; }
::selection { background: rgba(116, 136, 245, .32); color: var(--text); }
:focus-visible { outline: 2px solid var(--selected); outline-offset: 2px; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: .56; }
button, input, select, textarea { letter-spacing: inherit; }
input::placeholder, textarea::placeholder { color: var(--faint); }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 10000;
  transform: translateY(-150%);
  padding: 9px 13px;
  border: 1px solid var(--selected);
  border-radius: var(--radius-sm);
  background: var(--panel-raised);
  color: var(--text);
  font-weight: 750;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.skip-link:focus { transform: translateY(0); }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Main application chrome. */
.app-shell { grid-template-rows: 72px 56px minmax(0, 1fr); background: var(--bg); }
.ghost-button, .mini-button, .secondary-button, .primary-button, .danger-button {
  transition: border-color .12s ease, background-color .12s ease, color .12s ease;
}

/* Icons: one inline sprite in index.html. 24px grid, currentColor strokes. */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: var(--icon-size);
  height: var(--icon-size);
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* One control geometry: 36px targets, 17px icons, one radius, one hover. */
.icon-button {
  width: var(--icon-hit);
  height: var(--icon-hit);
  display: inline-grid;
  place-items: center;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  transition: border-color .12s ease, background-color .12s ease, color .12s ease;
}
.icon-button:hover { border-color: var(--line-strong); background: var(--panel-hover); color: var(--text); }
.icon-button[aria-expanded="true"] { border-color: var(--selected-line); background: transparent; color: var(--selected-text); }
.control-button {
  height: var(--control-h);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 0 12px 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--panel);
  color: var(--muted-strong);
  font-size: 12.5px;
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .12s ease, background-color .12s ease, color .12s ease;
}
.control-button:hover { border-color: var(--line-strong); background: var(--panel-hover); color: var(--text); }
.control-button.compact { height: var(--control-compact); padding: 0 10px; font-size: 12px; }

/* Button tips use a shared viewport layer above panels, menus and dialogs. */
.button-tooltip {
  position: fixed;
  z-index: 11000;
  width: max-content;
  max-width: min(280px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  overflow: hidden;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel-raised);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.button-tooltip[hidden] { display: none; }

/* Popover and menu grammar: header, sections, 36px rows. */
.popover {
  position: absolute;
  z-index: 40;
  width: 252px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-float);
  background: var(--panel-raised);
  box-shadow: var(--shadow);
}
.popover-header { display: grid; gap: 2px; min-width: 0; padding: 9px 10px 10px; }
.popover-header strong { overflow: hidden; color: var(--text); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.popover-header span { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.menu-section { padding: 4px 0; border-top: 1px solid var(--line); }
.menu-section:last-child { padding-bottom: 0; }
.menu-row {
  width: 100%;
  height: var(--control-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  text-align: left;
}
button.menu-row { cursor: pointer; }
button.menu-row:hover, button.menu-row:focus-visible { background: var(--panel-hover); }
button.menu-row:focus-visible { outline: 2px solid var(--selected); outline-offset: -2px; }
.menu-row .icon { width: 16px; height: 16px; color: var(--muted); }
.menu-row .menu-value, .menu-row kbd { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.menu-row kbd, .shortcut-list kbd {
  min-width: 20px;
  padding: 1px 5px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--panel-sunken);
  font: 11px/16px var(--mono);
  text-align: center;
}

.shortcut-list { display: grid; }
.shortcut-row { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); color: var(--muted-strong); font-size: 13px; }
.shortcut-row:last-child { border-bottom: 0; }
.shortcut-row kbd { color: var(--text); }

/* Connection and data state: a 6px dot and a label. No pill, no glow. */
.status-pill {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.status-pill::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 7px 1px 1px;
  border-radius: 50%;
  background: var(--faint);
  vertical-align: middle;
}
.status-pill.healthy::before { background: var(--success); }
.status-pill.stale { color: var(--warning); }
.status-pill.stale::before { background: var(--warning); }
.status-pill.down { color: var(--danger); }
.status-pill.down::before { background: var(--danger); }
.status-pill.working { color: var(--warning); }
.status-pill.working::before { background: var(--warning); animation: status-working 1.1s ease-in-out infinite; }
.status-pill.historical { color: var(--historical); }
.status-pill.historical::before { background: var(--historical); }
@keyframes status-working { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .status-pill.working::before { animation: none; } }

/* Top bar: one 52px instrument strip. Placement and narrow rows are in map-shell.css. */
.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-float);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.topbar-start { display: flex; align-items: center; gap: var(--gap-sm); min-width: 0; }
.topbar .brand-block { gap: 10px; }
.topbar .brand-mark .icon { width: 18px; height: 18px; stroke-width: 1.7; }
.brand-copy { min-width: 0; }
/* The top bar names the company only (Administration → System & storage). */
.topbar .brand-copy strong { overflow: hidden; font-size: 13.5px; font-weight: 600; letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { justify-self: stretch; display: flex; align-items: center; justify-content: flex-end; gap: var(--gap-sm); min-width: 0; }
.connection-state { display: flex; align-items: center; gap: 14px; min-width: 0; margin-right: 8px; }
.create-control { position: relative; flex: none; }
.create-menu { top: calc(100% + 14px); right: -8px; }
.account { position: relative; flex: none; }
.account-menu { top: calc(100% + 14px); right: -8px; }
.account-role { text-transform: capitalize; }

/* Mode switch: three equal 36px cells in one well. Selected reads as
   selected, not lit: soft indigo fill, indigo label, 1px inner ring. */
.mode-switch {
  height: var(--control-h);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  border-radius: var(--radius-control);
  background: var(--panel-sunken);
}
.mode-button {
  min-width: 0;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px 0 14px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  transition: color .12s ease, background-color .12s ease, box-shadow .12s ease;
}
.mode-button > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mode-button:hover { background: var(--panel-hover); color: var(--text); }
.mode-button.active { background: transparent; box-shadow: inset 0 0 0 1px var(--selected-line); color: var(--selected-text); }
.mode-icon { width: 16px; height: 16px; }

/* Drawer: workspace heading, equal command grids, icon tabs and a flat
   inventory. Placement and width live in map-shell.css. */
.sidebar { background: var(--panel); }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.sidebar-heading > div { display: grid; gap: 3px; min-width: 0; }
.sidebar-heading h2 { margin: 0; font-size: 15px; font-weight: 650; }
.sidebar-heading .panel-kicker, .action-group-label, .inventory-section-title {
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.actionbar { display: grid; gap: 12px; flex-shrink: 0; padding: 14px 12px 12px; border-bottom: 1px solid var(--line); }
.action-group { display: grid; gap: 6px; }
.action-group-label { padding-left: 4px; }
.action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap-sm); }
.action-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.action-button {
  height: var(--control-h);
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 0 8px 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--panel);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  transition: border-color .12s ease, background-color .12s ease, color .12s ease;
}
.action-button .icon { width: 16px; height: 16px; color: var(--muted); }
.action-button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-button:hover { border-color: var(--line-strong); background: var(--panel-hover); color: var(--text); }
.action-button:hover .icon { color: var(--text); }
.save-state { display: flex; align-items: center; gap: 7px; padding-left: 4px; color: var(--faint); font-size: 11.5px; }
.save-state::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--success); }
.save-state.saving { color: var(--warning); }
.save-state.saving::before { background: var(--warning); }
.save-state.error { color: var(--danger); }
.save-state.error::before { background: var(--danger); }
.sidebar-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.sidebar-tab {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  margin-bottom: -1px;
  padding: 0 6px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
}
.sidebar-tab .icon { width: 16px; height: 16px; }
.sidebar-tab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-tab:hover { color: var(--text); }
.sidebar-tab.active { border-bottom-color: transparent; box-shadow: inset 0 0 0 1px var(--selected-line); color: var(--selected-text); }
.sidebar-panel { display: none; min-height: 0; overflow: auto; padding-bottom: 16px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.sidebar-panel.active { display: block; }
.panel-heading { position: sticky; top: 0; z-index: 2; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; background: var(--panel); }
.panel-heading h2 { margin: 0; font-size: 13px; font-weight: 600; }
.panel-body { padding: 0 16px; }
.panel-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

/* Inventory: flat 42px rows; the icon names the kind. Selected is a soft
   indigo fill with a 2px marker. */
.inventory-list { padding: 0 8px 8px; }
.inventory-section + .inventory-section { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.inventory-section-title { height: 32px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; }
.inventory-section-title span:last-child { letter-spacing: 0; font-variant-numeric: tabular-nums; }
.inventory-item {
  min-height: 42px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  content-visibility: auto;
  contain-intrinsic-size: auto 42px;
}
.inventory-item.file-item { grid-template-columns: 16px minmax(0, 1fr) auto var(--control-compact); }
.inventory-item.site-item { grid-template-columns: 16px minmax(0, 1fr) auto auto; }
.inventory-item:hover { background: var(--panel-hover); }
.inventory-item.selected { background: transparent; box-shadow: inset 0 0 0 1px var(--selected-line); color: var(--selected-text); }
.item-icon { width: 16px; height: 16px; color: var(--muted); }
.inventory-item.selected .item-icon { color: var(--selected-text); }
.item-copy { min-width: 0; }
.item-copy strong { display: block; overflow: hidden; color: var(--text); font-size: 12.5px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.item-copy span { display: block; margin-top: 1px; overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.item-metric { text-align: right; }
.item-metric strong { display: block; color: var(--muted-strong); font-size: 12px; font-weight: 550; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Backhaul rate lines: rate first, capacity after it in the muted tone. */
.item-metric strong:has(b) { color: var(--muted); font-size: 11.5px; font-weight: 500; }
.item-metric strong + strong { margin-top: 1px; }
.item-metric b { color: var(--muted-strong); font-weight: 600; }
.item-metric.is-stale strong, .item-metric.is-stale b { color: var(--muted); font-weight: 500; }
.item-metric strong.mono { font: 11px var(--mono); }
.inventory-actions { display: inline-flex; gap: 4px; }
.inventory-actions .icon-button { width: var(--control-compact); height: var(--control-compact); }
.inventory-delete { color: var(--danger); }
.inventory-delete:hover { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger-text); }
.file-delete { width: var(--control-compact); height: var(--control-compact); color: var(--danger); }
.file-delete:hover { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger-text); }

/* Readout rows: label left, value right, hairlines between. Used by drawer
   panels and the selection inspector. */
.readout-rows { display: grid; margin: 0; }
.readout-rows > div { min-height: 34px; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.readout-rows > div:last-child { border-bottom: 0; }
.readout-rows dt { color: var(--muted); font-size: 12px; }
.readout-rows dd { min-width: 0; margin: 0; color: var(--text); font-size: 12.5px; font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }

.panel-kicker {
  color: var(--faint);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}

/* Map surface and controls. */
.map-wrap { background: var(--bg); }
.map-context {
  position: absolute;
  top: 12px;
  left: 60px;
  z-index: 451;
  width: min(285px, calc(100% - 430px));
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-float);
  background: var(--panel-glass);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  pointer-events: none;
}
.map-context > span:first-child { color: var(--faint); font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.map-context strong { font-size: 13px; font-weight: 600; }
.map-context > span:last-child { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.map-provider-banner { position:absolute; top:calc(var(--search-top) + 58px); left:50%; transform:translateX(-50%); z-index:1100; max-width:min(620px,calc(100% - 100px)); padding:9px 13px; border:1px solid rgba(211,163,77,.45); border-radius:var(--radius-float); background:rgba(38,31,17,.95); color:#ecd9ad; box-shadow:var(--shadow-sm); font-size:12px; line-height:1.45; text-align:center; }
.map-provider-banner[hidden] { display:none; }
.map-help { position: absolute; left: 50%; bottom: 18px; z-index: 450; transform: translateX(-50%); padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-float); background: var(--panel-glass); box-shadow: var(--shadow-sm); color: var(--text); font-size: 12px; pointer-events: none; }
.map-help.hidden { display: none; }

/* Search: one 40px floating field with a 16px icon and the / shortcut. */
.map-search input {
  width: 100%;
  height: var(--search-h);
  padding: 0 40px 0 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-float);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.map-search input:hover { border-color: var(--line-strong); }
.map-search input:focus { border-color: var(--selected); box-shadow: 0 0 0 3px var(--selected-soft), var(--shadow-sm); }
.map-search .search-icon { position: absolute; top: 50%; left: 13px; width: 16px; height: 16px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.map-search kbd { position: absolute; top: 50%; right: 10px; min-width: 20px; padding: 1px 6px; transform: translateY(-50%); border: 1px solid var(--line-strong); border-radius: 4px; background: var(--panel-sunken); color: var(--muted); font: 11px/16px var(--mono); text-align: center; pointer-events: none; }
.map-search input:not(:placeholder-shown) ~ kbd { display: none; }

/* Selection inspector: a flat readout, not dashboard tiles. */
.selection-card { position: absolute; z-index: 450; width: min(340px, calc(100% - 24px)); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-float); background: var(--panel-glass); box-shadow: var(--shadow); backdrop-filter: blur(14px); scrollbar-width: thin; }
.inspector-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.inspector-header > div { min-width: 0; padding-top: 2px; }
.inspector-header > .inspector-header-actions { display: flex; align-items: center; gap: 6px; flex: none; padding-top: 0; }
.inspector-header h3 { margin: 0; font-size: 14px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.selection-meta { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.inspector-body { padding: 0 16px 14px; }
.site-ap-section h4 { display:flex; align-items:center; justify-content:space-between; margin:14px 0 0; padding-bottom:8px; border-bottom:1px solid var(--line); color:var(--text); font-size:12px; font-weight:600; }
.site-ap-section h4 span { color:var(--muted); font-variant-numeric:tabular-nums; font-weight:500; }
.site-ap-actions,.ap-color-actions { display:flex; align-items:center; gap:var(--gap-sm); }
.ap-color-field { display:flex; align-items:center; justify-content:space-between; gap:var(--gap-sm); }
.ap-color-actions small { color:var(--muted); }
.color-reset { margin:0 8px 8px; }
.site-ap-list { margin:0; padding:0; list-style:none; }
.site-ap-item { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:var(--gap-sm); min-height:48px; border-bottom:1px solid var(--line); }
.site-ap-item:last-child { border-bottom:0; }
.site-ap-copy { min-width:0; }
.site-ap-select { width:100%; min-height:44px; padding:6px; border:0; border-radius:var(--radius-control); background:transparent; text-align:left; cursor:pointer; }
.site-ap-select:hover { background:var(--panel-hover); }
.site-ap-item.selected { box-shadow:inset 0 0 0 1px var(--selected); border-radius:var(--radius-control); }
.site-ap-item.selected .site-ap-copy strong { color:var(--selected); }
.site-ap-select:focus-visible { outline:2px solid var(--selected); outline-offset:-2px; }

.site-ap-copy strong,.site-ap-copy span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.site-ap-copy strong { color:var(--text); font-size:12px; font-weight:600; }
.site-ap-copy span { margin-top:2px; color:var(--muted); font-size:11px; font-variant-numeric:tabular-nums; }
.readout { display: grid; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.readout-label { display: block; color: var(--faint); font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.readout-value { display: block; margin-top: 4px; color: var(--text); font-size: 18px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-value small { color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.inspector-note { margin: 10px 0 0; color: var(--faint); font-size: 11.5px; line-height: 1.5; }
.selection-actions { display: grid; gap: 10px; margin-top: 14px; }
.selection-actions-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.selection-actions-main > .control-button { flex: 1 0 auto; min-width: 0; max-width: 100%; justify-content: center; }
.selection-actions > .control-button { width: 100%; justify-content: center; }
.selection-actions-main > .control-button span { overflow: hidden; text-overflow: ellipsis; }
.selection-actions-main > .danger-button { flex: none; }
.selection-actions-collectors { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.selection-actions-label { color: var(--muted); font-size: 12px; }
.selection-actions-collector-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.selection-actions-collector-buttons > .control-button { min-width: 0; justify-content: center; }
.selection-actions-collector-buttons > .control-button span { overflow: hidden; text-overflow: ellipsis; }

/* Prediction studies: a compact right-side work queue with direct row actions. */
.prediction-panel { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-float); background: var(--panel-glass); box-shadow: var(--shadow); backdrop-filter: blur(14px); scrollbar-width: thin; }
.prediction-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.prediction-panel-header > div:first-child { min-width:0; }
.prediction-panel-actions { display:flex; align-items:center; gap:var(--gap-xs); }
.prediction-panel-actions [aria-pressed="true"] { color:var(--selected); border-bottom:2px solid var(--selected); }
.prediction-panel-header h2 { margin: 0; color: var(--text); font-size: 13px; font-weight: 600; }
.prediction-panel-header span { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.prediction-list { padding: 6px 8px 8px; }
.prediction-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px; min-height: 48px; padding: 3px 0 3px 6px; border-left: 2px solid transparent; border-radius: 6px; }
.prediction-item:hover { background: var(--panel-hover); }
.prediction-item.selected { background: transparent; border-left-color: transparent; box-shadow: inset 0 0 0 1px var(--selected-line); color: var(--selected-text); }
.prediction-item.selected .prediction-row strong { color: var(--selected-text); }
.prediction-row { min-width: 0; display: grid; grid-template-columns: 9px minmax(0, 1fr); align-items: center; gap: 9px; padding: 5px 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.prediction-row strong, .prediction-row span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prediction-row strong { color: var(--text); font-size: 12px; font-weight: 600; }
.prediction-row span { margin-top: 2px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.prediction-status { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.prediction-status.succeeded { background: var(--success); }
.prediction-status.running, .prediction-status.queued { background: var(--warning); }
.prediction-status.failed { background: var(--danger); }
.prediction-item-actions { display: inline-flex; gap: 3px; padding-right: 4px; }
.prediction-item-actions .icon-button { width: var(--control-compact); height: var(--control-compact); }
.prediction-item-actions .prediction-delete { color: var(--danger); }
.prediction-item-actions .prediction-delete:hover { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger-text); }
.prediction-empty { padding: 18px 10px 20px; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
.prediction-color-chip { width: 14px; height: 14px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--prediction-color); }
.prediction-row .prediction-color-chip { display: inline-block; width: 8px; height: 8px; margin: 0 6px 0 0; vertical-align: baseline; }
.prediction-color-popover { position: fixed; inset: auto; z-index: 5100; width: min(334px,calc(100vw - 16px)); max-height: calc(100dvh - 16px); padding: 0; overflow: auto; background: var(--panel); }
.prediction-color-popover .popover-header { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-sm); padding: 4px 8px; border-bottom: 1px solid var(--line); }
.prediction-color-popover .popover-header strong { font-size: 12px; }
.prediction-color-popover .popover-header .icon-button { flex: none; width: var(--control-compact); height: var(--control-compact); }
.prediction-color-palette { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; padding: 8px; }
.prediction-color-option { position: relative; cursor: pointer; }
.prediction-color-id { position: absolute; right: 3px; bottom: 3px; padding: 1px 3px; border-radius: 3px; background: var(--panel); color: var(--text); font-size: 10px; line-height: 12px; font-variant-numeric: tabular-nums; pointer-events: none; }
.prediction-color-error { margin: 0; padding: 0 8px 8px; color: var(--danger-text); font-size: 12px; }
.prediction-color-swatch { position: relative; display: block; height: var(--control-h); border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--prediction-color); }
.prediction-color-swatch::after { content: ''; position: absolute; top: 50%; left: 50%; width: 8px; height: 8px; border: 2px solid var(--bg); border-radius: 50%; background: var(--action); transform: translate(-50%, -50%); visibility: hidden; }
.prediction-color-option input:checked + .prediction-color-swatch::after { visibility: visible; }
.prediction-color-option input:checked + .prediction-color-swatch,
.prediction-color-option input:focus-visible + .prediction-color-swatch { outline: 2px solid var(--selected); outline-offset: 2px; }
.selection-prediction-color { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.legend-prediction-colors { display: inline-flex; gap: 2px; flex: none; }
.legend-prediction-colors > span { width: 6px; height: 12px; border-radius: 2px; }

/* Legend: data colors on a quiet panel. Missing data is dashed gray. */
.map-legend { position: absolute; z-index: 450; min-width: 172px; padding: 10px 12px 8px; border: 1px solid var(--line); border-radius: var(--radius-float); background: var(--panel-glass); box-shadow: var(--shadow-sm); backdrop-filter: blur(14px); }
.map-legend strong { display: block; color: var(--text); font-size: 12px; font-weight: 600; }
.legend-context { display: block; margin: 2px 0 6px; color: var(--faint); font-size: 11px; }
.legend-row { min-height: 20px; display: flex; align-items: center; gap: 8px; color: var(--muted-strong); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.legend-row:first-of-type { margin-top: 6px; }
.legend-swatch { width: 16px; height: 3px; flex: none; border-radius: 2px; }
.legend-swatch.dashed { background: repeating-linear-gradient(90deg, #7d8894 0 4px, transparent 4px 7px); }
.legend-swatch.split { background: linear-gradient(90deg, #53d769 0 50%, #ff9f43 50% 100%); }
.map-legend .segmented { margin: 0 0 4px; }
/* Two-way switch for line readings: bandwidth or capacity per direction. */
.segmented { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--panel-sunken); }
.segmented button { min-height: 24px; padding: 0 9px; border: 0; border-radius: 5px; background: none; color: var(--muted); font: inherit; font-size: 12px; font-weight: 550; cursor: pointer; }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: transparent; box-shadow: inset 0 0 0 1px var(--selected-line); color: var(--selected-text); }
.layer-row-choice { cursor: default; }

/* Dialogs: one floating radius, a plain raised header, an SVG close on the
   icon-button grammar, sentence-case titles and a neutral action pair. */
.modal-backdrop { position: fixed; inset: 0; z-index: 5000; display: grid; place-items: center; padding: 18px; background: rgba(5, 7, 10, .72); backdrop-filter: blur(6px); }
.modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-float);
  background: var(--panel);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.modal.wide { width: min(1060px, 100%); }
.modal.narrow { width: min(460px, 100%); }
.modal-header {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 12px 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-raised);
}
.modal-header > div { min-width: 0; display: grid; gap: 3px; }
.modal-header h2 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; }
.modal-header p { max-width: 680px; margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.modal-body { overflow: auto; padding: 20px; font-size: 13px; line-height: 1.5; scrollbar-width: thin; }
.modal-body > p { margin: 0 0 14px; color: var(--muted-strong); font-size: 13px; line-height: 1.55; }
.study-status-line { display: flex; align-items: center; gap: 10px; min-height: 28px; margin: 0 0 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.study-status-label { color: var(--muted); font-size: 12px; }
.study-status { flex: none; font-weight: 600; }
.study-status-detail { min-width: 0; overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--panel); }
.modal-footer > div { display: flex; gap: 8px; margin-left: auto; }
.modal-footer-hint { color: var(--faint); font-size: 11.5px; }
.map-area-dialog { padding:0; width:min(1060px,calc(100vw - 32px)); height:min(760px,calc(100dvh - 32px)); max-width:none; max-height:none; border:1px solid var(--line-strong); border-radius:var(--radius-float); background:var(--panel); color:var(--text); box-shadow:var(--shadow-xl); }
.map-area-dialog[open] { display:grid; grid-template-rows:auto auto minmax(0,1fr) auto; }
.map-area-dialog::backdrop { background:rgba(5,7,10,.72); }
.map-area-toolbar { display:flex; gap:12px; padding:4px 20px; border-bottom:1px solid var(--line); }
.map-area-toolbar .mode-button { height:var(--control-h); }
.map-area-canvas { min-width:0; min-height:0; touch-action:none; }
.map-area-canvas.drawing-area,.map-area-canvas.drawing-area * { cursor:crosshair !important; }
.map-area-dialog .modal-footer > span { min-width:0; color:var(--muted); font-size:12px; }
.map-area-dialog .modal-footer { flex-wrap:wrap; }
/* Workflow dialogs group content in flat sections, not nested cards. */
.modal-body .admin-card { margin: 0; padding: 16px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
.modal-body .admin-card:first-child { padding-top: 0; border-top: 0; }
.modal-body .admin-card:last-child { padding-bottom: 0; }
.modal-body .admin-card h2 { margin: 0 0 10px; font-size: 13.5px; font-weight: 600; }
.modal-body p.admin-card, .modal-body .admin-card > p { color: var(--muted-strong); font-size: 13px; line-height: 1.55; }
.modal-body .admin-card > :last-child { margin-bottom: 0; }
.modal-body .admin-card > :not(h2) + :is(button, .table-wrap) { margin-top: 12px; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }

/* Actions: near-white primary, bordered neutral secondary, red only where
   destructive. 36px geometry; .small is the 32px compact size. */
.primary-button, .secondary-button, .danger-button {
  min-height: var(--control-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}
.primary-button { border-color: var(--action); background: var(--action); color: var(--action-text); }
.primary-button:hover { border-color: var(--action-hover); background: var(--action-hover); }
.secondary-button { background: var(--panel-raised); color: var(--text); }
.secondary-button:hover { border-color: var(--line-strong); background: var(--panel-hover); }
.danger-button { border-color: rgba(221, 104, 114, .5); background: rgba(221, 104, 114, .1); color: #f0a8ae; }
.danger-button:hover { border-color: rgba(221, 104, 114, .7); background: rgba(221, 104, 114, .16); }
.primary-button.small, .secondary-button.small, .danger-button.small { min-height: var(--control-compact); padding: 0 10px; font-size: 12px; }
.primary-button:disabled, .secondary-button:disabled, .danger-button:disabled { opacity: .5; cursor: default; }
.modal-save.pristine, .modal-save.pristine:hover {
  border-color: var(--line);
  background: var(--panel-sunken);
  color: var(--faint);
  opacity: 1;
  cursor: default;
}

/* Fields: sentence-case labels above 36px controls. */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { min-width: 0; display: grid; align-content: start; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label, .field-label { color: var(--muted-strong); font-size: 12px; font-weight: 500; }
.scope-readout { overflow-wrap: anywhere; color: var(--text); font: 12px/1.5 var(--mono); }
.field :where(input:not([type="checkbox"], [type="radio"]), select, textarea) {
  width: 100%;
  min-width: 0;
  padding: 7px 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  outline: none;
}
.field :where(input:not([type="checkbox"], [type="radio"]), select, textarea) {
  min-height: var(--control-h);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--panel-sunken);
}
.field textarea { min-height: 78px; line-height: 1.5; resize: vertical; }
.field :where(input:not([type="checkbox"], [type="radio"]), select, textarea):hover { border-color: var(--line-strong); }
.field :where(input:not([type="checkbox"], [type="radio"]), select, textarea):focus { border-color: var(--selected); box-shadow: 0 0 0 3px var(--selected-soft); }
.field ::placeholder { color: var(--faint); }
.field small { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.form-note { margin: 0; color: var(--muted-strong); font-size: 12px; line-height: 1.5; }
/* Form actions keep their own width. */
.field:where(:has(> button)) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
/* A status line under a field reads with it, not as its own row. */
.form-grid > .subtle { margin-top: -8px; }
.checkbox-field {
  min-height: var(--control-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--panel-sunken);
  color: var(--muted-strong);
  font-size: 12.5px;
  line-height: 1.4;
  cursor: pointer;
}
.checkbox-field:hover { border-color: var(--line-strong); }
.checkbox-field input { width: 16px; height: 16px; flex: none; margin: 0; accent-color: var(--selected); }
/* Section titles: sentence case on a hairline, not boxed. */
.form-section { grid-column: 1 / -1; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form-section h3 { margin: 0; color: var(--text); font-size: 13.5px; font-weight: 600; }
.ptp-advanced, .ap-advanced { border-top: 1px solid var(--line); padding-top: var(--gap-md); }
.ptp-advanced > summary, .ap-advanced > summary { cursor: pointer; min-height: var(--control-h); color: var(--text); }
.ptp-advanced > summary:focus-visible, .ap-advanced > summary:focus-visible { outline: 2px solid var(--selected); outline-offset: 2px; }
.ap-advanced:not([open]) > .form-grid { display: none; }
.lidar-surveys { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.lidar-surveys > summary { cursor: pointer; min-height: var(--control-h); color: var(--text); font-size: 13.5px; font-weight: 600; }
.lidar-surveys > summary:focus-visible { outline: 2px solid var(--selected); outline-offset: 2px; }
#ptp-aim-preview td { font-variant-numeric: tabular-nums; }
/* A fieldset groups related fields under a sentence-case legend. */
fieldset.field { min-width: 0; margin: 0; gap: 12px; padding: 12px 16px 16px; border: 1px solid var(--line); border-radius: var(--radius-panel); }
fieldset.field legend { padding: 0 6px; color: var(--text); font-size: 13px; font-weight: 600; }
fieldset.field label { display: grid; gap: 6px; }
fieldset.field p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

.upload-dropzone {
  position: relative;
  min-height: 172px;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-panel);
  background: var(--panel-sunken);
  text-align: center;
  cursor: pointer;
}
.upload-dropzone:hover { border-color: var(--muted); }
.upload-dropzone.dragging { border-color: var(--selected); background: var(--selected-soft); }
.upload-dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-dropzone strong { color: var(--text); font-size: 13.5px; font-weight: 600; }
.upload-dropzone > span:not(.upload-icon) { max-width: 540px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.upload-icon { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--panel-raised); color: var(--muted-strong); }
.upload-icon .icon { width: 20px; height: 20px; }
.upload-progress { padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--panel-sunken); color: var(--muted-strong); font-size: 12px; }

@media (max-width: 950px) {
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .modal-backdrop { padding: 8px; }
  .modal { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  .modal-header { min-height: 56px; padding: 10px 10px 10px 16px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 10px 16px; }
  .modal-footer-hint { display: none; }
}

/* Administration: the map's graphite vocabulary on a document page. One
   header bar, an icon nav, flat sections, rows and tables, state as a dot and
   a label, and the shared control geometry. The information architecture is
   unchanged. */
.admin-page { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--topbar-h) minmax(0, 1fr); background: var(--bg); }
.admin-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.admin-header .brand-mark .icon { width: 18px; height: 18px; stroke-width: 1.7; }
.admin-header .brand-copy { display: flex; align-items: baseline; gap: 7px; overflow: hidden; white-space: nowrap; }
.admin-header .brand-copy strong { overflow: hidden; font-size: 13.5px; font-weight: 600; letter-spacing: 0; text-overflow: ellipsis; }
.admin-header .brand-copy span { flex: none; margin: 0; color: var(--muted); font-size: 13.5px; }
.admin-header .brand-copy .brand-separator { color: var(--faint); }
.admin-header-actions { display: flex; flex: none; align-items: center; gap: var(--gap-sm); }
.admin-header-actions .status-pill { margin-right: 10px; }
.ghost-link {
  min-height: var(--control-compact);
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: var(--radius-control);
  color: var(--muted-strong);
  font-size: 12.5px;
  font-weight: 550;
  text-decoration: none;
}
.ghost-link:hover { background: var(--panel-hover); color: var(--text); }

/* Navigation: 36px rows with an icon; the current section takes the soft
   indigo fill and 2px marker used by the drawer. Group labels match the
   drawer's. */
.admin-layout { min-height: 0; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.admin-nav {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 10px 10px 12px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}
.admin-nav-scroll { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.admin-nav-group { margin: 16px 10px 6px; }
.admin-nav-group span, .eyebrow { color: var(--faint); font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.admin-nav-item {
  width: 100%;
  min-height: var(--control-h);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1px 0;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-control);
  background: none;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.admin-nav-item .icon { color: var(--muted); }
.admin-nav-item:hover { background: var(--panel-hover); color: var(--text); }
.admin-nav-item.active { background: transparent; box-shadow: inset 0 0 0 1px var(--selected-line); color: var(--selected-text); }
.admin-nav-item.active .icon { color: var(--selected-text); }
.admin-nav-footer { display: grid; gap: 3px; margin-top: 10px; padding: 12px 10px 0; border-top: 1px solid var(--line); }
.admin-nav-footer strong { color: var(--muted); font-size: 12px; font-weight: 500; }
.admin-nav-footer span { display: flex; flex-wrap: wrap; gap: 4px; }
.admin-nav-footer code { font-size: 11px; white-space: nowrap; }

/* Content: a 13px baseline, a quiet note, and a sentence-case page title. */
.admin-content { min-width: 0; overflow: auto; padding: 24px clamp(16px, 3vw, 40px) 48px; font-size: 13px; scrollbar-width: thin; }
.admin-content > #admin-section { width: min(1340px, 100%); margin: 0 auto; }
/* Guides are reading surfaces, rather than compact administration forms. */
.documentation-section .admin-page-heading { margin-bottom: 28px; padding-bottom: 20px; }
.documentation-section .admin-page-heading h1 { font-size: 26px; }
.documentation-section .admin-page-heading p { font-size: 14px; line-height: 1.65; }
.docs-layout { display: grid; grid-template-columns: minmax(220px, 250px) minmax(0, 1fr); gap: 32px; align-items: start; }
.docs-index, .docs-article { min-width: 0; }
.docs-index { padding: 8px 0; position: sticky; top: 16px; max-height: calc(100vh - 180px); overflow: auto; scrollbar-width: thin; }
.docs-search-label { display: block; color: var(--text); font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.docs-index input { width: 100%; height: var(--control-h); margin-bottom: 16px; padding: 0 12px; color: var(--text); background: var(--panel-raised); border: 1px solid var(--line); border-radius: var(--radius-control); font-size: 14px; }
.docs-list { display: grid; gap: 4px; }
.docs-entry { display: block; width: 100%; min-height: var(--control-h); padding: 10px 12px; text-align: left; color: var(--muted-strong); background: transparent; border: 0; border-left: 2px solid transparent; border-radius: 0; font-size: 14px; line-height: 1.5; cursor: pointer; }
.docs-entry strong { font-weight: 500; }
.docs-entry:hover { background: var(--panel-hover); }
.docs-entry.active { color: var(--selected-text); background: transparent; border-left-color: transparent; box-shadow: inset 0 0 0 1px var(--selected-line); }
.docs-entry.active strong { font-weight: 600; }
.docs-article { padding: clamp(24px, 3vw, 48px); border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--panel); }
.docs-markdown { max-width: 74ch; margin: 0 auto; font-size: 16px; line-height: 1.75; overflow-wrap: anywhere; }
.docs-markdown h1, .docs-markdown h2, .docs-markdown h3, .docs-markdown h4, .docs-markdown h5, .docs-markdown h6 { color: var(--text); font-weight: 600; line-height: 1.3; }
.docs-markdown h1 { margin: 0 0 24px; font-size: clamp(26px, 2.4vw, 32px); letter-spacing: -.02em; }
.docs-markdown h2 { margin: 48px 0 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 23px; letter-spacing: -.01em; }
.docs-markdown h3 { margin: 32px 0 14px; font-size: 19px; }
.docs-markdown h4, .docs-markdown h5, .docs-markdown h6 { margin: 28px 0 12px; font-size: 16px; }
.docs-markdown h1:first-child, .docs-markdown h2:first-child { margin-top: 0; }
.docs-markdown h1 + p { color: var(--muted-strong); font-size: 17px; line-height: 1.7; }
.docs-markdown p, .docs-markdown ul, .docs-markdown ol { margin: 1em 0; }
.docs-markdown ul, .docs-markdown ol { padding-left: 24px; }
.docs-markdown li { margin: .5em 0; padding-left: 4px; }
.docs-markdown li > p, .docs-markdown li > ul, .docs-markdown li > ol { margin: .5em 0; }
.docs-markdown strong { font-weight: 600; }
.docs-markdown pre { margin: 24px 0; overflow: auto; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg); font-family: var(--mono); font-size: 14px; line-height: 1.65; }
.docs-markdown code { font-family: var(--mono); font-size: .9em; }
.docs-markdown pre code { padding: 0; border: 0; background: none; color: var(--muted-strong); font-size: inherit; }
.docs-markdown :not(pre) > code { padding: 2px 5px; border-radius: 4px; background: var(--panel-raised); color: var(--text); }
.docs-markdown table { display: block; max-width: 100%; margin: 24px 0; overflow-x: auto; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.docs-markdown th, .docs-markdown td { padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: normal; line-height: 1.6; }
.docs-markdown th { position: static; color: var(--text); font-size: inherit; font-weight: 600; }
.docs-markdown table code { font-size: inherit; }
.docs-markdown blockquote { margin: 24px 0; padding-left: 20px; border-left: 2px solid var(--line-strong); color: var(--muted-strong); }
.docs-markdown blockquote > :first-child { margin-top: 0; }
.docs-markdown blockquote > :last-child { margin-bottom: 0; }
.docs-markdown hr { margin: 32px 0; border: 0; border-top: 1px solid var(--line); }
.docs-markdown a { color: var(--text); text-decoration-color: var(--muted); text-underline-offset: 4px; }
.docs-markdown a:hover { text-decoration-color: var(--text); }
@media (max-width: 1100px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); }
  .docs-index { position: static; max-height: 260px; padding: 0 0 16px; border-bottom: 1px solid var(--line); }
}
@media (max-width: 720px) {
  .docs-layout { gap: 24px; }
  .docs-article { padding: 24px 20px; }
}
.admin-banner {
  width: min(1340px, 100%);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 auto 20px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--panel);
  font-size: 12.5px;
  line-height: 1.5;
}
.admin-banner-icon { margin-top: 1px; color: var(--muted); }
.admin-banner div { display: grid; gap: 1px; }
.admin-banner strong { color: var(--text); font-size: 13px; font-weight: 600; }
.admin-banner div span { color: var(--muted); }
.admin-page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.admin-page-heading .eyebrow { display: block; margin: 0 0 6px; }
.admin-page-heading h1 { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.admin-page-heading p { max-width: 760px; margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

/* Current settings: one panel with a shortcut to each editor. */
.overview-grid {
  margin-bottom: 16px;
  padding: 2px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--panel);
}
.overview-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.overview-card:last-child { border-bottom: 0; }
.overview-card h2 { margin: 0 0 6px; color: var(--text); font-size: 14px; font-weight: 600; }
.overview-value { color: var(--muted-strong); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.overview-card p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.state-dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--faint); }
.state-dot.good { background: var(--success); }
.state-dot.pending { background: var(--warning); }
.state-dot.bad { background: var(--danger); }
.state-dot.neutral { background: var(--muted); }

.lidar-results-heading { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.lidar-results-heading h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
@media (max-width: 720px) { .lidar-results-heading { flex-direction: column; gap: 12px; } }

/* One card level per task; groups inside it are hairline sections. */
.admin-card { margin-bottom: 16px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--panel); }
.admin-card h2 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.admin-card > p { margin: 0 0 16px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.admin-card code { font-family: var(--mono); font-size: 12px; color: var(--text); }
.admin-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.admin-card-header > div { min-width: 0; }
.admin-card-header p { max-width: 820px; margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.admin-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.admin-title-row p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
/* A count is information, not state: muted tabular text, no pill. */
.count-badge { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Restart scope is a status line: amber when saving needs a restart. */
.restart-scope { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; color: var(--muted-strong); font-size: 12px; }
.restart-scope > span { display: inline-flex; align-items: center; gap: 7px; margin-right: 2px; }
.restart-scope > span::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--warning); }
.restart-scope.no-restart > span::before { background: var(--success); }
.restart-scope code { font-size: 11.5px; }
.settings-form { gap: 16px 12px; }
.form-panel { grid-column: 1 / -1; min-width: 0; margin: 0; padding: 16px 0 0; border: 0; border-top: 1px solid var(--line); }
.form-panel:first-child { padding-top: 0; border-top: 0; }
.form-panel legend { float: left; width: 100%; margin: 0 0 12px; padding: 0; color: var(--text); font-size: 13.5px; font-weight: 600; }
.form-panel legend + * { clear: both; }
.form-panel-description { margin: 0 0 14px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.form-panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.form-panel-grid > .full { grid-column: 1 / -1; }
.settings-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.settings-footer > div { display: grid; gap: 2px; }
.settings-footer strong { color: var(--muted-strong); font-size: 12.5px; font-weight: 550; }
.settings-footer span { color: var(--muted); font-size: 12px; }
.settings-form.dirty .settings-form-state { color: var(--warning); }
.settings-form .primary-button:disabled { opacity: 1; border-color: var(--line); background: var(--panel-raised); color: var(--muted); }
.admin-inline-form { margin: 0; }
.admin-inline-form:not(:last-child) { margin-bottom: 20px; }

/* Tables: sentence-case headers, 12.5px rows, one hover, no zebra. */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-panel); scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 2; background: var(--panel-raised); color: var(--muted); font-size: 12px; font-weight: 500; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, .02); }
td strong { font-weight: 500; }
.table-input, td select {
  min-width: 128px;
  min-height: var(--control-compact);
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--panel-sunken);
  color: var(--text);
  font-size: 12.5px;
}
.empty-cell { padding: 28px; color: var(--muted); text-align: center; }
.wrap-cell { min-width: 260px; max-width: 520px; line-height: 1.5; white-space: normal; }
.subtle { color: var(--muted); font-size: 12px; line-height: 1.45; }
.compact-check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-strong); font-size: 12.5px; }
.compact-check input { margin: 0; accent-color: var(--selected); }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lidar-preparation-actions { margin-top: 12px; }
[data-lidar-evidence] { grid-column: 1 / -1; padding: 10px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 6px; }
[data-lidar-evidence] p { margin: 6px 0; }
[data-lidar-evidence] pre { white-space: pre-wrap; font-size: 12px; }
.error-text { max-width: 56ch; margin-top: 4px; color: var(--danger); font-size: 12px; overflow-wrap: anywhere; }
.notice { padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--panel-raised); color: var(--muted-strong); font-size: 12.5px; line-height: 1.55; }
.notice.good { border-color: rgba(78, 183, 131, .32); background: rgba(78, 183, 131, .05); }
.notice.warning { border-color: rgba(211, 163, 77, .35); background: rgba(211, 163, 77, .05); color: #e6d3a8; }

/* State reads as a dot and a label, like the map's connection state. */
.state-pill, .deployment-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--muted-strong); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.state-pill::before, .deployment-badge::before { content: ''; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--faint); }
.state-pill.good::before, .deployment-badge.pass::before { background: var(--success); }
.state-pill.pending, .deployment-badge.pending { color: var(--warning); }
.state-pill.pending::before, .deployment-badge.pending::before { background: var(--warning); }
.state-pill.bad, .deployment-badge.fail { color: var(--danger); }
.state-pill.bad::before, .deployment-badge.fail::before { background: var(--danger); }

/* Queue colors stay distinct from selection and from active work. */
.state-pill.queued { color: #8da8c9; }
.state-pill.running { color: var(--warning); }
.state-pill.retrying { color: #cc98bd; }
.state-pill.review { color: #65c4cd; }
.state-pill:is(.queued,.running,.retrying)::before { background: currentColor; }
.lidar-files .state-pill.good { color: var(--success); }
.lidar-files .state-pill.idle { color: var(--faint); }
.lidar-files .table-wrap { border: 0; border-radius: 0; }
.lidar-files th { background: var(--panel); }
.lidar-files td { vertical-align: top; }
.lidar-files .wrap-cell { min-width: 200px; overflow-wrap: anywhere; }
.lidar-file-name { display: block; margin-bottom: 3px; color: var(--text); }
.lidar-file-number { font-variant-numeric: tabular-nums; }
.lidar-file-actions { gap: 4px; }
.lidar-file-actions .icon-button { width: var(--control-compact); height: var(--control-compact); }
.lidar-delete:hover { color: var(--danger); }
.lidar-files details { margin-top: 4px; font-size: 12px; color: var(--muted); }
.lidar-files summary { width: fit-content; cursor: pointer; }
.lidar-files details .wrap-cell { margin-top: 6px; color: var(--muted-strong); }

@media (max-width: 720px) {
  .lidar-files .table-wrap { overflow: visible; }
  .lidar-files thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .lidar-files table, .lidar-files tbody { display: block; }
  .lidar-files tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px 16px; padding: 16px 0; border-top: 1px solid var(--line); }
  .lidar-files td { min-width: 0; max-width: none; padding: 0; border: 0; white-space: normal; }
  .lidar-files td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; }
  .lidar-files .lidar-file-identity, .lidar-files .lidar-file-action-cell, .lidar-files .empty-cell { grid-column: 1 / -1; }
  .lidar-files td[data-label="Download"] { order: 1; }
  .lidar-files td[data-label="Surfaces"] { order: 2; }
  .lidar-files td[data-label="Size"] { order: 3; }
  .lidar-files td[data-label="Points"] { order: 4; }
  .lidar-files .lidar-file-action-cell { order: 5; }
  .lidar-file-actions .icon-button { width: var(--control-h); height: var(--control-h); }
}

.deployment-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.deployment-summary { display: grid; gap: 4px; margin: 0 0 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--panel); }
.deployment-summary strong { color: var(--text); font-size: 15px; font-weight: 600; }
.deployment-summary span { color: var(--muted); font-size: 12.5px; }
.deployment-table-wrap { overflow-x: auto; margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius-panel); }
.deployment-table { min-width: 620px; }
.deployment-table td { line-height: 1.5; vertical-align: top; white-space: normal; }
.deployment-table td:first-child { width: 26%; }
.deployment-table td small { display: block; color: var(--muted); font-size: 12px; }
.deployment-table td p { margin: 4px 0 0; }

@media (max-width: 950px) {
  .admin-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .admin-nav { min-width: 0; display: block; padding: 6px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-nav-scroll { display: flex; gap: 2px; overflow-x: auto; }
  .admin-nav-group, .admin-nav-footer { display: none; }
  .admin-nav-item { width: auto; flex: none; margin: 0; }
  .admin-nav-item.active { box-shadow: inset 0 0 0 1px var(--selected-line); }
  .form-panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .admin-header { padding: 0 8px 0 12px; }
  .admin-header .status-pill { display: none; }
  .admin-header-actions .control-button { width: var(--icon-hit); justify-content: center; padding: 0; }
  .admin-header-actions .control-button span { display: none; }
  .admin-content { padding: 16px 12px 40px; }
  .admin-banner { margin-bottom: 16px; }
  .admin-page-heading { flex-direction: column; align-items: flex-start; gap: 12px; }
  .admin-card { padding: 16px; }
  .overview-grid { padding: 2px 16px; }
  .overview-card { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .overview-card > button { justify-self: start; }
  .admin-card-header { flex-direction: column; gap: 10px; }
  .restart-scope { justify-content: flex-start; max-width: none; }
  .settings-footer { flex-direction: column; align-items: stretch; }
  .settings-footer button { width: 100%; }
  .map-layer-admin > .admin-title-row { flex-direction: column; gap: 10px; }
  .map-layer-admin > .admin-title-row > button { width: 100%; }
}

/* Sign-in: the mark, "Sign in to BDC Maps" and one action on a single dark
   surface. The map carries the product's personality, not this page. */
.auth-page { min-height: 100%; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.auth-card {
  width: min(400px, 100%);
  display: grid;
  justify-items: center;
  padding: 32px 28px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-float);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
}
.auth-card .brand-mark { width: 44px; height: 44px; border-radius: var(--radius-panel); }
.auth-card .brand-mark .icon { width: 24px; height: 24px; }
.auth-card h1 { margin: 18px 0 6px; font-size: 18px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.auth-status { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.service-error-actions { display: flex; flex-wrap: wrap; gap: var(--gap-sm); }
.primary-link {
  width: 100%;
  min-height: var(--control-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: var(--radius-control);
  background: var(--action);
  color: var(--action-text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.primary-link:hover { background: var(--action-hover); }
.setup-note { width: 100%; padding: 12px 14px; border: 1px solid rgba(211, 163, 77, .35); border-radius: var(--radius-control); background: rgba(211, 163, 77, .05); text-align: left; }
.setup-note h2 { margin: 0 0 6px; color: var(--warning); font-size: 13px; font-weight: 600; }
.setup-note p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }

/* Preserve a usable information hierarchy as the viewport narrows. */
@media (max-width: 1180px) {
  .map-context { width: min(245px, calc(100% - 420px)); }
}
@media (max-width: 950px) {
  .app-shell { grid-template-rows: 66px 52px minmax(0, 1fr); }
  .map-context { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Geographic map stack. Every application mode is rendered over a
   selectable real-world tile source; the application no longer presents the
   network as a free-standing logical graph. */
#map { background:var(--bg); }
.leaflet-tile-pane { filter:none; opacity:1; }
body[data-basemap="satellite"] .leaflet-control-attribution,
body[data-basemap="satellite"] .leaflet-control-scale-line { background:rgba(8,10,13,.82)!important; color:#fff!important; }
.leaflet-control-scale-line { border-color:rgba(255,255,255,.58)!important; background:rgba(11,14,18,.75)!important; color:#dfe5ea!important; text-shadow:0 1px 2px #000; }

/* Map controls share the 36px icon-button geometry; zoom is a joined pair. */
.map-control-stack { position:absolute; z-index:690; display:grid; gap:var(--gap-sm); }
.map-control-button { background:var(--panel-glass); box-shadow:var(--shadow-sm); backdrop-filter:blur(12px); }
.leaflet-control-zoom.leaflet-bar { overflow:hidden; border:1px solid var(--line)!important; border-radius:var(--radius-control)!important; background:var(--panel-glass)!important; box-shadow:var(--shadow-sm)!important; }
.leaflet-control-zoom.leaflet-bar a { width:34px!important; height:35px!important; display:grid!important; place-items:center; border:0!important; border-radius:0!important; background:transparent!important; color:var(--muted)!important; line-height:1!important; }
.leaflet-control-zoom.leaflet-bar a + a { border-top:1px solid var(--line)!important; }
.leaflet-control-zoom.leaflet-bar a:hover { background:var(--panel-hover)!important; color:var(--text)!important; }
.leaflet-control-zoom.leaflet-bar a.leaflet-disabled { background:transparent!important; color:var(--faint)!important; opacity:.5; }
.leaflet-control-zoom .icon { width:16px; height:16px; }

/* Layers inspector: radio rows, switch rows and aligned sliders. */
.layers-panel { position:absolute; z-index:700; width:min(320px,calc(100% - 84px)); overflow:auto; border:1px solid var(--line); border-radius:var(--radius-float); background:var(--panel-glass); box-shadow:var(--shadow); backdrop-filter:blur(18px); scrollbar-width:thin; }
.layers-panel-header { position:sticky; top:0; z-index:2; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 12px 12px 16px; border-bottom:1px solid var(--line); background:var(--panel); }
.layers-panel-header > div { display:grid; gap:2px; min-width:0; }
.layers-panel-header h2 { margin:0; font-size:14px; font-weight:650; }
.panel-subtitle { color:var(--muted); font-size:12px; }
.layers-section { padding:10px 16px 12px; border-bottom:1px solid var(--line); }
.layers-section:last-of-type { border-bottom:0; }
.layers-section h3 { margin:0 0 4px; color:var(--faint); font-size:10.5px; font-weight:650; letter-spacing:.08em; text-transform:uppercase; }
.basemap-options, .overlay-options { display:grid; }
.basemap-option, .layer-row { min-height:32px; display:flex; align-items:center; gap:10px; color:var(--muted-strong); font-size:12.5px; cursor:pointer; }
.layer-row { justify-content:space-between; }
.layer-row > label { flex:1; cursor:pointer; }
.layer-row-actions { display:flex; align-items:center; gap:var(--gap-sm); flex:none; }
.number-toggle { display:flex; align-items:center; gap:var(--gap-sm); }
.number-toggle input { min-width:0; flex:1; }
.number-toggle button { flex:none; }
.number-toggle button[aria-pressed="true"] { border-color:var(--selected); background:transparent; color:var(--selected-text); }
.basemap-option:hover, .basemap-option.active, .layer-row:hover { color:var(--text); }
.basemap-option input { width:16px; height:16px; flex:none; margin:0; accent-color:var(--selected); }
.fabric-dataset-list { max-height:224px; overflow:auto; scrollbar-width:thin; }
.fabric-dataset-option { min-height:42px; }
.fabric-dataset-option > span { display:grid; gap:2px; }
.fabric-dataset-option strong { overflow:hidden; text-overflow:ellipsis; font-size:12px; font-weight:500; }
.fabric-dataset-option small { overflow:hidden; text-overflow:ellipsis; color:var(--faint); font-size:10.5px; font-variant-numeric:tabular-nums; }
.basemap-option span, .layer-row span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.overlay-options .disabled,.layer-opacity-section .disabled { opacity:.42; cursor:not-allowed; }
.switch {
  -webkit-appearance:none;
  appearance:none;
  width:30px;
  height:18px;
  flex:none;
  margin:0;
  border-radius:999px;
  background:var(--line-strong) radial-gradient(circle, var(--muted-strong) 0 6px, transparent 6.5px) 0 0 / 18px 18px no-repeat;
  cursor:pointer;
  transition:background-color .12s ease, background-position .12s ease;
}
.switch:checked { background-color:var(--selected); background-image:radial-gradient(circle, #fff 0 6px, transparent 6.5px); background-position:12px 0; }
.switch:disabled { cursor:not-allowed; }
.layer-opacity-section { display:grid; }
.layer-opacity-section label { min-height:32px; display:grid; grid-template-columns:84px minmax(0,1fr) 38px; align-items:center; gap:10px; color:var(--muted-strong); font-size:12px; }
.layer-opacity-section output { color:var(--text); font-size:12px; text-align:right; font-variant-numeric:tabular-nums; }
.layer-status { padding:10px 16px 12px; border-top:1px solid var(--line); color:var(--faint); font-size:11.5px; line-height:1.5; }

/* Range: thin track, filled to the value (--range-value, set by app.js), and
   a light thumb. The history slider fills violet only while historical. */
.range { -webkit-appearance:none; appearance:none; width:100%; height:16px; margin:0; background:transparent; cursor:pointer; --range-fill:var(--selected); }
.range::-webkit-slider-runnable-track { height:4px; border-radius:999px; background:linear-gradient(to right, var(--range-fill) 0 var(--range-value, 0%), var(--line-strong) var(--range-value, 0%) 100%); }
.range::-webkit-slider-thumb { -webkit-appearance:none; width:14px; height:14px; margin-top:-5px; border:0; border-radius:50%; background:var(--text); box-shadow:0 0 0 3px var(--panel), 0 1px 3px rgba(0,0,0,.45); }
.range::-moz-range-track { height:4px; border-radius:999px; background:var(--line-strong); }
.range::-moz-range-progress { height:4px; border-radius:999px; background:var(--range-fill); }
.range::-moz-range-thumb { width:14px; height:14px; border:0; border-radius:50%; background:var(--text); box-shadow:0 0 0 3px var(--panel); }
.range:disabled { opacity:.4; cursor:not-allowed; }
.range:focus-visible { outline:2px solid var(--selected); outline-offset:3px; border-radius:4px; }

.site-marker-shell { background:transparent!important; border:0!important; }
.bdc-gl-pane { position:absolute; inset:0; pointer-events:none; }
.bdc-gl-map .maplibregl-marker { cursor:pointer; }
.bdc-gl-map .maplibregl-ctrl-bottom-left { left:12px; bottom:12px; }
.bdc-gl-map .maplibregl-ctrl-scale { background:rgba(11,14,18,.82); border-color:var(--muted); color:var(--text); font:10px/1.3 sans-serif; }
.bdc-gl-map .maplibregl-ctrl-attrib { background:rgba(11,14,18,.82); color:var(--muted); font-size:10px; }
.bdc-gl-map .maplibregl-ctrl-attrib a { color:var(--muted); }
.bdc-gl-map .maplibregl-ctrl-scale + .maplibregl-ctrl-scale { margin-top:0; }
.bdc-gl-map .leaflet-tooltip { z-index:700; }
.bdc-gl-map .leaflet-tooltip[hidden] { display:none; }
.site-marker-shell { display:grid; place-items:center; }
.site-marker { width:7px; height:7px; border:2px solid #f1f5f7; border-radius:50%; background:#48c8ff; box-shadow:0 0 0 1px #0b0e12, 0 0 0 2px rgba(241,245,247,.82); }
.site-marker span { display:none; }
.site-marker.down { background:#765960; border-color:#ffe0e4; }
.site-label { border:1px solid rgba(58,70,83,.85)!important; border-radius:6px!important; background:rgba(11,14,18,.88)!important; color:#f1f7fa!important; box-shadow:0 3px 10px rgba(0,0,0,.35)!important; font-size:9px!important; font-weight:750!important; padding:3px 6px!important; white-space:nowrap!important; }
.site-label.leaflet-tooltip-top:before { border-top-color:rgba(11,14,18,.88)!important; }
.site-label.leaflet-tooltip-bottom:before { border-bottom-color:rgba(11,14,18,.88)!important; }
.site-label.leaflet-tooltip-left:before { border-left-color:rgba(11,14,18,.88)!important; }
.site-label.leaflet-tooltip-right:before { border-right-color:rgba(11,14,18,.88)!important; }
/* Backhaul numbers ride inside the line, rotated along it (app.js sets ink and
   angle): straight on a solid stroke, or in a capsule of the line's color on a
   dashed one. The tooltip box only positions the reading on the line. */
.link-label { padding:0!important; border:0!important; background:none!important; box-shadow:none!important; pointer-events:none!important; }
.link-label:before { display:none!important; }
.link-pill { display:block; height:16px; padding:0 7px; border-radius:8px; box-shadow:0 0 0 1.5px rgba(11,14,18,.6); font-size:10.5px; font-weight:600; line-height:16px; white-space:nowrap; }
/* On a solid line the reading is drawn straight onto the 11px stroke. */
.link-text { display:block; font-size:9px; font-weight:650; line-height:11px; white-space:nowrap; }
/* Links too short on screen for an in-line reading show it on hover. */
.link-hover-label { padding:7px 10px!important; border:1px solid var(--line-strong)!important; border-radius:var(--radius-control)!important; background:var(--panel-raised)!important; color:var(--text)!important; box-shadow:var(--shadow-sm)!important; }
.link-hover-label:before { display:none!important; }
.profile-line-label { padding:3px 6px!important; border:1px solid var(--line-strong)!important; border-radius:var(--radius-control)!important; background:var(--panel-glass)!important; color:var(--text)!important; box-shadow:var(--shadow-sm)!important; font-size:10.5px!important; font-weight:600!important; font-variant-numeric:tabular-nums; white-space:nowrap!important; pointer-events:none!important; }
.profile-line-label:before { display:none!important; }
.link-label-main,.link-label-sub { display:block; white-space:nowrap; }
.link-label-main { font-size:12px; font-weight:600; }
.link-label-sub { margin-top:2px; color:var(--muted-strong); font-size:11.5px; font-variant-numeric:tabular-nums; }

/* Deployment checks are evidence, not an unconditional green status badge. */

/* Engineering run inspector */
.hash-wrap{overflow-wrap:anywhere;font-family:monospace;font-size:12px}.study-budget{display:grid;grid-template-columns:1fr 1fr;gap:8px}.study-budget dd{margin:0;text-align:right;font-variant-numeric:tabular-nums}

.study-profile{margin:16px 0;background:var(--panel-raised);border-radius:8px;padding:12px}.study-profile svg{width:100%;max-height:350px}.study-profile figcaption{color:var(--muted-strong);font-size:12px}.study-budget{display:grid;grid-template-columns:1fr 1fr;gap:8px}.hash-wrap{overflow-wrap:anywhere}.study-profile path{stroke-width:2}
/* Antenna hardware presets use the same flat sections and control geometry. */
.antenna-template-picker { min-width: 0; }
.antenna-template-picker select { width: 100%; min-width: 0; }
.antenna-template-action { display: flex; justify-content: flex-end; flex-direction: column; }
.antenna-template-summary { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
fieldset.field.prediction-single, fieldset.field.prediction-sectors { border: 0; padding: 0; margin: 0; min-width: 0; }
.prediction-single[hidden], .prediction-sectors[hidden] { display: none; }
.prediction-sector-row { border-top: 1px solid var(--line); padding: 12px 0; }
.prediction-sector-row > .field { min-width: 0; }

.section-title { margin: 16px 0 8px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--text); font-size: 13.5px; font-weight: 600; }
.toast.warning { border-color: var(--warning); }

.elevation-profile { min-width: 0; }
.profile-overview, .profile-sampling, .profile-sample-readout, .profile-coordinates { margin: 0; display: grid; align-items: baseline; gap: var(--gap-sm) var(--gap-md); }
.profile-overview, .profile-sampling { grid-template-columns: auto minmax(0,1fr) auto minmax(0,1fr); }
.profile-overview dt, .profile-sampling dt, .profile-sample-readout dt, .profile-coordinates dt { color: var(--muted); font-size: 12px; }
.profile-overview dd, .profile-sampling dd, .profile-sample-readout dd, .profile-coordinates dd { min-width: 0; margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.profile-overview dd { font-size: 14px; font-weight: 600; }
.profile-section { display: grid; gap: var(--gap-md); margin-top: var(--gap-lg); padding-top: var(--gap-lg); border-top: 1px solid var(--line); }
.profile-section h3 { margin: 0; color: var(--text); font-size: 13.5px; font-weight: 600; }
.profile-section-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-md); }
.profile-state { display: inline-flex; align-items: center; gap: var(--gap-sm); color: var(--muted); font-size: 12px; }
.profile-state .prediction-status { flex: none; }
.profile-plot { position: relative; min-width: 0; margin: 0; cursor: crosshair; touch-action: none; }
.elevation-profile-chart {width:100%;height:auto;min-height:180px;display:block;}
.elevation-profile-chart text {fill:var(--muted);font-size:12px;font-variant-numeric:tabular-nums;}
.elevation-profile-chart .profile-grid {stroke:var(--line);stroke-width:1;}
.elevation-profile-chart .profile-trace {fill:none;stroke:var(--profile-color);stroke-width:2;stroke-linejoin:round;stroke-linecap:round;}
.profile-sample-marker { position: absolute; z-index: 1; display: grid; place-items: center; width: var(--icon-hit); height: var(--icon-hit); padding: 0; border: 0; background: none; transform: translate(-50%,-50%); cursor: grab; }
.profile-point-dot { width: 12px; height: 12px; border: 2px solid var(--profile-color); border-radius: 50%; background: var(--panel); }
.profile-sample-marker:focus-visible { outline: none; }
.profile-sample-marker:focus-visible .profile-point-dot, .profile-details > summary:focus-visible { outline: 2px solid var(--selected); outline-offset: 3px; }
.profile-sample-popup { position: absolute; z-index: 2; max-width: min(220px,100%); padding: var(--gap-md) 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--panel-glass); box-shadow: var(--shadow-sm); pointer-events: none; cursor: default; }
.profile-sample-readout { grid-template-columns: auto minmax(0,1fr); }
.profile-sample-readout :is(dt,dd) { white-space: nowrap; }
.profile-progress { margin: 0; padding: var(--gap-lg) 0; color: var(--muted-strong); overflow-wrap: anywhere; }
.profile-statistics-wrap { overflow-x: auto; scrollbar-width: thin; }
.profile-statistics { min-width: 280px; }
.profile-statistics :is(th,td) { padding: var(--gap-md) var(--gap-sm); font-variant-numeric: tabular-nums; }
.profile-statistics th { position: static; background: none; }
.profile-statistics thead th { color: var(--muted); font-size: 11.5px; }
.profile-statistics tbody th { color: var(--muted-strong); font-size: 12.5px; }
.profile-statistics :is(th,td):not(:first-child) { text-align: right; }
.profile-statistics :is(th,td):first-child { padding-left: 0; }
.profile-statistics :is(th,td):last-child { padding-right: 0; }
.profile-statistics tbody tr:last-child th { border-bottom: 0; }
.profile-sampling { padding-top: var(--gap-xs); }
.profile-details { margin-top: var(--gap-lg); border-top: 1px solid var(--line); }
.profile-details > summary { min-height: var(--control-h); padding: var(--gap-md) 0; color: var(--muted-strong); font-size: 12.5px; cursor: pointer; }
.profile-details > summary:hover { color: var(--text); }
.profile-coordinates { grid-template-columns: auto minmax(0,1fr); padding-top: var(--gap-sm); }
.profile-details h4 { margin: var(--gap-lg) 0 var(--gap-sm); padding-top: var(--gap-md); border-top: 1px solid var(--line); color: var(--muted-strong); font-size: 12px; font-weight: 500; }
.profile-sources, .profile-method { margin: 0; padding-left: 20px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.profile-sources li, .profile-method li { padding: 2px 0; overflow-wrap: anywhere; }
.profile-actions { display: flex; flex-wrap: wrap; gap: var(--gap-sm); margin-top: var(--gap-lg); padding-top: var(--gap-md); border-top: 1px solid var(--line); }
@media (max-width:600px) {
  .profile-overview, .profile-sampling { grid-template-columns: auto minmax(0,1fr); }
  .elevation-profile-chart text { font-size: 24px; }
}

/* Map image preview and personal download history. */
.snapshot-preview { display:block; width:100%; max-height:50vh; object-fit:contain; border:1px solid var(--line); border-radius:var(--radius-control); background:var(--bg); }
.snapshot-annotations { min-width:0; margin:0; padding:12px; border:1px solid var(--line); border-radius:var(--radius-control); display:grid; gap:12px; }
.snapshot-annotations[hidden] { display:none; }
.snapshot-annotations legend { padding:0 6px; color:var(--muted-strong); font-size:12px; }
.snapshot-annotations .checkbox-field { display:flex; gap:10px; }
.snapshot-annotations .form-note { margin:0; }
.snapshot-history-list { display:grid; }
.snapshot-history-row { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 0; border-bottom:1px solid var(--line); }
.snapshot-history-row > div:first-child { min-width:0; }
.snapshot-history-row strong { display:block; overflow-wrap:anywhere; font-size:13px; font-weight:600; }
.snapshot-history-row span { display:block; color:var(--muted); font-size:11px; margin-top:4px; }
.snapshot-downloads { display:flex; flex:none; gap:var(--gap-sm); }
@media(max-width:500px) { .snapshot-history-row { align-items:flex-start; flex-direction:column; gap:8px; } }

#measure-profile[aria-pressed="true"] { border-color:var(--selected-line); background:transparent; color:var(--selected-text); }

.address-match-list { border-top:1px solid var(--line); }
.address-match { width:100%; grid-template-columns:minmax(0,1fr); text-align:left; background:transparent; color:var(--text); border:0; border-bottom:1px solid var(--line); border-radius:0; }

.fabric-address-reference { cursor:default; }
.fabric-address-reference > .icon { width:16px; height:16px; flex:none; color:var(--faint); }

.study-profile.profile-plot { margin: var(--gap-lg) 0; padding: var(--gap-md); border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--panel-sunken); }
.study-profile .study-trace { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.study-profile .ground { --trace-color: #8aa88e; }
.study-profile .surface { --trace-color: #d3a34d; }
.study-profile .sight { --trace-color: #60bbff; }
.study-profile .fresnel { --trace-color: #c8ccd2; }
.study-profile .study-trace { stroke: var(--trace-color); }
.study-profile .study-trace.fresnel { stroke-dasharray: 5 3; stroke-width: 1; }
.study-profile .study-canopy-cover { fill: #8aa88e; }
.study-profile-legend { display: flex; flex-wrap: wrap; gap: var(--gap-md) var(--gap-lg); }
.study-profile-key { display: inline-flex; align-items: center; gap: var(--gap-sm); }
.study-profile-key::before { content: ""; width: 18px; border-top: 2px solid var(--trace-color); }
.study-profile-key.fresnel::before { border-top: 1px dashed var(--trace-color); }
.study-profile figcaption p { margin: var(--gap-sm) 0 0; line-height: 1.5; }
.study-profile .profile-point-dot { border-color: var(--profile-color); }

/* Compact prediction dialogs retain independently scrollable fields and actions. */
.modal:has(.prediction-form) { width: min(720px, 100%); max-height: min(820px, calc(100dvh - 36px)); }
.modal:has(.prediction-form) .modal-body { padding: 12px 16px; }
.prediction-form, .prediction-form .form-grid { gap: 9px 10px; }
.prediction-form .field { gap: 3px; }
.prediction-form .field :where(input:not([type="checkbox"], [type="radio"]), select) { min-height: 30px; padding: 4px 8px; }
.prediction-form .form-section { margin: 2px 0 0; padding-top: 8px; }
.prediction-form .form-section h3 { margin-bottom: 0; }
.prediction-form .prediction-single { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.prediction-gap-controls [data-bounded-gap] { display: grid; grid-template-columns: minmax(0, 1fr) 2fr; align-items: end; gap: 10px; }
.prediction-gap-controls [hidden] { display: none; }
.prediction-help summary { cursor: pointer; color: var(--muted-strong); font-size: 12px; }
.prediction-help[open] > :not(summary) { margin-top: 6px; }
@media (max-width: 680px) {
  .prediction-form.three, .prediction-form .prediction-single { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .prediction-form.three, .prediction-form .prediction-single, .prediction-gap-controls [data-bounded-gap] { grid-template-columns: 1fr; }
}

.prediction-form > .field:has(> select[name="antenna_mode"]) { grid-column: span 2; }
.prediction-lidar-preparation { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 6px 0; }
.prediction-lidar-preparation > h3 { display: none; }
.prediction-lidar-preparation > p { margin: 0; font-size: 12px; }
.prediction-lidar-preparation > p:empty { display: none; }
.prediction-lidar-preparation > .button-row { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
@media (max-width: 480px) {
  .prediction-form > .field:has(> select[name="antenna_mode"]) { grid-column: auto; }
  .prediction-lidar-preparation { grid-template-columns: 1fr; }
  .prediction-lidar-preparation > .button-row { grid-column: auto; grid-row: auto; }
}

.radio-template-specifications { padding: 8px 0; border-block: 1px solid var(--line); }
.radio-template-specifications summary { cursor: pointer; font-size: 12px; color: var(--muted-strong); }
.radio-template-specifications > details { margin-top: 8px; }
.radio-template-specifications dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 5px 12px; font-size: 11px; }
.radio-template-specifications dt, .radio-template-specifications dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.radio-template-specifications dt { color: var(--muted); }

/* Prerequisites precede calculations; progress is based on completed work. */
.work-queue { padding:12px 14px; border-bottom:1px solid var(--line); }
.work-queue header { display:flex; align-items:center; gap:8px; }
.work-queue header strong { margin-right:auto; }
.work-queue header span,.work-queue p,.work-queue-step span { color:var(--muted); font-size:11px; }
.work-queue ol { list-style:none; padding:0; margin:10px 0 0; display:grid; gap:12px; }
.work-queue-step { display:grid; gap:4px; min-width:0; overflow-wrap:anywhere; }
.work-queue-step strong { font-size:12px; font-weight:500; }
.work-queue-step.has-error span { color:var(--danger); }
.work-queue progress { width:100%; height:7px; accent-color:var(--selected); border:0; }
