:root {
  color-scheme: light;
  --ink: #182b3a;
  --muted: #5c6b76;
  --paper: #f4f7f9;
  --panel: #ffffff;
  --line: #cad5dc;
  --green: #075d8d;
  --green-soft: #deedf5;
  --amber: #8a6100;
  --amber-soft: #f7edcf;
  --red: #c62828;
  --red-soft: #f7e2e2;
  --blue: #075d8d;
  --blue-soft: #deedf5;
  --civic-blue: #075d8d;
  --civic-blue-dark: #063f61;
  --civic-red: #e1252f;
  --shadow: 0 12px 36px rgba(7, 63, 97, 0.08);
}

* { box-sizing: border-box; }

html { background: var(--paper); scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(rgba(7, 63, 97, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 32px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select { font: inherit; }
button { color: inherit; }
button, select, input, textarea { touch-action: manipulation; }

.skip-link {
  position: fixed;
  z-index: 20;
  left: 16px;
  top: -60px;
  padding: 10px 14px;
  color: white;
  background: var(--ink);
}

.skip-link:focus { top: 16px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.masthead {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 34px clamp(20px, 4vw, 64px) 28px;
  border-top: 7px solid var(--civic-red);
  border-bottom: 0;
  color: white;
  background: var(--civic-blue);
}

.masthead h1, h2, h3, p { margin-top: 0; }
.masthead h1 {
  margin-bottom: 0;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(2rem, 4vw, 3.6rem);
  font-weight: 750;
  letter-spacing: -0.03em;
}

.brand-lockup {
  width: min(100%, 410px);
  margin-bottom: 18px;
  padding: 10px 18px 9px;
  border-left: 4px solid #f5a623;
  background: white;
}

.brand-lockup img {
  display: block;
  width: 100%;
  height: auto;
}

.service-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.015em;
}

.demo-label {
  display: inline-flex;
  margin: 13px 0 0;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  color: white;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.prototype-label {
  max-width: 560px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.7rem;
  line-height: 1.4;
}

.prototype-label a { color: white; text-underline-offset: 3px; }

.eyebrow {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.masthead .eyebrow { color: rgba(255, 255, 255, 0.72); }

.masthead-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 6px;
}

.field-ops-link {
  display: grid;
  gap: 2px;
  padding: 9px 12px 9px 14px;
  border-left: 3px solid var(--civic-red);
  box-shadow: 0 8px 20px rgba(0, 30, 48, 0.16);
  color: var(--civic-blue-dark);
  background: white;
  text-decoration: none;
}

.field-ops-link strong {
  font-size: 0.78rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.field-ops-link span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 650;
}

.field-ops-link:hover { background: var(--green-soft); }
.field-ops-link:focus-visible { outline: 3px solid white; outline-offset: 3px; }

.role-control {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.masthead .role-control, .masthead .live-mark { color: rgba(255, 255, 255, 0.82); }

.source-refresh-status {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.source-refresh-status summary {
  display: grid;
  gap: 2px;
  min-width: 138px;
  padding: 5px 24px 5px 8px;
  cursor: pointer;
  list-style: none;
}

.source-refresh-status summary::-webkit-details-marker { display: none; }

.source-refresh-status summary::after {
  position: absolute;
  top: 50%;
  right: 8px;
  content: "▾";
  transform: translateY(-50%);
}

.source-refresh-status[open] summary::after { transform: translateY(-50%) rotate(180deg); }

.source-refresh-status time {
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.data-feed-update-list {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  max-height: min(560px, 70vh);
  overflow-y: auto;
  border: 1px solid var(--line);
  box-shadow: 0 18px 42px rgba(0, 30, 48, 0.24);
  color: var(--ink);
  background: var(--panel);
  letter-spacing: 0;
  text-transform: none;
}

.data-feed-update {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 16px;
  padding: 11px 13px;
}

.data-feed-update + .data-feed-update { border-top: 1px solid var(--line); }
.data-feed-update strong { font-size: 0.72rem; }
.data-feed-update time, .data-feed-update .feed-time-unavailable { color: var(--ink); font-size: 0.68rem; font-weight: 650; text-align: right; }
.data-feed-update p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 0.64rem; line-height: 1.35; }
.data-feed-update.is-unavailable strong, .data-feed-update.is-unavailable time, .data-feed-update.is-unavailable .feed-time-unavailable { color: var(--muted); }

.role-control select {
  padding: 4px 22px 4px 6px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel);
  font-size: 0.72rem;
  text-transform: none;
}

.masthead .quiet-button {
  color: white;
  border-bottom-color: rgba(255, 255, 255, 0.68);
}

.live-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.live-mark span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
}

.quiet-button {
  display: inline-block;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.data-notice {
  display: none;
  padding: 10px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: var(--amber-soft);
  font-size: 0.78rem;
}

.data-notice.visible { display: block; }
.data-notice.success { background: var(--green-soft); }
.data-notice.error { color: var(--red); background: var(--red-soft); }

.connection-status {
  padding: 10px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid #d6c59d;
  color: var(--ink);
  background: var(--amber-soft);
  font-size: 0.78rem;
  text-align: center;
}

.section-nav {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  gap: 4px;
  padding: 0 clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
}

.nav-item {
  padding: 16px 14px 13px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.nav-item.active {
  border-bottom-color: var(--civic-red);
  color: var(--ink);
}

main { padding: 0 clamp(20px, 4vw, 64px) 64px; }
.view { display: none; }
.view.active { display: block; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 42px 0 24px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  font-weight: 400;
  letter-spacing: -0.025em;
}

.section-note {
  max-width: 420px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: right;
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.metric { min-height: 130px; padding: 22px; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric-label { margin-bottom: 14px; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
.metric-value { margin-bottom: 7px; font-family: Georgia, "Times New Roman", serif; font-size: 2rem; }
.metric-note { margin-bottom: 0; color: var(--muted); font-size: 0.76rem; line-height: 1.4; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.queue-panel, .detail-panel, .map-panel, .hotspot-list, .record-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.map-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 52px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.map-controls > label:first-child { display: grid; gap: 3px; min-width: 170px; }
.map-controls label span, .map-address-control > label, .map-saved-addresses > span { color: var(--muted); font-size: 0.62rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; }
.map-controls select { padding: 3px 0; border: 0; color: var(--ink); background: transparent; font-size: 0.78rem; }
.check-control { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.72rem; }
.map-controls .result-count { margin-left: auto; }
.map-controls .map-address-control { display: grid; gap: 5px; min-width: min(430px, 38vw); }
.map-search-row { display: flex; align-items: center; gap: 7px; }
.map-search-row input { min-width: 0; flex: 1; padding: 7px 8px; border: 1px solid var(--line); color: var(--ink); background: white; font-size: 0.76rem; }
.map-search-row .secondary-button { padding: 7px 10px; }
.map-saved-addresses { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 7px; min-height: 23px; }
.map-address-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.map-address-chip, .map-clear-addresses { padding: 3px 7px; border: 1px solid var(--line); color: var(--green); background: transparent; cursor: pointer; font-size: 0.66rem; }
.map-address-chip:hover, .map-address-chip:focus-visible { border-color: var(--green); background: var(--green-soft); }
.map-clear-addresses { padding-inline: 2px; border-color: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.map-address-empty { color: var(--muted); font-size: 0.66rem; }
.map-search-privacy { margin: 0; color: var(--muted); font-size: 0.64rem; line-height: 1.4; }
.map-search-summary { min-height: 38px; padding: 10px 14px; border: 1px solid var(--line); border-top: 0; color: var(--muted); background: #f1f1ec; font-size: 0.72rem; line-height: 1.45; }
.operational-map-wrap { position: relative; min-height: 640px; border: 1px solid var(--line); border-top: 0; background: #e8ebe9; box-shadow: var(--shadow); }
#operationalMap { width: 100%; height: 640px; }
.map-fallback { position: absolute; inset: 0; display: grid; place-content: center; padding: 30px; text-align: center; }
.map-fallback[hidden] { display: none; }
.map-fallback h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.map-fallback p { color: var(--muted); font-size: 0.8rem; }
.operational-map-key { display: flex; flex-wrap: wrap; gap: 18px; padding: 13px 16px; border: 1px solid var(--line); border-top: 0; background: var(--panel); color: var(--muted); font-size: 0.68rem; }
.operational-map-key span { display: inline-flex; align-items: center; gap: 6px; }
.operational-map-key i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.key-request { border: 2px solid var(--red); background: white; }
.key-veo { background: #008b8b; }
.key-spin { background: #e86f3f; }
.key-flag { border: 2px solid var(--red); background: transparent; }
.key-watch { border: 2px dashed var(--amber); background: transparent; }
.key-policy { border: 2px dashed #7a4b76; background: rgba(122, 75, 118, 0.08); }

.fleet-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.65fr);
  gap: 20px;
  align-items: start;
}

.fleet-map-panel, .pileup-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.vehicle-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 1px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  background: var(--line);
}

.vehicle-filters label { display: grid; gap: 5px; padding: 10px 12px; background: var(--panel); }
.vehicle-filters label span { color: var(--muted); font-size: 0.66rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; }
.vehicle-filters select { width: 100%; padding: 3px 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 0.8rem; }

#vehicleCanvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 650px;
  border-top: 1px solid var(--line);
}

.fleet-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--muted); font-size: 0.68rem; }
.fleet-legend span { display: inline-block; width: 9px; height: 9px; margin-left: 7px; border-radius: 50%; }
.fleet-legend .legend-veo { background: #008b8b; }
.fleet-legend .legend-spin { background: #e86f3f; }
.fleet-legend .legend-flag { border: 2px solid var(--red); background: transparent; }
.fleet-legend .legend-watch { border: 2px dashed var(--amber); background: transparent; }
.map-caption { margin: 0; padding: 13px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.7rem; line-height: 1.45; }
.pileup-panel { max-height: 760px; overflow-y: auto; }
.pileup-item { padding: 17px 22px; border-top: 1px solid var(--line); }
.pileup-item h3 { margin: 7px 0 5px; font-family: Georgia, "Times New Roman", serif; font-size: 1.12rem; font-weight: 400; }
.pileup-item p { margin-bottom: 5px; color: var(--muted); font-size: 0.72rem; line-height: 1.4; }
.pileup-item .coordinate-link { color: var(--ink); font-variant-numeric: tabular-nums; }
.pileup-item.watch-item { background: #faf5e8; }
.watch-history { display: flex; align-items: end; gap: 4px; height: 48px; margin: 14px 0 8px; padding-bottom: 1px; border-bottom: 1px solid var(--line); }
.watch-history span { flex: 1; min-width: 5px; background: var(--amber); opacity: 0.72; }
.watch-history span.event-linked-bar { background: var(--green); opacity: 1; }
.event-context { margin: 12px 0; padding: 12px; border-left: 2px solid var(--green); background: rgba(255,255,255,0.56); }
.event-context > strong { color: var(--green); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; }
.event-context a { color: var(--green); font-size: 0.68rem; font-weight: 700; }

.panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 22px 24px 18px;
}

.panel-heading h3 { margin-bottom: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; font-weight: 400; }
.result-count { color: var(--muted); font-size: 0.76rem; }

.filters {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(120px, 1fr));
  gap: 1px;
  margin: 0 24px 18px;
  border: 1px solid var(--line);
  background: var(--line);
}

.filters label { display: grid; gap: 5px; padding: 9px 11px; background: var(--panel); }
.filters label span { color: var(--muted); font-size: 0.66rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; }
.filters input, .filters select { width: 100%; padding: 2px 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 0.78rem; }

.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 14px; color: var(--muted); background: #f1f1ec; font-size: 0.68rem; letter-spacing: 0.06em; text-align: left; text-transform: uppercase; }
td { padding: 14px; border-top: 1px solid var(--line); font-size: 0.78rem; vertical-align: top; }
tbody tr { cursor: pointer; transition: background 120ms ease; }
tbody tr:hover, tbody tr.selected { background: #f2f5f2; }
.case-title { display: block; margin-bottom: 4px; font-weight: 650; }
.case-meta { color: var(--muted); font-size: 0.7rem; }
.import-review { margin: 18px 24px 24px; padding: 18px; border: 1px solid var(--amber); background: var(--amber-soft); }
.import-review-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.import-review h4 { margin: 4px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.1rem; font-weight: 400; }
.import-review > p { margin: 10px 0; color: var(--muted); font-size: 0.72rem; line-height: 1.5; }
.import-review-item { display: grid; grid-template-columns: minmax(150px, 0.4fr) 1fr; gap: 16px; padding: 10px 0; border-top: 1px solid rgba(149, 107, 29, 0.28); font-size: 0.72rem; }
.import-review-item span { color: var(--muted); }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-critical { color: var(--red); background: var(--red-soft); }
.badge-high { color: var(--amber); background: var(--amber-soft); }
.badge-standard { color: var(--blue); background: var(--blue-soft); }
.badge-received { color: var(--red); background: var(--red-soft); }
.badge-assigned, .badge-approved { color: var(--blue); background: var(--blue-soft); }
.badge-in_progress, .badge-dispatched { color: var(--amber); background: var(--amber-soft); }
.badge-resolved, .badge-completed { color: var(--green); background: var(--green-soft); }
.badge-recommended { color: var(--amber); background: var(--amber-soft); }

.detail-panel { position: sticky; top: 72px; min-height: 460px; padding: 24px; }
.empty-state { display: grid; place-content: center; min-height: 410px; color: var(--muted); }
.empty-state h3 { margin-bottom: 8px; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; font-weight: 400; }
.empty-state p:last-child { line-height: 1.55; }
.detail-panel h3 { margin-bottom: 8px; font-family: Georgia, "Times New Roman", serif; font-size: 1.6rem; font-weight: 400; }
.detail-address { color: var(--muted); line-height: 1.45; }
.evidence {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 22px 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.evidence dt { color: var(--muted); font-size: 0.67rem; text-transform: uppercase; letter-spacing: 0.06em; }
.evidence dd { margin: 4px 0 0; font-size: 0.8rem; }
.detail-form { display: grid; gap: 14px; }
.detail-form label { display: grid; gap: 6px; color: var(--muted); font-size: 0.68rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; }
.detail-form input, .detail-form select, .detail-form textarea { width: 100%; padding: 10px; border: 1px solid var(--line); background: white; color: var(--ink); font-size: 0.8rem; text-transform: none; letter-spacing: 0; }
.detail-form textarea { min-height: 84px; resize: vertical; }
.operator-evidence { margin: -8px 0 20px; padding: 13px 14px; border-left: 3px solid var(--green); background: var(--green-soft); }
.operator-evidence strong { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; }
.operator-evidence p { margin: 5px 0; color: var(--ink); font-size: 0.76rem; line-height: 1.45; }
.operator-evidence a { color: var(--green); font-size: 0.72rem; font-weight: 700; }
.linked-photo-panel { margin: -8px 0 20px; border: 1px solid var(--line); background: #f4f3ee; }
.linked-photo-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.linked-photo-heading .eyebrow { margin: 0 0 3px; }
.linked-photo-heading strong { font-family: Georgia, "Times New Roman", serif; font-size: 1rem; font-weight: 400; }
.linked-photo-heading a { color: var(--green); font-size: 0.68rem; font-weight: 700; }
.linked-photo-strip { display: flex; gap: 10px; overflow-x: auto; padding: 12px; scroll-snap-type: x proximity; }
.linked-photo {
  position: relative;
  flex: 0 0 210px;
  height: 150px;
  overflow: hidden;
  border: 1px solid var(--line);
  color: white;
  background: var(--ink);
  scroll-snap-align: start;
}
.linked-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.linked-photo span { position: absolute; right: 0; bottom: 0; left: 0; padding: 8px; background: linear-gradient(transparent, rgba(0,0,0,0.76)); font-size: 0.65rem; font-weight: 700; }
.linked-photo.photo-load-failed { display: grid; place-items: center; height: 80px; color: var(--green); background: white; }
.linked-photo.photo-load-failed span { position: static; color: var(--green); background: transparent; text-align: center; }
.root-cause-review { margin: 0 0 24px; padding: 16px; border: 1px solid var(--line); background: #eef3f5; }
.root-cause-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.root-cause-heading .eyebrow { margin: 0 0 4px; }
.root-cause-heading h4 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.1rem; font-weight: 400; }
.root-cause-conclusion { margin: 12px 0; color: var(--ink); font-size: 0.76rem; line-height: 1.5; }
.root-cause-review ul { display: grid; gap: 6px; margin: 0 0 14px; padding-left: 18px; color: var(--muted); font-size: 0.68rem; line-height: 1.45; }
.root-cause-review > p:not(.eyebrow, .root-cause-conclusion, .evidence-boundary) { color: var(--muted); font-size: 0.7rem; }
.vehicle-trace { display: grid; gap: 0; margin: 14px 0; border-top: 1px solid var(--line); }
.vehicle-trace div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.vehicle-trace dt { color: var(--muted); font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.vehicle-trace dd { margin: 0; font-size: 0.7rem; line-height: 1.45; overflow-wrap: anywhere; }
.evidence-review-form { margin-bottom: 24px; padding: 16px; border: 1px solid var(--line); background: var(--paper); }
.evidence-review-form .eyebrow { margin: 0; }
.evidence-review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.evidence-review-form :disabled { cursor: not-allowed; opacity: 0.62; }
.evidence-boundary { margin: 0; color: var(--muted); font-size: 0.7rem; line-height: 1.5; }
.challenge-form { margin-bottom: 24px; padding: 16px; border-left: 3px solid var(--amber); background: var(--amber-soft); }
.challenge-form .eyebrow { margin: 0; }
.request-history { margin-bottom: 24px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.request-history ol { display: grid; gap: 0; margin: 10px 0 0; padding: 0; list-style: none; }
.request-history li { position: relative; display: grid; grid-template-columns: 128px 1fr; gap: 3px 14px; padding: 9px 0 9px 16px; border-left: 1px solid var(--line); }
.request-history li::before { position: absolute; top: 14px; left: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); content: ""; }
.request-history time { grid-row: 1 / span 2; color: var(--muted); font-size: 0.65rem; font-variant-numeric: tabular-nums; }
.request-history strong { font-size: 0.72rem; }
.request-history span { color: var(--muted); font-size: 0.67rem; line-height: 1.4; }

.primary-button, .secondary-button {
  padding: 10px 14px;
  border: 1px solid var(--green);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
}
.primary-button { color: white; background: var(--green); }
.secondary-button { color: var(--green); background: transparent; }
.primary-button:disabled, .secondary-button:disabled { cursor: not-allowed; opacity: 0.45; }

.intake-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 28px 100px rgba(24, 32, 29, 0.24);
}

.intake-dialog::backdrop {
  background: rgba(24, 32, 29, 0.48);
  backdrop-filter: blur(3px);
}

.intake-form { padding: 26px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dialog-heading h2 { margin-bottom: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.8rem; font-weight: 400; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; font-size: 1.35rem; line-height: 1; }
.form-note { margin: 14px 0 22px; color: var(--muted); font-size: 0.78rem; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.single-column { grid-template-columns: 1fr; }
.auth-dialog { width: min(520px, calc(100vw - 32px)); }
.form-grid label { display: grid; gap: 6px; color: var(--ink); font-size: 0.74rem; font-weight: 650; }
.form-grid label span { color: var(--muted); font-size: 0.62rem; font-weight: 500; text-transform: uppercase; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; padding: 10px 11px; border: 1px solid var(--line); color: var(--ink); background: white; font-size: 0.8rem; }
.form-grid textarea { min-height: 80px; resize: vertical; }
.full-field { grid-column: 1 / -1; }
.form-error { min-height: 18px; margin: 12px 0 0; color: var(--red); font-size: 0.75rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.workflow-monitor { margin-bottom: 20px; padding: 22px; border: 1px solid var(--line); background: var(--panel); }
.workflow-run-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-top: 18px; }
.workflow-run { padding: 14px; border: 1px solid var(--line); background: var(--paper); }
.workflow-run h4 { margin: 5px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 1rem; font-weight: 400; }
.workflow-run p { color: var(--muted); font-size: 0.72rem; line-height: 1.45; }

.hotspot-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr); gap: 20px; }
.policy-boundary-analysis { margin-bottom: 20px; padding: 24px; border: 1px solid var(--line); background: var(--paper); }
.policy-boundary-analysis h3 { margin: 4px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; font-weight: 400; }
.policy-boundary-analysis a { color: var(--green); font-size: 0.78rem; font-weight: 700; }
.policy-boundary-analysis > p { margin: 14px 0 0; color: var(--muted); font-size: 0.8rem; line-height: 1.55; }
.policy-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.policy-metrics p { display: grid; gap: 4px; margin: 0; padding: 16px; border-right: 1px solid var(--line); }
.policy-metrics p:last-child { border-right: 0; }
.policy-metrics strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.8rem; font-weight: 400; }
.policy-metrics span { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; }
.map-panel { min-height: 520px; padding: 24px; }
.map-key { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.72rem; }
.map-key span { width: 72px; height: 8px; background: linear-gradient(90deg, var(--green-soft), var(--green)); }
.zone-map { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 10px; min-height: 410px; margin-top: 24px; }
.zone-block { display: grid; place-items: center; min-height: 110px; padding: 12px; border: 1px solid var(--line); text-align: center; }
.zone-block strong { display: block; margin-bottom: 5px; font-family: Georgia, "Times New Roman", serif; font-size: 1rem; font-weight: 400; }
.zone-block span { color: var(--muted); font-size: 0.68rem; }
.hotspot-list { padding: 8px 22px; }
.hotspot-item { padding: 20px 0; border-bottom: 1px solid var(--line); }
.hotspot-item:last-child { border-bottom: 0; }
.hotspot-item h3 { margin: 7px 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; font-weight: 400; }
.hotspot-item p { margin-bottom: 8px; color: var(--muted); font-size: 0.78rem; line-height: 1.5; }
.hotspot-item .secondary-button { margin-top: 5px; }
.threshold-note { font-style: italic; }
.hotspot-item.named-watch { margin: 0 -22px; padding: 20px 22px; background: #faf5e8; }
.hotspot-item.reporting-watch { background: #eef3f5; }
.hotspot-item.event-watch { background: #f1eee4; }
.hotspot-item.event-watch a { color: var(--green); font-weight: 700; }

.historical-source strong { font-weight: 700; }
.trend-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr); gap: 20px; margin-bottom: 20px; }
.trend-layout-secondary { grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr); }
.trend-panel { padding: 22px 24px; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.month-bars { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 76px minmax(80px, 1fr) 38px; align-items: center; gap: 12px; color: var(--muted); font-size: 0.68rem; }
.bar-row > div, .channel-track { height: 7px; overflow: hidden; background: var(--green-soft); }
.bar-row i, .channel-track i { display: block; height: 100%; background: var(--green); }
.bar-row strong { color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.channel-list { display: grid; gap: 18px; }
.channel-row { display: grid; gap: 6px; }
.channel-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; font-size: 0.78rem; }
.channel-row > span { color: var(--muted); font-size: 0.68rem; }
.ranked-list { display: grid; }
.rank-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.rank-row:first-child { border-top: 0; }
.rank-row > span { color: var(--green); font-size: 0.65rem; font-weight: 750; }
.rank-row strong { font-family: Georgia, "Times New Roman", serif; font-size: 0.92rem; font-weight: 400; }
.rank-row em { color: var(--muted); font-size: 0.7rem; font-style: normal; font-variant-numeric: tabular-nums; }
.burst-summary { padding: 18px; background: #eef3f5; }
.burst-summary > strong { float: left; margin: -3px 16px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 2.3rem; font-weight: 400; }
.burst-summary p { color: var(--muted); font-size: 0.74rem; line-height: 1.5; }
.corridor-counts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0; border: 1px solid var(--line); }
.corridor-counts div { display: grid; gap: 4px; padding: 12px; }
.corridor-counts div + div { border-left: 1px solid var(--line); }
.corridor-counts dt { color: var(--muted); font-size: 0.64rem; }
.corridor-counts dd { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; }
.burst-examples { display: grid; gap: 10px; margin: 0; padding-left: 22px; }
.burst-examples li { padding-left: 4px; color: var(--muted); font-size: 0.68rem; }
.burst-examples strong, .burst-examples span { display: block; }
.burst-examples strong { color: var(--ink); font-size: 0.73rem; }
.anonymous-patterns { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.anonymous-patterns > p:not(.eyebrow) { margin: 7px 0 12px; color: var(--muted); font-size: 0.7rem; line-height: 1.5; }
.source-pattern-row { display: grid; gap: 3px; padding: 9px 0; border-top: 1px solid var(--line); }
.source-pattern-row strong { font-size: 0.73rem; }
.source-pattern-row span { color: var(--muted); font-size: 0.67rem; line-height: 1.4; }

.daily-brief { margin-bottom: 20px; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.forecast-panel { margin-bottom: 20px; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.forecast-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 22px 24px 16px; }
.forecast-heading h3 { margin: 3px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; font-weight: 400; }
.forecast-status { margin: 0; color: var(--muted); font-size: 0.68rem; text-align: right; }
.forecast-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 24px 18px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  overscroll-behavior-inline: contain;
}
.forecast-card {
  flex: 0 0 min(330px, 78vw);
  min-height: 245px;
  padding: 18px;
  border: 1px solid var(--line);
  background: #fffefb;
  scroll-snap-align: start;
}
.forecast-card-pending { background: #f4f3ee; }
.forecast-card-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.forecast-confidence { color: var(--muted); font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.05em; }
.forecast-value { margin: 22px 0 3px; font-family: Georgia, "Times New Roman", serif; font-size: 2.25rem; }
.forecast-card h4 { margin: 0 0 16px; font-size: 0.76rem; }
.forecast-card p:not(.forecast-value) { margin: 8px 0 0; color: var(--muted); font-size: 0.68rem; line-height: 1.5; }
.forecast-card .forecast-boundary { padding-top: 10px; border-top: 1px solid var(--line); font-style: italic; }
.forecast-measurement { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.forecast-measurement > section { padding: 18px 24px; }
.forecast-measurement > section + section { border-left: 1px solid var(--line); }
.forecast-measurement p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); font-size: 0.7rem; line-height: 1.5; }
.forecast-score-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.forecast-score-row span { display: grid; gap: 2px; color: var(--muted); font-size: 0.61rem; text-transform: uppercase; letter-spacing: 0.04em; }
.forecast-score-row strong { color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; font-weight: 400; letter-spacing: 0; }
.brief-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.brief-heading h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; font-weight: 400; }
.brief-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.brief-grid section { min-height: 240px; padding: 22px 24px; }
.brief-grid section + section { border-left: 1px solid var(--line); }
.brief-number { margin-bottom: 6px; font-family: Georgia, "Times New Roman", serif; font-size: 2rem; }
.brief-grid h4 { min-height: 34px; margin: 0 0 14px; font-size: 0.74rem; line-height: 1.4; }
.brief-grid ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.brief-grid li { display: grid; gap: 2px; }
.brief-grid li strong { font-size: 0.67rem; }
.brief-grid li span, .brief-empty { margin: 0; color: var(--muted); font-size: 0.65rem; line-height: 1.4; }
.alert-layout { display: grid; grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr); gap: 20px; }
.alert-panel { padding: 22px 24px; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.subscription-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 12px; }
.subscription-form label { display: grid; gap: 5px; color: var(--muted); font-size: 0.66rem; font-weight: 650; }
.subscription-form select { width: 100%; padding: 9px 8px; border: 1px solid var(--line); background: white; }
.subscription-list, .alert-delivery-list { display: grid; }
.subscription-item, .alert-delivery { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-top: 1px solid var(--line); }
.subscription-item h4, .alert-delivery h4 { margin: 6px 0 3px; font-family: Georgia, "Times New Roman", serif; font-size: 1rem; font-weight: 400; }
.subscription-item p, .alert-delivery p { margin: 0; color: var(--muted); font-size: 0.67rem; }
.alert-delivery > div:last-child { display: grid; gap: 4px; text-align: right; }
.alert-delivery > div:last-child strong { color: var(--green); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; }
.alert-delivery time { color: var(--muted); font-size: 0.63rem; }

.card-list { display: grid; gap: 16px; }
.record-card { display: grid; grid-template-columns: 1fr auto; gap: 28px; padding: 24px; }
.record-card h3 { margin: 8px 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; font-weight: 400; }
.record-card p { max-width: 760px; margin-bottom: 8px; color: var(--muted); font-size: 0.8rem; line-height: 1.5; }
.record-actions { display: flex; align-items: center; gap: 8px; }
.record-meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 16px; color: var(--muted); font-size: 0.72rem; }
.intervention-evidence, .completion-note { padding: 10px 12px; background: #f1f1ec; }
.completion-control { display: grid; gap: 7px; min-width: 260px; color: var(--muted); font-size: 0.68rem; font-weight: 650; }
.completion-control textarea { min-height: 82px; padding: 9px; border: 1px solid var(--line); color: var(--ink); background: white; resize: vertical; font-size: 0.75rem; font-weight: 400; }
.empty-card { padding: 34px; border: 1px dashed var(--line); color: var(--muted); background: rgba(255,255,255,0.45); line-height: 1.55; }

.source-callout { margin-bottom: 18px; padding: 20px 24px; border-left: 3px solid var(--green); background: var(--green-soft); }
.source-callout p { max-width: 940px; margin-bottom: 8px; color: var(--ink); font-size: 0.8rem; line-height: 1.55; }
.source-callout a { color: var(--green); font-size: 0.75rem; font-weight: 700; }
.sla-evidence-summary { margin-bottom: 18px; }
.sla-evidence-summary article { padding: 22px 24px; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.sla-evidence-summary h3 { margin: 4px 0 16px; font-family: Georgia, "Times New Roman", serif; font-size: 1.3rem; font-weight: 400; }
.sla-evidence-summary p { margin: 13px 0 0; color: var(--muted); font-size: 0.76rem; line-height: 1.5; }
.evidence-metrics { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.evidence-metrics div { display: grid; gap: 4px; padding: 14px; }
.evidence-metrics div + div { border-left: 1px solid var(--line); }
.evidence-metrics strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; font-weight: 400; }
.evidence-metrics span { color: var(--muted); font-size: 0.66rem; }
.sla-evidence-summary .provisional-label { color: var(--amber); font-weight: 700; }
.sla-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.sla-card, .compliance-note { position: relative; padding: 24px; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.sla-card h3, .compliance-note h3 { margin: 7px 0 12px; font-family: Georgia, "Times New Roman", serif; font-size: 1.3rem; font-weight: 400; }
.sla-card p, .compliance-note p { color: var(--muted); font-size: 0.78rem; line-height: 1.5; }
.sla-card .sla-threshold { color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; }
.sla-id { position: absolute; top: 20px; right: 20px; color: var(--green); font-size: 0.72rem; font-weight: 750; letter-spacing: 0.08em; }
.sla-card dl { display: grid; gap: 8px; margin: 20px 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sla-card dl div { display: flex; justify-content: space-between; gap: 16px; }
.sla-card dt { color: var(--muted); font-size: 0.7rem; }
.sla-card dd { margin: 0; font-size: 0.78rem; font-weight: 700; }
.sla-card .sla-gap { margin-bottom: 0; color: var(--red); }
.compliance-note { margin-top: 18px; }
.compliance-note a { color: var(--green); font-size: 0.78rem; font-weight: 700; }

.activity-ledger { border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.activity-entry { display: grid; grid-template-columns: 190px 1fr; gap: 24px; padding: 20px 24px; border-top: 1px solid var(--line); }
.activity-entry:first-child { border-top: 0; }
.activity-entry time { color: var(--muted); font-size: 0.72rem; font-variant-numeric: tabular-nums; }
.activity-entry h3 { display: inline; margin-left: 8px; font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; font-weight: 400; }
.activity-entry p { margin: 7px 0 0; color: var(--muted); font-size: 0.72rem; line-height: 1.45; }

.metrics-page-summary { margin-bottom: 20px; }
.site-metrics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.metrics-panel { border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.metrics-panel-wide { grid-column: 1 / -1; }
.metric-report { display: grid; gap: 0; padding: 0 24px 22px; }
.metric-report-row { display: grid; grid-template-columns: minmax(150px, 0.7fr) 1fr; gap: 20px; padding: 12px 0; border-top: 1px solid var(--line); }
.metric-report-row:first-child { border-top: 0; }
.metric-report-row dt { color: var(--muted); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.metric-report-row dd { margin: 0; font-size: 0.76rem; line-height: 1.5; }
.metric-status { display: inline-block; padding: 4px 8px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 0.64rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; }
.metric-status.pending { color: var(--amber); background: var(--amber-soft); }
.metric-boundary-note { margin: 0; padding: 0 24px 22px; color: var(--muted); font-size: 0.72rem; line-height: 1.55; }
.artifact-counts { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.artifact-counts div { padding: 18px 24px; }
.artifact-counts div + div { border-left: 1px solid var(--line); }
.artifact-counts strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 1.7rem; font-weight: 400; }
.artifact-counts span { color: var(--muted); font-size: 0.67rem; line-height: 1.4; }
.view-window-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 24px 18px; border: 1px solid var(--line); }
.view-window-grid div { display: grid; gap: 3px; padding: 12px; }
.view-window-grid div:nth-child(3n+2), .view-window-grid div:nth-child(3n+3) { border-left: 1px solid var(--line); }
.view-window-grid div:nth-child(n+4) { border-top: 1px solid var(--line); }
.view-window-grid strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; font-weight: 400; }
.view-window-grid span { color: var(--muted); font-size: 0.64rem; }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px clamp(20px, 4vw, 64px) calc(24px + env(safe-area-inset-bottom));
  border-top: 5px solid var(--civic-red);
  color: rgba(255, 255, 255, 0.78);
  background: var(--civic-blue-dark);
  font-size: 0.72rem;
}

.site-footer p { margin: 0; }
.footer-tagline { color: white; font-weight: 750; letter-spacing: 0.04em; }

@media (max-width: 980px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .metric:nth-child(4) { border-top: 1px solid var(--line); }
  .workspace, .hotspot-layout, .fleet-layout, .trend-layout, .trend-layout-secondary, .alert-layout { grid-template-columns: 1fr; }
  .brief-grid { grid-template-columns: 1fr 1fr; }
  .brief-grid section:nth-child(3) { border-top: 1px solid var(--line); border-left: 0; }
  .brief-grid section:nth-child(4) { border-top: 1px solid var(--line); }
  .sla-grid { grid-template-columns: 1fr; }
  .evidence-metrics { grid-template-columns: 1fr 1fr; }
  .evidence-metrics div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .evidence-metrics div:nth-child(4) { border-top: 1px solid var(--line); }
  .policy-metrics { grid-template-columns: 1fr 1fr; }
  .policy-metrics p:nth-child(2) { border-right: 0; }
  .policy-metrics p:nth-child(n+3) { border-top: 1px solid var(--line); }
  .detail-panel { position: static; }
  .filters { grid-template-columns: 1fr 1fr; }
  .site-metrics-grid { grid-template-columns: 1fr; }
  .metrics-panel-wide { grid-column: auto; }
}

@media (max-width: 640px) {
  body { padding-bottom: env(safe-area-inset-bottom); background-size: 100% 28px; }
  .masthead { gap: 18px; padding: calc(20px + env(safe-area-inset-top)) 16px 18px; border-top-width: 5px; }
  .masthead h1 { font-size: clamp(2rem, 10vw, 2.8rem); line-height: 0.98; }
  .brand-lockup { width: min(100%, 360px); margin-bottom: 14px; padding: 8px 12px 7px; border-left-width: 3px; }
  .masthead, .section-heading { align-items: flex-start; flex-direction: column; }
  .section-actions { width: 100%; align-items: flex-start; flex-direction: column; }
  .masthead-meta { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-bottom: 0; }
  .masthead-meta > * { min-width: 0; }
  .field-ops-link, .live-mark, .source-refresh-status, .role-control { grid-column: 1 / -1; }
  .field-ops-link { min-height: 44px; align-content: center; }
  .source-refresh-status summary { min-height: 44px; padding: 8px 32px 8px 10px; align-content: center; }
  .data-feed-update-list { position: static; width: 100%; max-height: 60vh; border-width: 1px 0 0; box-shadow: none; }
  .masthead .quiet-button, .masthead .file-button { min-height: 44px; padding: 11px 10px; border: 1px solid rgba(255,255,255,0.42); text-align: center; }
  .masthead .install-button { color: var(--civic-blue-dark); border-color: white; background: white; }
  .section-nav {
    width: 100%;
    max-width: 100vw;
    gap: 0;
    padding: 0 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline proximity;
    scrollbar-width: none;
  }
  .section-nav::-webkit-scrollbar { display: none; }
  .nav-item {
    min-width: max-content;
    min-height: 48px;
    padding: 14px 12px 11px;
    scroll-snap-align: start;
    font-size: 0.78rem;
  }
  main { padding: 0 12px 40px; }
  .section-heading { gap: 14px; padding: 28px 4px 18px; }
  .section-heading h2 { font-size: 1.8rem; line-height: 1.08; }
  .section-actions .primary-button { width: 100%; min-height: 46px; }
  .section-note { text-align: left; }
  .metrics { grid-template-columns: 1fr; }
  .metric { min-height: 0; padding: 17px 18px; }
  .metric-label { margin-bottom: 7px; }
  .metric-value { font-size: 1.75rem; }
  .metric + .metric { border-left: 0; border-top: 1px solid var(--line); }
  .filters { grid-template-columns: 1fr; }
  .panel-heading { padding: 18px 16px 14px; }
  .filters { margin: 0 12px 14px; }
  .filters label { min-height: 58px; padding: 9px 11px; }
  .filters input, .filters select { min-height: 30px; font-size: 1rem; }
  .table-wrap { overflow: visible; border-top: 0; }
  table, tbody { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 0 12px 12px;
    border: 1px solid var(--line);
    background: var(--panel);
  }
  tbody tr.selected { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
  td { min-width: 0; padding: 11px 12px; border-top: 1px solid var(--line); font-size: 0.82rem; }
  td:nth-child(1), td:nth-child(2) { border-top: 0; }
  td:nth-child(2) { grid-column: 1 / -1; grid-row: 1; padding: 15px 12px; font-size: 0.9rem; }
  td:nth-child(1) { grid-column: 1; grid-row: 2; }
  td:nth-child(3) { grid-column: 2; grid-row: 2; }
  td:nth-child(4) { grid-column: 1; grid-row: 3; }
  td:nth-child(5) { grid-column: 2; grid-row: 3; }
  td:nth-child(6) { grid-column: 1 / -1; grid-row: 4; }
  td:nth-child(1)::before, td:nth-child(3)::before, td:nth-child(4)::before, td:nth-child(5)::before, td:nth-child(6)::before {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
  }
  td:nth-child(1)::before { content: "Priority"; }
  td:nth-child(3)::before { content: "Vendor"; }
  td:nth-child(4)::before { content: "Zone"; }
  td:nth-child(5)::before { content: "Age"; }
  td:nth-child(6)::before { content: "Status"; }
  .detail-panel { min-height: 0; padding: 18px 16px; }
  .empty-state { min-height: 240px; }
  .evidence { grid-template-columns: 1fr; }
  .import-review { margin-inline: 14px; }
  .import-review-heading, .import-review-item { grid-template-columns: 1fr; flex-direction: column; }
  .vehicle-filters { grid-template-columns: 1fr; }
  .evidence-review-grid { grid-template-columns: 1fr; }
  .linked-photo { flex-basis: min(74vw, 250px); }
  .root-cause-heading { align-items: flex-start; flex-direction: column; }
  .vehicle-trace div { grid-template-columns: 1fr; gap: 3px; }
  .request-history li { grid-template-columns: 1fr; }
  .request-history time { grid-row: auto; }
  .record-card { grid-template-columns: 1fr; }
  .record-actions { justify-content: flex-start; }
  .completion-control { min-width: 0; width: 100%; }
  .zone-map { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .full-field { grid-column: auto; }
  .activity-entry { grid-template-columns: 1fr; gap: 8px; }
  .metric-report-row { grid-template-columns: 1fr; gap: 5px; }
  .artifact-counts { grid-template-columns: 1fr; }
  .artifact-counts div + div { border-top: 1px solid var(--line); border-left: 0; }
  .view-window-grid { grid-template-columns: 1fr 1fr; }
  .view-window-grid div:nth-child(n) { border-top: 0; border-left: 0; }
  .view-window-grid div:nth-child(even) { border-left: 1px solid var(--line); }
  .view-window-grid div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .corridor-counts { grid-template-columns: 1fr; }
  .corridor-counts div + div { border-top: 1px solid var(--line); border-left: 0; }
  .forecast-heading { align-items: flex-start; flex-direction: column; padding: 18px 16px 14px; }
  .forecast-status { text-align: left; }
  .forecast-strip { padding: 0 16px 16px; }
  .forecast-card { flex-basis: min(82vw, 330px); }
  .forecast-measurement { grid-template-columns: 1fr; }
  .forecast-measurement > section + section { border-top: 1px solid var(--line); border-left: 0; }
  .brief-heading { flex-direction: column; }
  .brief-grid { grid-template-columns: 1fr; }
  .brief-grid section + section { border-top: 1px solid var(--line); border-left: 0; }
  .policy-metrics { grid-template-columns: 1fr; }
  .policy-metrics p { border-right: 0; }
  .policy-metrics p + p { border-top: 1px solid var(--line); }
  .subscription-form { grid-template-columns: 1fr; }
  .subscription-item, .alert-delivery { align-items: flex-start; flex-direction: column; }
  .alert-delivery > div:last-child { text-align: left; }
  .map-controls { align-items: flex-start; flex-direction: column; }
  .map-controls .map-address-control { width: 100%; min-width: 0; }
  .map-search-row { flex-wrap: wrap; }
  .map-search-row input { flex-basis: 100%; }
  .map-search-row .secondary-button { min-height: 44px; flex: 1; }
  .map-controls .result-count { margin-left: 0; }
  .operational-map-wrap, #operationalMap { min-height: 520px; height: 520px; }
  .intake-dialog, .auth-dialog {
    width: 100vw;
    max-width: none;
    max-height: calc(100dvh - env(safe-area-inset-top));
    margin: auto 0 0;
    border-width: 1px 0 0;
  }
  .intake-form { padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .dialog-actions { position: sticky; bottom: 0; padding-top: 10px; background: var(--panel); }
  .dialog-actions button { min-height: 46px; flex: 1; }
  .site-footer { align-items: flex-start; flex-direction: column; gap: 8px; padding-inline: 16px; }
}

.vendor-response-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.vendor-response-panel p { margin-bottom: 4px; }
.vendor-response-list { display: grid; gap: 8px; }

.vendor-response-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.vendor-response-row > div:first-child {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.vendor-response-row small {
  flex-basis: 100%;
  color: var(--muted);
}

.vendor-response-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 640px) {
  .vendor-response-row {
    align-items: stretch;
    flex-direction: column;
  }

  .vendor-response-actions > button {
    flex: 1;
  }
}

.vendor-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
}

.vendor-targets legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.vendor-targets label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.experiment-fields {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.experiment-fields[hidden] { display: none; }

.experiment-plan {
  margin-top: 14px;
  padding: 14px;
  border-left: 4px solid var(--civic-blue);
  background: var(--green-soft);
}

.experiment-plan p:last-child { margin-bottom: 0; }

.recurrence-fields[hidden] { display: none; }

.intervention-scope {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.intervention-scope p { margin-bottom: 0; }
.intervention-scope .quiet-button { justify-self: start; margin-top: 6px; }

.key-intervention {
  border: 2px solid #2f6b4f;
  background: rgba(47, 107, 79, 0.12);
}


.forecast-boundary {
  padding: 12px 14px;
  border-left: 4px solid var(--amber);
  background: var(--amber-soft);
}

.forecast-boundary p:last-child { margin-bottom: 0; }

.vendor-response-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.vendor-response-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.vendor-routing-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.vendor-routing-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.vendor-routing-form label span {
  color: var(--amber);
  font-size: 0.64rem;
  text-transform: uppercase;
}

.vendor-routing-form input,
.vendor-routing-form select,
.vendor-routing-form textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: white;
  font: inherit;
  font-weight: 400;
}

.vendor-routing-wide { grid-column: 1 / -1; }
.vendor-routing-form button { justify-self: start; }

@media (max-width: 640px) {
  .vendor-response-row,
  .vendor-routing-form {
    grid-template-columns: 1fr;
  }

  .vendor-routing-wide { grid-column: auto; }
}
