/* Sunniest Walks. Tokens and layout carried over from the 2026-10-19 prototype.
   Layout: one-screen tool. Control rail on the left (stacks under the map on phones); map fills the rest. */
@font-face { font-family: "Bricolage Grotesque"; font-weight: 500; font-display: swap; src: url(/fonts/bricolage-grotesque-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 700; font-display: swap; src: url(/fonts/bricolage-grotesque-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url(/fonts/atkinson-hyperlegible-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url(/fonts/atkinson-hyperlegible-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }

:root {
  --bg: #f3f5f6; --panel: #ffffff; --fg: #1c2630; --muted: #5b6875; --line: #d9dfe4;
  --sun: #e8950c; --sun-soft: #fbe3b3; --shade: #4f6680; --route: #1c2630; --halo: #ffffff;
  --bld: #b9c2ca; --veg: #a9c79c; --ground: #eceff1; --water: #c7d8e4; --road: #ffffff; --label: #5b6875;
  --s0: #6f839a; --s1: #9a9a8a; --s2: #c9a466; --s3: #e5a12c; --s4: #f08c00;
  --danger: #b3261e;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #11161b; --panel: #182029; --fg: #e6ebef; --muted: #98a6b3; --line: #2b3641;
  --sun: #ffb43a; --sun-soft: #4a3714; --shade: #8aa3bf; --route: #f5f7f9; --halo: #11161b;
  --bld: #283039; --veg: #233c2a; --ground: #151c22; --water: #1b2a36; --road: #222c36; --label: #98a6b3;
  --s0: #56789e; --s1: #5f6a63; --s2: #a08243; --s3: #d79a2c; --s4: #ffb43a; --danger: #f2b8b5; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #11161b; --panel: #182029; --fg: #e6ebef; --muted: #98a6b3; --line: #2b3641;
  --sun: #ffb43a; --sun-soft: #4a3714; --shade: #8aa3bf; --route: #f5f7f9; --halo: #11161b;
  --bld: #283039; --veg: #233c2a; --ground: #151c22; --water: #1b2a36; --road: #222c36; --label: #98a6b3;
  --s0: #56789e; --s1: #5f6a63; --s2: #a08243; --s3: #d79a2c; --s4: #ffb43a; --danger: #f2b8b5; color-scheme: dark }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 15px; line-height: 1.45; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: 2px; }

.app { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; height: 100%; }
.rail { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; min-width: 0;
  padding-block: 20px 24px; padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: 18px;
  display: flex; flex-direction: column; gap: 18px; }
.mapwrap { position: relative; min-width: 0; min-height: 0; background: var(--ground); }
#map { position: absolute; inset: 0; }
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 58vh auto; height: auto; }
  .mapwrap { order: -1; height: 58vh; }
  .rail { border-right: 0; border-top: 1px solid var(--line); overflow: visible;
    padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
}
h1 { font-family: var(--display); font-weight: 700; font-size: 1.75rem; line-height: 1.1; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h1 em { font-style: normal; color: var(--sun); }
.lede { margin: 6px 0 0; color: var(--muted); font-size: 0.9rem; }
.label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.label output { font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0; text-transform: none; color: var(--fg); font-weight: 500; }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { font: inherit; font-weight: 700; padding: 9px 6px; border: 0; background: transparent; color: var(--fg); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--panel); }
select, input[type=range], input[type=date] { width: 100%; }
select, input[type=date], input[type=search] { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); }
input[type=range] { accent-color: var(--sun); }
.scale { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }

/* places */
.places { display: grid; gap: 8px; }
.place { position: relative; display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; }
.place .pin { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 0.8rem; color: var(--halo); }
.place .pin.a { background: var(--route); } .place .pin.b { background: var(--sun); }
.place input { width: 100%; min-width: 0; }
.iconbtn { font: inherit; font-size: 0.8rem; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); cursor: pointer; white-space: nowrap; }
.iconbtn[aria-pressed="true"] { border-color: var(--sun); background: var(--sun-soft); }
.suggest { position: absolute; z-index: 20; left: 34px; right: 0; top: calc(100% + 2px); margin: 0; padding: 4px; list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.18); max-height: 260px; overflow-y: auto; }
.suggest li { padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 0.88rem; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--sun-soft); }
.hint { font-size: 0.8rem; color: var(--muted); margin: 0; }

.dates { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip { font: inherit; font-size: 0.78rem; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--fg); cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--sun); background: var(--sun-soft); }

.result { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.card.hl { border-color: var(--sun); background: var(--sun-soft); }
.card .k { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.card .v { font-family: var(--display); font-size: 1.9rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.card .s { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.verdict { font-size: 0.92rem; margin: 0; }
.status { display: flex; gap: 10px; align-items: center; font-size: 0.9rem; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; }
.status.err { border-style: solid; border-color: var(--danger); color: var(--danger); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--sun); flex: none; }
@media (prefers-reduced-motion: no-preference) { .spinner { animation: spin 0.9s linear infinite; } }
@keyframes spin { to { transform: rotate(360deg); } }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { font: inherit; font-size: 0.85rem; padding: 7px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); cursor: pointer; }
.btn.primary { background: var(--fg); color: var(--panel); border-color: var(--fg); font-weight: 700; }
.btn[aria-pressed="true"] { border-color: var(--sun); background: var(--sun-soft); }
.chart svg { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-family: var(--mono); font-size: 10px; }
details { border-top: 1px solid var(--line); padding-top: 12px; font-size: 0.85rem; color: var(--muted); }
details summary { cursor: pointer; color: var(--fg); font-weight: 700; }
details p, details li { margin: 6px 0; }
.foot { border-top: 1px solid var(--line); padding-top: 12px; font-size: 0.78rem; color: var(--muted); display: grid; gap: 6px; }
.foot nav { display: flex; gap: 12px; flex-wrap: wrap; }
.foot button.link { font: inherit; background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* map overlays */
.overlay { position: absolute; display: flex; gap: 8px; align-items: flex-start; z-index: 5; }
.compass { top: calc(12px + env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; flex-direction: column; align-items: center; gap: 2px; }
.compass svg text { font-family: var(--mono); font-size: 9px; fill: var(--muted); text-anchor: middle; dominant-baseline: central; }
.compass .el { font-family: var(--mono); font-size: 0.75rem; color: var(--fg); font-variant-numeric: tabular-nums; }
.tools { bottom: 34px; right: max(12px, env(safe-area-inset-right, 0px)); flex-direction: column; }
.tools .btn { min-width: 44px; min-height: 36px; font-weight: 700; }
.legend { bottom: 34px; left: max(12px, env(safe-area-inset-left, 0px)); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font-size: 0.75rem; color: var(--muted); align-items: center; flex-wrap: wrap; max-width: calc(100% - 90px); }
.ramp { display: inline-flex; height: 8px; width: 90px; border-radius: 4px; overflow: hidden; }
.ramp i { flex: 1; } .ramp i:nth-child(1){background:var(--s0)} .ramp i:nth-child(2){background:var(--s1)} .ramp i:nth-child(3){background:var(--s2)} .ramp i:nth-child(4){background:var(--s3)} .ramp i:nth-child(5){background:var(--s4)}
.key { display: inline-flex; align-items: center; gap: 5px; }
.sw { width: 18px; height: 0; border-top: 3px solid var(--route); display: inline-block; }
.sw.d { border-top-style: dotted; }
@media (max-width: 760px) {
  /* keep the legend clear of the map attribution on phones */
  .legend { bottom: auto; top: calc(12px + env(safe-area-inset-top, 0px)); max-width: calc(100% - 110px); }
  .banner { top: calc(64px + env(safe-area-inset-top, 0px)) !important; }
}
.banner { top: calc(12px + env(safe-area-inset-top, 0px)); left: max(12px, env(safe-area-inset-left, 0px)); background: var(--fg); color: var(--panel); border-radius: 8px; padding: 6px 10px; font-size: 0.85rem; font-weight: 700; max-width: calc(100% - 140px); }
.marker { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--halo); border: 2.5px solid var(--halo); box-shadow: 0 1px 4px rgb(0 0 0 / 0.3); cursor: grab; }
.marker.a { background: var(--route); } .marker.b { background: var(--sun); }
.maplibregl-ctrl-attrib { font-family: var(--body); font-size: 11px; }
.maplibregl-ctrl-attrib.maplibregl-compact { background: var(--panel); color: var(--fg); }

/* consent */
.consent { position: fixed; z-index: 50; left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  margin-inline: auto; max-width: 560px; background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: 0 12px 32px rgb(0 0 0 / 0.25); display: grid; gap: 10px; }
.consent h2 { font-family: var(--display); font-size: 1.05rem; margin: 0; }
.consent p { margin: 0; font-size: 0.88rem; color: var(--muted); }
.consent .row { justify-content: flex-end; }
.consent .row .btn { min-width: 120px; font-weight: 700; }

/* 3D */
.view3d { position: absolute; inset: 0; z-index: 8; background: var(--ground); }
.view3d canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.view3d .bar { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); left: max(12px, env(safe-area-inset-left, 0px)); display: flex; gap: 8px; align-items: center; }
.view3d .note { position: absolute; bottom: 12px; left: max(12px, env(safe-area-inset-left, 0px)); font-size: 0.75rem; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }

/* content pages */
.page { max-width: 46rem; margin: 0 auto; padding-block: 32px 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.page h1 { margin-bottom: 8px; }
.page h2 { font-family: var(--display); font-size: 1.2rem; margin: 28px 0 8px; }
.page p, .page li { max-width: 65ch; }
.page .back { display: inline-block; margin-bottom: 18px; font-size: 0.9rem; }
.page table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.page th, .page td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tablewrap { overflow-x: auto; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
