@font-face { font-family: "Alexer"; src: url("fonts/alexer-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Alexer"; src: url("fonts/alexer-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Clearface"; src: url("fonts/clearface-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Clearface"; src: url("fonts/clearface-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --paper: #F5F3EE;
  --card: #FAFAF8;
  --line: #E8E5DF;
  --line-strong: #C8C4BA;
  --ink: #0D0D0F;
  --muted: #6B6B6B;
  --slate: #29282D;
  --teal: #52AAAC;
  --teal-dark: #3D8A8C;
  --teal-pale: #EEF7F7;
  --olive: #596F00;
  --danger: #B91C1C;
  --sample-bg: #FFF4DA;
  --sample-ink: #6B4E00;
  --serif: "Clearface", Georgia, "Times New Roman", serif;
  --sans: "Alexer", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--paper); }
p, h1, dl, dd, dt, figure { margin: 0; }
button, input { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--teal-dark); outline-offset: 2px; }

.app { display: grid; grid-template-columns: 440px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.panel { display: flex; flex-direction: column; gap: 16px; padding: 22px 26px 24px; overflow-y: auto; background: var(--paper); border-right: 1px solid var(--line-strong); }
.stage { position: relative; min-width: 0; min-height: 0; }
.map { background: #E9E6DE; height: 100%; }

.brand { display: flex; align-items: center; justify-content: space-between; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 24px; letter-spacing: 0.01em; }
.demo-tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 11px; }

.search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.search input { height: 46px; padding: 0 14px; background: #fff; border: 1px solid var(--line-strong); border-radius: 6px; }
.search input::placeholder { color: var(--muted); }
.search button { height: 46px; padding: 0 18px; border: 0; border-radius: 6px; background: var(--slate); color: #fff; font-weight: 700; cursor: pointer; }
.search button:hover { background: var(--teal-dark); }

.presets { display: flex; align-items: baseline; gap: 10px; }
.presets-label { color: var(--muted); font-size: 13px; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-strong); background: transparent; border-radius: 999px; padding: 3px 11px; font-size: 13px; cursor: pointer; }
.chip:hover { background: var(--teal-pale); border-color: var(--teal-dark); }

.status { min-height: 20px; color: var(--muted); }
.status[data-tone="error"] { color: var(--danger); }
.alternates { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 13px; color: var(--muted); }

.empty { padding-top: 6px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.empty-lead { font-family: var(--serif); font-size: 22px; line-height: 1.3; padding-top: 16px; max-width: 30ch; }
.empty-note { color: var(--muted); max-width: 46ch; }

.result { display: grid; gap: 20px; border-top: 1px solid var(--line); padding-top: 18px; animation: settle 180ms ease-out; }
@keyframes settle { from { opacity: 0.35; } to { opacity: 1; } }

.place h1 { font-family: var(--serif); font-weight: 700; font-size: 24px; line-height: 1.2; }
.place p { margin-top: 4px; color: var(--muted); }
.notice { background: var(--sample-bg); color: var(--sample-ink); border-radius: 4px; padding: 8px 12px; font-size: 13px; }

.hero-label { color: var(--muted); }
.hero-figure { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.hero-number { font-family: var(--serif); font-weight: 700; font-size: 68px; line-height: 1; letter-spacing: -0.01em; font-variant-numeric: lining-nums tabular-nums; }
.hero-unit { color: var(--muted); font-size: 18px; }
.range { position: relative; height: 22px; margin-top: 12px; }
.range-track { position: absolute; left: 0; right: 0; top: 9px; height: 4px; border-radius: 2px; background: var(--line); }
.range-band { position: absolute; top: 4px; height: 14px; border-radius: 7px; background: rgba(82, 170, 172, 0.32); border: 1px solid var(--teal-dark); }
.range-dot { position: absolute; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--ink); border: 2px solid var(--paper); }
.band-text { margin-top: 6px; font-size: 13px; color: var(--muted); }
.band-text strong { color: var(--ink); font-weight: 700; }

.streetview { position: absolute; top: 16px; right: 16px; z-index: 1000; width: min(360px, calc(100% - 32px)); padding: 6px 6px 8px; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 6px 20px rgba(13, 13, 15, 0.14); }
.sv-frame { position: relative; aspect-ratio: 16 / 10; background: #E9E6DE; border-radius: 4px; overflow: hidden; }
.sv-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sv-message { position: absolute; inset: 0; display: grid; place-items: center; padding: 0 24px; text-align: center; color: var(--muted); font-size: 13px; }
.streetview figcaption { margin: 6px 4px 0; font-size: 12px; color: var(--muted); }

.day-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.day-hour { font-weight: 700; }
.day-note { font-size: 12px; color: var(--muted); min-height: 18px; }
.day-reading { display: flex; align-items: baseline; gap: 6px; font-family: var(--serif); font-weight: 700; font-size: 34px; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.day-unit { font-family: var(--sans); font-weight: 400; font-size: 14px; color: var(--muted); }
.chart { display: block; width: 100%; height: auto; margin-top: 8px; touch-action: none; cursor: crosshair; border-radius: 4px; }
.chart text { font-family: var(--sans); font-size: 10.5px; fill: var(--muted); }
.facts { display: grid; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.facts div { display: flex; justify-content: space-between; gap: 12px; }
.facts dt { color: var(--muted); }
.facts dd { text-align: right; }
.soft { color: var(--muted); }

.sources { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: grid; gap: 4px; }

.legend { background: rgba(245, 243, 238, 0.94); border: 1px solid var(--line-strong); border-radius: 6px; padding: 6px; display: grid; gap: 2px; }
.legend button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; padding: 4px 8px; border-radius: 4px; text-align: left; cursor: pointer; font-size: 13px; }
.legend button:hover { background: var(--teal-pale); }
.legend button[aria-pressed="false"] { opacity: 0.45; }
.legend-swatch { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.legend-count { margin-left: auto; padding-left: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.leaflet-container { font-family: var(--sans); background: #E9E6DE; }

@media (max-width: 860px) {
  .tabs { gap: 12px; }
  .tab { font-size: 13px; }
  .app { grid-template-columns: 1fr; grid-template-rows: 44vh auto; height: auto; min-height: 100dvh; }
  .stage { order: -1; }
  .streetview { width: min(46%, 240px); top: 10px; right: 10px; }
  .panel { overflow: visible; border-right: 0; }
  .hero-number { font-size: 56px; }
}
@media (prefers-reduced-motion: reduce) { .result { animation: none; } }

/* ---------- tabs and calculators ---------- */
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line-strong); }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 6px 0 10px; font-weight: 700; color: var(--muted); cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--teal-dark); }
.view { display: grid; gap: 16px; }

.setup { display: grid; gap: 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.setup-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.setup-note { font-size: 13px; color: var(--muted); }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; font-size: 18px; line-height: 1; cursor: pointer; }
.stepper button:hover:not(:disabled) { background: var(--teal-pale); border-color: var(--teal-dark); }
.stepper button:disabled { opacity: 0.35; cursor: default; }
.stepper output { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

.answer-lead { color: var(--muted); }
.answer-figure { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.answer-number { font-family: var(--serif); font-weight: 700; font-size: 60px; line-height: 1; letter-spacing: -0.01em; font-variant-numeric: lining-nums tabular-nums; }
.answer-pair { margin-top: 2px; }
.answer-second { margin-top: 10px; }
.answer-note { margin-top: 4px; font-size: 13px; color: var(--muted); }
.answer strong { font-weight: 700; }

.fields { display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.field { display: grid; grid-template-columns: minmax(0, 1fr) 110px; align-items: center; gap: 4px 12px; }
.field > span { color: var(--muted); }
.field input[type="number"] { height: 38px; padding: 0 10px; background: #fff; border: 1px solid var(--line-strong); border-radius: 6px; text-align: right; font-variant-numeric: tabular-nums; }
.field-range { grid-template-columns: minmax(0, 1fr) auto; }
.field-range output { font-weight: 700; font-variant-numeric: tabular-nums; }
.field-range input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: var(--teal-dark); }
.context { font-size: 13px; color: var(--muted); }

.assumptions { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.assumptions summary { cursor: pointer; color: var(--ink); font-weight: 700; }
.assumptions p { margin-top: 8px; }
.assumptions ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }

/* Google requires its logo (16 to 19 px high, with clear space) beside its map. */
.google-logo { position: absolute; left: 10px; top: 10px; height: 18px; z-index: 1000; }
