/* parkwise app styles – only tokens from tokens.css. Min text 13px, taps >= 44px. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--pw-font);
  font-size: var(--pw-fs-md);
  color: var(--pw-text);
  background: var(--pw-bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--pw-teal); }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: var(--pw-fs-xl); }
h3 { font-size: var(--pw-fs-md); margin-bottom: 6px; }
p { margin: 6px 0; line-height: 1.4; }
.muted { color: var(--pw-text-2); }
.small { font-size: var(--pw-fs-xs); }
.strong { font-weight: 700; }

/* ---------------------------------------------------------------- layout
   Phone (< 900px): one full-screen screen; the map sits behind the map home.
   Desktop (>= 900px): side panel left, large map right – a web app, not a phone. */
.app {
  --tab-h: calc(64px + env(safe-area-inset-bottom));
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--pw-bg);
}
.map-pane { position: absolute; inset: 0; background: var(--pw-surface-2); z-index: 0; }
.app.has-tabs .map-pane { bottom: var(--tab-h); }
.panel { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.panel > * { pointer-events: auto; }
.brand { display: none; }
.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--pw-bg);
}
.app.has-tabs .screen { bottom: var(--tab-h); }
/* phone map home: screen is see-through, only its cards catch taps */
.app[data-route="map"] .screen { background: transparent; pointer-events: none; overflow: hidden; }
.app[data-route="map"] .screen .map-screen > * { pointer-events: auto; }
.app[data-route="map"] .map-pane .leaflet-bottom { bottom: var(--peek-h, 0); }

/* ---------------------------------------------------------------- tab bar */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: calc(64px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: var(--pw-surface);
  border-top: 1px solid var(--pw-border);
  z-index: 900;
}
.tabbar[hidden] { display: none; }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--pw-tap);
  font-size: var(--pw-fs-xs); color: var(--pw-text-2); text-decoration: none;
}
.tab-icon { font-size: 20px; line-height: 1; }
.tab.on { color: var(--pw-navy); font-weight: 700; }

/* ---------------------------------------------------------------- buttons, chips */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--pw-tap); padding: 0 18px;
  border-radius: var(--pw-radius); border: 1px solid transparent;
  font-size: var(--pw-fs-md); font-weight: 600; text-decoration: none; cursor: pointer;
  background: var(--pw-surface-2); color: var(--pw-navy);
}
.btn.primary { background: var(--pw-navy); color: #fff; }
.btn.secondary { background: var(--pw-surface); border-color: var(--pw-border); }
.btn.ghost { background: transparent; color: var(--pw-text-2); }
.btn.block { display: flex; width: 100%; }
.btn.small { min-height: var(--pw-tap); padding: 0 12px; font-size: var(--pw-fs-sm); }
.btn:focus-visible, .chip:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid var(--pw-teal); outline-offset: 2px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--pw-tap); height: var(--pw-tap); border-radius: 50%;
  border: 0; background: var(--pw-surface-2); color: var(--pw-navy);
  font-size: 24px; line-height: 1; text-decoration: none; cursor: pointer; flex: none;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: var(--pw-tap); padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--pw-border); background: var(--pw-surface);
  font-size: var(--pw-fs-sm); cursor: pointer;
}
.chip.on { background: var(--pw-navy); border-color: var(--pw-navy); color: #fff; font-weight: 600; }

/* ---------------------------------------------------------------- chance, price, tags */
.chance { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 600; }
.chance-bar { display: inline-flex; gap: 2px; }
.chance-bar i { width: 7px; height: 14px; border-radius: 2px; background: var(--pw-border); }
.chance-bar i.on { background: var(--pw-navy); }
.chance-word { font-size: var(--pw-fs-sm); }

.price { display: inline-block; padding: 2px 8px; border-radius: 6px; font-weight: 700; font-size: var(--pw-fs-sm); white-space: nowrap; color: var(--pw-navy); }
.price.free { background: var(--pw-free); }
.price.paid { background: var(--pw-paid); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag {
  font-size: var(--pw-fs-xs); padding: 3px 8px; border-radius: 6px;
  background: var(--pw-surface-2); color: var(--pw-text-2);
}
.tag.free { background: var(--pw-free-soft); color: var(--pw-navy); box-shadow: inset 0 0 0 1px var(--pw-free); }
.tag.paid { background: var(--pw-paid-soft); color: var(--pw-navy); box-shadow: inset 0 0 0 1px var(--pw-paid); }
.tag.planb { background: var(--pw-navy); color: #fff; font-weight: 700; }
.tag.warn { background: var(--pw-warn-soft); color: var(--pw-warn); font-weight: 600; }

.fc-label { display: inline-block; font-size: var(--pw-fs-xs); color: var(--pw-text-2); }

/* ---------------------------------------------------------------- pages */
.screen-page { padding: 12px 16px 32px; padding-top: max(12px, env(safe-area-inset-top)); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; margin-bottom: 8px; }
.page-head h1 { font-size: var(--pw-fs-lg); }
.head-summary {
  flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-height: var(--pw-tap);
  font-size: var(--pw-fs-sm); color: var(--pw-text-2); text-decoration: none; text-align: right;
}
.page-foot { margin-top: 20px; }
.page-foot.sticky {
  position: sticky; bottom: 0; margin: 20px -16px -32px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(250, 250, 250, 0), var(--pw-bg) 30%);
}
.section-title { font-size: var(--pw-fs-sm); color: var(--pw-text-2); text-transform: uppercase; letter-spacing: 0.04em; margin: 20px 0 8px; }

.card {
  display: block; background: var(--pw-surface); border: 1px solid var(--pw-border);
  border-radius: var(--pw-radius); padding: 14px; margin: 12px 0; color: var(--pw-text); text-decoration: none;
}
.card.notice { background: var(--pw-warn-soft); border-color: transparent; color: var(--pw-warn); font-size: var(--pw-fs-sm); }

/* ---------------------------------------------------------------- hero (leave-by) */
.hero { display: flex; flex-direction: column; gap: 2px; }
.hero-label { font-size: var(--pw-fs-sm); font-weight: 600; color: var(--pw-text-2); }
.hero-time {
  font-size: var(--pw-fs-hero); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em;
  align-self: flex-start; background: var(--pw-lime); padding: 0 8px; border-radius: 8px; margin-left: -4px;
}
.hero-sub { font-size: var(--pw-fs-xs); color: var(--pw-text-2); }
.hero.tight .hero-label { font-size: var(--pw-fs-lg); color: var(--pw-navy); font-weight: 800; }
.hero-card { background: var(--pw-surface); border-radius: var(--pw-radius); padding: 16px; border: 1px solid var(--pw-border); }

/* ---------------------------------------------------------------- map home */
.map-screen { position: absolute; inset: 0; }
.dest-pill {
  position: absolute; top: max(12px, env(safe-area-inset-top)); left: 12px; right: 12px; z-index: 800;
  display: flex; flex-direction: column; padding: 10px 16px; min-height: var(--pw-tap);
  background: var(--pw-surface); border-radius: var(--pw-radius); box-shadow: var(--pw-shadow);
  text-decoration: none; color: var(--pw-text);
}
.dest-route { display: flex; align-items: center; gap: 6px; font-size: var(--pw-fs-md); min-width: 0; }
.dest-from { color: var(--pw-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.dest-to { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dest-edit { margin-left: auto; color: var(--pw-text-2); }
.dest-when { font-size: var(--pw-fs-xs); color: var(--pw-text-2); }

/* legend + start pin */
.map-legend {
  display: flex; flex-wrap: wrap; gap: 4px 12px; max-width: 260px;
  background: rgba(255, 255, 255, 0.94); padding: 8px 10px; border-radius: 10px;
  box-shadow: var(--pw-shadow); font: 13px/1.3 var(--pw-font); color: var(--pw-text);
}
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg-pin { display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--pw-navy); }
.lg-pin.garage { width: 20px; height: 20px; border-radius: 5px; background: var(--pw-navy); color: #fff; font-style: normal; }
.lg-pin.garage b { font-size: 13px; line-height: 1; }
.lg-pin.street { width: 14px; height: 14px; border-radius: 50%; background: var(--pw-surface); }
.lg-sw { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(31, 42, 55, 0.3); }
.lg-sw.free { background: var(--pw-free); }
.lg-sw.paid { background: var(--pw-paid); }
.lg-sw.excluded { background: #c9d0d8; }
.pin-origin { display: flex; align-items: center; justify-content: center; }
.pin-origin span {
  padding: 3px 8px; border-radius: 999px; background: var(--pw-surface); color: var(--pw-navy);
  border: 2px solid var(--pw-navy); font: 700 13px/1.2 var(--pw-font); white-space: nowrap; box-shadow: var(--pw-shadow);
}
.leaflet-tooltip { font: 13px/1.35 var(--pw-font); color: var(--pw-text); }
@media (max-width: 899px) { .leaflet-control-zoom { display: none; } } /* pinch to zoom; keeps the search pill clear */

/* plan: search */
.search { display: flex; gap: 8px; margin-top: 10px; }
.search-input { flex: 1; min-width: 0; font-size: var(--pw-fs-md); font-weight: 400; }
.results { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--pw-border); border-radius: var(--pw-radius); overflow: hidden; background: var(--pw-surface); }
.results li + li { border-top: 1px solid var(--pw-border); }
.result { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: var(--pw-tap); padding: 10px 14px; border: 0; background: none; text-align: left; cursor: pointer; }
.result:hover { background: var(--pw-surface-2); }
.custom-dest { margin-top: 8px; }
.loc-banner {
  position: absolute; top: calc(max(12px, env(safe-area-inset-top)) + 72px); left: 12px; right: 12px; z-index: 800;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px;
  padding: 6px 6px 6px 12px; background: var(--pw-navy); color: #fff; border-radius: var(--pw-radius);
  font-size: var(--pw-fs-xs);
}
.loc-banner .btn { background: rgba(255, 255, 255, 0.14); color: #fff; }
.loc-banner .btn.ghost { background: transparent; color: #fff; }
.loc-actions { display: flex; gap: 4px; }
.peek {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 800;
  background: var(--pw-surface); border-radius: var(--pw-radius-lg) var(--pw-radius-lg) 0 0;
  box-shadow: 0 -6px 24px rgba(31, 42, 55, 0.14);
  padding: 10px 16px 14px; display: flex; flex-direction: column; gap: 8px;
}
.peek::before { content: ''; align-self: center; width: 36px; height: 4px; border-radius: 2px; background: var(--pw-border); }

.row-option {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 0;
  border-top: 1px solid var(--pw-border); text-decoration: none; color: var(--pw-text);
}
.row-kind { flex: none; width: 58px; font-size: var(--pw-fs-xs); font-weight: 700; color: var(--pw-text-2); text-transform: uppercase; }
.row-kind.planb { color: var(--pw-navy); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { display: flex; align-items: center; gap: 10px; font-size: var(--pw-fs-sm); color: var(--pw-text-2); }
.chev { color: var(--pw-text-3); font-size: 22px; }

/* map markers */
.pin-spot { display: flex; align-items: center; justify-content: center; }
.pin-spot span {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border: 2.5px solid var(--pw-navy);
  font: 800 14px/1 var(--pw-font); color: #fff; box-shadow: 0 2px 6px rgba(31, 42, 55, 0.3);
}
.pin-spot.street span { border-radius: 50%; width: 22px; height: 22px; }
.pin-spot.garage span { border-radius: 6px; width: 28px; height: 28px; background: var(--pw-navy); }
.pin-spot.street.free span { background: var(--pw-free); }
.pin-spot.street.paid span { background: var(--pw-paid); }
.pin-spot.garage.free span { box-shadow: 0 0 0 3px var(--pw-free), 0 2px 6px rgba(31, 42, 55, 0.3); }
.pin-spot.garage.paid span { box-shadow: 0 0 0 3px var(--pw-paid), 0 2px 6px rgba(31, 42, 55, 0.3); }
.pin-spot.excluded span { background: #c9d0d8; border-color: #9aa5b1; color: #f3f5f7; box-shadow: none; }
.pin-spot.hl span { transform: scale(1.25); }
.pin-dest { display: flex; align-items: flex-end; justify-content: center; }
.pin-dest span {
  position: relative; padding: 4px 10px; border-radius: 10px; background: var(--pw-teal); color: #fff;
  font: 700 13px/1.2 var(--pw-font); white-space: nowrap; box-shadow: var(--pw-shadow); margin-bottom: 8px;
}
.pin-dest span::after {
  content: ''; position: absolute; left: 50%; bottom: -6px; margin-left: -6px;
  border: 6px solid transparent; border-bottom: 0; border-top-color: var(--pw-teal);
}
.leaflet-control-attribution { font-size: 13px !important; }

/* ---------------------------------------------------------------- plan */
.field { margin: 18px 0; }
.field-label { font-size: var(--pw-fs-sm); color: var(--pw-text-2); margin-bottom: 8px; display: flex; justify-content: space-between; }
.field-label output { color: var(--pw-navy); font-weight: 700; font-size: var(--pw-fs-md); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  min-height: 60px; padding: 10px 12px; border-radius: var(--pw-radius);
  border: 1px solid var(--pw-border); background: var(--pw-surface); cursor: pointer;
}
.seg-btn span { font-size: var(--pw-fs-xs); color: var(--pw-text-2); }
.seg-btn.on { border: 2px solid var(--pw-navy); }
.row-inline { display: flex; flex-direction: column; gap: 10px; }
.input {
  min-height: var(--pw-tap); padding: 0 12px; font-size: var(--pw-fs-lg); font-weight: 700;
  border: 1px solid var(--pw-border); border-radius: var(--pw-radius); background: var(--pw-surface); color: var(--pw-navy);
}
.input.time { width: 140px; }
.range { width: 100%; height: var(--pw-tap); accent-color: var(--pw-navy); }
.range-ends { display: flex; justify-content: space-between; font-size: var(--pw-fs-xs); color: var(--pw-text-2); }
.toggles { display: flex; flex-direction: column; gap: 4px; }
.toggle {
  display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 14px;
  background: var(--pw-surface); border: 1px solid var(--pw-border); border-radius: var(--pw-radius); cursor: pointer;
}
.toggle input { width: 24px; height: 24px; accent-color: var(--pw-navy); }

/* ---------------------------------------------------------------- options */
.why p strong { color: var(--pw-navy); }
.tradeoff { background: var(--pw-surface-2); border-color: transparent; }
.tradeoff .btn { margin-top: 8px; }
.opt-list { display: flex; flex-direction: column; }
.opt-card { margin: 0 0 10px; }
.opt-card.is-best { border: 2px solid var(--pw-navy); }
.opt-top { display: flex; align-items: center; gap: 10px; }
.opt-rank {
  flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--pw-surface-2);
  display: flex; align-items: center; justify-content: center; font-size: var(--pw-fs-xs); font-weight: 700;
}
.opt-name { flex: 1; font-weight: 700; }
.opt-mid { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 8px; font-size: var(--pw-fs-sm); }
.opt-meta { margin-top: 4px; font-size: var(--pw-fs-sm); }

.not-shown summary { min-height: var(--pw-tap); display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.not-shown ul { list-style: none; margin: 4px 0 0; padding: 0; }
.not-shown li a {
  display: flex; flex-direction: column; padding: 10px 0; min-height: var(--pw-tap);
  border-top: 1px solid var(--pw-border); color: var(--pw-text); text-decoration: none; font-size: var(--pw-fs-sm);
}

.heat-row { display: flex; gap: 3px; align-items: flex-end; margin-top: 10px; }
.heat-cell { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.heat-bar { width: 100%; height: 40px; display: flex; align-items: flex-end; background: var(--pw-surface-2); border-radius: 3px; overflow: hidden; }
.heat-bar i { width: 100%; background: var(--pw-text-3); }
.heat-cell.now .heat-bar i { background: var(--pw-navy); }
.heat-cell.now .heat-bar { outline: 2px solid var(--pw-navy); outline-offset: 1px; }
.heat-h { height: 16px; font-size: var(--pw-fs-xs); color: var(--pw-text-2); }
.heat-legend { display: flex; justify-content: space-between; margin-top: 4px; }

.empty-title { font-size: var(--pw-fs-xl); margin-top: 8px; }
.sugg-list { display: flex; flex-direction: column; margin-top: 8px; }
.sugg { text-align: left; width: 100%; cursor: pointer; display: flex; flex-direction: column; gap: 4px; margin: 0 0 10px; }
.sugg-best { font-size: var(--pw-fs-sm); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.sugg-cta { font-weight: 700; color: var(--pw-teal); }
.sugg.transit { background: var(--pw-surface-2); border-color: transparent; }

/* ---------------------------------------------------------------- spot detail */
.spot-head h1 { font-size: var(--pw-fs-xl); }
.spot-chance { font-size: var(--pw-fs-lg); margin-bottom: 4px; }
.spot-chance .chance-word { font-size: var(--pw-fs-md); }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--pw-border); font-size: var(--pw-fs-sm); }
.kv > div:first-child, .kv > h3 + div { border-top: 0; }
.kv .k { color: var(--pw-text-2); flex: none; }
.kv .v { text-align: right; }
.kv > .attrs { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: flex-start; padding-top: 10px; }
.attr { font-size: var(--pw-fs-xs); }
.attr.no { color: var(--pw-text-3); }
.chart { width: 100%; height: auto; display: block; margin-top: 4px; }
.chart .grid { stroke: var(--pw-border); stroke-width: 1; }
.chart .axis { font-size: 13px; fill: var(--pw-text-2); font-family: var(--pw-font); }
.chart .axis.strong { fill: var(--pw-navy); font-weight: 700; }
.chart .band { fill: var(--pw-teal-soft); opacity: 0.3; }
.chart .line { fill: none; stroke: var(--pw-teal); stroke-width: 2.5; stroke-linejoin: round; }
.chart .arrival { stroke: var(--pw-navy); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart .dot { fill: var(--pw-navy); }
.chart-legend { display: flex; gap: 16px; margin-top: 4px; }
.chart-legend i { display: inline-block; width: 16px; height: 8px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }
.lg-line { background: var(--pw-teal); height: 3px !important; }
.lg-band { background: var(--pw-teal-soft); opacity: 0.5; }
.source { margin: 12px 0; }

/* ---------------------------------------------------------------- sheet, toast */
.sheet-wrap { position: absolute; inset: 0; z-index: 2000; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(31, 42, 55, 0.4); }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--pw-surface); border-radius: var(--pw-radius-lg) var(--pw-radius-lg) 0 0;
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px; animation: up 0.18s ease-out;
}
.sheet-title { font-size: var(--pw-fs-lg); }
.nav-apps { display: flex; flex-direction: column; gap: 8px; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.toast {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 3000;
  background: var(--pw-navy); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: var(--pw-fs-sm);
  box-shadow: var(--pw-shadow); width: max-content; max-width: calc(100% - 32px); text-align: center;
}

@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }

/* ---------------------------------------------------------------- route search (map home + plan) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.top-card {
  position: absolute; top: max(12px, env(safe-area-inset-top)); left: 12px; right: 12px; z-index: 800;
  background: var(--pw-surface); border-radius: var(--pw-radius); box-shadow: var(--pw-shadow); padding: 10px 12px;
}
.route-box { display: flex; flex-direction: column; gap: 6px; }
.route-row {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 6px 0 12px;
  border: 1px solid var(--pw-border); border-radius: var(--pw-radius); background: var(--pw-surface);
}
.route-row:focus-within { border-color: var(--pw-teal); box-shadow: 0 0 0 3px rgba(15, 138, 135, 0.15); }
.route-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--pw-text-2); }
.route-dot.to { border-color: var(--pw-teal); background: var(--pw-teal); }
.route-input { flex: 1; min-width: 0; height: 44px; border: 0; outline: 0; background: transparent; font: inherit; font-size: var(--pw-fs-md); color: var(--pw-text); }
.route-input::placeholder { color: var(--pw-text-3); }
.route-gps, .route-go {
  flex: none; width: 40px; height: 40px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--pw-surface-2); color: var(--pw-navy); font-size: 20px; line-height: 1;
}
.route-go { background: var(--pw-navy); color: #fff; }
.route-msg { margin: 0 4px; }
.route-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.chip.small { min-height: 36px; padding: 0 12px; font-size: var(--pw-fs-sm); }
.results { margin: 0; }
.when-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: var(--pw-tap);
  margin-top: 8px; padding: 0 4px; border-top: 1px solid var(--pw-border);
  font-size: var(--pw-fs-sm); color: var(--pw-text); text-decoration: none;
}
.when-edit { color: var(--pw-teal); font-weight: 700; flex: none; }
.pin-spot.hover span { transform: scale(1.4); box-shadow: 0 0 0 4px rgba(15, 138, 135, 0.5); }

/* ---------------------------------------------------------------- demo */
.demo-pill {
  position: absolute; left: 12px; bottom: calc(var(--tab-h) + 12px); z-index: 1500;
  min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px dashed var(--pw-text-3);
  background: rgba(255, 255, 255, 0.92); color: var(--pw-text-2); font-size: var(--pw-fs-xs); cursor: pointer;
}
.app:not(.has-tabs) .demo-pill { bottom: 12px; }
.demo-btn { justify-content: space-between; }
kbd { font: 600 13px/1 var(--pw-font); padding: 4px 8px; border-radius: 6px; background: var(--pw-surface-2); border: 1px solid var(--pw-border); color: var(--pw-text-2); }

/* ---------------------------------------------------------------- drive, feedback, trips */
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: var(--pw-fs-xs); font-weight: 700; color: var(--pw-teal); }
.live-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--pw-teal); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
.drive-main h2 { font-size: var(--pw-fs-xl); margin: 2px 0 6px; }
.alert { background: var(--pw-warn-soft); border: 2px solid var(--pw-warn); }
.alert h3 { color: var(--pw-warn); font-size: var(--pw-fs-lg); }
.alert-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.row-option.plain { border-top: 0; }
.choice-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 20px; }
.choice {
  min-height: 52px; padding: 0 16px; text-align: left; border-radius: var(--pw-radius);
  border: 1px solid var(--pw-border); background: var(--pw-surface); font-weight: 600; cursor: pointer;
}
.choice.on { border: 2px solid var(--pw-navy); background: var(--pw-surface-2); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.saved-card { text-align: center; }
.saved-big { font-size: var(--pw-fs-xl); font-weight: 800; margin: 4px 0; }
.saved-card .saved-big { display: inline-block; background: var(--pw-lime); padding: 2px 10px; border-radius: 8px; }
.week-bars { display: flex; gap: 10px; align-items: flex-end; height: 150px; margin: 12px 0; }
.wb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.wb-val { font-size: var(--pw-fs-xs); font-weight: 700; height: 16px; }
.wb-bar { flex: 1; width: 100%; display: flex; align-items: flex-end; background: var(--pw-surface-2); border-radius: 6px; overflow: hidden; }
.wb-bar i { width: 100%; background: var(--pw-navy); }
.wb-day { font-size: var(--pw-fs-xs); color: var(--pw-text-2); }
.wb-day.today { color: var(--pw-navy); font-weight: 800; }
.trip-row { margin: 0 0 8px; }
.trip-top { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.trip-saved { margin-left: auto; font-weight: 700; }

/* ---------------------------------------------------------------- profile */
.persona { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; }
.persona > blockquote, .persona > p { grid-column: 1 / -1; }
.avatar {
  width: 64px; height: 64px; border-radius: 50%; background: var(--pw-navy); color: var(--pw-lime);
  display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800;
}
.persona h1 { font-size: var(--pw-fs-xl); }
.persona p { margin: 2px 0; }
blockquote { margin: 4px 0; padding: 8px 12px; border-left: 3px solid var(--pw-teal); background: var(--pw-surface-2); border-radius: 0 8px 8px 0; font-style: italic; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--pw-border); font-size: var(--pw-fs-sm); }
.kv-row:first-of-type { border-top: 0; }
.seg-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.seg-pill {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: var(--pw-tap); padding: 6px 14px;
  border-radius: var(--pw-radius); border: 1px solid var(--pw-border); background: var(--pw-surface); cursor: pointer; font-weight: 600;
}
.seg-pill span { font-size: var(--pw-fs-xs); font-weight: 400; color: var(--pw-text-2); }
.seg-pill.on { border: 2px solid var(--pw-navy); background: var(--pw-surface-2); }
.toggle.plain { border: 0; padding: 0; min-height: var(--pw-tap); }
.how summary { cursor: pointer; list-style: none; }
.how summary h3 { display: inline; }
.how ul { padding-left: 18px; margin: 10px 0; }
.how li { margin: 8px 0; line-height: 1.45; font-size: var(--pw-fs-sm); }

/* ---------------------------------------------------------------- real garages (OpenStreetMap) */
.pin-real { display: flex; align-items: center; justify-content: center; }
.pin-real span {
  display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 5px;
  background: var(--pw-surface); border: 2px solid var(--pw-navy-2); color: var(--pw-navy);
  font: 800 13px/1 var(--pw-font); box-shadow: 0 1px 4px rgba(31, 42, 55, 0.25); opacity: 0.9;
}
.pin-real:hover span { transform: scale(1.2); opacity: 1; }
.lg-pin.real { width: 18px; height: 18px; border-radius: 4px; background: var(--pw-surface); color: var(--pw-navy); font-style: normal; }
.lg-pin.real b { font-size: 13px; line-height: 1; }
.lg-real { flex-basis: 100%; }
.real-pop { font: 13px/1.4 var(--pw-font); color: var(--pw-text); }
.real-pop strong { font-size: var(--pw-fs-md); display: block; }
.real-badge { display: inline-block; margin: 4px 0; padding: 2px 6px; border-radius: 6px; background: var(--pw-surface-2); color: var(--pw-text-2); }
.real-pop ul { margin: 4px 0 8px; padding-left: 16px; }
.real-list { list-style: none; margin: 4px 0; padding: 0; }
.real-row {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 6px 0;
  border: 0; border-top: 1px solid var(--pw-border); background: none; text-align: left; cursor: pointer;
}
.real-row:hover .row-name { text-decoration: underline; }
.real-icon {
  flex: none; width: 28px; height: 28px; border-radius: 6px; border: 2px solid var(--pw-navy-2);
  display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--pw-navy);
}
.map-legend { max-width: 300px; }

.brand-clock { margin-left: auto; font-size: var(--pw-fs-xs); font-weight: 600; color: var(--pw-text-2); display: inline-flex; align-items: center; gap: 6px; }
.brand-clock.live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--pw-teal); }
.brand-clock.pitch { color: var(--pw-navy); background: var(--pw-lime); padding: 2px 8px; border-radius: 999px; }

.route-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 10px; }
.kv > .route-links { justify-content: flex-start; border-top: 1px solid var(--pw-border); }
.real-pop .route-links { padding: 4px 0 8px; }
.real-pop .btn.primary { color: #fff; }
.real-drive { margin: 4px 0 0; font-weight: 600; }
.real-item { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--pw-border); }
.real-item .real-row { border-top: 0; flex: 1; }
.pin-real.surface span { width: 16px; height: 16px; font-size: 13px; border-width: 1.5px; border-radius: 4px; opacity: 0.8; }

.opt-link { display: block; color: inherit; text-decoration: none; }
.opt-card .route-links { margin-top: 10px; border-top: 1px solid var(--pw-border); }
.hero-card .route-links, .peek .route-links { padding-top: 6px; }
.peek .route-links { padding: 0 0 6px; }
.route-links .btn.small { padding: 0 10px; font-size: var(--pw-fs-xs); } /* keeps the 44px tap height */

/* ---------------------------------------------------------------- start page: tour entry */
.top-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.top-title { font-weight: 800; font-size: var(--pw-fs-md); }
.how-btn {
  min-height: var(--pw-tap); padding: 0 14px; border-radius: 999px; border: 1px solid var(--pw-teal);
  background: var(--pw-surface); color: var(--pw-teal); font-weight: 700; font-size: var(--pw-fs-sm); cursor: pointer;
}
.how-btn:hover { background: var(--pw-teal); color: #fff; }
.welcome {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 12px;
  background: var(--pw-lime); border-radius: var(--pw-radius); font-size: var(--pw-fs-sm);
}
.welcome-text { flex: 1; min-width: 160px; }
.welcome-x { width: 32px; height: 32px; border: 0; background: transparent; font-size: 16px; cursor: pointer; color: var(--pw-navy); }

/* ---------------------------------------------------------------- guided tour */
.tour { position: fixed; inset: 0; z-index: 5000; }
.tour-block { position: absolute; inset: 0; }
.tour.dim .tour-block { background: rgba(15, 23, 32, 0.6); }
.tour-hole {
  position: fixed; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 4px var(--pw-lime), 0 0 0 9999px rgba(15, 23, 32, 0.6);
  transition: left 0.25s ease, top 0.25s ease, width 0.25s ease, height 0.25s ease;
}
.tour-pop {
  position: fixed; background: var(--pw-surface); border-radius: var(--pw-radius-lg); padding: 18px 18px 14px;
  box-shadow: 0 20px 60px rgba(15, 23, 32, 0.35); color: var(--pw-text);
  transition: left 0.25s ease, top 0.25s ease;
}
.tour-pop h3 { font-size: var(--pw-fs-lg); margin: 6px 0 8px; }
.tour-text { margin: 0 0 14px; font-size: var(--pw-fs-sm); line-height: 1.5; }
.tour-progress { display: flex; align-items: center; gap: 10px; font-size: var(--pw-fs-xs); color: var(--pw-text-2); font-weight: 700; }
.tour-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--pw-surface-2); overflow: hidden; }
.tour-bar i { display: block; height: 100%; background: var(--pw-teal); transition: width 0.25s ease; }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tour-nav { display: flex; gap: 8px; }
body.touring .demo-pill { display: none; }
@media (prefers-reduced-motion: reduce) { .tour-hole, .tour-pop, .tour-bar i { transition: none; } }

/* ---------------------------------------------------------------- desktop (last, so it wins over the phone rules above) */
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: minmax(400px, 34vw) 1fr; --tab-h: 0px; }
  .panel {
    position: relative; grid-column: 1; grid-row: 1; inset: auto; min-height: 0;
    display: flex; flex-direction: column;
    background: var(--pw-bg); border-right: 1px solid var(--pw-border);
    box-shadow: 4px 0 24px rgba(31, 42, 55, 0.08); pointer-events: auto;
  }
  .map-pane { position: relative; grid-column: 2; grid-row: 1; inset: auto; height: 100%; }
  .app.has-tabs .map-pane { bottom: auto; }
  .brand {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 16px 24px; border-bottom: 1px solid var(--pw-border); background: var(--pw-surface);
  }
  .brand-mark {
    width: 32px; height: 32px; border-radius: 8px; background: var(--pw-navy); color: var(--pw-lime);
    display: flex; align-items: center; justify-content: center; font-weight: 800;
  }
  .brand-name { font-weight: 800; font-size: var(--pw-fs-lg); }
  .brand-tag { font-size: var(--pw-fs-xs); color: var(--pw-text-2); }
  .screen { position: relative; inset: auto; flex: 1; min-height: 0; }
  .app.has-tabs .screen { bottom: auto; }
  .app[data-route="map"] .screen { background: var(--pw-bg); pointer-events: auto; overflow-y: auto; }
  .app[data-route="map"] .map-pane .leaflet-bottom { bottom: 0; }
  .screen-page { padding: 16px 24px 32px; }
  .page-foot.sticky { margin: 20px -24px -32px; padding: 12px 24px 20px; }

  /* map home in the side panel: cards stacked, no floating overlays */
  .map-screen { position: static; padding: 16px 24px 24px; display: flex; flex-direction: column; gap: 12px; }
  .map-screen .top-card, .map-screen .peek { position: static; box-shadow: none; }
  .map-screen .top-card { border: 1px solid var(--pw-border); padding: 14px; }
  .map-screen .peek { border: 1px solid var(--pw-border); border-radius: var(--pw-radius); padding: 16px; }
  .map-screen .peek::before { display: none; }
  .hero-time { font-size: 56px; }

  .tabbar { position: static; height: 64px; padding-bottom: 0; }

  /* dialogs instead of bottom sheets */
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%);
    width: 420px; border-radius: var(--pw-radius-lg); animation: none; padding: 24px;
  }
  .toast { bottom: 32px; }
  .demo-pill { left: auto; right: 60px; top: 12px; bottom: auto; min-height: 34px; }
}

/* ---------------------------------------------------------------- compact option footer */
.opt-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.opt-foot .tags { margin-top: 0; }
.route-one {
  flex: none; display: inline-flex; align-items: center; min-height: var(--pw-tap); padding: 0 12px;
  border-radius: 999px; font-weight: 700; font-size: var(--pw-fs-sm); color: var(--pw-teal); text-decoration: none;
}
.route-one:hover { background: var(--pw-surface-2); }

/* ================================================================ design proposals
   html[data-look] is set from ?look=clean|night|float (remembered per browser).
   Semantics stay the same in every look: mint/sand = free/paid, chance = bars + word. */

/* ---------- A · Clean: light, airy, borderless cards with soft shadows */
html[data-look="clean"] .panel { background: #f4f6f8; }
html[data-look="clean"] .card,
html[data-look="clean"] .hero-card,
html[data-look="clean"] .map-screen .top-card,
html[data-look="clean"] .map-screen .peek {
  border: 0; box-shadow: 0 1px 2px rgba(31, 42, 55, 0.06), 0 6px 20px rgba(31, 42, 55, 0.06);
}
html[data-look="clean"] .opt-card.is-best { box-shadow: 0 0 0 2px var(--pw-navy), 0 6px 20px rgba(31, 42, 55, 0.08); }
html[data-look="clean"] .brand { background: transparent; border-bottom: 0; padding-bottom: 4px; }
html[data-look="clean"] .route-row { background: var(--pw-surface-2); border-color: transparent; }
html[data-look="clean"] .section-title { letter-spacing: 0.08em; }
html[data-look="clean"] .row-option { border-top-color: transparent; }
html[data-look="clean"] .tabbar { background: #f4f6f8; border-top: 0; }

/* ---------- B · Night: navy side panel, lime accents – like a navigation app */
html[data-look="night"] .panel,
html[data-look="night"] .sheet-wrap,
html[data-look="night"] .tour-pop {
  --pw-bg: #17212b; --pw-surface: #212d3a; --pw-surface-2: #2b3846; --pw-border: #354353;
  --pw-text: #f2f5f8; --pw-text-2: #a7b4c1; --pw-text-3: #7f8d9b;
  color: var(--pw-text);
}
html[data-look="night"] .panel { background: var(--pw-bg); border-right-color: #0f171f; }
html[data-look="night"] .brand { background: #121a22; border-bottom-color: #0f171f; }
html[data-look="night"] .brand-name, html[data-look="night"] h1, html[data-look="night"] h2, html[data-look="night"] h3 { color: #fff; }
html[data-look="night"] .btn.primary, html[data-look="night"] .route-go { background: var(--pw-lime); color: var(--pw-navy); }
html[data-look="night"] .btn.secondary, html[data-look="night"] .icon-btn, html[data-look="night"] .route-gps { background: var(--pw-surface-2); color: var(--pw-text); border-color: var(--pw-border); }
html[data-look="night"] .chance-bar i { background: #3d4b5b; }
html[data-look="night"] .chance-bar i.on { background: var(--pw-lime); }
html[data-look="night"] .chip.on, html[data-look="night"] .seg-pill.on, html[data-look="night"] .choice.on { background: var(--pw-lime); color: var(--pw-navy); border-color: var(--pw-lime); }
html[data-look="night"] .seg-btn.on, html[data-look="night"] .opt-card.is-best { border-color: var(--pw-lime); }
html[data-look="night"] .tab.on, html[data-look="night"] .row-kind.planb, html[data-look="night"] .field-label output,
html[data-look="night"] .when-edit, html[data-look="night"] .route-one, html[data-look="night"] .how-btn { color: var(--pw-lime); }
html[data-look="night"] .how-btn { border-color: var(--pw-lime); background: transparent; }
html[data-look="night"] .how-btn:hover { background: var(--pw-lime); color: var(--pw-navy); }
html[data-look="night"] .hero-time { color: var(--pw-navy); }
html[data-look="night"] .why p strong, html[data-look="night"] .opt-name, html[data-look="night"] .row-name { color: #fff; }
html[data-look="night"] .tag.planb { background: var(--pw-lime); color: var(--pw-navy); }
html[data-look="night"] .tag.free, html[data-look="night"] .tag.paid { color: var(--pw-navy); }
html[data-look="night"] .input, html[data-look="night"] .route-input { color: var(--pw-text); }
html[data-look="night"] .heat-bar i { background: #5d6d7e; }
html[data-look="night"] .heat-cell.now .heat-bar i { background: var(--pw-lime); }
html[data-look="night"] .heat-cell.now .heat-bar { outline-color: var(--pw-lime); }
html[data-look="night"] .wb-bar i { background: var(--pw-lime); }
html[data-look="night"] .chart .line { stroke: var(--pw-lime); }
html[data-look="night"] .chart .band { fill: var(--pw-lime); opacity: 0.18; }
html[data-look="night"] .chart .arrival { stroke: #fff; }
html[data-look="night"] .chart .dot { fill: #fff; }
html[data-look="night"] .chart .axis.strong { fill: #fff; }
html[data-look="night"] .lg-line { background: var(--pw-lime); }
html[data-look="night"] .alert { background: #3a2418; }
html[data-look="night"] .card.notice { background: #3a2418; }
html[data-look="night"] .tradeoff, html[data-look="night"] .sugg.transit { background: var(--pw-surface-2); }
html[data-look="night"] blockquote { background: var(--pw-surface-2); border-left-color: var(--pw-lime); }
html[data-look="night"] .avatar { background: var(--pw-lime); color: var(--pw-navy); }
html[data-look="night"] .welcome { color: var(--pw-navy); }
html[data-look="night"] .welcome .btn.primary { background: var(--pw-navy); color: #fff; }
html[data-look="night"] .page-foot.sticky { background: linear-gradient(to bottom, rgba(23, 33, 43, 0), var(--pw-bg) 30%); }
html[data-look="night"] .real-icon { border-color: var(--pw-text-2); color: var(--pw-text); }
html[data-look="night"] .result:hover { background: var(--pw-surface-2); }

/* ---------- C · Float: full-screen map, the planner floats over it as one rounded card */
@media (min-width: 900px) {
  html[data-look="float"] .app { display: block; }
  html[data-look="float"] .map-pane,
  html[data-look="float"] .app.has-tabs .map-pane { position: absolute; inset: 0; height: auto; }
  html[data-look="float"] .panel {
    position: absolute; left: 20px; top: 20px; bottom: 20px; width: 420px;
    border: 0; border-radius: 24px; overflow: hidden;
    box-shadow: 0 2px 6px rgba(31, 42, 55, 0.12), 0 24px 64px rgba(31, 42, 55, 0.22);
  }
  html[data-look="float"] .brand { border-bottom: 0; }
  html[data-look="float"] .brand-tag { display: none; }
  html[data-look="float"] .card,
  html[data-look="float"] .hero-card,
  html[data-look="float"] .map-screen .top-card,
  html[data-look="float"] .map-screen .peek { border: 0; background: var(--pw-surface-2); }
  html[data-look="float"] .panel { background: var(--pw-surface); }
  html[data-look="float"] .screen { background: var(--pw-surface); }
  html[data-look="float"] .app[data-route="map"] .screen { background: var(--pw-surface); }
  html[data-look="float"] .route-row { background: var(--pw-surface); }
  html[data-look="float"] .tabbar { border-top-color: var(--pw-surface-2); }
  html[data-look="float"] .map-pane .leaflet-bottom.leaflet-left { left: 452px; }
  html[data-look="float"] .demo-pill { right: 64px; }
}

.look-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.map-legend { max-width: none; flex-wrap: nowrap; white-space: nowrap; }

/* ---------------------------------------------------------------- real Berlin open data layers */
.pin-pr span {
  display: flex; align-items: center; justify-content: center; width: 40px; height: 26px;
  border-radius: 6px; background: #fff; color: var(--pw-navy); border: 2px solid var(--pw-navy);
  font: 700 13px/1 var(--pw-font); box-shadow: var(--pw-shadow);
}
.pr-list { margin: 8px 0 4px; padding-left: 18px; }
.pr-list li { margin: 4px 0; }
.leaflet-control-layers { font: 14px/1.4 var(--pw-font); border-radius: var(--pw-radius-sm) !important; }
.leaflet-control-layers-toggle { width: 44px !important; height: 44px !important; }
.leaflet-control-layers label { min-height: 32px; display: flex; align-items: center; }
.pin-spot.labelled { position: relative; }
.pin-label {
  position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); margin-bottom: -2px;
  padding: 2px 7px; border-radius: 6px; background: var(--pw-navy); color: #fff;
  font: 700 13px/1.3 var(--pw-font); white-space: nowrap; box-shadow: var(--pw-shadow); pointer-events: none;
}
.lg-sw.blocked { background: transparent; border: 2px dashed #8a96a3; box-sizing: border-box; }
