/* What Stays? — design tokens + layout. Mobile-first. Same ticket look as Which Side (dark band, white slips), with its
   own accent. Every colour is a token here; nothing below this block names a colour. */
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/chakra-petch-600.woff2) format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/chakra-petch-700.woff2) format("woff2"); }
:root {
  --bg: #e8ebf0; --bg-elev: #ffffff; --bg-soft: #f1f3f6; --line: #dfe3e9; --line-strong: #c3c8d1; --text: #12151c; --muted: #565d6b;
  --band: #12151c; --on-band: #ffffff; --band-muted: #a7aebb; --band-line: #2c323e;
  /* The accent: bright on the dark band and on buttons, deep where it sits on a light surface or on the map. */
  --brand: #2fd08c; --on-brand: #06281a; --brand-deep: #0b7a4b; --brand-ink: var(--brand-deep);
  --note-soft: #fff3d6; --warn: #c81e1e; --warn-soft: #fde8e8;
  --route: var(--brand-deep); --route-alt: #6b7280; --route-halo: #ffffff; --pin-start: #12151c; --pin-via: #565d6b; --pin-text: #ffffff;
  --scrim: rgba(18, 21, 28, .5);
  /* One colour per kind of place: the dots on the map (which is always light) and the mark on each tab. */
  --c-eat: #c2410c; --c-tea: #a16207; --c-wc: #0369a1; --c-fuel: #b91c1c; --c-ev: #15803d; --c-see: #7c3aed;
  --c-stay: #be185d; --c-shop: #0f766e; --c-cash: #4d7c0f; --c-med: #9f1239; --c-fix: #475569;
  --ok: #166534; --ok-soft: #dcfce7;
  --radius: 16px; --shadow: 0 1px 2px rgba(18, 21, 28, .08), 0 10px 28px -18px rgba(18, 21, 28, .3);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --display: "Chakra Petch", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #0b0d12; --bg-elev: #171a21; --bg-soft: #1f232c; --line: #2a2f3a; --line-strong: #3d4452; --text: #e9ecf1; --muted: #a2a9b6; --brand-ink: var(--brand); --note-soft: #3a2a08; --warn: #f87171; --warn-soft: #3b1212; --ok: #86efac; --ok-soft: #14351f; --shadow: 0 1px 2px rgba(0, 0, 0, .5); color-scheme: dark; } }
:root[data-theme="dark"] { --bg: #0b0d12; --bg-elev: #171a21; --bg-soft: #1f232c; --line: #2a2f3a; --line-strong: #3d4452; --text: #e9ecf1; --muted: #a2a9b6; --brand-ink: var(--brand); --note-soft: #3a2a08; --warn: #f87171; --warn-soft: #3b1212; --ok: #86efac; --ok-soft: #14351f; --shadow: 0 1px 2px rgba(0, 0, 0, .5); color-scheme: dark; }
/* On paper: dark ink on white, whatever the screen was set to (the layout for paper is at the foot of this file). */
@media print { :root, :root[data-theme="dark"], :root:not([data-theme="light"]) { --bg: #ffffff; --bg-elev: #ffffff; --bg-soft: #f1f3f6; --line: #c3c8d1; --line-strong: #8b93a1; --text: #000000; --muted: #3a404b; --band: #ffffff; --on-band: #000000; --band-muted: #3a404b; --band-line: #c3c8d1; --brand-ink: var(--brand-deep); --note-soft: #f1f3f6; --warn: #c81e1e; --warn-soft: #fde8e8; --ok: #166534; --ok-soft: #dcfce7; --shadow: none; color-scheme: light; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.45; font-size: 16px; }
a { color: inherit; text-underline-offset: 2px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
p { margin: 0 0 .6rem; }
.muted { color: var(--muted); }
.small, small { font-size: .875rem; }
[hidden] { display: none !important; }
/* The answer takes a screen's height from the moment it appears, so its top can be brought to the top of the screen and
   nothing below jumps as the plan, the map and the lists arrive. */
#results { min-height: 100vh; min-height: 100svh; }
:focus-visible { outline: 3px solid var(--brand-ink); outline-offset: 2px; }
.topbar :focus-visible, .band :focus-visible, .ticket-head :focus-visible { outline-color: var(--brand); }
#tripRoute:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { width: min(100% - 24px, 600px); margin-inline: auto; }
.lbl, .slip .field > label { display: block; font: 600 14px/1.3 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

/* top bar + band */
.topbar { position: sticky; top: 0; z-index: 1100; background: var(--band); color: var(--on-band); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: inline-flex; align-items: center; min-height: 44px; font: 700 17px var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--brand); text-decoration: none; white-space: nowrap; }
.top-actions { display: flex; align-items: center; margin-right: -10px; }
.top-btn { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--on-band); font-weight: 600; font-size: 15px; }
.top-btn:hover { background: var(--band-line); }
.top-btn.install { color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); margin-right: 4px; }
.top-btn.install:hover { background: var(--brand); color: var(--on-brand); }
.band { background: var(--band); color: var(--on-band); padding: 6px 0 56px; }
.band h1 { font: 700 clamp(1.7rem, 7.4vw, 2.3rem)/1.08 var(--display); text-wrap: balance; }

/* ticket slips */
.slip { position: relative; background: var(--bg-elev); border-radius: var(--radius); box-shadow: var(--shadow); }
.planner .slip { margin-top: -40px; }
.slip-sec { padding: 16px 18px; }
.perf { position: relative; height: 0; margin: 0 14px; border-top: 2px dashed var(--line); }
.perf::before, .perf::after { content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); }
.perf::before { left: -26px; } .perf::after { right: -26px; }

/* planner */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field > label { font-weight: 600; font-size: .92rem; }
.field input, .field textarea { width: 100%; min-width: 0; border: 1.5px solid var(--line-strong); background: var(--bg-elev); border-radius: 10px; padding: 10px 12px; font-size: 16px; }
.field input { min-height: 46px; }
.slip .field input { min-height: 44px; padding: 6px 0 8px; border: 0; border-bottom: 2px solid var(--text); border-radius: 0; background: transparent; font: 600 19px var(--display); }
.slip .field input:focus-visible { outline-offset: 4px; }
.slip #depart { font: 600 17px var(--mono); }
@media (max-width: 380px) { .slip #depart { font-size: 15px; letter-spacing: -.02em; } }
.od, .via { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 10px; align-items: end; margin-bottom: 14px; }
.od .field, .via .field { margin-bottom: 0; }
.slip .via .field input { font-size: 17px; }
.swap { display: grid; place-items: center; width: 44px; height: 44px; border: 1.5px solid var(--line-strong); border-radius: 50%; background: var(--bg-elev); color: var(--text); }
.swap:hover { border-color: var(--text); }
.swap svg { width: 18px; height: 18px; }
.ac { position: relative; }
.ac-list { position: absolute; z-index: 40; left: 0; right: -54px; top: calc(100% + 6px); margin: 0; padding: 4px; list-style: none; background: var(--bg-elev); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); max-height: 280px; overflow: auto; }
.ac-list:empty { display: none; }
.ac-list li { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.ac-list li:hover, .ac-list li.active { background: var(--bg-soft); }
.ac-list .nm { font-weight: 600; } .ac-list .sb { color: var(--muted); font-size: .875rem; white-space: nowrap; }
.ac-list .ad { color: var(--muted); font-size: .875rem; }
.ac-list li.msg { color: var(--muted); cursor: default; }
.ac-list li.msg:hover { background: none; }
.slip .field.when { margin-bottom: 0; }
.inline { display: flex; gap: 10px; align-items: flex-end; }
.inline input { flex: 1 1 auto; min-width: 0; }

/* what do you want on the way */
.chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
@media (min-width: 440px) { .chips { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.chip { min-height: 44px; padding: 6px 4px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--bg-elev); color: var(--text); font: 700 14px var(--display); letter-spacing: .06em; text-transform: uppercase; }
.chip:hover { border-color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg-elev); }
/* Road or Metro: what belongs to the other way of travelling is not shown */
body[data-mode="road"] [data-only]:not([data-only~="road"]), body[data-mode="metro"] [data-only]:not([data-only~="metro"]), body[data-mode="train"] [data-only]:not([data-only~="train"]) { display: none !important; }
.modes-sec { padding-bottom: 0; }
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 4px; border-radius: 12px; background: var(--bg-soft); }
.modes button { min-height: 44px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: 700 14px var(--display); letter-spacing: .08em; text-transform: uppercase; }
.modes button[aria-pressed="true"] { background: var(--text); color: var(--bg-elev); }
.mopts { margin-top: 16px; }
.seg.seg3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body[data-mode="metro"] .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.quick .btn { padding: 8px 4px; border-color: transparent; font-size: .92rem; }
.quick .btn:hover { border-color: var(--text); }

/* buttons */
.btn { min-height: 44px; padding: 8px 14px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--bg-elev); color: var(--text); font-weight: 600; }
.btn:hover { border-color: var(--text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { min-height: 44px; padding: 6px 12px; font-size: .9rem; }
.btn.tk { font: 700 14px var(--display); letter-spacing: .08em; text-transform: uppercase; }
.btn.primary { border-color: var(--brand); background: var(--brand); color: var(--on-brand); cursor: pointer; }
/* The main action gets the site's coloured hand on laptops (src/styles/cursor.css); everything else keeps the system hand. */
@media (pointer: fine) and (not (forced-colors: active)) { .btn.primary { cursor: url(/cursors/hand-press.svg) 12 7, pointer; } }
.btn.primary:hover { filter: brightness(.95); }
.btn.primary:disabled { opacity: .7; cursor: progress; }
.btn.wide { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; margin-top: 16px; border-radius: 12px; font: 700 17px var(--display); letter-spacing: .08em; text-transform: uppercase; }
.btn.wide svg { width: 18px; height: 18px; }
.link-btn { min-height: 44px; padding: 10px 0; border: 0; background: none; color: var(--text); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.slip-sec > .link-btn { margin: -6px 0 -10px; }
.status { min-height: 1.2em; margin: 10px 2px 0; color: var(--muted); font-size: .95rem; }
.planner > .status:empty { margin: 0; min-height: 0; }
.status.err { color: var(--warn); font-weight: 600; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.actions .status { margin: 0; flex: 1 1 12rem; }

/* folding sections */
details summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; cursor: pointer; list-style: none; font-weight: 600; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: ""; flex: none; width: 8px; height: 8px; margin: 0 4px 4px 0; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
details[open] > summary::after { margin-bottom: -4px; transform: rotate(-135deg); }
#gmaps { margin-top: 14px; padding: 0 18px; background: var(--bg-elev); border-radius: var(--radius); box-shadow: var(--shadow); }
#gmaps[open] { padding-bottom: 14px; }

/* trip ticket */
#results { margin-top: 28px; scroll-margin-top: 68px; }
.ticket-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 18px 18px 16px; border-radius: var(--radius); background: var(--band); color: var(--on-band); }
.ticket:has(.stale:not([hidden]), .slip-sec:not([hidden])) .ticket-head { border-radius: var(--radius) var(--radius) 0 0; }
.trip-route { margin: 0; font: 700 clamp(1.4rem, 6.4vw, 1.9rem)/1.08 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.trip-meta { margin: 6px 0 0; color: var(--band-muted); font: 14px/1.45 var(--mono); }
.ticket-head .btn { flex: none; border-color: var(--band-line); background: none; color: var(--on-band); }
.stale { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding: 10px 12px 10px 18px; background: var(--note-soft); font-weight: 700; }
#results.is-stale > :not(.ticket), #results.is-stale .ticket > :not(.stale) { filter: grayscale(1); opacity: .75; }
.alts { display: grid; gap: 8px; margin-top: 10px; }
.alt { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline; min-height: 48px; padding: 8px 12px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--bg-elev); color: var(--text); text-align: left; }
.alt:hover { border-color: var(--text); }
.alt .nm { font: 700 14px var(--display); letter-spacing: .06em; text-transform: uppercase; }
.alt .nums { color: var(--muted); font: 14px var(--mono); white-space: nowrap; }
.alt[aria-pressed="true"] { border-color: var(--text); background: var(--text); color: var(--bg-elev); }
.alt[aria-pressed="true"] .nums { color: inherit; }
.notice { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--note-soft); font-size: .9rem; }
.share-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
@media (min-width: 560px) { .share-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.share-row .btn { padding: 8px 6px; border-color: transparent; }
.share-row .btn:hover { border-color: var(--text); }
.soon { margin: 18px 4px 0; color: var(--muted); font-size: .9rem; }

/* more options */
#more { border-top: 2px dashed var(--line); padding: 0 18px; }
#more[open] { padding-bottom: 16px; }
.opts { display: grid; gap: 14px; }
@media (min-width: 440px) { .opts { grid-template-columns: 1fr 1fr; } .opt:first-child, .opt.checks { grid-column: 1 / -1; } }
.opt select, .opt input[type="number"], .opt input[type="time"] { width: 100%; min-height: 44px; margin-top: 6px; padding: 8px 10px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--bg-elev); font-size: 16px; }
.seg { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.seg button { min-height: 44px; padding: 4px 2px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--bg-elev); color: var(--text); font: 700 14px var(--display); letter-spacing: .04em; text-transform: uppercase; }
.seg button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg-elev); }
.checks { display: grid; gap: 2px; }
@media (min-width: 440px) { .checks { grid-template-columns: 1fr 1fr; } }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--brand-ink); }

/* your stops: plan tabs, the timeline, totals */
.plan { margin-top: 24px; }
.plan > .lbl { margin: 0 4px 8px; }
.plan > .status { margin: 0 4px 10px; }
.plan > .status:empty { display: none; }
.plan-tab { display: grid; gap: 2px; padding: 8px 16px; border-radius: 14px; text-align: left; }
.tab.plan-tab::before { content: none; }
.plan-tab .nums { color: var(--muted); font: 400 14px var(--font); letter-spacing: 0; text-transform: none; }
.plan-tab[aria-pressed="true"] .nums { color: inherit; }
.stops { position: relative; margin: 4px 0 0; padding: 0; list-style: none; background: var(--bg-elev); border-radius: var(--radius); box-shadow: var(--shadow); }
.stop { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); gap: 0 10px; padding: 14px 14px 14px 14px; }
.stop + .stop { border-top: 2px dashed var(--line); }
.stop-when { display: grid; align-content: start; gap: 2px; }
.stop-when .t { font: 700 15px var(--mono); }
.stop-when .km { color: var(--muted); font: 14px var(--mono); }
.stop.end .end-name { margin: 0; font: 700 1rem var(--display); letter-spacing: .04em; text-transform: uppercase; }
.needs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; padding: 0; list-style: none; }
.needs li { padding: 1px 8px; border-radius: 6px; background: var(--text); color: var(--bg-elev); font: 700 14px var(--display); letter-spacing: .08em; text-transform: uppercase; }
.stop-name { display: block; min-height: 44px; margin: -10px 0; padding: 10px 0; border: 0; background: none; color: var(--text); font-weight: 700; font-size: 1.05rem; text-align: left; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; overflow-wrap: anywhere; }
.stop .sub { margin: 2px 0 0; color: var(--muted); font-size: .875rem; }
.stop .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 6px 0 0; font-size: .875rem; }
.stop .meta .wx, .stop .meta .here { color: var(--muted); }
.stop .why { margin: 6px 0 0; font-size: .92rem; }
.stop-warn { margin: 6px 0 0; padding: 6px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: .88rem; font-weight: 600; }
.stop-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.stop-actions .btn { min-height: 44px; padding: 6px 10px; }
.unmet { margin-top: 10px; }
.unmet p { margin: 0; }
.unmet .link-btn { display: block; min-height: 44px; padding: 8px 0; text-align: left; font-weight: 600; }
.totals { position: sticky; bottom: 0; z-index: 30; display: grid; gap: 6px; margin: 12px -12px 0; padding: 8px 12px 10px; border-top: 1px solid var(--line); background: var(--bg); }
.totals p { margin: 0; font-weight: 700; font-size: .9rem; }
.totals-go { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: start; }
.totals-go > .btn { min-height: 44px; font-weight: 700; }
.totals-go > .btn[aria-pressed="true"] { border-color: var(--brand-ink); color: var(--brand-ink); }
.totals-links { display: grid; gap: 8px; }
.totals-links .btn { display: grid; place-items: center; min-height: 44px; text-align: center; text-decoration: none; font-weight: 700; }
.plan-more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.plan-more .btn { display: grid; place-items: center; padding: 8px 4px; border-color: transparent; text-align: center; text-decoration: none; font-size: .92rem; }
.plan-more .btn:hover { border-color: var(--text); }
.know { margin-top: 12px; padding: 0 18px; }
.know[open] { padding-bottom: 12px; }
.know-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: .92rem; }
.know-list li { margin: 6px 0; }

/* metro: the ride, then the stations worth getting off at. A line's own colour comes from the data as --c. */
.mplan > .lbl, .mplan h3.lbl { margin: 16px 4px 8px; }
.ride { padding: 14px 16px; }
.ride-sum { margin: 0 0 10px; font-weight: 700; }
.leg { position: relative; margin: 0; padding: 2px 0 2px 18px; border-left: 6px solid var(--c, var(--line-strong)); }
.leg .ln { margin: 0; font: 700 14px var(--display); letter-spacing: .06em; text-transform: uppercase; }
.leg .ft { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.leg .nums { margin: 2px 0 0; color: var(--muted); font-size: .875rem; }
.leg details { margin-top: 4px; font-size: .875rem; color: var(--muted); }
.leg summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.leg ol { margin: 4px 0 6px; padding-left: 20px; }
.hop { margin: 8px 0; padding: 6px 10px; border-radius: 8px; background: var(--bg-soft); font-size: .88rem; }
.mstops { margin: 4px 0 0; padding: 0; list-style: none; background: var(--bg-elev); border-radius: var(--radius); box-shadow: var(--shadow); }
.mstop { padding: 14px 16px; }
.mstop + .mstop { border-top: 2px dashed var(--line); }
.mstop h4 { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; font-size: 1.08rem; }
.mstop .tag { padding: 1px 8px; border-radius: 6px; background: var(--ok-soft); color: var(--ok); font: 700 14px var(--display); letter-spacing: .06em; text-transform: uppercase; }
.mstop .sub { margin: 4px 0 0; color: var(--muted); font-size: .875rem; }
.mstop .cost { margin: 4px 0 0; font-weight: 700; font-size: .92rem; }
.spots { margin: 8px 0 0; padding-left: 22px; }
.spots li { margin: 2px 0; }
.spots .link-btn { display: block; min-width: 44px; min-height: 44px; padding: 8px 0; text-align: left; }
.spots .sub { display: block; margin: -2px 0 4px; }
.mstop .check { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; font-size: .92rem; }
.walk-note { margin: 8px 0 0; font-size: .88rem; }

/* train: the plain journey, the options, the chosen plan */
.tplan > .lbl, .tplan h3.lbl { margin: 16px 4px 8px; }
.topts { margin-bottom: 16px; }
#tMore { margin-top: 12px; }
#tMore > summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.slip-sec > .check { display: flex; gap: 8px; align-items: flex-start; margin-top: 4px; }
.links-out { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.links-out .btn { min-height: 44px; padding: 6px 12px; font-size: .88rem; text-decoration: none; display: inline-grid; place-items: center; }
.topts-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.topt { padding: 14px 16px; border-radius: var(--radius); background: var(--bg-elev); box-shadow: var(--shadow); border: 2px solid transparent; }
.topt[aria-current="true"] { border-color: var(--brand-ink); }
.topt .tag { display: inline-block; margin-bottom: 6px; padding: 1px 8px; border-radius: 6px; background: var(--text); color: var(--bg-elev); font: 700 14px var(--display); letter-spacing: .08em; text-transform: uppercase; }
.topt h4 { font-size: 1.05rem; }
.topt .cost { margin: 4px 0 0; font-weight: 700; font-size: .92rem; }
.topt .sub { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.topt .btn { margin-top: 10px; }
.tstops { padding: 6px 16px; }
.tstop { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 10px 0; }
.tstop + .tstop { border-top: 2px dashed var(--line); }
.tstop .nm { font-weight: 700; }
.tstop .sub { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .875rem; }
.tstop .stop-actions { grid-column: 1 / -1; margin-top: 2px; }
.tadd { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 0 12px; border-top: 2px dashed var(--line); }
.tadd select { flex: 1 1 12rem; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--bg-elev); font-size: 16px; }
.tfares { margin-top: 10px; padding: 14px 16px; }
.tfares table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tfares td { padding: 6px 0; vertical-align: top; border-top: 1px solid var(--line); }
.tfares tr:first-child td { border-top: 0; }
.tfares td:last-child { text-align: right; white-space: nowrap; font-weight: 700; padding-left: 10px; }
.tfares .small { display: block; }
.how { padding-bottom: 6px; font-size: .92rem; }
.how h4 { margin: 12px 0 4px; font-size: .95rem; }
.how p { margin: 0 0 6px; }
.stop .sights { margin: 6px 0 0; font-size: .92rem; }

/* on the way: tabs, filters, rows */
.onway { margin-top: 24px; }
.onway > .lbl { margin: 0 4px 8px; }
.onway > .status { margin: 0 4px 8px; }
.onway > .status:empty { display: none; }
.tabs, .filters { display: flex; gap: 8px; overflow-x: auto; margin: 0 -12px; padding: 2px 12px 8px; scrollbar-width: none; }
.tabs::-webkit-scrollbar, .filters::-webkit-scrollbar { display: none; }
.tab, .filter { flex: none; min-height: 44px; padding: 6px 14px; border: 1.5px solid var(--line-strong); border-radius: 999px; background: var(--bg-elev); color: var(--text); font-weight: 600; white-space: nowrap; }
.tab { font: 700 14px var(--display); letter-spacing: .06em; text-transform: uppercase; }
.tab::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1.5px var(--bg-elev); }
.tab:hover, .filter:hover { border-color: var(--text); }
.tab[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg-elev); }
.filter { font-size: .88rem; }
.filter[aria-pressed="true"] { border-color: var(--brand-ink); box-shadow: inset 0 0 0 1px var(--brand-ink); color: var(--brand-ink); }
.places { margin: 0; padding: 0; list-style: none; background: var(--bg-elev); border-radius: var(--radius); box-shadow: var(--shadow); }
.places:empty { display: none; }
.places li + li { border-top: 1px solid var(--line); }
.place-row { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); gap: 2px 10px; width: 100%; min-height: 56px; padding: 10px 14px; border: 0; background: none; color: var(--text); text-align: left; }
.places li:first-child .place-row { border-radius: var(--radius) var(--radius) 0 0; }
.places li:last-child .place-row { border-radius: 0 0 var(--radius) var(--radius); }
.place-row:hover { background: var(--bg-soft); }
.place-row .when { grid-row: span 3; padding-top: 2px; font: 600 14px var(--mono); }
.place-row .nm { font-weight: 700; overflow-wrap: anywhere; }
.place-row .sub { color: var(--muted); font-size: .875rem; }
.place-row .st { justify-self: start; }
.st { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--bg-soft); color: var(--muted); font-size: .875rem; font-weight: 700; }
.st-open { background: var(--ok-soft); color: var(--ok); }
.st-closing { background: var(--note-soft); color: var(--text); }
.st-closed { background: var(--warn-soft); color: var(--warn); }
.onway .more { width: 100%; margin-top: 10px; }
.onway .notice { margin-top: 10px; }

/* a place's sheet, and the "now" sheet */
.sheet.place { max-width: 440px; max-height: 88vh; overflow: auto; }
.sheet.place h3 { overflow-wrap: anywhere; }
.sheet.place p { margin: 8px 0; }
.sheet .kind { margin: 0; color: var(--muted); }
.wiki img { display: block; max-width: 100%; max-height: 200px; margin-bottom: 8px; border-radius: 10px; }
.pick { margin: 10px 0; padding: 8px 12px; border-left: 4px solid var(--brand); border-radius: 0 10px 10px 0; background: var(--bg-soft); }
.pick p { margin: 0; } .pick p + p { margin-top: 4px; }
.known-for { margin: 6px 0 0; font-size: .92rem; font-weight: 600; color: var(--brand-ink); }
.sheet .known-for { margin: 0 0 .6rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; padding: 0; list-style: none; }
.tags li { padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: .875rem; }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 10px 0; font-size: .92rem; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; overflow-wrap: anywhere; }
.links { display: grid; gap: 8px; margin: 14px 0 10px; }
.links .btn, .now-row .btn { display: grid; place-items: center; text-align: center; text-decoration: none; }
.sheet .places { box-shadow: none; border: 1px solid var(--line); }
.now-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding-right: 10px; }
.now-row .place-row { grid-template-columns: 3.8rem minmax(0, 1fr); padding-right: 0; }

/* map */
.route { margin-top: 24px; }
.route > .lbl { margin: 0 4px 8px; }
#map { width: 100%; height: 320px; border-radius: var(--radius); overflow: hidden; background: var(--bg-soft); isolation: isolate; }
@media (min-width: 720px) { #map { height: 400px; } }
.map-fail { margin: 8px 4px 0; color: var(--muted); font-size: .9rem; }
.leaflet-container { font: inherit; }
.leaflet-popup-content { font-size: .9rem; }
.pin { display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid var(--pin-text); border-radius: 50%; background: var(--pin-via); color: var(--pin-text); font: 700 14px var(--display); box-shadow: 0 1px 4px var(--scrim); }
.pin-a { background: var(--pin-start); }
.pin-b { background: var(--brand); color: var(--on-brand); }
.pin-stop { border-radius: 8px; background: var(--route); }
.pin-walk { background: var(--c-see); }
.pin.pin-station { width: 12px; height: 12px; border: 2.5px solid var(--pin-start); background: var(--pin-text); box-shadow: none; }

/* The map's own zoom buttons are 30 px in Leaflet's stylesheet: too small for a thumb. */
.leaflet-touch .leaflet-bar a, .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; font-size: 22px; }

/* footer, dialogs, toast */
footer { padding: 28px 0 36px; color: var(--muted); font-size: .875rem; }
footer p { margin: 0 0 6px; }
.foot-row a { display: inline-flex; align-items: center; min-height: 44px; }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.sheet { width: calc(100% - 32px); max-width: 360px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow); }
.sheet::backdrop { background: var(--scrim); }
.sheet.help { max-width: 440px; max-height: 88vh; overflow: auto; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.sheet-head .btn { min-width: 44px; }
.sheet h3 { font: 700 1.3rem var(--display); }
.sheet h4 { margin: 16px 0 4px; font: 700 1rem var(--display); }
.steps { margin: 10px 0 14px; padding-left: 20px; line-height: 1.5; }
.sheet.help .steps { margin: 4px 0 6px; font-size: .9rem; }
.steps li { margin: 4px 0; }
.steps b { white-space: nowrap; }
.toast { position: fixed; bottom: 20px; left: 50%; z-index: 1200; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 10px; background: var(--text); color: var(--bg); font-weight: 600; opacity: 0; transform: translateX(-50%); transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
/* Saved plans, on the first screen */
.saved { margin-top: 14px; }
.saved-list { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.saved-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.saved-open { display: grid; gap: 2px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); text-align: left; }
.saved-open:hover { border-color: var(--text); }
.saved-open .nm { font-weight: 700; overflow-wrap: anywhere; }
.saved-open .sub { color: var(--muted); font-size: .875rem; }

/* The trip while it is driven: one bar at the bottom of the screen, in the dark band's colours, in big type */
.live { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1150; padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--band); color: var(--on-band); box-shadow: 0 -8px 24px -12px var(--scrim); }
.live .wrap { display: grid; gap: 6px; }
.live-line { margin: 0; font: 700 1.1rem/1.25 var(--display); overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.live-nums { margin: 0; color: var(--brand); font: 700 1.5rem/1.1 var(--display); }
.live-nums:empty { display: none; }
.live-sub { margin: 0; color: var(--band-muted); font-size: .92rem; }
.live-sub:empty { display: none; }
.live-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.live-acts:empty { display: none; }
.live-acts .btn { flex: 1 1 auto; min-height: 44px; display: grid; place-items: center; border-color: var(--band-line); background: transparent; color: var(--on-band); text-decoration: none; font-weight: 700; }
.live-acts .btn.primary { border-color: var(--brand); background: var(--brand); color: var(--on-brand); }
.live-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.live-quick button { min-height: 44px; padding: 4px 2px; border: 1px solid var(--band-line); border-radius: 10px; background: transparent; color: var(--on-band); font-size: .88rem; }
.live-quick button:hover, .live-quick button[aria-expanded="true"] { border-color: var(--on-band); }
.live :focus-visible { outline-color: var(--brand); }
.live-more { display: grid; gap: 6px; max-height: 40vh; overflow: auto; }
.live-more .lbl { margin: 4px 0 0; color: var(--band-muted); }
.live-then { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: .92rem; }
.live-more .check input { accent-color: var(--brand); }
.live-more .btn { justify-self: start; border-color: var(--band-line); background: transparent; color: var(--on-band); }
body[data-live] { padding-bottom: var(--live-h, 190px); }
body[data-live] .totals { position: static; }
body[data-live] .toast { bottom: calc(var(--live-h, 190px) + 16px); }
.pin-here { width: 18px; height: 18px; border-width: 3px; background: var(--c-wc); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c-wc) 25%, transparent); }

/* On paper: the ticket, the stops with their reasons, the totals and Good to know; nothing that can only be tapped.
   (The colours for paper are with the other tokens at the top.) */
@media print {
  .topbar, .band, .planner, .share-row, .soon, .route, .onway, .plan-more, .stop-actions, .totals-go, .tabs, .live, .toast, .stale, #editBtn, #altSec, .links-out, .tadd, .leg details, .btn, .link-btn, footer, dialog { display: none !important; }
  body { padding-bottom: 0 !important; }
  #results { min-height: 0; }
  .totals { position: static; }
  .slip, .stops, .ticket-head { box-shadow: none; }
  .ticket-head { border: 1px solid var(--line); }
  .stop, .topt, .tstop, .mstop { break-inside: avoid; }
  details.know > :not(summary) { display: block; }  /* Good to know is printed open */
  .stop-name { text-decoration: none; }
}
