@scope (.ai-data-map) {
:scope {
  color-scheme: light;
  font: 16px/1.45 var(--font-body);
  color: #172e32;
  background: var(--color-bg);
  --paper: #fffefa;
  --ink: #172e32;
  --muted: #4b6160;
  --accent: #155a54;
  --line: #d4ded8;
  --land: #f3f1e5;
  --water: #d9e9e7;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
a { color: #15504e; text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary, select { cursor: pointer; }
button, a, input, select, summary, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #a04912; outline-offset: 3px; }
.shell { width: min(100%, 1650px); margin-inline: auto; padding-inline: clamp(12px, 2.8vw, 42px); }
.map-app-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 18px 14px; }
h1 { margin: 0 0 2px; font: 600 clamp(31px, 4vw, 51px)/1.02 var(--font-display); letter-spacing: -.045em; }
.intro, .scope { margin: 4px 0 0; }
.scope, .map-app-footer { color: var(--muted); font-size: 13px; }
.outline, .text-button { display: inline-flex; justify-content: center; align-items: center; min-height: 38px; border-radius: 7px; padding: 6px 11px; font-size: 13px; font-weight: 700; }
.outline { border: 1px solid #a9beb5; background: var(--paper); color: #184743; text-decoration: none; }
.outline:hover, .outline[aria-expanded="true"] { background: #e8f1ec; }
.text-button { border: 0; padding-inline: 4px; background: transparent; color: var(--accent); text-decoration: underline; }
#open-map { display: none; }
.controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-tools { display: flex; flex: 1 1 310px; gap: 8px; max-width: 510px; }
.search { flex: 1; min-width: 0; position: relative; }
.search svg { position: absolute; inset: 11px auto auto 11px; stroke: var(--muted); stroke-width: 1.8; fill: none; pointer-events: none; }
.search input { box-sizing: border-box; width: 100%; height: 41px; padding: 5px 8px 5px 36px; border: 1px solid #a9beb5; border-radius: 7px; background: var(--paper); font-size: 14px; }
.stages { display: flex; gap: 5px; flex-wrap: wrap; }
.stage-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 8px; border: 1px solid #a9beb5; border-radius: 7px; background: var(--paper); font-size: 13px; font-weight: 650; white-space: nowrap; }
.stage-chip:hover, .stage-chip[aria-pressed="true"] { border-color: #27655a; background: #d9ebe2; }
.stage-chip[aria-pressed="true"] { box-shadow: inset 0 -2px #27655a; }
.stage-chip .number { color: #3d5d54; font-variant-numeric: tabular-nums; }
.stage-chip .symbol { --mark: #25574f; }
.extra-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; padding: 12px; margin-top: 8px; background: #eaece2; border: 1px solid var(--line); border-radius: 8px; }
.extra-filters label, dialog label { font-size: 13px; font-weight: 650; }
.extra-filters select { display: block; max-width: 230px; height: 36px; margin-top: 4px; border: 1px solid #a9beb5; border-radius: 5px; background: var(--paper); padding-inline: 6px; }
.extra-filters .layer { display: flex; align-items: center; gap: 5px; min-height: 35px; }
.presets { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-block: 8px 9px; }
.presets span { font-size: 12px; font-weight: 700; margin-right: 3px; color: var(--muted); }
.presets button { border: 0; border-radius: 20px; background: #e6eee7; color: #215149; padding: 4px 9px; font-size: 12px; font-weight: 650; min-height: 30px; }
.presets button:hover { background: #d5e7db; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(275px, 325px); height: clamp(480px, 68vh, 920px); border: 1px solid #aebfb7; border-radius: 11px; overflow: hidden; background: var(--paper); }
.map-panel { position: relative; min-width: 0; min-height: 0; isolation: isolate; container-type: inline-size; }
#map { width: 100%; height: 100%; background: var(--water); }
.map-tools { position: absolute; z-index: 490; right: 10px; top: 10px; }
.map-tools button { min-height: 34px; box-shadow: 0 1px 4px #16372e28; }
.legend { position: absolute; z-index: 490; left: 10px; bottom: 21px; max-width: min(264px, calc(100% - 20px)); max-height: calc(100% - 75px); overflow: auto; background: var(--paper); border: 1px solid #a9beb5; border-radius: 7px; box-shadow: 0 1px 4px #16372e20; }
.legend summary { padding: 7px 10px; font-size: 12px; font-weight: 750; }
.legend-content { padding: 0 10px 8px; font-size: 12px; }
.legend-content p { margin: 6px 0; }
.key-list { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0; margin: 0; list-style: none; }
.key-list li { display: flex; align-items: center; gap: 5px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; background: var(--mark); }
.symbol { display: inline-block; flex: none; width: 11px; height: 11px; border: 2px solid var(--mark, #25574f); border-radius: 50%; background: var(--mark, #25574f); }
.symbol.under_construction { background: var(--paper); border-width: 3px; }
.symbol.planned { background: var(--paper); border-style: dashed; }
.symbol.related { background: var(--paper); border-radius: 2px; transform: rotate(45deg); }
.project-pin { display: grid; place-items: center; border-radius: 50%; }
.project-pin .symbol { width: 16px; height: 16px; box-shadow: 0 0 0 1px #fff, 0 1px 3px #173e3666; }
.project-pin.approximate .symbol { box-shadow: 0 0 0 1px #fff, 0 0 0 5px #183f3630, 0 1px 4px #173e3655; }
.project-pin:focus-visible { outline-offset: -1px; }
.city-label, .state-label { white-space: nowrap; pointer-events: none; color: #456561; text-shadow: 0 1px var(--land), 1px 0 var(--land), -1px 0 var(--land), 0 -1px var(--land); }
.city-label { font: 650 11px/1.1 system-ui; }
.state-label { font: 700 11px/1.1 system-ui; letter-spacing: .14em; color: #53736b; }
.results { border-left: 1px solid var(--line); overflow: auto; min-height: 0; }
.results-header { display: flex; align-items: center; justify-content: space-between; gap: 6px; background: var(--paper); padding: 10px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
.results h2 { margin: 0; font-size: 15px; }
.sort select { border: 1px solid var(--line); padding: 3px 5px; border-radius: 5px; background: var(--paper); font-size: 12px; }
.records { list-style: none; padding: 0; margin: 0; }
.record-button { display: flex; align-items: start; gap: 9px; text-align: left; padding: 10px 12px; min-height: 46px; width: 100%; background: var(--paper); border: 0; border-bottom: 1px solid #e6eae2; color: var(--ink); }
.record-button .symbol { margin-top: 4px; }
.record-button:hover, .record-button:focus-visible, .record-button[aria-current="true"] { background: #e9f1e9; }
.record-button strong { display: block; font-size: 13px; line-height: 1.3; }
.record-button small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.empty { margin: 14px 12px; font-size: 14px; }
.map-popup { font: 13px/1.4 system-ui; max-height: min(52vh, 355px); min-width: min(230px, 60vw); overflow: auto; overflow-wrap: anywhere; }
.map-popup h2 { margin: 6px 0 3px; font-size: 16px; line-height: 1.22; }
.map-popup p { margin: 4px 0 8px; }
.map-popup .meta { color: #45615a; font-size: 12px; margin-bottom: 4px; }
.map-popup .accuracy { font-size: 12px; color: #275147; font-weight: 650; }
.badge { display: inline-block; color: #194a42; background: #dcece2; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 750; }
.map-popup ul { padding-left: 17px; margin: 4px 0 8px; }
.map-popup li { margin: 4px 0; }
.map-popup details summary { font-weight: 750; margin-block: 6px; }
.map-popup .record-button { padding-inline: 4px; }
.map-popup .text-button { min-height: 27px; margin-top: 3px; }
.leaflet-popup-content { margin: 13px 16px; }
.map-app-footer { display: flex; gap: 10px; justify-content: space-between; padding-block: 10px 14px; }
.map-app-footer details { max-width: 670px; }
.map-app-footer summary { font-weight: 700; }
#snapshot { font-weight: 400; margin-inline-start: 6px; }
.downloads { display: flex; gap: 12px; }
dialog { border: 1px solid #a9beb5; background: var(--paper); color: var(--ink); border-radius: 10px; width: min(94vw, 500px); padding: 17px; }
dialog::backdrop { background: #18332999; }
dialog h2 { margin: 0 0 12px; }
dialog label, dialog textarea { display: block; width: 100%; }
dialog textarea { margin: 4px 0 6px; border: 1px solid #9eb7ad; border-radius: 6px; padding: 6px; }
dialog .copy { margin-bottom: 8px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: start; }
#copy-status { margin: 0; min-height: 1em; font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:scope.embed .shell { max-width: none; padding-inline: 8px; }
:scope.embed .map-app-header { padding-block: 6px; }
:scope.embed h1 { font: 750 15px/1.15 system-ui; letter-spacing: 0; }
:scope.embed .intro, :scope.embed .scope, :scope.embed #share-button, :scope.embed .map-app-footer, :scope.embed .presets { display: none; }
:scope.embed #open-map { display: inline-flex; min-height: 28px; padding-block: 2px; }
:scope.embed .workspace { margin-top: 7px; height: max(285px, calc(100dvh - 141px)); }
@media (max-width: 860px) {
  .workspace { grid-template-columns: minmax(0, 1fr) minmax(218px, 260px); }
}
@media (max-width: 660px) {
  .shell { padding-inline: 9px; }
  .map-app-header { padding-block: 10px 8px; align-items: flex-start; }
  h1 { font-size: clamp(23px, 6.4vw, 32px); }
  #share-button { min-height: 32px; white-space: nowrap; font-size: 11px; padding-inline: 7px; }
  .intro { font-size: 13px; }
  .scope { font-size: 11px; }
  .controls { gap: 5px; }
  .search-tools { flex-basis: 100%; max-width: none; }
  .stages { gap: 4px; }
  .stage-chip { min-height: 36px; font-size: 11px; gap: 4px; padding-inline: 6px; }
  .extra-filters select { max-width: min(42vw, 225px); }
  .presets { margin-block: 5px 7px; gap: 4px; }
  .presets button { padding-inline: 7px; font-size: 11px; }
  .workspace { display: block; height: auto; overflow: visible; }
  .map-panel { height: clamp(295px, 47svh, 470px); border-radius: 10px 10px 0 0; overflow: hidden; }
  .results { border-top: 1px solid var(--line); border-left: 0; overflow: visible; }
  .results-header { position: static; }
  :scope.embed .workspace { height: auto; }
  :scope.embed .map-panel { height: max(250px, calc(100svh - 186px)); }
}

.companies { display: flex; align-items: baseline; gap: 8px; min-width: 0; margin: 8px 0 0; padding: 0; border: 0; }
.companies legend { float: left; margin-right: 8px; padding: 5px 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.company-filters { display: flex; gap: 4px; flex-wrap: wrap; }
.company-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 29px; border: 1px solid #bfcfc7; border-radius: 5px; padding: 2px 7px; background: var(--paper); font-size: 12px; cursor: pointer; }
.company-chip:has(input:checked) { background: #d9ebe2; border-color: #27655a; font-weight: 700; }
.company-chip input { margin: 0; accent-color: #27655a; }
.company-chip .swatch { width: 8px; height: 8px; }
.leaflet-tooltip.hover-card { width: min(360px, calc(100cqw - 16px)); margin: 0; white-space: normal; background: var(--paper); border-color: #a9beb5; color: var(--ink); padding: 10px 12px; }
.leaflet-tooltip.hover-card::before { display: none; }
.hover-summary { overflow-wrap: break-word; font: 13px/1.4 system-ui; }
.hover-summary p { margin: 4px 0 0; }
.hover-summary h3 { margin: 4px 0 0; font-size: 14px; line-height: 1.2; }
.hover-summary .meta { color: var(--muted); }
.capacity-evidence { color: var(--accent); font-weight: 650; }
.capacity-control { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-block: 8px 10px; font-size: 13px; }
.capacity-control label, #capacity-threshold { font-weight: 700; }
.capacity-control input { width: clamp(95px, 26vw, 290px); margin: 0; min-height: 25px; accent-color: var(--accent); cursor: pointer; }
#capacity-threshold { min-width: 8ch; color: var(--accent); font-variant-numeric: tabular-nums; }
#capacity-help, .capacity-note { color: var(--muted); font-size: 12px; }
.capacity-dashboard {
  margin-block: 24px 12px;
  overflow: hidden;
  border: 1px solid #b2c2b9;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 4px 16px #172e320b;
}
.capacity-summary { background: linear-gradient(120deg, #173438, #20564e); color: #f7fcf8; }
.capacity-summary, .capacity-chart { padding: clamp(14px, 2.5vw, 32px); }
.capacity-summary-heading, .capacity-chart-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 18px;
}
.capacity-summary h2 { margin: 0; font: 600 clamp(23px, 3vw, 36px)/1.1 var(--font-display); letter-spacing: -.025em; }
.capacity-summary a { color: #dcefe5; font-size: 13px; font-weight: 650; }
.capacity-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 16px 0 0;
  border-top: 1px solid #cfede242;
}
.capacity-metrics > div { padding: 10px 9px 0 0; }
.capacity-metrics dt { color: #c9e6db; font-size: 12px; font-weight: 650; }
.capacity-metrics dd {
  margin: 2px 0 0;
  font-size: clamp(19px, 3vw, 36px);
  font-weight: 720;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.045em;
}
.capacity-chart h3 { font: 600 clamp(21px, 2.6vw, 28px)/1.2 var(--font-display); margin: 0; }
.capacity-chart-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.capacity-segments { display: inline-flex; gap: 2px; padding: 3px; background: #e8eee9; border-radius: 8px; }
.capacity-segments button, #capacity-metric { min-height: 35px; padding: 4px 10px; font-size: 13px; font-weight: 650; border-radius: 6px; }
.capacity-segments button { border: 0; background: transparent; }
.capacity-segments button[aria-pressed="true"] { background: var(--paper); color: var(--accent); box-shadow: 0 1px 3px #172e3230; }
#capacity-metric { border: 1px solid #b9c9bf; background: var(--paper); }
.capacity-chart-help { margin-block: 7px 13px; }
.capacity-rankings { padding: 0; margin: 0; list-style: none; }
.capacity-rankings li + li { border-top: 1px solid #e5ebe6; }
.capacity-row {
  display: grid;
  grid-template-columns: minmax(105px, 16%) minmax(0, 1fr) minmax(83px, 11%);
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 8px 9px;
  min-height: 43px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: inherit;
  text-align: left;
  --bar-color: #34756a;
}
.capacity-row:hover, .capacity-row[aria-pressed="true"] { background: #eaf3ed; }
.capacity-row[aria-pressed="true"] { border-color: #93b8a6; }
.capacity-label strong, .capacity-label small { display: block; }
.capacity-label strong { font-size: 14px; }
.capacity-label small { color: var(--muted); font-size: 11px; }
.capacity-track { height: 10px; background: #e7eee8; overflow: hidden; border-radius: 20px; }
.capacity-bar { display: block; height: 100%; background: var(--bar-color); border-radius: inherit; }
.capacity-value { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.capacity-footnote { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); }
.capacity-footnote p { margin: 3px 0; }
:scope.embed .capacity-dashboard { display: none; }
:scope.embed #capacity-help { display: none; }
@media (max-width: 660px) {
  .companies { margin-top: 5px; }
  .companies legend { font-size: 11px; margin-right: 4px; }
  .company-chip { font-size: 11px; min-height: 27px; padding-inline: 4px; }
  .company-chip .swatch { display: none; }
  .capacity-control { font-size: 12px; }
  #capacity-help { flex-basis: 100%; }
  .capacity-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .capacity-row { grid-template-columns: minmax(79px, 26%) minmax(0, 1fr) minmax(69px, 23%); gap: 7px; }
  .capacity-value, .capacity-label strong { font-size: 12px; }
}
.map-app-header h1,
.map-app-header .intro { color: var(--color-text); }
.map-app-header h1 { font-weight: 400; letter-spacing: -.015em; }
.results h2,
.map-popup h2,
.hover-summary h3,
.capacity-dashboard h2,
.capacity-chart h3,
#share-dialog h2 { color: inherit; }
.map-app-header .scope,
.map-app-footer,
.capacity-control label,
#capacity-help,
.companies legend,
.presets > span { color: var(--color-text-muted); }
.map-app-header a,
.map-app-footer a,
#capacity-threshold,
#clear { color: var(--color-accent); }
.map-app-header a, .map-app-footer a { text-decoration: underline; }
}
