:root {
  --background: #f4f4f2;
  --surface: #f9f9f7;
  --surface-muted: #e9e9e6;
  --surface-deep: #dededb;
  --foreground: #202124;
  --muted: #686b70;
  --border: #aeb1b5;
  --border-dark: #85898e;
  --accent: #195c45;
  --accent-dark: #104633;
  --accent-soft: #e1eee8;
  --notice: #f1ead7;
  --sans: Arial, Helvetica, sans-serif;
  --mono: "Courier New", Courier, monospace;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; background: var(--background); }
body { min-height: 100%; margin: 0; color: var(--foreground); background: var(--background); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
button:active { opacity: .7; }
button:disabled { cursor: wait; opacity: .5; }
a { color: inherit; text-underline-offset: 3px; }
::selection { color: #fff; background: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip-link { position: fixed; z-index: 100; top: -60px; left: 12px; padding: 8px 10px; border: 1px solid var(--border-dark); background: var(--surface); }
.skip-link:focus { top: 12px; }
main:focus { outline: 0; }

.site-header { min-height: 58px; position: sticky; top: 0; z-index: 500; display: grid; grid-template-columns: 180px 1fr; align-items: center; padding: 8px 18px; border-bottom: 1px solid var(--border); background: var(--surface-muted); }
.wordmark { display: inline-flex; align-items: center; gap: 8px; width: fit-content; min-height: 44px; color: #111; font: 700 17px/1 var(--mono); text-decoration: none; }
.wordmark svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; }
nav { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
nav a, .nav-action { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 11px; border: 1px solid transparent; background: transparent; font-size: 12px; font-weight: 600; text-decoration: none; }
nav a:hover { border-color: var(--border); background: var(--surface); }
.nav-action { border-color: var(--accent); color: #fff; background: var(--accent); }
.nav-action:hover { background: var(--accent-dark); }

.hero { min-height: 590px; display: grid; grid-template-columns: minmax(360px, 41%) minmax(0, 59%); border-bottom: 1px solid var(--border); }
.hero-copy { display: flex; flex-direction: column; justify-content: center; padding: 50px clamp(28px, 5vw, 72px); border-right: 1px solid var(--border); }
.eyebrow, .label { margin: 0 0 12px; color: var(--muted); font: 700 10px/1.35 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
h1, h2, h3 { color: #111; }
h1 { max-width: 620px; margin: 0; font-size: clamp(44px, 6vw, 76px); font-weight: 650; line-height: .98; letter-spacing: -.045em; }
.hero-brief { max-width: 560px; display: grid; grid-template-columns: 1fr 1fr; margin: 24px 0 0; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.hero-brief div { min-width: 0; padding-right: 18px; }
.hero-brief div + div { padding-right: 0; padding-left: 18px; border-left: 1px solid var(--border); }
.hero-brief .impact { grid-column: 1 / -1; display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; margin-top: 14px; padding: 14px 0 0; border-top: 1px solid var(--border); border-left: 0; }
.hero-brief dt { color: var(--accent-dark); }
.hero-brief dd { margin: 5px 0 0; color: #46494d; font-size: 13px; line-height: 1.5; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.button { min-height: 44px; padding: 8px 13px; border: 1px solid var(--border-dark); border-radius: 2px; background: var(--surface); font-size: 12px; font-weight: 700; }
.button:hover { background: var(--surface-deep); }
.button-dark { border-color: var(--accent); color: #fff; background: var(--accent); }
.button-dark:hover { background: var(--accent-dark); }
.button-light { border-color: #789083; color: #fff; background: transparent; }
.button-light:hover { background: rgba(255,255,255,.1); }
.button-ochre { border-color: var(--accent); color: #fff; background: var(--accent); }
.text-link { min-height: 44px; display: inline-flex; align-items: center; gap: 5px; padding: 8px 10px; color: var(--accent); font-size: 12px; font-weight: 700; }

.hero-map { min-height: 590px; position: relative; overflow: hidden; background: var(--surface-deep); }
.hero-map > #place-map { width: 100%; height: 100%; min-height: inherit; background: var(--surface-deep); }
.map-loading, .map-fallback { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; margin: 0; color: var(--muted); font: 11px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.map-fallback a { color: var(--accent); }
.leaflet-tile-pane { filter: saturate(.45) contrast(.92); }
.leaflet-bar { border: 1px solid var(--border) !important; border-radius: 0 !important; }
.leaflet-bar a, .leaflet-bar a:first-child, .leaflet-bar a:last-child { width: 44px !important; height: 44px !important; border-radius: 0 !important; color: var(--foreground); line-height: 44px !important; }
.leaflet-control-attribution { color: var(--muted); font: 10px/1.3 var(--sans); }
.route-stamp { position: absolute; z-index: 410; right: 18px; bottom: 18px; width: min(265px, calc(100% - 36px)); padding: 14px; border: 1px solid #59615d; border-top: 3px solid var(--accent); background: rgba(244,244,242,.96); }
.route-stamp span, .route-stamp small { display: block; color: var(--muted); font: 10px/1.45 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.route-stamp strong { display: block; margin: 7px 0 5px; color: #111; font-size: 18px; line-height: 1.2; }

.ticker { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--border); background: var(--surface-muted); }
.ticker div { min-height: 68px; padding: 12px 18px; border-right: 1px solid var(--border); }
.ticker div:last-child { border-right: 0; }
.ticker span, .ticker strong { display: block; }
.ticker span { color: var(--muted); font: 10px/1.2 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.ticker strong { margin-top: 7px; color: #111; font-size: 13px; }

.result-section { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 520px; border-bottom: 1px solid var(--border); }
.section-intro { padding: 30px 24px; border-right: 1px solid var(--border); background: var(--surface-muted); }
.section-intro h2 { margin: 8px 0 0; font-size: clamp(30px, 4vw, 44px); font-weight: 650; line-height: 1.02; letter-spacing: -.035em; }
.section-intro > p:last-child { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.route-details { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(280px, 1.2fr); background: var(--surface); }
.match-score { grid-column: 1 / -1; min-height: 190px; display: flex; align-items: flex-end; gap: 11px; padding: 30px; border-bottom: 1px solid var(--border); background: var(--accent-soft); }
.match-score strong { color: #111; font: 700 clamp(80px, 10vw, 124px)/.78 var(--mono); letter-spacing: -.08em; }
.match-score span { margin-bottom: 5px; color: var(--muted); font: 700 10px/1.3 var(--mono); text-transform: uppercase; }
.route-details dl { margin: 0; padding: 14px 28px; border-right: 1px solid var(--border); }
.route-details dl div { padding: 16px 0; border-bottom: 1px solid var(--border); }
.route-details dl div:last-child { border-bottom: 0; }
dt { color: var(--muted); font: 700 10px/1.3 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
dd { margin: 6px 0 0; color: #111; font-size: 12px; font-weight: 600; }
.route-reason { display: flex; flex-direction: column; justify-content: center; padding: 28px; color: #fff; background: var(--accent-dark); }
.route-reason .label { color: #b8d6c9; }
.route-reason > p:not(.label) { margin: 0 0 24px; color: #dce8e2; font-size: 12px; line-height: 1.65; }
.route-reason .button { width: fit-content; }

.trust-process { padding: 42px clamp(22px, 6vw, 88px); border-bottom: 1px solid var(--border); background: var(--surface); }
.trust-process-header { max-width: 1180px; display: grid; grid-template-columns: minmax(280px, .85fr) minmax(320px, 1.15fr); gap: clamp(42px, 8vw, 110px); align-items: end; margin: 0 auto 24px; }
.trust-process-header h2 { max-width: 560px; margin: 7px 0 0; color: #111; font-size: clamp(27px, 3vw, 36px); font-weight: 650; line-height: 1.12; letter-spacing: -.03em; }
.trust-process-header > p { max-width: 620px; margin: 0 0 3px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.trust-process-body { max-width: 1180px; display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); margin: 0 auto; border-top: 1px solid var(--border-dark); border-bottom: 1px solid var(--border-dark); }
.trust-process-body h3 { margin: 0 0 10px; color: #111; font: 700 11px/1.2 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.process-summary { padding: 18px 32px 18px 0; border-right: 1px solid var(--border); }
.process-summary ol { margin: 0; padding: 0; list-style: none; }
.process-summary li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 7px 0; }
.process-summary li > span { padding-top: 2px; color: var(--accent); font: 700 10px/1.4 var(--mono); }
.process-summary p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.process-summary strong { display: block; margin-bottom: 3px; color: #111; font-size: 15px; }
.source-register { padding: 18px 0 18px 32px; }
.source-register > a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; min-height: 46px; padding: 6px 0; border-top: 1px solid var(--border); color: inherit; text-decoration: none; }
.source-register > a:last-child { border-bottom: 1px solid var(--border); }
.source-register > a:hover strong, .source-register > a:focus-visible strong { text-decoration: underline; text-underline-offset: 3px; }
.source-register span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.source-register strong { display: block; color: #111; font-size: 15px; }
.source-register small { color: var(--accent-dark); font: 700 10px/1.3 var(--mono); text-align: right; text-transform: uppercase; }

.closing { min-height: 150px; display: flex; align-items: center; justify-content: space-between; gap: 36px; padding: 36px clamp(22px, 6vw, 88px); text-align: left; background: var(--accent-dark); }
.closing p { max-width: 760px; margin: 0; color: #fff; font-size: clamp(27px, 3vw, 36px); font-weight: 650; line-height: 1.12; letter-spacing: -.03em; }
.closing .button-ochre { min-height: 46px; padding: 9px 18px; border-color: #fff; color: var(--accent-dark); background: #fff; }
.closing .button-ochre:hover { color: #fff; background: transparent; }
body > footer { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px clamp(22px, 5vw, 72px); color: #f4f4f2; background: #292d2b; }
body > footer p { margin: 0; color: #c8cbc8; font: 10px/1.6 var(--mono); letter-spacing: .03em; text-align: right; }
.wordmark-light { color: #fff; }

.planner { width: min(690px, calc(100% - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid #55585d; background: var(--background); color: var(--foreground); }
.planner::backdrop { background: rgba(20,20,20,.62); }
.planner-shell > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 17px 19px 14px; border-bottom: 1px solid var(--border); background: var(--surface-muted); }
.planner h2 { margin: 5px 0 0; color: #111; font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.planner .eyebrow { margin-bottom: 0; }
.planner-intro { max-width: 430px; margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.close-button, .back-button { min-width: 58px; min-height: 44px; padding: 7px 9px; border: 1px solid var(--border-dark); border-radius: 2px; background: var(--surface); font-size: 12px; font-weight: 600; }
.progress { height: 3px; background: #c5c7ca; }
.progress span { display: block; width: 33.333%; height: 100%; background: var(--accent); }
.planner-step { display: none; min-height: 410px; padding: 24px 28px; }
.planner-step.active { display: block; }
fieldset { margin: 0 0 25px; padding: 0; border: 0; }
legend { margin-bottom: 12px; color: #111; font-size: 14px; font-weight: 700; }
.choice-row { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); }
.choice-row button { min-height: 54px; border: 0; border-right: 1px solid var(--border); background: var(--surface); font-size: 12px; }
.choice-row button:last-child { border-right: 0; }
.choice-row button.selected { outline: 2px solid #0b3728; outline-offset: -2px; color: #fff; background: var(--accent); }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.choice-grid button { min-height: 84px; padding: 12px; border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); text-align: left; }
.choice-grid strong, .choice-grid span { display: block; }
.choice-grid strong { margin-bottom: 4px; color: #111; font-size: 13px; }
.choice-grid span { color: var(--muted); font-size: 12px; }
.choice-grid button.selected { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.helper { margin: -8px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.helper[data-state="error"] { color: #8b2118; font-weight: 700; }
.helper[data-state="success"] { color: var(--accent-dark); }
.location-entry label { display: block; margin-bottom: 6px; color: var(--muted); font: 11px/1.3 var(--mono); letter-spacing: .03em; text-transform: uppercase; }
.location-entry > div { display: grid; grid-template-columns: 1fr auto; }
.location-entry input { min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid var(--border-dark); background: var(--surface); color: var(--foreground); font-size: 14px; }
.location-entry input:focus { border-color: var(--accent); outline: 2px solid #9dc6b7; outline-offset: 1px; }
.location-entry input::placeholder { color: #777a7e; }
.location-entry button { min-height: 44px; padding: 8px 11px; border: 1px solid var(--border-dark); border-left: 0; background: var(--surface-muted); font-size: 11px; font-weight: 700; }
.location-entry .helper { margin: 7px 0 0; }
.toggle-list { border-top: 1px solid var(--border); }
.toggle-list button { width: 100%; min-height: 66px; position: relative; display: block; padding: 10px 48px 10px 10px; border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); background: var(--surface); text-align: left; }
.toggle-list button::after { content: "+"; position: absolute; right: 14px; top: 50%; translate: 0 -50%; color: var(--accent); font: 700 18px/1 var(--mono); }
.toggle-list button.selected { background: var(--accent-soft); }
.toggle-list button.selected::after { content: "×"; }
.toggle-list span, .toggle-list small { display: block; }
.toggle-list span { color: #111; font-size: 13px; font-weight: 700; }
.toggle-list small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.result-header { display: flex; justify-content: space-between; align-items: flex-start; }
.result-header span { color: #111; font: 700 26px/1 var(--mono); }
.planner-step h3 { margin: 12px 0 7px; color: #111; font-size: 26px; font-weight: 650; letter-spacing: -.025em; }
.result-summary { max-width: 570px; color: #46494d; font-size: 12px; line-height: 1.6; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 20px 0; border: 1px solid var(--border); background: var(--surface-muted); }
.result-stats div { min-height: 76px; padding: 10px; border-right: 1px solid var(--border); }
.result-stats div:last-child { border-right: 0; }
.result-stats dd { margin-top: 5px; font-size: 12px; }
.mission { padding: 12px; border: 1px solid #9b8750; background: var(--notice); }
.mission span { color: #625d50; font: 700 10px/1.2 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.mission p { margin: 7px 0 0; color: #3f3b32; font-size: 12px; line-height: 1.6; }
.planner-controls { display: flex; justify-content: space-between; align-items: center; padding: 12px 19px; border-top: 1px solid var(--border); background: var(--surface-muted); }

@media (max-width: 850px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { min-height: 470px; border-right: 0; border-bottom: 1px solid var(--border); }
  .hero-map { min-height: 480px; }
  .result-section { grid-template-columns: 230px minmax(0, 1fr); }
  .route-details { grid-template-columns: 1fr; }
  .route-details dl { border-right: 0; border-bottom: 1px solid var(--border); }
  .trust-process-header { grid-template-columns: 1fr; gap: 18px; align-items: start; }
  .trust-process-header > p { max-width: 720px; }
}

@media (max-width: 620px) {
  body { font-size: 15px; }
  .site-header { min-height: 56px; grid-template-columns: 1fr auto; padding: 7px 10px; }
  nav a { display: none; }
  .nav-action { min-height: 44px; }
  .hero-copy { min-height: 460px; padding: 42px 18px; }
  h1 { font-size: 49px; }
  .hero-brief { grid-template-columns: 1fr; padding: 6px 0; }
  .hero-brief div { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; align-items: start; padding: 9px 0; }
  .hero-brief div + div { padding: 9px 0; border-top: 1px solid var(--border); border-left: 0; }
  .hero-brief .impact { margin-top: 0; padding: 9px 0; }
  .hero-brief dd { margin-top: 0; }
  .hero-map { min-height: 390px; }
  .ticker { grid-template-columns: 1fr 1fr; }
  .ticker div:nth-child(2) { border-right: 0; }
  .ticker div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .result-section { grid-template-columns: 1fr; }
  .section-intro { border-right: 0; border-bottom: 1px solid var(--border); }
  .match-score { min-height: 150px; padding: 24px 18px; }
  .match-score strong { font-size: 78px; }
  .route-details dl, .route-reason { padding-left: 18px; padding-right: 18px; }
  .trust-process { padding: 38px 18px; }
  .trust-process-header { margin-bottom: 22px; }
  .trust-process-header h2 { font-size: 32px; }
  .trust-process-body { grid-template-columns: 1fr; }
  .process-summary { padding: 19px 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .source-register { padding: 19px 0; }
  .source-register > a { gap: 14px; }
  .source-register small { max-width: 90px; }
  .closing { min-height: 0; align-items: flex-start; flex-direction: column; gap: 22px; padding: 34px 18px; }
  body > footer { align-items: flex-start; flex-direction: column; }
  body > footer p { text-align: left; }
  .planner { width: 100%; height: 100%; max-height: 100%; border: 0; }
  .planner-step { min-height: calc(100vh - 190px); overflow-y: auto; padding: 22px 16px; }
  .planner-shell > header, .planner-controls { padding-left: 16px; padding-right: 16px; }
  .choice-row { grid-template-columns: 1fr 1fr; }
  .choice-row button:nth-child(2) { border-right: 0; }
  .choice-row button:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .choice-grid { grid-template-columns: 1fr; }
  .location-entry > div { grid-template-columns: 1fr; }
  .location-entry button { border-top: 0; border-left: 1px solid var(--border-dark); }
  .result-stats { grid-template-columns: 1fr; }
  .result-stats div { border-right: 0; border-bottom: 1px solid var(--border); }
  .result-stats div:last-child { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
