/*
 * styles.css — the whole look of Optimal Location, every page.
 *
 * Visual idea: a surveyor's map sheet. Cool grey-green paper, dark slate ink,
 * and one strong magenta reserved for "the answer" (the best spot, the main
 * button, the weekly-time ribbon). Type is Overpass, a face drawn from US
 * highway signage, which suits an app about roads and journeys.
 *
 * Sections:
 *   1. Font and colour tokens (light and dark)
 *   2. Base elements
 *   3. Site header, breadcrumbs, footer
 *   4. App layout (form, map, results)
 *   5. Form controls and place cards
 *   6. Results
 *   7. Map markers and popups
 *   8. Content pages (how it works, privacy, terms, contact, 404)
 *   9. Utilities, toast, motion and print
 */

/* ---------- 1. Fonts and tokens ---------- */

@font-face {
  font-family: 'Overpass';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/overpass-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Overpass';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/overpass-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #f2f5f3; /* page background: survey paper */
  --surface: #ffffff; /* panels and inputs */
  --ink: #18282d; /* text */
  --muted: #4f6862; /* secondary text */
  --line: #cfdad5; /* hairlines and borders */
  --contour: #dfe8e3; /* faint contour pattern */
  --accent: #b0136b; /* the answer: best spot, main action */
  --accent-strong: #8c0e55;
  --accent-soft: #f7e3ee;
  --on-accent: #ffffff;
  --warn-bg: #fff4d6;
  --warn-ink: #5c4300;
  --focus: #1d6fd6;
  --radius-s: 6px;
  --radius-m: 10px;
  --shadow: 0 1px 0 rgba(24, 40, 45, 0.06), 0 8px 24px -12px rgba(24, 40, 45, 0.25);
  --font: 'Overpass', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --map-tiles: saturate(0.55) contrast(0.96);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #0f1a1d;
    --surface: #16252a;
    --ink: #e4ece8;
    --muted: #a3b9b2;
    --line: #2c4146;
    --contour: #1a2b30;
    --accent: #f05aa6;
    --accent-strong: #ff7ab9;
    --accent-soft: #3a1729;
    --on-accent: #1a0a12;
    --warn-bg: #3b300f;
    --warn-ink: #f3dd9a;
    --focus: #7cb4ff;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --map-tiles: invert(1) hue-rotate(180deg) saturate(0.4) brightness(0.92) contrast(0.9);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --paper: #0f1a1d;
  --surface: #16252a;
  --ink: #e4ece8;
  --muted: #a3b9b2;
  --line: #2c4146;
  --contour: #1a2b30;
  --accent: #f05aa6;
  --accent-strong: #ff7ab9;
  --accent-soft: #3a1729;
  --on-accent: #1a0a12;
  --warn-bg: #3b300f;
  --warn-ink: #f3dd9a;
  --focus: #7cb4ff;
  --map-tiles: invert(1) hue-rotate(180deg) saturate(0.4) brightness(0.92) contrast(0.9);
  color-scheme: dark;
}

/* ---------- 2. Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  font-feature-settings: 'tnum' 1; /* numbers line up in tables and results */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main {
  flex: 1 0 auto;
}
h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
  font-weight: 800;
}
h2 {
  font-size: 1.25rem;
  font-weight: 750;
}
h3 {
  font-size: 1.05rem;
  font-weight: 700;
}
p {
  margin: 0 0 1em;
}
a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--accent);
}
img,
svg {
  max-width: 100%;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.wrap {
  width: min(100% - 32px, 1320px);
  margin-inline: auto;
}
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 3000;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  border-radius: var(--radius-s);
  font-weight: 700;
}
.skip-link:focus {
  top: 12px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 3. Header, breadcrumbs, footer ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.015em;
}
.brand img {
  width: 34px;
  height: 34px;
}
.brand:hover {
  color: var(--ink);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.site-nav a {
  text-decoration: none;
  padding: 8px 10px;
  border-radius: var(--radius-s);
  font-weight: 600;
}
.site-nav a[aria-current='page'] {
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.breadcrumbs {
  margin: 20px 0 8px;
  font-size: 0.9rem;
  color: var(--muted);
}
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0;
}
.breadcrumbs li + li::before {
  content: '/';
  margin-right: 6px;
  color: var(--line);
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 56px;
  padding: 22px 0 28px;
  font-size: 0.92rem;
  color: var(--muted);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
}
.site-footer p {
  margin: 0;
}
.site-footer nav {
  display: flex;
  gap: 18px;
}

/* ---------- 4. App layout ---------- */

.intro {
  padding: 26px 0 18px;
  max-width: 78ch;
}
.intro p {
  max-width: 70ch;
  color: var(--muted);
  font-size: 1.08rem;
  margin: 0;
}

.app {
  display: grid;
  grid-template-columns: minmax(340px, 440px) minmax(0, 1fr);
  grid-template-areas:
    'plan map'
    'results map';
  grid-template-rows: auto 1fr;
  gap: 20px 24px;
  align-items: start;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow);
  padding: 20px;
}
.plan {
  grid-area: plan;
}
.results {
  grid-area: results;
}
.map-wrap {
  grid-area: map;
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  min-height: 520px;
  max-height: 900px;
  border-radius: var(--radius-m);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--contour);
}
#map {
  width: 100%;
  height: 100%;
}
#map .leaflet-tile-pane {
  filter: var(--map-tiles);
}

@media (max-width: 900px) {
  .app {
    /* minmax(0, …) lets long, unbroken text shrink instead of widening the page */
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'plan' 'map' 'results';
  }
  .map-wrap {
    position: relative;
    top: 0;
    height: 60vh;
    min-height: 340px;
  }
}

/* ---------- 5. Form controls and place cards ---------- */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.hint {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 12px;
}

.places {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: grid;
  gap: 10px;
}
.place {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 4px 10px;
  padding: 12px 12px 12px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--paper);
}
.place.is-unresolved .loc-input {
  border-color: var(--accent);
}
.badge {
  grid-row: 1 / span 3;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-weight: 800;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
  margin-top: 22px;
}
.place-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}
.place-fields .full {
  grid-column: 1 / -1;
}
.field {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.field > label,
.field > .label {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--muted);
}
.input,
.select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
}
.input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}
.input:focus,
.select:focus {
  border-color: var(--focus);
}
.resolved-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.remove-place {
  position: absolute;
  top: 6px;
  right: 6px;
}

/* Autocomplete list (ARIA combobox pattern) */
.combo {
  position: relative;
}
.combo-list {
  position: absolute;
  z-index: 1200;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow);
  max-height: 280px;
  overflow-y: auto;
}
.combo-list[hidden] {
  display: none;
}
.combo-option {
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1.3;
}
.combo-option small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}
.combo-option[aria-selected='true'],
.combo-option:hover {
  background: var(--accent-soft);
}
.combo-empty {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.btn-primary {
  width: 100%;
  min-height: 50px;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-size: 1.05rem;
  font-weight: 750;
}
.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--on-accent);
}
.btn-primary[disabled] {
  opacity: 0.65;
  cursor: progress;
}
.btn-quiet {
  border-color: transparent;
  background: transparent;
  padding: 6px 8px;
}
.btn-quiet:hover {
  background: var(--contour);
  border-color: transparent;
}
.btn-icon {
  width: 34px;
  min-height: 34px;
  padding: 0;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.subsection {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}
.home-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}

/* Preferences ("How you get around") */
details.prefs > summary {
  cursor: pointer;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 12px;
}
.prefs-title {
  font-weight: 750;
  font-size: 1.05rem;
}
details.prefs > summary::-webkit-details-marker {
  display: none;
}
details.prefs > summary::after {
  grid-column: 2;
  grid-row: 1;
  content: '+';
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted);
}
details.prefs[open] > summary::after {
  content: '–';
}
.prefs-summary {
  grid-column: 1;
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 2px;
}
.prefs-body {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
legend {
  font-weight: 650;
  font-size: 0.9rem;
  margin-bottom: 6px;
  padding: 0;
}
.checks {
  display: grid;
  gap: 6px;
}
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.check input {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--accent);
  flex: none;
}
.inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.run {
  margin-top: 18px;
}
.progress {
  margin-top: 12px;
  font-size: 0.92rem;
}
.progress progress {
  width: 100%;
  height: 6px;
  accent-color: var(--accent);
}
.form-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 0.92rem;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 14px;
  font-size: 0.92rem;
}

/* ---------- 6. Results ---------- */

.results[hidden] {
  display: none;
}
.results.is-stale {
  opacity: 0.6;
}
.stale-note {
  font-size: 0.9rem;
  color: var(--warn-ink);
  background: var(--warn-bg);
  padding: 8px 10px;
  border-radius: var(--radius-s);
}
.answer-place {
  font-size: 1.15rem;
  font-weight: 750;
  margin: 0;
}
.answer-detail {
  color: var(--muted);
  margin: 2px 0 10px;
  font-size: 0.92rem;
}

/* The signature: weekly time and how it splits across your places */
.weekly {
  margin: 14px 0 6px;
}
.weekly-figure {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.7rem);
  font-weight: 850;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--accent);
}
.weekly-caption {
  display: block;
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 6px;
}
.ribbon {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  margin: 12px 0 6px;
  background: var(--contour);
}
.ribbon span {
  display: block;
  height: 100%;
  min-width: 2px;
  border-right: 2px solid var(--surface);
}
.ribbon span:last-child {
  border-right: 0;
}
.ribbon-key {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 0.82rem;
  color: var(--muted);
  list-style: none;
  padding: 0;
  margin: 0;
}
.ribbon-key i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: -1px;
}
.compare {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
}

.legs {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 6px;
  font-size: 0.92rem;
}
.legs caption {
  text-align: left;
  font-weight: 750;
  margin-bottom: 6px;
}
.legs th,
.legs td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.legs th {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 650;
}
.legs td.num,
.legs th.num {
  text-align: right;
  white-space: nowrap;
}
.legs .place-cell {
  display: flex;
  gap: 8px;
  align-items: center;
}
.legs .badge {
  margin: 0;
  width: 22px;
  height: 22px;
  font-size: 0.75rem;
  flex: none;
}
.table-scroll {
  overflow-x: auto;
}

.alts {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 8px;
}
.alt {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
}
.alt-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
}
.alt p {
  margin: 0;
  font-size: 0.9rem;
}
.alt .muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.notes {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 16px;
}
.notes p {
  margin: 0 0 6px;
}
.share-hook {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 0.95rem;
}

.empty-state {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- 7. Map markers, legend and popups ---------- */

.marker {
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font);
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.marker-dest {
  width: 30px;
  height: 30px;
  background: #18282d;
  color: #ffffff;
  border: 2px solid #ffffff;
  font-size: 0.9rem;
}
.marker-home {
  width: 30px;
  height: 30px;
  background: #ffffff;
  color: #18282d;
  border: 3px solid #18282d;
  border-radius: 6px;
}
.marker-home svg {
  width: 16px;
  height: 16px;
}
.marker-best {
  width: 44px;
  height: 44px;
  background: #b0136b;
  color: #ffffff;
  border: 3px solid #ffffff;
  font-size: 1.3rem;
}
.marker-alt {
  width: 30px;
  height: 30px;
  background: #ffffff;
  color: #b0136b;
  border: 3px solid #b0136b;
  font-size: 0.9rem;
}
.leaflet-container {
  font-family: var(--font);
  background: var(--contour);
}
.leaflet-popup-content {
  font-size: 0.9rem;
  line-height: 1.4;
}
.leaflet-popup-content .btn {
  min-height: 34px;
  padding: 4px 10px;
  margin-top: 6px;
}
.popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.leaflet-control-attribution {
  font-size: 0.7rem;
}
.map-legend {
  background: var(--surface);
  color: var(--ink);
  padding: 8px 10px;
  border-radius: var(--radius-s);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  line-height: 1.3;
  max-width: 220px;
}
.map-legend .scale {
  height: 8px;
  border-radius: 4px;
  margin: 6px 0 2px;
  background: linear-gradient(90deg, #b0136b, #e7a6c9, #e9efec);
}
.map-legend .ends {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}
.map-legend label {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
  cursor: pointer;
}

/* ---------- 8. Content pages ---------- */

.page {
  max-width: 72ch;
  padding-bottom: 24px;
}
.page h1 {
  margin-top: 8px;
}
.page h2 {
  margin-top: 1.8em;
}
.page .lede {
  font-size: 1.12rem;
  color: var(--muted);
}
.page ul,
.page ol {
  padding-left: 1.3em;
}
.page li {
  margin-bottom: 0.4em;
}
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0 !important;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 46px;
  margin-bottom: 18px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  display: grid;
  place-items: center;
}
.figure {
  margin: 24px 0;
}
.figure img {
  display: block;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  height: auto;
}
.figure figcaption {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 8px;
}
.assumptions {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.assumptions th,
.assumptions td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
}
.faq details p {
  margin: 10px 0 0;
}
.contact-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  margin: 18px 0;
}
.contact-email {
  font-size: 1.2rem;
  font-weight: 750;
}
.notfound {
  text-align: left;
  padding: 48px 0;
}
.notfound .big {
  font-size: clamp(4rem, 3rem + 6vw, 8rem);
  font-weight: 900;
  line-height: 0.9;
  color: var(--accent);
  margin: 0 0 12px;
  letter-spacing: -0.04em;
}
.home-explainer {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.home-explainer h2 {
  font-size: 1.1rem;
}
.home-explainer p {
  color: var(--muted);
  margin: 0;
}
@media (max-width: 760px) {
  .home-explainer {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

/* ---------- 9. Utilities, toast, motion, print ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 4000;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: var(--radius-s);
  box-shadow: var(--shadow);
  font-weight: 600;
  max-width: calc(100% - 32px);
}
.toast[hidden] {
  display: none;
}
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* The one deliberate moment of motion: the ribbon fills when a result lands. */
.ribbon.animate span {
  animation: grow 0.7s ease-out both;
  transform-origin: left center;
}
@keyframes grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 520px) {
  .map-legend {
    max-width: 170px;
    font-size: 0.75rem;
  }
  .place-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .inline-fields {
    grid-template-columns: 1fr;
  }
  .site-nav .label-long {
    display: none;
  }
  .panel {
    padding: 16px;
  }
}

@media print {
  .site-header nav,
  .plan,
  .toolbar,
  .share-hook,
  .skip-link {
    display: none !important;
  }
  .app {
    display: block;
  }
  .map-wrap {
    position: static;
    height: 420px;
  }
}
.result-actions {
  margin-top: 16px;
}
.page .btn-primary,
.notfound .btn-primary {
  width: auto;
  padding-inline: 22px;
}

/* "Try an example" chips under the introduction */
.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}
.examples-label {
  font-weight: 650;
  font-size: 0.92rem;
  margin-right: 2px;
}
.btn-chip {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 18px;
  font-size: 0.92rem;
  background: var(--surface);
}
.btn-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
