/* Motorway status. A calm, plain-spoken travel site. Colour carries meaning: green open, orange partly closed, red closed, yellow take care. */

:root {
  color-scheme: light;
  --paper: #f6f7f3;
  --surface: #ffffff;
  --surface-2: #edf1ea;
  --ink: #15241d;
  --ink-2: #3b4a42;
  --muted: #5b6a62;
  --line: #d9e0d6;

  --brand: #0c6b4d;
  --brand-ink: #ffffff;
  --brand-soft: #dcefe6;

  --closed: #b3261e;
  --closed-soft: #fbe3e0;
  --partial: #d98200;
  --partial-soft: #fdeccf;
  --advisory: #e3b505;
  --advisory-soft: #fbf1c4;
  --clear: #2e7d4f;
  --clear-soft: #dff1e5;
  --me: #2c5fa8;

  --font-display: "Outfit", "Segoe UI", system-ui, sans-serif;
  --font-body: "Geist", "Segoe UI", system-ui, sans-serif;

  --r: 16px;
  --r-sm: 12px;
  --pill: 999px;
  --shadow: 0 1px 2px rgb(21 36 29 / 0.06), 0 8px 24px -12px rgb(21 36 29 / 0.18);
  --shadow-lg: 0 2px 6px rgb(21 36 29 / 0.08), 0 24px 48px -16px rgb(21 36 29 / 0.28);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  --control: 44px;
  --container: 1280px;
  --gutter: 32px;
  --head-h: 64px;
  --dur: 160ms;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 12px); }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 1rem; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 600; line-height: 1.12; overflow-wrap: break-word; min-width: 0; }
p { margin: 0; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--s3); top: -4rem; z-index: 90; background: var(--ink); color: var(--paper); padding: var(--s2) var(--s4); border-radius: var(--r-sm); }
.skip:focus { top: var(--s3); }
.wrap { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

/* header */
.site-head { position: sticky; top: 0; z-index: 40; height: var(--head-h); background: rgb(246 247 243 / 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--s5); }
.brand { display: inline-flex; align-items: center; gap: var(--s3); text-decoration: none; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.nav { display: flex; gap: var(--s5); margin-left: auto; }
.nav a { text-decoration: none; color: var(--ink-2); font-weight: 500; padding: var(--s2) 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); border-bottom-color: var(--brand); }
.helpline { font-size: 0.92rem; color: var(--ink-2); white-space: nowrap; }
.helpline a { font-weight: 600; color: var(--brand); text-underline-offset: 3px; }

/* hero: what is wrong on the roads right now, by city */
.hero { padding: var(--s7) 0 var(--s8); }
.hero-top { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s5); flex-wrap: wrap; margin-bottom: var(--s6); }
.hero-copy { display: grid; gap: var(--s3); max-width: 46rem; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 700; letter-spacing: -0.025em; max-width: 18ch; }
.headline { color: var(--ink-2); font-size: clamp(1.1rem, 1.6vw, 1.3rem); max-width: 44ch; }
.hero-cta { min-height: 52px; padding: 0 var(--s6); font-size: 1.05rem; }
.hero-tools { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.hero-tools .find { flex: 0 1 22rem; }
.find { position: relative; }
.find i { position: absolute; left: var(--s4); top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.find input { width: 100%; min-height: var(--control); padding: 0 var(--s4) 0 44px; border: 0; border-radius: var(--pill); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); }
.find input:focus-visible { outline: 3px solid var(--brand); outline-offset: 0; }

.city-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); align-items: start; }
.ccard { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: var(--s4) var(--s4) var(--s3); display: grid; gap: var(--s2); }
.ccard-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.ccard h3 { font-size: 1.3rem; }
.ccard-roads { color: var(--muted); font-size: 0.9rem; }
.ccard .rows { list-style: none; margin: 0 calc(-1 * var(--s2)); padding: 0; display: grid; gap: 2px; }
.crow { width: 100%; display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); gap: var(--s3); align-items: start; text-align: left; border: 0; background: transparent; padding: var(--s2); border-radius: var(--r-sm); cursor: pointer; }
.crow:hover { background: var(--paper); }
.crow-road { font-family: var(--font-display); font-weight: 700; padding-top: 1px; }
.crow-main { display: grid; gap: 2px; min-width: 0; }
.crow-top { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.crow-title { font-weight: 600; font-size: 0.95rem; overflow-wrap: anywhere; }
.crow-sub { color: var(--ink-2); font-size: 0.86rem; overflow-wrap: anywhere; }
.pill-sm { min-height: 22px; padding: 0 var(--s2); font-size: 0.78rem; }
.more { justify-self: start; border: 0; background: none; color: var(--brand); font-weight: 600; cursor: pointer; padding: var(--s1) 0; }
.more:hover { text-decoration: underline; }
.state { display: grid; gap: var(--s3); justify-items: start; background: var(--surface); border-radius: var(--r); padding: var(--s5); box-shadow: var(--shadow); }
.state h3 { font-size: 1.25rem; }
.state p { color: var(--ink-2); font-size: 0.95rem; }
.sk { height: 160px; border-radius: 20px; background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: sk 1.6s ease-in-out infinite; }
.results .sk { height: 72px; }
@keyframes sk { to { background-position: -200% 0; } }

/* planner: the map fills the screen, the trip panel floats on the left */
.planner { position: relative; height: calc(100vh - var(--head-h)); height: calc(100dvh - var(--head-h)); min-height: 36rem; border-top: 1px solid var(--line); }
#map { position: absolute; inset: 0; background: var(--surface-2); }
.map-fail { padding: var(--s6); color: var(--ink-2); }
.panel { position: absolute; z-index: 10; top: var(--s4); left: var(--s4); bottom: var(--s4); width: 26rem; max-width: calc(100% - 2 * var(--s4)); display: flex; flex-direction: column; gap: var(--s4); padding: var(--s5); background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lg); overflow-y: auto; overscroll-behavior: contain; }
.panel-h { font-size: 1.35rem; }
.panel .search { padding: 0; box-shadow: none; border-radius: 0; }
.hint { color: var(--ink-2); font-size: 0.95rem; }

/* search */
.search { display: grid; gap: var(--s3); padding: var(--s5); background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); }
.fields { position: relative; display: grid; gap: var(--s3); }
.fields .field input { padding-right: 60px; }
.field { position: relative; display: grid; gap: var(--s1); }
.field label { font-weight: 600; font-size: 0.9rem; color: var(--ink-2); }
.field input { min-height: var(--control); padding: 0 var(--s4); border: 0; border-radius: var(--r-sm); background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line); width: 100%; }
.field input::placeholder { color: var(--muted); }
.field input:focus-visible { outline: 3px solid var(--brand); outline-offset: 0; }
.swap { position: absolute; z-index: 6; right: var(--s3); top: 89px; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--surface); color: var(--brand); font-size: 1.25rem; cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--line), var(--shadow); transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.swap:hover { background: var(--brand-soft); }
.swap:active { transform: translateY(-50%) scale(0.94); }
.locate { position: absolute; right: var(--s2); top: 26px; width: 40px; height: 44px; display: grid; place-items: center; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--brand); font-size: 1.3rem; cursor: pointer; transition: background-color var(--dur) var(--ease); }
.locate:hover { background: var(--brand-soft); }
.locate[aria-busy="true"] { opacity: 0.5; cursor: progress; }
.suggest { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: var(--s1); list-style: none; background: var(--surface); border-radius: var(--r-sm); box-shadow: 0 12px 32px -8px rgb(21 36 29 / 0.3), 0 0 0 1px var(--line); max-height: 15rem; overflow-y: auto; }
.suggest li { padding: var(--s2) var(--s3); border-radius: 8px; cursor: pointer; font-size: 0.95rem; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--brand-soft); }
.suggest li.none { color: var(--muted); cursor: default; }
.search-actions .btn { width: 100%; }
.search-msg { font-size: 0.92rem; color: var(--closed); }
.search-msg:empty { display: none; }

/* buttons, chips, pills */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--control); padding: 0 var(--s5); border: 0; border-radius: var(--pill); background: var(--brand); color: var(--brand-ink); font-weight: 600; cursor: pointer; transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.btn:hover { background: #0a5a41; }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn[disabled] { background: var(--surface-2); color: var(--muted); cursor: progress; }
.btn-quiet { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); padding: 0 var(--s4); }
.btn-quiet:hover { background: var(--brand-soft); }
.btn-quiet[disabled] { box-shadow: inset 0 0 0 2px var(--line); background: transparent; }
.btn-sm { min-height: 36px; padding: 0 var(--s3); font-size: 0.9rem; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { min-height: 40px; padding: 0 var(--s4); border: 0; border-radius: var(--pill); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: var(--s2); transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.chip:hover { box-shadow: inset 0 0 0 1.5px var(--brand); }
.chip:active { transform: translateY(1px); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); box-shadow: none; }
.chip-n { font-variant-numeric: tabular-nums; font-weight: 600; opacity: 0.85; }
.mapctl .chip { box-shadow: var(--shadow); }
.mapctl .chip[aria-pressed="true"] { background: var(--ink); }

.pill { display: inline-flex; align-items: center; min-height: 28px; padding: 0 var(--s3); border-radius: var(--pill); font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.pill-closed { background: var(--closed-soft); color: #7d1912; }
.pill-partial { background: var(--partial-soft); color: #6b4000; }
.pill-advisory { background: var(--advisory-soft); color: #5a4700; }
.pill-clear { background: var(--clear-soft); color: #1d5a37; }

.banner { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; padding: var(--s3) var(--s4); border-radius: var(--r-sm); background: var(--partial-soft); font-size: 0.92rem; }
.stamp-row { display: flex; align-items: center; gap: var(--s3); }
.stamp { color: var(--muted); font-size: 0.88rem; font-variant-numeric: tabular-nums; }

/* trip results */
.results { display: grid; gap: var(--s3); align-content: start; }
.route-head { display: grid; gap: var(--s1); }
.route-head h2 { font-size: 1.4rem; }
.route-head p { color: var(--ink-2); font-size: 0.95rem; }
.route-head .btn { justify-self: start; margin-top: var(--s2); }
.route-opts { display: grid; gap: var(--s3); }
.optcard { background: var(--surface); border-radius: var(--r); box-shadow: inset 0 0 0 1.5px var(--line); overflow: hidden; transition: box-shadow var(--dur) var(--ease); }
.optcard.open { box-shadow: inset 0 0 0 2.5px var(--ink), var(--shadow); }
.opt { text-align: left; border: 0; background: transparent; cursor: pointer; display: grid; gap: var(--s1); width: 100%; padding: var(--s3) var(--s4); }
.opt:hover { background: var(--surface-2); }
.opt-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.opt-title { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.opt-via { font-weight: 600; font-size: 0.98rem; overflow-wrap: anywhere; }
.opt-meta { color: var(--ink-2); font-size: 0.88rem; }
.opt-body { display: grid; gap: var(--s3); padding: var(--s3) var(--s4) var(--s4); border-top: 1px solid var(--line); }
.rroad { display: grid; gap: var(--s2); }
.rroad + .rroad { border-top: 1px dashed var(--line); padding-top: var(--s3); }
.rroad-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.rroad-title { display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.road-id { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.road-name { color: var(--ink-2); font-size: 0.9rem; }
.rroad-km { color: var(--muted); font-size: 0.88rem; }
.inc { background: var(--paper); border-radius: var(--r-sm); padding: var(--s3) var(--s4); display: grid; gap: var(--s2); }
.inc-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.inc-title { font-weight: 600; font-size: 0.95rem; overflow-wrap: anywhere; }
.inc-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.inc-brief { font-size: 0.88rem; color: var(--ink-2); }
.inc .btn-sm { min-height: 32px; flex: none; }
.inc-more summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 0.88rem; padding: var(--s1) 0; }
.inc-more[open] summary { margin-bottom: var(--s2); }
.inc-facts { margin: 0 0 var(--s2); display: grid; grid-template-columns: max-content 1fr; gap: var(--s1) var(--s4); font-size: 0.9rem; }
.inc-facts dt { color: var(--muted); }
.inc-facts dd { margin: 0; overflow-wrap: anywhere; }
.inc-msg { color: var(--ink-2); font-size: 0.88rem; }
.hint-row { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s2); }

/* map overlays */
.mapctl { position: absolute; z-index: 5; top: var(--s4); right: 64px; }
.legend-wrap { position: absolute; z-index: 5; left: calc(26rem + 2 * var(--s4)); right: 64px; bottom: var(--s4); display: grid; gap: var(--s2); justify-items: start; pointer-events: none; }
.legend { list-style: none; margin: 0; padding: var(--s2) var(--s4); display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); font-size: 0.85rem; color: var(--ink-2); background: var(--surface); border-radius: var(--pill); box-shadow: var(--shadow); pointer-events: auto; }
.legend li { display: flex; align-items: center; gap: var(--s2); }
.map-note { padding: var(--s2) var(--s4); font-size: 0.85rem; color: var(--ink-2); background: var(--surface); border-radius: var(--pill); box-shadow: var(--shadow); pointer-events: auto; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; }
.sw-open { background: var(--clear); }
.sw-closed { background: var(--closed); }
.sw-partial { background: var(--partial); }
.sw-advisory { background: var(--advisory); }
.sw-approach { width: 22px; height: 0; border-radius: 0; border-top: 3px dashed var(--ink-2); }
.pin-road { display: inline-flex; align-items: center; min-height: 28px; padding: 0 var(--s3); border-radius: var(--pill); background: var(--ink); color: var(--surface); font-size: 0.82rem; font-weight: 600; white-space: nowrap; box-shadow: 0 0 0 3px var(--surface), var(--shadow); }
.pin-dest { display: inline-flex; align-items: center; min-height: 28px; padding: 0 var(--s3); border-radius: var(--pill); background: var(--ink); color: var(--surface); font-size: 0.82rem; font-weight: 600; white-space: nowrap; box-shadow: 0 0 0 3px var(--surface), var(--shadow); }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--me); box-shadow: 0 0 0 4px var(--surface), 0 0 0 8px rgb(44 95 168 / 0.25); }
.maplibregl-popup-content { border-radius: var(--r-sm); padding: var(--s3) var(--s4); font-family: var(--font-body); color: var(--ink); box-shadow: var(--shadow-lg); }
.maplibregl-popup-content strong { font-family: var(--font-display); font-weight: 600; }
.pop { display: grid; gap: var(--s1); font-size: 0.9rem; max-width: 18rem; }
.pop .pill { justify-self: start; }

/* sections below the hero */
.band h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.band-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.road-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: var(--s3); align-items: start; }
.rcard { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.rcard summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s1) var(--s3); padding: var(--s4); border-radius: var(--r); }
.rcard summary::-webkit-details-marker { display: none; }
.rcard summary:hover { background: var(--paper); }
.rcard-title { display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.rcard-sub { grid-column: 1 / -1; color: var(--ink-2); font-size: 0.9rem; }
.rcard-ends { grid-column: 1 / -1; color: var(--muted); font-size: 0.85rem; }
.rcard-body { display: grid; gap: var(--s2); padding: 0 var(--s4) var(--s4); }
.about-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s6); margin-top: var(--s5); }
.about-grid h3 { font-size: 1.2rem; margin-bottom: var(--s2); }
.about-grid p { color: var(--ink-2); max-width: 36ch; }

.site-foot { padding: var(--s5) 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.foot-row { display: flex; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.foot-row a { color: var(--brand); font-weight: 600; }
.noscript { position: fixed; inset: auto 0 0 0; padding: var(--s5); background: var(--partial-soft); z-index: 80; }

@media (max-width: 64rem) {
  :root { --gutter: 20px; }
  .about-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
  .city-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav { display: none; }
  .band { padding: var(--s7) 0; }
  .hero { padding: var(--s6) 0 var(--s7); }
  .planner { height: auto; min-height: 0; display: flex; flex-direction: column; }
  #map { position: relative; inset: auto; height: 60vh; min-height: 22rem; }
  .panel { position: relative; inset: auto; width: auto; max-width: none; margin: calc(-1 * var(--s5)) var(--s3) var(--s4); overflow: visible; }
  .mapctl { top: var(--s3); right: 60px; }
  .legend-wrap { left: var(--s3); right: var(--s3); bottom: auto; top: calc(60vh - 112px); }
}
@media (max-width: 40rem) {
  :root { --gutter: 16px; }
  .helpline { font-size: 0.85rem; }
  .hero-cta { width: 100%; }
  .hero-tools .find { flex: 1 1 100%; }
  .city-grid { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: var(--s4); margin-inline: var(--s2); }
  .legend { font-size: 0.78rem; padding: var(--s1) var(--s3); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}

/* road rows: just the name and Open or Closed */
.ccard .rows { margin: 0; gap: 0; }
.rrow { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s2) 0; border-top: 1px solid var(--line); }
.rrow:first-child { border-top: 0; }
.rrow-btn { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); cursor: pointer; border-radius: var(--r-sm); padding: 2px 0; }
.rrow-btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.rrow-btn:hover .road-name { text-decoration: underline; }
.rrow-name { display: flex; align-items: baseline; gap: var(--s2); min-width: 0; flex: 1 1 auto; }
.rrow .pill { flex: none; }
.rrow-name .road-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rrow .road-id { flex: none; min-width: 3.2rem; }
.opt { border-radius: var(--r); box-shadow: inset 0 0 0 1.5px var(--line); background: var(--surface); }
.opt.on { box-shadow: inset 0 0 0 2.5px var(--ink); }
.opt-top { align-items: flex-start; }
.rcard-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4); }
.results .rows { list-style: none; margin: 0; padding: 0; }

.clear-filters { border: 0; background: none; color: var(--brand); font-weight: 600; cursor: pointer; padding: 0 var(--s2); min-height: 40px; text-decoration: underline; text-underline-offset: 3px; }
.clear-filters:hover { color: var(--ink); }
.chip-x-disabled[aria-pressed="true"]::after { content: ""; width: 8px; height: 8px; margin-left: 2px; background: currentColor; clip-path: polygon(15% 0, 50% 35%, 85% 0, 100% 15%, 65% 50%, 100% 85%, 85% 100%, 50% 65%, 15% 100%, 0 85%, 35% 50%, 0 15%); }

/* two pages: status (home) and the trip planner (plan) */
body[data-view="plan"] .hero { display: none; }
body[data-view="home"] .planner { display: none; }
body[data-view="plan"] .nav { display: none; }
body[data-view="home"] .back { display: none; }
.back { text-decoration: none; font-weight: 600; color: var(--brand); padding: var(--s2) 0; }
.back:hover { text-decoration: underline; text-underline-offset: 3px; }

/* major cities: a 3-column grid going down; the All cities button sits below it */
#city-groups .more { justify-self: start; }
.ccard-title { font-size: 1.2rem; }
.rrow .pill { flex: none; }
#kinds .chip-n { font-variant-numeric: tabular-nums; }

.back-short { display: none; }
.brand-name { white-space: nowrap; }
a.btn { text-decoration: none; }

/* phones: the map gets the top of the screen, the trip panel scrolls underneath */
@media (max-width: 40rem) {
  .site-head { height: auto; min-height: var(--head-h); }
  .bar { flex-wrap: nowrap; gap: var(--s3); padding-block: var(--s2); }
  .brand-name { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; }
  .helpline { display: none; }
  .back-long { display: none; }
  .back-short { display: inline; }
  .back { flex: none; font-size: 1rem; }
  .bar { min-height: var(--head-h); }
  .planner { height: calc(100dvh - var(--head-h)); min-height: 0; overflow: hidden; position: relative; }
  #map { position: absolute; inset: 0; height: auto; min-height: 0; }
  /* the trip panel is a bottom sheet: it slides down to leave the map clear */
  .panel { position: absolute; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none; margin: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -8px 24px -12px rgb(21 36 29 / 0.3); max-height: 72%; padding: 0 var(--s4) calc(var(--s5) + env(safe-area-inset-bottom)); gap: var(--s3); transition: transform 320ms var(--ease); transform: translateY(0); }
  .panel[data-sheet="closed"] { transform: translateY(calc(100% - 56px)); overflow: hidden; }
  .panel[data-sheet="closed"] .sheet-body { visibility: hidden; }
  .sheet-body { display: grid; gap: var(--s3); transition: visibility 320ms; }
  .sheet-handle { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: var(--s2); width: calc(100% + 2 * var(--s4)); margin: 0 calc(-1 * var(--s4)); min-height: 56px; padding: var(--s2) var(--s4); border: 0; border-radius: 20px 20px 0 0; background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; touch-action: none; }
  .sheet-handle .grip { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 40px; height: 5px; border-radius: 3px; background: var(--line); }
  .sheet-handle .ph { font-size: 1.1rem; transition: transform 320ms var(--ease); }
  .panel[data-sheet="closed"] .sheet-handle .ph { transform: rotate(180deg); }
  .sheet-handle .sheet-label { margin-top: var(--s2); }
  .panel-h { display: none; }
  .mapctl { top: var(--s2); left: var(--s2); right: auto; }
  .maplibregl-ctrl-top-right { top: auto; bottom: 0; }
  .mapctl .chip { min-height: 36px; padding: 0 var(--s3); font-size: 0.9rem; }
  .legend-wrap { display: none; }
  .fields .field input { font-size: 16px; }
  .search-actions .btn { min-height: 48px; }
  .route-head h2 { font-size: 1.2rem; }
  .opt-via { font-size: 0.95rem; }
}

/* desktop and tablet: no sheet handle */
@media (min-width: 40.01rem) { .sheet-handle { display: none; } .sheet-body { display: contents; } .panel-h { display: block; } }
@media (prefers-reduced-motion: reduce) { .panel { transition: none; } }
