:root {
  color-scheme: light;
  --ink: #19303b;
  --muted: #5b6d72;
  --soft: #eef3f1;
  --line: #dce5e1;
  --accent: #5e8a40;
  --accent-dark: #40672f;
  --brand-blue: #438dad;
  --brand-yellow: #e7b32d;
  --sand: #f8f7f2;
  --white: #fff;
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { color: var(--ink); background: var(--sand); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: var(--accent-dark); }
:focus-visible { outline: 3px solid var(--brand-yellow); outline-offset: 3px; }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 2000; padding: 10px 14px; background: var(--white); }
.skip-link:focus { top: 12px; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 24px; color: #f5f9f7; background: #173441; }
.topbar-left { display: flex; align-items: center; min-width: 0; gap: clamp(16px, 2.8vw, 42px); }
.brand { display: flex; align-items: center; flex: none; gap: 11px; color: #fff; text-decoration: none; white-space: nowrap; }
.brand:hover strong { color: #f4d473; }
.brand strong { display: block; font-size: 17px; letter-spacing: -.03em; }
.brand small { display: block; color: #bbd0d3; font-size: 10px; letter-spacing: .09em; margin-top: 3px; }
.brand-mark { width: 35px; height: 35px; flex: none; }
.view-switch { display: flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid #5e7c84; border-radius: 7px; background: #102d39; white-space: nowrap; }
.view-switch button { min-height: 35px; padding: 7px 12px; border: 0; border-radius: 4px; background: transparent; color: #d9e6e3; font-size: 11px; font-weight: 700; cursor: pointer; }
.view-switch button:hover { background: #315562; }
.view-switch button[data-view="biased"][aria-pressed="true"] { background: var(--brand-yellow); color: #263439; }
.view-switch button[data-view="real"][aria-pressed="true"] { background: var(--accent); color: #fff; }
.topbar-meta { display: flex; align-items: center; gap: 11px; font-size: 13px; white-space: nowrap; }
.meta-divider { height: 14px; width: 1px; background: #5a737b; }
.support-link { margin-left: 14px; padding: 8px 15px; border: 1px solid #e7b32d; border-radius: 4px; background: #e7b32d; color: #173441; font-size: 12px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.support-link:hover { background: #f4cc55; border-color: #f4cc55; }

.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(330px, 390px) minmax(0, 1fr); }
.side-panel { position: relative; z-index: 500; background: #fff; box-shadow: 9px 0 34px rgba(21, 46, 53, .09); }
.panel-scroll { padding: 34px 29px 27px; height: calc(100vh - 109px); min-height: 650px; overflow-y: auto; }
.kicker { display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: 11px; letter-spacing: .15em; text-transform: uppercase; font-weight: 700; }
.kicker-line { display: inline-block; width: 22px; height: 2px; background: var(--brand-yellow); }
h1 { margin: 17px 0 10px; max-width: 330px; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(30px, 3vw, 38px); line-height: 1.08; letter-spacing: -.05em; font-weight: 700; }
.stage-description { margin: 0 0 28px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.journey { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding-bottom: 20px; margin-bottom: 23px; border-bottom: 1px solid var(--line); }
.journey button { border: 0; background: transparent; color: #879699; font-size: 12px; cursor: pointer; padding: 6px 4px; border-radius: 3px; }
.journey button:hover { color: var(--accent-dark); background: var(--soft); }
.journey button.active { color: var(--accent-dark); font-weight: 700; }
.journey button.future { color: #a3afaf; }
.journey .chev { color: #aebcba; font-size: 13px; }
.stage-content { min-height: 200px; }
.selection-card, .detail-card, .loading-card { background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.selection-card { padding: 20px; box-shadow: 0 9px 25px rgba(23, 46, 52, .04); }
.selection-label, .detail-label { display: block; color: #667d7f; font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.selection-card h2 { margin: 8px 0 5px; font-size: 21px; letter-spacing: -.03em; }
.selection-card p { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.selection-number { display: inline-flex; color: var(--accent-dark); font-size: 34px; font-weight: 800; letter-spacing: -.05em; margin: 10px 0 4px; }
.primary-button, .secondary-button { width: 100%; min-height: 43px; border-radius: 5px; cursor: pointer; font-weight: 700; font-size: 13px; }
.primary-button { border: 1px solid var(--accent); color: white; background: var(--accent); }
.primary-button:hover { background: var(--accent-dark); }
.secondary-button { border: 1px solid #b6ccc5; color: var(--accent-dark); background: white; }
.secondary-button:hover { background: #f1f7f3; }
.card-kv { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 12px; }
.card-kv span { color: var(--muted); }
.card-kv strong { text-align: right; }
.detail-card { padding: 18px 19px; }
.detail-card h2 { margin: 9px 0 3px; font-size: 20px; line-height: 1.25; letter-spacing: -.03em; }
.address { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.detail-meta { display: flex; gap: 17px; margin: 18px 0 13px; padding: 14px 0; border-block: 1px solid var(--line); }
.detail-meta div { flex: 1; }
.detail-meta div + div { border-left: 1px solid var(--line); padding-left: 17px; }
.detail-meta strong { display: block; font-size: 23px; letter-spacing: -.04em; }
.detail-meta span { display: block; color: var(--muted); font-size: 11px; line-height: 1.35; }
.detail-meta:has(> :nth-child(3)) { gap: 10px; }
.detail-meta:has(> :nth-child(3)) div + div { padding-left: 10px; }
.detail-meta:has(> :nth-child(3)) strong { font-size: 20px; }
.detail-meta.detail-meta-wide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; container-type: inline-size; }
.detail-meta.detail-meta-wide div { min-width: 0; }
.detail-meta.detail-meta-wide div + div { padding-left: 8px; }
.detail-meta.detail-meta-wide strong { font-size: clamp(14px, 6.1cqi, 17px); letter-spacing: -.055em; white-space: nowrap; }
.pie-breakdown { margin: 17px 0 8px; padding: 13px 14px; background: #f4f7f5; border: 1px solid var(--line); border-radius: 6px; }
.pie-breakdown h3 { margin: 0 0 4px; font-size: 14px; }
.pie-breakdown p { margin: 0 0 8px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.pie-breakdown-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 7px; align-items: center; padding: 5px 0; font-size: 11px; }
.pie-breakdown-row strong { white-space: nowrap; }
.legend-dot { width: 10px; height: 10px; border: 1px solid #778589; border-radius: 50%; display: inline-block; flex: none; }
.results-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 23px 0 10px; }
.results-title h3 { margin: 0; font-size: 14px; }
.results-title small { color: var(--muted); font-size: 11px; }
.zone-list { display: grid; gap: 7px; }
.city-action { margin-top: 18px; }
.explore-zone-list { margin-top: 20px; }
.zone-choice { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; align-items: center; padding: 10px 12px; border: 1px solid #c8dcd4; border-radius: 5px; text-align: left; color: var(--ink); background: #fff; cursor: pointer; }
.zone-choice strong { font-size: 13px; }
.zone-choice span:nth-child(2) { grid-column: 1; color: var(--muted); font-size: 11px; }
.zone-choice span:last-child { grid-column: 2; grid-row: 1 / 3; color: var(--accent); font-weight: 700; }
.zone-choice:hover { background: #edf7f2; border-color: var(--accent); }
.result-row { padding: 8px 0; border-bottom: 1px solid #e9efec; }
.result-row:last-child { border: 0; }
.result-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.result-name { flex: 1; line-height: 1.3; }
.result-number { color: #759087; font-weight: 700; margin-right: 6px; }
.result-count { white-space: nowrap; font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.result-track { margin-top: 6px; height: 5px; border-radius: 99px; background: #e8efeb; overflow: hidden; }
.result-fill { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: #a9c298; }
.result-row:first-child .result-fill { background: var(--accent); }
.result-row.special .result-fill { background: #aab5b3; }
.method-note { margin: 14px 0 0; color: #667779; font-size: 11px; line-height: 1.5; }
.section-link { display: block; margin-top: 12px; font-size: 12px; }
.section-action { margin-top: 18px; }
.zone-action { margin: 0 0 12px; }
.section-form { display: grid; gap: 9px; margin-top: 23px; }
.section-form label { font-size: 12px; font-weight: 700; }
.section-combo { position: relative; }
.section-form input, .section-form select { width: 100%; height: 44px; padding: 10px 12px; border: 1px solid #a8c0ba; border-radius: 5px; background: white; color: var(--ink); font: inherit; font-size: 14px; }
.section-form input:hover, .section-form select:hover { border-color: var(--accent); }
.section-options { position: absolute; z-index: 1000; top: calc(100% + 4px); left: 0; right: 0; max-height: 236px; overflow-y: auto; background: #fff; border: 1px solid #a8c0ba; border-radius: 5px; box-shadow: 0 12px 24px rgba(17, 51, 53, .2); }
.city-form .section-options { position: static; margin-top: 5px; box-shadow: 0 5px 16px rgba(17, 51, 53, .12); }
.section-options[hidden] { display: none; }
.section-option { display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 9px 11px; border: 0; border-bottom: 1px solid #e7eeea; text-align: left; color: var(--ink); background: white; cursor: pointer; }
.section-option:last-child { border-bottom: 0; }
.section-option strong { font-size: 12px; }
.section-option span { color: var(--muted); font-size: 11px; line-height: 1.3; }
.section-option:hover, .section-option.active { background: #e8f4ee; }
.no-sections { margin: 0; padding: 14px 11px; color: var(--muted); font-size: 12px; }
.section-form small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.form-error { margin: 0; color: #9e2830; font-size: 12px; line-height: 1.4; }
.form-error[hidden] { display: none; }
.section-form .primary-button { margin-top: 7px; }
.place-section-choices { margin: 18px 0; padding: 14px; border: 1px solid #b8d6cc; border-radius: 6px; background: #eef7f2; }
.place-section-choices[hidden] { display: none; }
.place-section-choices h3 { margin: 0 0 5px; font-size: 14px; }
.place-section-choices p { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.section-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-bottom: 12px; }
.section-choice-grid button { padding: 9px 7px; border: 1px solid #9ac4b8; border-radius: 4px; background: #fff; color: #174d48; font-size: 12px; font-weight: 700; cursor: pointer; }
.section-choice-grid button:hover, .section-choice-grid button:focus-visible { background: #e5f0df; border-color: var(--accent); }
.place-section-choices .secondary-button { width: 100%; }
.loading-card { padding: 20px; color: var(--muted); font-size: 13px; }
.source-note { display: flex; gap: 10px; padding: 18px 0 0; margin-top: 26px; border-top: 1px solid var(--line); }
.source-note-icon { width: 18px; height: 18px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #e6f3ed; color: var(--accent-dark); font-family: Georgia, serif; font-size: 13px; font-weight: bold; }
.source-note strong { font-size: 12px; }
.source-note p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.map-panel { position: relative; min-height: 650px; background: #e9f0ee; overflow: hidden; }
#map { width: 100%; height: 100%; min-height: 650px; background: #e9f0ee; }
.map-heading { position: absolute; top: 26px; left: 27px; z-index: 420; padding: 12px 16px; min-width: 170px; background: rgba(255,255,255,.93); border: 1px solid rgba(199,217,209,.8); border-radius: 5px; box-shadow: 0 8px 26px rgba(13,54,54,.1); pointer-events: none; }
.map-heading-overline { display: block; color: #728487; font-size: 10px; font-weight: 700; letter-spacing: .13em; }
.map-heading strong { display: block; font-family: Georgia, serif; font-size: 19px; margin-top: 3px; }
.map-actions { position: absolute; z-index: 420; right: 26px; top: 27px; }
.map-actions button { background: white; border: 1px solid #d5e3dc; border-radius: 5px; padding: 9px 12px; box-shadow: 0 5px 18px rgba(18,48,48,.09); cursor: pointer; color: var(--accent-dark); font-weight: 700; font-size: 12px; }
.map-actions button:hover { background: #eaf4ef; }
.map-key { position: absolute; z-index: 420; left: 27px; bottom: 27px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 11px; max-width: calc(100% - 110px); padding: 10px 12px; background: rgba(255,255,255,.95); border-radius: 4px; box-shadow: 0 5px 20px rgba(18,48,48,.08); font-size: 11px; color: #53676b; }
.map-legend-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.map-feedback { position: absolute; z-index: 430; top: 96px; left: 27px; max-width: 245px; padding: 5px 7px; border-radius: 3px; background: rgba(255,255,255,.88); color: #435b5d; font-size: 11px; line-height: 1.4; pointer-events: none; }
.key-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.leaflet-container { font-family: Arial, Helvetica, sans-serif; }
.leaflet-control-attribution { font-size: 10px !important; }
.leaflet-tooltip.place-tooltip, .leaflet-tooltip.city-tooltip { border: 1px solid #c3d5cf; border-radius: 4px; padding: 5px 8px; box-shadow: 0 4px 14px rgba(24,62,58,.09); color: #173b3c; font-size: 12px; font-weight: 700; }
.section-pie-icon { background: transparent; border: 0; }
.zone-pie-icon, .place-pie-icon { background: transparent; border: 0; }
.city-pie-icon, .city-band-label-icon, .explore-zone-icon { background: transparent; border: 0; }
.city-pie { display: block; width: 44px; height: 44px; margin: 4px; border: 3px solid #17343f; border-radius: 50%; box-shadow: 0 0 0 3px #fff, 0 3px 12px rgba(11,34,40,.35); cursor: pointer; }
.city-band-label-icon { pointer-events: none; }
.city-band-label { display: flex; width: 100px; height: 54px; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #fff; text-align: center; text-shadow: 0 1px 4px rgba(6,24,29,.78), 0 1px 1px rgba(6,24,29,.95); pointer-events: none; }
.city-band-label small { font-size: 10px; font-weight: 700; line-height: 1; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.city-band-label strong { font-size: 23px; line-height: 1.05; font-weight: 800; letter-spacing: -.04em; white-space: nowrap; }
.explore-zone-marker { display: flex; width: 92px; height: 50px; margin: 3px 2px; flex-direction: column; justify-content: center; align-items: center; gap: 2px; border: 2px solid var(--accent); border-radius: 8px; color: #17343f; background: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.85), 0 3px 12px rgba(11,34,40,.25); cursor: pointer; transition: transform .15s ease; }
.explore-zone-marker strong { font-size: 13px; line-height: 1; }
.explore-zone-marker small { color: #5a737b; font-size: 10px; line-height: 1; }
.explore-zone-icon:hover .explore-zone-marker, .explore-zone-icon:focus-visible .explore-zone-marker { transform: scale(1.08); }
.zone-pie { display: block; width: 78px; height: 78px; margin: 6px; border: 4px solid #17343f; border-radius: 50%; box-shadow: 0 0 0 4px #fff, 0 5px 17px rgba(11,34,40,.34); cursor: pointer; transition: transform .15s ease; }
.zone-pie-icon:hover .zone-pie, .zone-pie-icon:focus-visible .zone-pie { transform: scale(1.08); }
.place-pie { display: block; width: 32px; height: 32px; margin: 3px; border: 2px solid #17343f; border-radius: 50%; box-shadow: 0 0 0 2px #fff, 0 2px 9px rgba(11,34,40,.3); cursor: pointer; transition: transform .15s ease; }
.place-pie-icon:hover .place-pie, .place-pie-icon:focus-visible .place-pie { transform: scale(1.18); }
.section-pie { display: block; width: 34px; height: 34px; margin: 5px; border: 2px solid #17343f; border-radius: 50%; box-shadow: 0 2px 9px rgba(11,34,40,.3); cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.section-pie-icon:hover .section-pie, .section-pie-icon:focus-visible .section-pie { transform: scale(1.16); box-shadow: 0 0 0 4px rgba(255,255,255,.8), 0 4px 16px rgba(11,34,40,.4); }
.section-pie.selected { width: 40px; height: 40px; margin: 2px; border-width: 3px; box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--accent), 0 5px 16px rgba(11,34,40,.35); }
.page-footer { min-height: 37px; display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 8px 27px; border-top: 1px solid #dce5df; color: #65777a; background: #f7faf8; font-size: 10px; }

@media (max-width: 1160px) {
  .support-link { margin-left: 4px; }
  .topbar { padding-inline: 18px; }
  .topbar-left { gap: 14px; }
  .view-switch button { padding-inline: 9px; }
}

@media (max-width: 820px) {
  .topbar { min-height: 65px; padding: 11px 16px; flex-wrap: wrap; }
  .topbar-left { width: 100%; flex-wrap: wrap; justify-content: space-between; }
  .view-switch { max-width: 100%; }
  .view-switch button { flex: 1; white-space: normal; line-height: 1.15; }
  .topbar-meta { gap: 6px; font-size: 11px; }
  .support-link { margin-left: 8px; }
  .workspace { display: flex; flex-direction: column; }
  .side-panel { order: 2; box-shadow: none; }
  .panel-scroll { height: auto; min-height: 0; padding: 24px 19px 28px; overflow: visible; }
  h1 { font-size: 32px; }
  .map-panel { order: 1; min-height: 50vh; height: 50vh; }
  #map { min-height: 50vh; height: 50vh; }
  .map-heading { top: 13px; left: 13px; padding: 9px 11px; min-width: 0; }
  .map-heading strong { font-size: 16px; }
  .map-actions { top: 13px; right: 13px; }
  .map-key { bottom: 15px; left: 13px; max-width: calc(100% - 85px); }
  .map-feedback { display: none; }
  .city-band-label small { display: none; }
  .city-band-label strong { font-size: 16px; }
  .page-footer { flex-wrap: wrap; padding: 12px 18px; }
}

@media (max-width: 480px) {
  .topbar-meta .meta-divider, .topbar-meta span:first-child { display: none; }
  .brand strong { font-size: 16px; }
  .brand small { font-size: 9px; }
  .brand-mark { width: 26px; height: 26px; }
  .map-actions button span { display: none; }
  .journey { gap: 2px; }
  .journey button { font-size: 11px; }
  .map-key { font-size: 9px; gap: 4px 7px; padding: 6px 7px; bottom: 8px; }
  .map-key .legend-dot { width: 8px; height: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
