/* Mode system chrome (mobile home only): the bottom mode bar and mode-scoped
   visibility. Loaded by index.html, never by the desktop cockpit. */

.mode-bar {
   position: fixed;
   left: 0;
   right: 0;
   bottom: 0;
   z-index: 900;
   display: flex;
   /* Card, not nav-bg: the tab text tokens (ink/muted/accent) are only
      contrast-guaranteed against sand/card surfaces. */
   background: var(--hwy-card);
   border-top: 1px solid var(--hwy-line);
   padding-bottom: env(safe-area-inset-bottom);
}

.mode-tab {
   flex: 1;
   min-height: 56px;
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   gap: 2px;
   background: none;
   border: none;
   font: inherit;
   font-size: 12px;
   font-weight: 600;
   color: var(--hwy-muted);
   cursor: pointer;
   -webkit-tap-highlight-color: transparent;
}

.mode-tab-icon {
   font-size: 20px;
   line-height: 1;
}

.mode-tab.is-active {
   color: var(--hwy-accent);
}

.mode-tab:disabled {
   opacity: 0.45;
   cursor: default;
}

/* Keep scrolling content clear of the fixed bar. */
body.has-mode-bar {
   padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

/* The page must never scroll (or silently widen) horizontally: on mobile,
   overflowing content expands the layout viewport past the visual one, which
   pushes fixed bottom chrome partly off the physical screen. */
html, body {
   overflow-x: clip;
}

/* Floating buttons that predate the mode bar must clear it, not cover it
   (the feedback FAB still exists under the classic-layout escape hatch). */
body.has-mode-bar .hh-fb-fab {
   bottom: calc(72px + env(safe-area-inset-bottom));
}

/* ── Sheet layout: map fills the viewport; planning lives in one bottom sheet ── */

body.sheet-layout {
   overflow: hidden;
   height: 100dvh;
}

body.sheet-layout .app-header {
   position: fixed;
   top: 0;
   left: 0;
   right: 0;
   z-index: 500;
}

/* Title text ALWAYS reads against the header surface: several themes restyle
   .app-title with cockpit-surface colors (ink and friends) that vanish on
   header-bg. --hwy-header-ink is computed per theme against header-bg. */
body.sheet-layout .app-header .app-title,
body.sheet-layout .app-header .app-tagline {
   color: var(--hwy-header-ink, #fff) !important;
}

body.sheet-layout .settings-topbar .settings-title {
   color: var(--hwy-header-ink, #fff) !important;
}

body.sheet-layout .app-main {
   padding: 0;
   max-width: none;
}

body.sheet-layout .map-section {
   position: fixed;
   inset: 0;
   margin: 0;
   z-index: 1;
}

body.sheet-layout .map-container {
   height: 100%;
   border-radius: 0;
   border: none;
}

/* The sheet's tab strip replaces the chip nav; the map never scrolls away. */
body.sheet-layout .feature-nav {
   display: none !important;
}

.mode-sheet {
   position: fixed;
   left: 0;
   right: 0;
   bottom: calc(56px + env(safe-area-inset-bottom));
   height: 46dvh;
   z-index: 800;
   display: flex;
   flex-direction: column;
   background: var(--hwy-sand);
   border: 1px solid var(--hwy-line);
   border-bottom: none;
   border-radius: 18px 18px 0 0;
   box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.18);
   transition: height 0.25s ease;
}

.mode-sheet.is-dragging {
   transition: none;
}

.mode-sheet.detent-peek { height: 128px; }
.mode-sheet.detent-half { height: 46dvh; }
/* Full still clears the header and leaves a sliver of map. */
.mode-sheet.detent-full { height: calc(100dvh - 150px); }

.sheet-handle {
   flex: 0 0 auto;
   width: 100%;
   background: none;
   border: none;
   cursor: grab;
   touch-action: none;
   padding: 10px 0 6px;
   display: flex;
   justify-content: center;
}

.sheet-grip {
   display: block;
   width: 42px;
   height: 5px;
   border-radius: 3px;
   background: var(--hwy-muted);
   opacity: 0.5;
}

.sheet-tabs {
   flex: 0 0 auto;
   display: flex;
   gap: 6px;
   padding: 2px 10px 8px;
   overflow-x: auto;
   scrollbar-width: none;
}

.sheet-tabs::-webkit-scrollbar {
   display: none;
}

.sheet-tab {
   flex: 0 0 auto;
   display: inline-flex;
   align-items: center;
   gap: 5px;
   background: var(--hwy-card);
   border: 1px solid var(--hwy-line);
   border-radius: 999px;
   padding: 8px 13px;
   min-height: 38px;
   font-size: 13px;
   font-weight: 600;
   white-space: nowrap;
   cursor: pointer;
   color: var(--hwy-ink);
}

.sheet-tab.is-active {
   background: var(--hwy-green);
   color: #fff;
   border-color: var(--hwy-accent);
}

.sheet-content {
   flex: 1;
   overflow-y: auto;
   -webkit-overflow-scrolling: touch;
   padding: 0 14px 14px;
}

.mode-sheet.detent-peek .sheet-content {
   overflow: hidden;
}

/* One surface at a time inside the sheet: the trip home, a single panel, or
   a pre-trip cover. */
#sheetContent > section,
#sheetContent > .sheet-home,
#sheetContent > .sheet-cover {
   display: none;
}

#sheetContent > .sheet-active {
   display: block;
}

/* Sections adopted into the sheet lose their page-flow top margins. */
#sheetContent > section {
   margin-top: 0;
}

/* The sheet is a plan-mode surface; drive gets its own chrome (phase 3). */
body.mode-drive .mode-sheet {
   display: none;
}

/* ── Departure slider floating over the map (mobile mirror of the cockpit's
   Leave-box popover). Sits just above the peeked sheet so the route and its
   weather icons stay in full view while scrubbing. ── */
.departure-float {
   position: fixed;
   left: 10px;
   right: 10px;
   bottom: calc(56px + 128px + 12px + env(safe-area-inset-bottom));
   z-index: 850;
   background: var(--hwy-card);
   border: 1px solid var(--hwy-line);
   border-radius: 14px;
   box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
   padding: 10px 14px 12px;
}

.departure-float .departure-slider {
   margin-top: 0;
   padding: 0;
   background: none;
}

/* A fatter track area for thumbs: the range keeps its look, just more of it. */
.departure-float .departure-slider-range {
   margin: 10px 0 4px;
}

.departure-float-head {
   display: flex;
   align-items: center;
   gap: 10px;
   margin-bottom: 4px;
}

.departure-float-title {
   flex: 1;
   font-size: 11px;
   font-weight: 700;
   letter-spacing: 0.05em;
   text-transform: uppercase;
   color: var(--hwy-muted, #666);
}

.departure-float-exact {
   border: none;
   background: none;
   font: inherit;
   font-size: 12px;
   font-weight: 600;
   color: var(--hwy-accent);
   cursor: pointer;
   padding: 4px 0;
}

.departure-float-close {
   border: none;
   background: none;
   font-size: 16px;
   line-height: 1;
   color: var(--hwy-muted, #666);
   cursor: pointer;
   padding: 4px 6px;
}

/* Promo pill sits below the header and BELOW the sheet in stacking order, so
   raising the sheet can never be blocked by a promotion. Rectangular corners:
   coerced band content wraps to several lines, and a 999px radius on tall
   content balloons into a circle. */
body.sheet-layout .hwy-banner-oval {
   top: calc(env(safe-area-inset-top) + 76px);
   bottom: auto;
   z-index: 700;
   border-radius: 18px;
   padding: 10px 14px;
}

/* The free (Leaflet) map on the mobile home: same slot as the Google map.
   Styles that lived only in desktop.css, now needed here too. */
#freeMap { position: absolute; inset: 0; z-index: 1; isolation: isolate; }
#freeMap.free-map-dark .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.9) saturate(0.7); }
.free-map-emoji { font-size: 22px; line-height: 30px; text-align: center; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); background: none; border: none; }
.free-map-gas-stop { font: 800 13px/22px system-ui, -apple-system, sans-serif; text-align: center; color: #fff; background: #147a3c; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 1px 5px rgba(0,0,0,0.45); }

/* ── Search-first trip form ── */

.field-destination input {
   font-size: 18px;
   font-weight: 600;
   padding: 13px 14px;
}

.trip-form-more-toggle {
   background: none;
   border: none;
   text-align: left;
   padding: 2px 2px 0;
   font-size: 13px;
   font-weight: 600;
   color: var(--hwy-muted);
   cursor: pointer;
   min-height: 32px;
}

.trip-form-more {
   display: flex;
   flex-direction: column;
   gap: 12px;
}

/* ── Trip summary as a decision card ── */

.summary-dest {
   font-size: 23px;
   font-weight: 800;
   line-height: 1.15;
}

.summary-stats {
   display: flex;
   gap: 8px;
   margin: 10px 0 8px;
}

.summary-stat {
   flex: 1;
   display: flex;
   flex-direction: column;
   align-items: center;
   background: var(--hwy-subtle);
   border-radius: 12px;
   padding: 9px 4px;
   min-width: 0;
}

.summary-stat b {
   font-size: 19px;
   font-weight: 800;
   font-variant-numeric: tabular-nums;
   white-space: nowrap;
}

.summary-stat span {
   font-size: 11px;
   font-weight: 700;
   text-transform: uppercase;
   letter-spacing: 0.5px;
   color: var(--hwy-muted);
}

.summary-depart {
   display: inline-block;
   background: var(--hwy-card);
   border: 1px solid var(--hwy-line);
   border-radius: 999px;
   padding: 7px 13px;
   font-size: 13px;
   font-weight: 700;
   color: var(--hwy-ink);
   cursor: pointer;
   margin-bottom: 4px;
}

/* The commit button: full-width, the reserved commit color, impossible to miss. */
body.sheet-layout .hit-road-row {
   margin-top: 12px;
}

body.sheet-layout .hit-road-button {
   width: 100%;
   min-height: 52px;
   font-size: 17px;
   border-radius: 12px;
   background: var(--hwy-commit);
}

/* ── Trip stats strip: the consequences ledger, pinned under the tabs ── */

.stats-strip {
   flex: 0 0 auto;
   padding: 4px 14px 8px;
   font-size: 12.5px;
   font-weight: 700;
   color: var(--hwy-muted);
   white-space: nowrap;
   overflow-x: auto;
   scrollbar-width: none;
}

.stats-strip::-webkit-scrollbar {
   display: none;
}

.stats-strip-delta {
   color: var(--hwy-accent);
}

/* ── Place cards: one grammar for every place-like row ── */

.place-card {
   background: var(--hwy-card);
   border: 1px solid var(--hwy-line);
   border-radius: 12px;
   margin-bottom: 8px;
}

.place-card-main {
   display: flex;
   align-items: center;
   gap: 10px;
   padding: 10px 12px;
   min-height: 56px;
   cursor: pointer;
}

.place-card-emoji {
   font-size: 20px;
   flex: 0 0 auto;
}

.place-card-body {
   flex: 1;
   min-width: 0;
   display: flex;
   flex-direction: column;
   gap: 2px;
}

.place-card-title {
   font-size: 14.5px;
   font-weight: 700;
   color: var(--hwy-ink);
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
}

.place-card-meta {
   font-size: 12.5px;
   color: var(--hwy-muted);
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
}

.place-card-toggle {
   flex: 0 0 auto;
   width: 44px;
   height: 44px;
   border-radius: 50%;
   border: 1px solid var(--hwy-line);
   background: var(--hwy-subtle);
   font-size: 20px;
   font-weight: 700;
   color: var(--hwy-ink);
   cursor: pointer;
}

.place-card-toggle.is-on {
   background: var(--hwy-green);
   border-color: var(--hwy-green);
   color: #fff;
}

.place-card-action {
   flex: 0 0 auto;
   min-height: 44px;
   border-radius: 10px;
   border: 1px solid var(--hwy-line);
   background: var(--hwy-subtle);
   padding: 0 12px;
   font-size: 13px;
   font-weight: 700;
   color: var(--hwy-ink);
   cursor: pointer;
}

.place-card-detail {
   padding: 0 12px 12px;
   font-size: 13px;
   color: var(--hwy-muted);
}

/* ── Corridor facets ── */

.corridor-facets {
   display: flex;
   gap: 6px;
   overflow-x: auto;
   scrollbar-width: none;
   padding-bottom: 8px;
}

.corridor-facets::-webkit-scrollbar {
   display: none;
}

.corridor-facet {
   flex: 0 0 auto;
   background: var(--hwy-card);
   border: 1px solid var(--hwy-line);
   border-radius: 999px;
   padding: 7px 13px;
   font-size: 13px;
   font-weight: 600;
   color: var(--hwy-ink);
   cursor: pointer;
   min-height: 36px;
}

.corridor-facet.is-active {
   background: var(--hwy-green);
   border-color: var(--hwy-accent);
   color: #fff;
}

.corridor-hint {
   font-size: 13px;
   color: var(--hwy-muted);
   margin: 4px 0 10px;
}

.corridor-sample-badge {
   align-self: flex-start;
   font-size: 10px;
   font-weight: 800;
   text-transform: uppercase;
   letter-spacing: 0.5px;
   color: var(--hwy-warn-ink);
   background: var(--hwy-warn-bg);
   border-radius: 6px;
   padding: 1px 6px;
}

.corridor-gas-nudge {
   display: block;
   margin: 10px auto 4px;
}

.corridor-group-head {
   font-size: 12px;
   font-weight: 800;
   text-transform: uppercase;
   letter-spacing: 0.6px;
   color: var(--hwy-muted);
   margin: 12px 2px 6px;
}

/* ── Summary pills + actions (prefs made visible, save/share) ── */

.summary-pills,
.summary-actions {
   display: flex;
   flex-wrap: wrap;
   gap: 6px;
   margin: 8px 0 2px;
}

.summary-pill {
   background: var(--hwy-card);
   border: 1px solid var(--hwy-line);
   border-radius: 999px;
   padding: 7px 12px;
   min-height: 36px;
   font-size: 12.5px;
   font-weight: 700;
   color: var(--hwy-ink);
   cursor: pointer;
}

/* ── My trips (saved plans on the pre-trip home) ── */

.my-trips {
   margin-top: 10px;
}

.my-trip-row {
   display: flex;
   align-items: center;
   gap: 6px;
   margin-bottom: 6px;
}

.my-trip-open {
   flex: 1;
   text-align: left;
   background: var(--hwy-card);
   border: 1px solid var(--hwy-line);
   border-radius: 10px;
   padding: 10px 12px;
   min-height: 44px;
   font-size: 13.5px;
   font-weight: 700;
   color: var(--hwy-ink);
   cursor: pointer;
}

.my-trip-delete {
   width: 44px;
   height: 44px;
   border-radius: 10px;
   border: 1px solid var(--hwy-line);
   background: none;
   color: var(--hwy-muted);
   cursor: pointer;
}

/* ── Timeline legs (mobile): summaries first, hourly detail on tap ── */

.timeline-leg {
   list-style: none;
}

.timeline-leg-summary {
   display: flex;
   flex-direction: column;
   gap: 2px;
   padding: 10px 4px;
   cursor: pointer;
   border-top: 1px solid var(--hwy-line);
}

.timeline-leg-route {
   font-size: 14px;
   font-weight: 700;
}

.timeline-leg-conditions {
   font-size: 12.5px;
   color: var(--hwy-muted);
}

.timeline-leg-inner {
   padding-left: 6px;
}

/* ── Radio: tune buttons + the mini-bar ── */

.radio-tune {
   flex: 0 0 auto;
   align-self: center;
   min-height: 40px;
   min-width: 56px;
   border-radius: 10px;
   border: 1px solid var(--hwy-line);
   background: var(--hwy-subtle);
   font-size: 13px;
   font-weight: 700;
   color: var(--hwy-ink);
   cursor: pointer;
   margin-left: 8px;
}

.radio-mini-bar {
   position: fixed;
   left: 8px;
   right: 8px;
   bottom: calc(60px + env(safe-area-inset-bottom));
   z-index: 890;
   display: flex;
   align-items: center;
   gap: 4px;
   background: var(--hwy-card);
   border: 1px solid var(--hwy-line);
   border-radius: 12px;
   box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
   padding: 4px 6px;
}

.radio-mini-label {
   flex: 1;
   min-width: 0;
   text-align: left;
   background: none;
   border: none;
   font-size: 13px;
   font-weight: 700;
   color: var(--hwy-ink);
   cursor: pointer;
   min-height: 40px;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
}

.radio-mini-close {
   flex: 0 0 auto;
   width: 40px;
   height: 40px;
   border: none;
   background: none;
   color: var(--hwy-muted);
   font-size: 15px;
   cursor: pointer;
}

/* On the road the bar rides above the drive strip, oversized with the rest. */
body.mode-drive .radio-mini-bar {
   bottom: calc(120px + env(safe-area-inset-bottom));
   padding: 8px;
}

body.mode-drive .radio-mini-label {
   font-size: 17px;
   min-height: 48px;
}

/* The sheet content clears the bar when a station is tuned. */
body.has-radio-bar .sheet-content {
   padding-bottom: 64px;
}

/* ── First-run teaser: one line of promise + tappable sample trips ── */

.plan-teaser {
   margin-bottom: 12px;
}

.teaser-copy {
   margin: 4px 2px 12px;
   padding-left: 10px;
   border-left: 3px solid #f4b740; /* amber route tick — ties to the cockpit/badges system */
   font-size: 14px;
   font-weight: 600;
   color: var(--hwy-ink);
}

.sample-routes {
   display: flex;
   gap: 8px;
   overflow-x: auto;
   scrollbar-width: none;
   padding-bottom: 4px;
}

.sample-routes::-webkit-scrollbar {
   display: none;
}

/* Section headers in the strip: small vertical mile-marker labels between the
   groups (City to city, West Coast…), so 100+ signs scan fast. */
.sample-route-group {
   flex: 0 0 auto;
   align-self: stretch;
   display: flex;
   align-items: center;
   writing-mode: vertical-rl;
   transform: rotate(180deg);
   font-size: 10px;
   font-weight: 800;
   text-transform: uppercase;
   letter-spacing: 0.08em;
   color: var(--hwy-muted, #4b5563);
   padding: 4px 1px;
   border-left: 2px solid var(--hwy-line, #e3e0d8);
}

/* Each popular route is a little green highway guide sign you can tap into. */
.sample-route-card {
   flex: 0 0 auto;
   display: flex;
   flex-direction: column;
   align-items: flex-start;
   gap: 3px;
   /* Fixed guide-sign green (theme token goes light-mint in dark mode → white text fails). */
   background: linear-gradient(178deg, #12694f, #0b3d2e);
   border: none;
   box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.85), 0 4px 12px -6px rgba(11, 61, 46, 0.6);
   border-radius: 12px;
   padding: 10px 13px;
   min-height: 48px;
   max-width: 210px;
   cursor: pointer;
   text-align: left;
}

.sample-route-name {
   font-weight: 800;
   font-size: 13px;
   color: #fff;
}

.sample-route-ends {
   font-size: 12px;
   color: rgba(255, 255, 255, 0.82);
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
   max-width: 100%;
}

/* ── Pre-trip panel cover: sells the feature, points back at the form ── */

.sheet-cover {
   padding-top: 6px;
}

.sheet-cover-blurb {
   color: var(--hwy-muted);
   font-size: 14px;
   margin: 6px 0 14px;
}

/* ── Error banners carry a feedback entry ── */

.banner-feedback-link {
   display: inline-block;
   margin-left: 10px;
   background: none;
   border: 1px solid currentColor;
   border-radius: 999px;
   padding: 3px 10px;
   font-size: 12px;
   font-weight: 700;
   color: inherit;
   cursor: pointer;
}

/* ── Modal sheet (promise-based interrupts: guest credits, confirms) ── */

.msheet-overlay {
   position: fixed;
   inset: 0;
   z-index: 4000;
   background: rgba(0, 0, 0, 0.45);
   display: flex;
   align-items: flex-end;
   justify-content: center;
}

.msheet {
   width: 100%;
   max-width: 480px;
   background: var(--hwy-card);
   color: var(--hwy-ink);
   border-radius: 18px 18px 0 0;
   padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
   box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
}

.msheet-title {
   margin: 0 0 6px;
   font-size: 17px;
}

.msheet-body {
   margin: 0 0 12px;
   font-size: 14px;
   color: var(--hwy-muted);
   line-height: 1.45;
}

.msheet-meter {
   display: flex;
   align-items: center;
   gap: 10px;
   margin-bottom: 14px;
}

.msheet-meter-label {
   font-size: 13px;
   font-weight: 700;
   white-space: nowrap;
}

.msheet-meter-track {
   flex: 1;
   height: 8px;
   border-radius: 4px;
   background: var(--hwy-subtle);
   overflow: hidden;
}

.msheet-meter-fill {
   display: block;
   height: 100%;
   border-radius: 4px;
   background: var(--hwy-green);
}

.msheet-actions {
   display: flex;
   flex-direction: column;
   gap: 8px;
}

.msheet-action {
   min-height: 48px;
   border-radius: 12px;
   font-size: 15px;
   font-weight: 700;
   cursor: pointer;
   border: 1px solid var(--hwy-line);
   background: var(--hwy-card);
   color: var(--hwy-ink);
}

.msheet-action-primary {
   background: var(--hwy-green);
   border-color: var(--hwy-green);
   color: #fff;
}

.msheet-action-quiet {
   font-weight: 600;
}

/* ── Settings modal: App & help rows (interim Setup surface) ── */

.settings-applinks {
   display: flex;
   flex-direction: column;
   gap: 2px;
   padding: 6px 0;
}

.settings-applink {
   display: flex;
   align-items: center;
   gap: 10px;
   min-height: 48px;
   padding: 6px 8px;
   border: none;
   background: none;
   border-radius: 10px;
   font-size: 15px;
   font-weight: 600;
   color: var(--hwy-ink);
   text-decoration: none;
   cursor: pointer;
   text-align: left;
}

.settings-applink:active {
   background: var(--hwy-subtle);
}

/* ── Drive mode: three glanceable readouts + one drawer, nothing else ──
   House rules (from the automotive guidelines): primary numbers >= 34px,
   labels >= 16px, touch targets >= 64px, strings <= 120 chars, no
   decorative motion. */

.drive-panel {
   display: none;
}

body.mode-drive .drive-panel {
   position: fixed;
   inset: 0;
   z-index: 850;
   display: flex;
   flex-direction: column;
   pointer-events: none; /* the map stays pannable between the readouts */
}

.drive-panel > * {
   pointer-events: auto;
}

/* Driving is full-screen: header, sheet, mode bar, promos and dev chrome all
   yield — nothing competes with the road (ads while in motion are banned by
   every automotive guideline anyway). */
body.mode-drive .app-header,
body.mode-drive .mode-bar,
body.mode-drive .hwy-banner,
body.mode-drive .api-counter {
   display: none !important;
}

/* No decorative motion while driving. */
body.mode-drive * {
   transition: none !important;
   animation: none !important;
}

.drive-next {
   margin: calc(env(safe-area-inset-top) + 10px) 10px 0;
   background: var(--hwy-card);
   border: 1px solid var(--hwy-line);
   border-radius: 16px;
   padding: 12px 16px;
   display: flex;
   flex-direction: column;
   gap: 2px;
   box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
}

.drive-next-label {
   font-size: 13px;
   font-weight: 800;
   letter-spacing: 1px;
   text-transform: uppercase;
   color: var(--hwy-muted);
}

.drive-next-name {
   font-size: 27px;
   font-weight: 800;
   line-height: 1.15;
   color: var(--hwy-ink);
   display: -webkit-box;
   -webkit-line-clamp: 2;
   -webkit-box-orient: vertical;
   overflow: hidden;
}

.drive-next-dist {
   font-size: 18px;
   font-weight: 700;
   color: var(--hwy-accent);
}

.drive-spacer {
   flex: 1;
   pointer-events: none !important;
}

.drive-drawer {
   background: var(--hwy-sand);
   border: 1px solid var(--hwy-line);
   border-bottom: none;
   border-radius: 16px 16px 0 0;
   max-height: 64px;
   overflow: hidden;
}

body.mode-drive .drive-panel.drawer-open .drive-drawer {
   max-height: 52dvh;
   overflow-y: auto;
}

.drive-drawer-handle {
   width: 100%;
   min-height: 64px;
   background: none;
   border: none;
   font-size: 18px;
   font-weight: 800;
   color: var(--hwy-ink);
   cursor: pointer;
}

.drive-coming-up {
   list-style: none;
   margin: 0;
   padding: 0 16px 10px;
}

.drive-coming-item {
   display: flex;
   flex-direction: column;
   gap: 2px;
   padding: 12px 0;
   min-height: 64px;
   justify-content: center;
   border-top: 1px solid var(--hwy-line);
}

.drive-coming-title {
   font-size: 19px;
   font-weight: 700;
   color: var(--hwy-ink);
}

.drive-coming-meta {
   font-size: 16px;
   color: var(--hwy-muted);
}

.drive-drawer-note {
   margin: 0;
   padding: 8px 16px calc(10px + env(safe-area-inset-bottom));
   font-size: 13px;
   color: var(--hwy-muted);
}

.drive-strip {
   display: flex;
   align-items: center;
   gap: 8px;
   padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
   background: var(--hwy-card);
   border-top: 1px solid var(--hwy-line);
}

.drive-stat {
   flex: 1;
   display: flex;
   flex-direction: column;
   align-items: center;
   gap: 0;
}

.drive-stat {
   min-width: 0;
}

.drive-stat b {
   /* Big but never clipped: "1,284" mi-left and "9:41 PM" must render whole —
      an ellipsized readout fails the 2-second-glance law harder than a
      slightly smaller one. Floor stays >= the 27px glance minimum. */
   font-size: clamp(27px, 8.2vw, 34px);
   font-weight: 800;
   line-height: 1.05;
   color: var(--hwy-ink);
   font-variant-numeric: tabular-nums;
   max-width: 100%;
   white-space: nowrap;
}

.drive-stat span {
   font-size: 14px;
   font-weight: 700;
   text-transform: uppercase;
   letter-spacing: 0.6px;
   color: var(--hwy-muted);
}

.drive-chip {
   min-width: 64px;
   min-height: 64px;
   border-radius: 16px;
   border: 1px solid var(--hwy-line);
   background: var(--hwy-subtle);
   font-size: 22px;
   cursor: pointer;
   color: var(--hwy-ink);
}

.drive-end {
   font-size: 17px;
   font-weight: 800;
   background: var(--hwy-green);
   border-color: var(--hwy-green);
   color: #fff;
}

/* ── Drive prompts: two giant buttons, self-dismissing ── */

.drive-prompt {
   position: fixed;
   left: 10px;
   right: 10px;
   bottom: calc(110px + env(safe-area-inset-bottom));
   z-index: 950;
   background: var(--hwy-card);
   border: 1px solid var(--hwy-line);
   border-radius: 18px;
   padding: 14px;
   box-shadow: 0 10px 34px rgba(0, 0, 0, 0.35);
}

.drive-prompt-text {
   margin: 0 0 12px;
   font-size: 21px;
   font-weight: 800;
   color: var(--hwy-ink);
}

.drive-prompt-actions {
   display: flex;
   gap: 10px;
}

.drive-prompt-button {
   flex: 1;
   min-height: 72px;
   border-radius: 14px;
   font-size: 19px;
   font-weight: 800;
   cursor: pointer;
}

.drive-prompt-no {
   background: var(--hwy-subtle);
   border: 1px solid var(--hwy-line);
   color: var(--hwy-ink);
}

.drive-prompt-yes {
   background: var(--hwy-green);
   border: 1px solid var(--hwy-green);
   color: #fff;
}

/* ── Setup polish: theme grid, account meters, app links ── */

.settings-theme-grid {
   display: grid;
   grid-template-columns: repeat(2, 1fr);
   gap: 8px;
   margin: 8px 0;
}

.settings-theme-card {
   min-height: 48px;
   border: 1px solid var(--hwy-line);
   border-radius: 12px;
   background: var(--hwy-card);
   font-size: 14px;
   font-weight: 700;
   color: var(--hwy-ink);
   cursor: pointer;
   text-align: left;
   padding: 10px 12px;
}

.settings-theme-card.is-active {
   background: var(--hwy-green);
   border-color: var(--hwy-accent);
   color: #fff;
}

.settings-account {
   background: var(--hwy-subtle);
   border-radius: 12px;
   padding: 10px 12px;
   margin: 8px 0;
   font-size: 13px;
}

.settings-account-who {
   font-weight: 700;
   margin-bottom: 6px;
}

.settings-quota {
   display: flex;
   align-items: center;
   gap: 10px;
   font-size: 12.5px;
   color: var(--hwy-muted);
}

.settings-quota-track {
   flex: 1;
   height: 7px;
   border-radius: 4px;
   background: var(--hwy-card);
   overflow: hidden;
}

.settings-quota-fill {
   display: block;
   height: 100%;
   border-radius: 4px;
   background: var(--hwy-green);
}

/* ── One-time contextual hints ── */

.hint-bubble {
   position: fixed;
   left: 14px;
   right: 14px;
   z-index: 3000;
   pointer-events: none; /* a hint must never block a tap */
   background: var(--hwy-ink);
   color: var(--hwy-sand);
   border-radius: 12px;
   padding: 11px 14px;
   font-size: 13.5px;
   font-weight: 600;
   box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

/* ── Locate-me: the contextual geolocation ask ── */

.locate-me {
   position: absolute;
   right: 10px;
   top: calc(env(safe-area-inset-top) + 78px);
   z-index: 4;
   width: 44px;
   height: 44px;
   border-radius: 50%;
   border: 1px solid var(--hwy-line);
   background: var(--hwy-card);
   font-size: 18px;
   cursor: pointer;
   box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

body.mode-drive .locate-me {
   display: none; /* drive mode follows you already */
}

/* ── Honesty grammar, compact form: freshness reads as a timestamp line, not
      a chip wall (full provenance stays one tap away in the expanded cards;
      "via <source>" is retained — Places attribution stays visible). ── */

body.sheet-layout .fresh-chip {
   background: none;
   border-radius: 0;
   padding: 0 0 6px;
   font-size: 11px;
   margin: 0 0 4px;
}

/* ── Motion: panel swaps get one quiet fade; drive mode + reduced-motion
      suppress everything (drive's kill-switch is above). ── */

#sheetContent > .sheet-active {
   animation: sheet-panel-in 0.18s ease;
}

@keyframes sheet-panel-in {
   from { opacity: 0.4; transform: translateY(6px); }
   to { opacity: 1; transform: none; }
}

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

   #sheetContent > .sheet-active {
      animation: none;
   }
}
