/* 3.9.26 trip screen revamp and the cramped-screens pass (GoSEQ-work/TRIP-REVAMP.md). Loaded last, on the tokens in
   app.css :root. Everything colours itself from the theme tokens (--accent, --accent-soft, --surface-2, --text, --muted,
   --line), so every theme colour and dark mode follow. */

/* ---------- the card: one hero, one supporting line, the journey bar, one main action ---------- */
.ride-panel { padding-left: var(--edge); padding-right: var(--edge); }
.ride-now .phase { font-size: var(--fs-label); letter-spacing: .08em; }
.ride-now .phase-row { min-height: 32px; }
/* the hero (the Get off words keep the size they had) */
.ride-now .big:not(.getoff) { font-size: clamp(32px, 10.4vw, 42px); line-height: 1.04; letter-spacing: -.035em; }
.ride-now .big-badge .badge { height: 30px; min-width: 44px; font-size: var(--fs-row); }
/* the one supporting line */
.ride-now .sub { font-size: var(--fs-body); line-height: 1.4; margin: var(--sp-1) 0 var(--sp-3); }
.ride-sheet:not(.open) .ride-now .sub { margin-bottom: var(--sp-3); }
.sub .sp { font-weight: 700; white-space: nowrap; }
.sub .sp.ok { color: var(--ok); } .sub .sp.warn { color: var(--warn); } .sub .sp.bad { color: var(--bad); white-space: normal; }
.ride-now .jb { margin: var(--sp-2) 0 var(--sp-3); }
/* the one main action, full width; nothing beside it */
.ride-panel .actions { grid-template-columns: 1fr; padding-top: var(--sp-2); }
.ride-panel .actions .btn.primary { grid-column: 1 / -1; min-height: var(--btn-h); font-size: var(--fs-body); }
.ride-panel .actions .btn:not(.primary):only-child { grid-column: 1 / -1; }
/* two buttons that are a real either/or (Are you on it? / I missed it, Paused, Missed it): two equal pills that never cut off */
.ride-panel .actions:has(> .btn + .btn) { grid-template-columns: 1fr 1fr; }
.ride-panel .actions .btn { min-width: 0; padding: 0 var(--sp-3); white-space: normal; line-height: 1.15; text-align: center; }

/* The earlier-bus choice belongs inside the scrollable card, above the sticky trip action. */
.ride-now .lf-card { display: block; margin: 0 0 18px; padding: 14px; min-height: 0; }
.ride-now .lf-card b { display: block; line-height: 1.3; }
.ride-now .lf-card p { margin: 6px 0 12px; line-height: 1.35; }
.ride-now .lf-buttons { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; position: static; background: none; padding: 0; margin: 0; }
.ride-now .lf-buttons .btn { width: 100%; min-width: 0; min-height: 46px; padding: 8px; font-size: 14px; line-height: 1.2; white-space: normal; box-shadow: none; }

/* ---------- walking: the next turn is a slim row, not a card ---------- */
.ride-now .walkcard.walk-now { margin: 0 0 var(--sp-3); }
.ride-sheet .ride-now .walk-now .guide { display: block; margin: 0; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-chip); background: var(--surface-2); color: var(--text); }
.ride-sheet .ride-now .walk-now .guide + .note { margin-top: var(--sp-2); }
.ride-sheet .ride-now .walk-now .guide-main { gap: var(--sp-3); }
.ride-sheet .ride-now .walk-now .guide-arrow { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.ride-sheet .ride-now .walk-now .guide .turn { width: 24px; height: 24px; stroke-width: 2.8; }
.ride-sheet .ride-now .walk-now .guide-dist { font-size: var(--fs-row); line-height: 1.15; }
.ride-sheet .ride-now .walk-now .guide-text { font-size: var(--fs-detail); line-height: 1.3; margin: 0; color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ride-sheet .ride-now .walk-now .guide-then, .ride-sheet .ride-now .walk-now .guide-foot { display: none; }
.ride-sheet .ride-now .walk-now .guide.rerouting { display: flex; align-items: center; }
.ride-sheet .ride-now .walk-now .guide.rerouting .guide-dist { font-size: var(--fs-body); }
/* (in More the whole guide card, if it's there, is a plain card too) */
.ride-more .guide { background: var(--surface-2); color: var(--text); }
.ride-more .guide-arrow { background: var(--accent-soft); color: var(--accent); }
.ride-more .guide-then { border-top-color: var(--line); }

/* ---------- the notes under the card: calm, said once ---------- */
.ride-now .note, .ride-now .check-invite { margin: 0 0 var(--sp-3); }
.ride-now .note { padding: var(--sp-3); font-size: var(--fs-detail); }
.ride-now .stop-sign, .ride-now .verified-ok { margin: 0 0 var(--sp-3); }

/* ---------- the bus to look for: a slim row, a short photo credit ---------- */
.ride-now .bus-card.spot { display: flex; align-items: center; gap: var(--sp-3); margin: 0 0 var(--sp-3); padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-2); border-radius: var(--r-chip); }
.ride-now .bus-card.spot .bus-photo { width: 64px; border-radius: 8px; }
.ride-now .bus-card.spot .bus-body { min-width: 0; }
.ride-now .bus-card.spot .bus-kicker { font-size: var(--fs-label); letter-spacing: .06em; }
.ride-now .bus-card.spot .bus-title { font-size: var(--fs-detail); font-weight: 700; margin-top: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
.bus-credit.short { margin-top: 1px; font-size: var(--fs-label); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bus-credit.short a { padding: 0; margin: 0; }
.ride-now .bus-card.spot.wait { padding: var(--sp-2) var(--sp-3); }
/* the full card (More, the bus sheet on the map): the title and the model stay on a line each; the years don't wrap */
.bus-card { gap: var(--sp-3); padding: var(--sp-3); border-radius: var(--r-chip); }
.bus-photo { width: 96px; }
.bus-title { overflow-wrap: break-word; font-size: var(--fs-body); }
.bus-model { font-size: var(--fs-detail); color: var(--muted); }
.bus-model, .bus-title { text-wrap: balance; }
.bus-credit { margin-top: var(--sp-1); }
@media (max-width: 380px) { .bus-photo { width: 84px; } }

/* ---------- More: the ways to do more, as a plain list ---------- */
.ride-more { border-top: 0; margin-top: var(--sp-1); padding-top: 0; }
.ride-more > :first-child { margin-top: var(--sp-2); }
.more-menu { display: flex; flex-direction: column; margin: 0 0 var(--sp-4); border-radius: var(--r-card); background: var(--surface-2); overflow: hidden; }
.more-menu > * + * { border-top: 1px solid var(--line); }
.mm-row, .more-menu > .chip { display: flex; align-items: center; justify-content: flex-start; gap: var(--sp-3); width: 100%; min-height: 56px; margin: 0; padding: var(--sp-2) var(--sp-4); border-radius: 0; background: none; box-shadow: none; color: var(--text); font-size: var(--fs-body); font-weight: 700; text-align: left; }
.mm-row:active, .more-menu > .chip:active { background: color-mix(in srgb, var(--text) 8%, transparent); transform: none; }
.mm-row .i, .more-menu > .chip .i { width: 22px; height: 22px; flex: none; color: var(--accent); }
.mm-row b { display: block; font-weight: 700; line-height: 1.25; }
.mm-row small { display: block; margin-top: 1px; font-size: var(--fs-detail); line-height: 1.3; color: var(--muted); font-weight: 500; }
.mm-row.end b { color: var(--bad); } .mm-row.end .i { color: var(--bad); }
.mm-row.chase-go { background: none; color: var(--text); margin: 0; }
.more-menu > .later-chip { margin: 0; min-height: 56px; font-size: var(--fs-body); }
.more-menu > .check-chip { margin: 0; }
.more-menu > .alts { margin: 0; padding: var(--sp-3) var(--sp-4); }
.more-menu .pro-badge { margin-left: var(--sp-2); }

/* ---------- the sheet's top row and the buttons along the top of the map: smaller, quieter ---------- */
.ride-full { height: 28px; padding: 0 var(--sp-3) 0 var(--sp-2); font-size: var(--fs-label); }
.ride-full[data-on="1"] { box-shadow: none; background: var(--accent-soft); color: var(--accent); }
.ride-grip .grip-more { padding: 4px var(--sp-3); font-size: var(--fs-label); }
.ride-map .fab, .ride-map .sg-helpbtn { height: 44px; }
.ride-map .fab { width: 44px; }
.ride-map .share-fab { width: 44px; padding: 0; }
.ride-map .sg-helpbtn { min-width: 60px; padding: 0 var(--sp-4); font-size: var(--fs-body); }
.ride-map .map-top { gap: var(--sp-2); }
.ride-map .mv-attr { font-size: 10px; padding: 2px 5px; opacity: .8; }

/* ---------- the other trip screens: the same calm ---------- */
.ride-panel > .phase, .ride-panel > .big { margin-left: 0; }
.ride-panel > .phase { font-size: var(--fs-label); letter-spacing: .08em; }
.ride-panel > .big:not(.getoff) { font-size: clamp(32px, 10vw, 40px); letter-spacing: -.03em; }
.ride-panel > .sub { font-size: var(--fs-body); line-height: 1.4; }
.ride-panel .meet-candidate, .ride-panel .list .item { min-height: 56px; }

/* the first line says where, once, in sentence case, on one line (long station names used to wrap in capitals) */
.ride-now .phase, .ride-panel > .phase { text-transform: none; letter-spacing: 0; font-size: var(--fs-detail); font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ride-now .sub .badge { vertical-align: 1px; margin-right: 2px; }

/* ---------- note 7: how fresh the times are ---------- */
.fresh { display: flex; align-items: center; gap: var(--sp-2); margin: 0 var(--sp-1) var(--sp-3); font-size: var(--fs-detail); font-weight: 600; color: var(--muted); min-height: 24px; }
.fresh-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.fresh.off .fresh-dot { background: var(--warn); }
.fresh .spinner { width: 16px; height: 16px; flex: none; color: var(--accent); }
.fresh.busy { color: var(--text); }

/* ---------- the lift and where-to-get-off sheets ---------- */
.tsh-lead { font-size: var(--fs-row); font-weight: 700; line-height: 1.35; margin: var(--sp-2) 0 var(--sp-2); display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); }
.tsh-sub { font-size: var(--fs-body); margin: 0 0 var(--sp-4); }
.tsh-body .btn { margin-bottom: var(--sp-3); }
.tsh-h { margin: var(--sp-4) var(--sp-1) var(--sp-2); }
.tsh-stop { min-height: 56px; display: flex; align-items: center; gap: var(--sp-3); text-align: left; width: 100%; }
.tsh-stop b { font-weight: 700; font-size: var(--fs-body); } .tsh-stop small { display: block; font-size: var(--fs-detail); color: var(--accent); font-weight: 600; margin-top: 1px; }
.tsh-stop.likely { background: var(--accent-soft); border-radius: var(--r-chip); }
.tsh-t { flex: none; font-variant-numeric: tabular-nums; font-size: var(--fs-detail); }
.tsh-watch { margin-top: var(--sp-4); min-height: 48px; }
.tsh-sheet.later-sheet { max-height: 86%; }

/* ---------- the cramped-screens pass ---------- */
.bus-title .bus-seg, .bus-model .bus-seg { display: inline; white-space: nowrap; }
.bus-title .bus-seg.long, .bus-model .bus-seg.long { white-space: normal; overflow-wrap: anywhere; }   /* (Hearth: a long part wraps, never off screen) */
/* Home, Live near you: the stop's name gets the row (each route is listed under it anyway, so the chips beside it only squeezed it) */
.h-stop-head { padding: var(--sp-3) var(--sp-4) var(--sp-1); align-items: flex-start; }
.h-stop-head .stopchip { margin-top: 1px; }
.h-stop-head b { white-space: normal; overflow: visible; font-size: var(--fs-body); line-height: 1.25; text-wrap: balance; }
.h-stop-head small { margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--fs-detail); }
.h-stop-routes { display: none !important; }
.h-stop-head > .i:last-child { align-self: center; }
/* the departure rows: the place to, then its status and times; the big minutes keep their room */
.nr { gap: var(--sp-3); padding: var(--sp-2) var(--sp-4); }
.nr b { text-wrap: balance; }
.nr small { white-space: normal; overflow: visible; line-height: 1.35; font-size: var(--fs-detail); }
.nr small.nr-fan { font-size: var(--fs-label); }
.nr-t { min-width: 56px; }
/* the stop panel */
.ns-title { align-items: flex-start; gap: var(--sp-3); font-size: var(--fs-card); line-height: 1.2; }
.ns-title > span:last-child { -webkit-line-clamp: 3; overflow-wrap: break-word; text-wrap: balance; }
.ns-meta { line-height: 1.4; margin: 0 var(--sp-1) var(--sp-3); }
.ns-pick-b { gap: var(--sp-3); flex-wrap: wrap; } .ns-pick-b .btn { flex: 1 1 140px; }
.ns-pick-b .btn.primary { flex: 2 1 160px; }
.ns-foot { padding: var(--sp-3) var(--edge) calc(var(--sp-4) + var(--safe-bot, 0px)); }
.stop-title { line-height: 1.2; text-wrap: balance; }
.sheet-head .label { line-height: 1.35; }
/* the vehicle sheet's stop list: the name on its own lines, the time beside it */
.sheet .list .item { min-height: 56px; }
.sheet .list .item .grow b { text-wrap: balance; }
/* the drop-off picker, and "Getting a lift": the choice's words get the row; its action sits under them */
#f-lift { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; column-gap: var(--sp-3); }
#f-lift > .i { margin-top: 2px; }
#f-lift small { white-space: normal; line-height: 1.35; }
#f-lift .link { grid-column: 2; justify-self: start; padding: var(--sp-1) 0 0 !important; font-size: var(--fs-detail); font-weight: 700; min-height: 0; }
.ds-lead { font-size: var(--fs-detail); line-height: 1.45; margin: var(--sp-1) var(--sp-1) var(--sp-3); }
.ds-stop { min-height: 64px; padding: var(--sp-3) var(--sp-4); gap: var(--sp-3); }
.ds-stop b { font-size: var(--fs-body); line-height: 1.25; text-wrap: balance; }
.ds-stop small { font-size: var(--fs-detail); line-height: 1.35; }
.ds-routes { margin-top: var(--sp-1); display: flex; flex-wrap: wrap; gap: 6px; }
/* said once: the bar's "Next:" line repeats the line under the hero */
.ride-now .jb:not(.compact) .jb-next { display: none; }
.mm-compass { padding: var(--sp-2) var(--sp-4); }
.mm-compass .compass { margin: 0; }
.ride-map .share-fab { justify-content: center; }
.ride-now .big.lookup { font-size: clamp(28px, 8.6vw, 34px); }
.ride-more > .note { margin-bottom: var(--sp-3); }
.ride-more .crowd-ask .btn, .ride-more .rider-ask .btn { min-height: 44px; }
/* "Is this my stop?" for the few minutes after getting off: on the card, one calm row */
.ride-now .off-check { margin: 0 0 var(--sp-3); }
.ride-now .off-check .chip { width: 100%; justify-content: flex-start; min-height: 48px; border-radius: var(--r-chip); background: var(--surface-2); box-shadow: none; }
.tsh-body { text-align: left; }
.tsh-lead > span { min-width: 0; }
.h-stop-head .stopchip.road { display: none; }
.h-stop-head small { white-space: normal; }

/* The stop picker's map (dropoff.js pickStop): a fixed-height box so nothing shifts when it opens, shuts or its tiles load */
.ds-mapbox { position: relative; height: min(40vh, 300px); margin-top: var(--sp-2); border-radius: var(--r-card); overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow); transition: height .25s var(--ease), margin .25s var(--ease), opacity .2s; }
.ds-mapbox.shut { height: 0; margin-top: 0; opacity: 0; box-shadow: none; pointer-events: none; visibility: hidden; transition: height .25s var(--ease), margin .25s var(--ease), opacity .2s, visibility 0s .25s; }
.ds-map { position: absolute; inset: 0; }
.ds-maptog { min-height: 44px; display: block; margin: 0 0 0 auto; font-weight: 700; }
.ds-key { z-index: 5; position: absolute; left: var(--sp-2); top: var(--sp-2); display: flex; gap: var(--sp-3); padding: 4px 10px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--surface) 92%, transparent); font-size: var(--fs-label); font-weight: 700; color: var(--text); pointer-events: none; }
.ds-key span { display: inline-flex; align-items: center; gap: 5px; }
.ds-key i { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2.5px solid #5E6966; }
.ds-key .k-ex { background: var(--accent); border-color: var(--accent); }
.ds-key .k-sc { background: var(--ok); border-color: var(--ok); border-radius: 3px; }
.ds-key .k-home { background: var(--text); border-color: var(--text); }
.ds-mapbox .mv-stop.ex:not(.sel) { width: 18px; height: 18px; margin: -9px 0 0 -9px; background: var(--accent); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); z-index: 2; }
.ds-mapbox .mv-stop.sc:not(.sel) { width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 4px; background: var(--ok); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); z-index: 1; }
.ds-mapbox .mv-marker.home { --c: var(--text); --t: var(--bg); z-index: 4; }
.ds-mapbox .mv-marker.home span { font-size: var(--fs-cap); font-weight: 800; }
.ds-foot { position: sticky; bottom: 0; padding: var(--sp-4) 0 var(--sp-2); background: linear-gradient(to top, var(--bg) 70%, transparent); margin-top: var(--sp-4); }
.ds-foot .btn.primary:disabled { opacity: .5; }
/* route chips: express and school on one line, the plain numbers together on the next */
.ds-routes { flex-direction: column; align-items: flex-start; gap: 6px; }
.ds-grp { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
@media (prefers-reduced-motion: reduce) { .ds-mapbox, .ds-mapbox.shut { transition: none; } }
