/* Shift Ready.
   Direction: a calm, light app in the manner of the maps people already use, with a deep "night" navy for the one place that needs weight.
   One typeface (Public Sans, the US Web Design System face), soft grey-blue surfaces, hairline borders, one blue for everything you can press,
   amber only for the moon and the big number. Green/amber/red mean data and always come with a shape and a word. */
@font-face { font-family: "Public Sans"; src: url("../vendor/fonts/public-sans.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #f3f4f6; --surface: #ffffff; --panel: #eceef2; --ink: #13171d; --muted: #586271; --line: #e0e4ea; --line-strong: #c4cbd6;
  --hero: #13171d; --on-hero: #ffffff; --on-hero-muted: #c3cad6;
  --navy: var(--hero); --on-navy: var(--on-hero); --on-navy-muted: var(--on-hero-muted);
  --primary: #0a7c74; --primary-hover: #086a63; --primary-ink: #ffffff; --primary-soft: #def3f1; --amber: #f5a524;
  --map: #0a7c74; --map-off: #9aa3b0; --bad: #c4312b; --net-a: #7fd6cd;
  --yes: #1a7f37; --yes-bg: #e3f4e8; --maybe: #9a5a00; --maybe-bg: #fdf0d5; --no: #c4312b; --no-bg: #fce8e6;
  --radius: 14px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(19, 23, 29, .06), 0 8px 24px rgba(19, 23, 29, .07);
  --tab: 64px; --wrap: 1180px;
}
:root[data-theme="dark"] {
  --bg: #101215; --surface: #181b20; --panel: #20242b; --ink: #eef0f4; --muted: #9ca5b3; --line: #2a2f38; --line-strong: #3c4452;
  --hero: #1c2128; --on-hero: #ffffff; --on-hero-muted: #b4bcc9;
  --primary: #46c2b8; --primary-hover: #74d6ce; --primary-ink: #06211f; --primary-soft: #14302e; --amber: #f5b544;
  --map: #46c2b8; --map-off: #6d7685; --bad: #ff8d86; --net-a: #7fd6cd;
  --yes: #5ddc93; --yes-bg: #12301f; --maybe: #f1b45f; --maybe-bg: #33270f; --no: #ff8d86; --no-bg: #391a18;
  --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 8px 24px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif; font-variant-numeric: tabular-nums;
  padding-bottom: calc(var(--tab) + 28px);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 99; border-radius: 8px; box-shadow: var(--shadow); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1 { font-size: clamp(1.9rem, 5.4vw, 2.7rem); line-height: 1.08; margin: 0 0 14px; font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
h2 { font-size: 1.12rem; margin: 0 0 8px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
h3 { font-size: .95rem; margin: 18px 0 6px; font-weight: 700; }
p { margin: 0 0 10px; }
.small { font-size: .85rem; color: var(--muted); }
a { color: var(--primary); }
.wide { grid-column: 1 / -1; }

/* header: logo, tabs, language. On a phone the tabs move to the bottom. */
.top { position: sticky; top: 0; z-index: 900; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 10px 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em; white-space: nowrap; }
.mark { color: var(--ink); display: block; flex: none; }
.top-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; height: var(--tab); background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); z-index: 1000; padding-bottom: env(safe-area-inset-bottom); }
.tabbar button { border: 0; background: none; color: var(--muted); font: inherit; font-size: .72rem; font-weight: 600; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; cursor: pointer; position: relative; }
.tabbar .ico { display: block; line-height: 0; }
.tabbar button[aria-current=page] { color: var(--primary); }
.tabbar button[aria-current=page]::before { content: ""; position: absolute; top: 0; left: 24%; right: 24%; height: 3px; background: var(--primary); border-radius: 0 0 3px 3px; }

main { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; outline: none; }
.tab[hidden] { display: none; }
.tab { animation: fade .22s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tab { animation: none; } }
.page-h { padding: 26px 0 6px; }

/* the night band: weight, one number, one picture */
.hero-band { background: var(--navy); color: var(--on-navy); margin: 0 -20px; padding: 30px 20px 74px; }
.hero-in { max-width: var(--wrap); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.hero-band h1 { margin-bottom: 18px; max-width: 16ch; }
.hero-stat { margin: 0; display: flex; align-items: baseline; gap: 14px; max-width: 34rem; color: var(--on-navy-muted); font-size: 1.02rem; line-height: 1.35; }
.hero-stat b { font-size: clamp(2.6rem, 9vw, 4.2rem); line-height: .9; color: var(--amber); letter-spacing: -0.05em; font-weight: 800; flex: none; }
.hero-art { color: var(--on-navy-muted); opacity: .85; flex: none; display: none; }
.hero-art svg { color: inherit; margin: 0; width: 240px; height: auto; }
.split { margin-top: -50px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 16px; margin: 0 0 16px; }
.field { margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
label, legend { display: block; font-weight: 600; font-size: .88rem; margin: 0 0 5px; padding: 0; }
input[type=text], input[type=time], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 10px 12px; min-height: 46px;
}
textarea { resize: vertical; }
input[type=time] { width: auto; min-width: 8.5rem; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23566277' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 1px; }
.row { display: flex; gap: 8px; align-items: center; } .row.wrap { flex-wrap: wrap; } .row.gap { gap: 12px; }
.row > input[type=text] { flex: 1; min-width: 0; }

/* the route card: two stops joined by a line, like every directions screen people know */
.route-card { box-shadow: var(--shadow); border-color: transparent; padding: 18px; }
.route-fields { display: grid; gap: 6px; position: relative; margin-bottom: 10px; }
.route-fields::before { content: ""; position: absolute; left: 20px; top: 34px; bottom: 34px; border-left: 2px dotted var(--line-strong); }
.rf { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 0 6px 0 14px; transition: border-color .15s, background-color .15s, box-shadow .15s; }
.rf:focus-within { background: var(--surface); border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.rf input { border: 0; background: transparent; padding: 10px 4px; min-height: 48px; }
.rf input:focus-visible { outline: none; }
.rdot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.rdot.from { border: 2.5px solid var(--primary); background: var(--surface); }
.rdot.to { background: var(--primary); }
.swap { justify-self: end; margin: -2px 6px -2px 0; width: 32px; height: 32px; z-index: 1; }
#to-quick { margin-bottom: 16px; font-size: .92rem; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 50%; cursor: pointer; flex: none; transition: background-color .15s, transform .12s, border-color .15s; }
.iconbtn:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); } .iconbtn:active { transform: scale(.94); }
.iconbtn.flat { border-color: transparent; background: transparent; color: var(--muted); }
.when { margin-bottom: 14px; }
.when .seg { margin: 0 8px 10px 0; }

.seg { display: inline-flex; background: var(--panel); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg label { margin: 0; font-weight: 600; font-size: .9rem; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; white-space: nowrap; padding: 8px 12px; min-height: 38px; cursor: pointer; border-radius: 8px; color: var(--muted); transition: background-color .15s, color .15s, box-shadow .15s; }
.seg span:hover { color: var(--ink); }
.seg input:checked + span { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
.seg input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); }
.seg.small span { padding: 6px 10px; min-height: 34px; font-size: .85rem; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { font: inherit; font-size: .85rem; font-weight: 600; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; min-height: 36px; cursor: pointer; transition: border-color .15s, background-color .15s, transform .12s; }
.chips button:hover { border-color: var(--primary); background: var(--primary-soft); } .chips button:active { transform: scale(.97); }

.home-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 0 16px; border-top: 1px solid var(--line); margin-top: 4px; }
.switch { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-weight: 600; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background-color .18s; flex: none; }
.switch .track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .18s cubic-bezier(.3,.7,.3,1); }
.switch input:checked + .track { background: var(--primary); } .switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }
.endt { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; } .endt input { min-height: 40px; }
.endt[hidden], #end-time[hidden] { display: none; }

.btn { font: inherit; font-weight: 700; border-radius: var(--radius-sm); padding: 10px 18px; min-height: 46px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background-color .15s, border-color .15s, transform .12s, box-shadow .15s; }
.btn:hover { background: var(--panel); } .btn:active { transform: translateY(1px) scale(.99); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); box-shadow: 0 1px 2px rgba(36, 87, 245, .3); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.ghost { background: transparent; }
.btn.big { width: 100%; font-size: 1.05rem; min-height: 54px; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: .88rem; }
.btn[disabled] { opacity: .65; cursor: progress; }
.link { background: none; border: 0; color: var(--primary); font: inherit; font-weight: 600; padding: 6px 0; cursor: pointer; }
.link:hover { text-decoration: underline; }
.chip { font: inherit; font-weight: 600; font-size: .85rem; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 5px 12px; min-height: 36px; cursor: pointer; }
select.chip { padding-right: 30px; max-width: 170px; }

.saved { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.saved .chip-saved { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px 6px 10px; font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; color: var(--ink); box-shadow: var(--shadow); }
.saved .chip-saved:hover { border-color: var(--primary); }
.saved .chip-saved svg { color: var(--primary); }
.saved .x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.1rem; padding: 0 4px; min-width: 36px; min-height: 36px; }

/* verdict */
.verdict { padding: 16px 18px; margin: 0 0 14px; border-radius: var(--radius); border: 1px solid; position: relative; overflow: hidden; }
.verdict::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: currentColor; }
.verdict .tag { font-size: 1.55rem; font-weight: 800; display: flex; align-items: center; gap: 12px; letter-spacing: -0.02em; }
.verdict .icon { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; flex: none; font-size: 1rem; }
.verdict .sub { margin: 8px 0 0; color: var(--ink); }
.verdict.yes { background: var(--yes-bg); border-color: color-mix(in srgb, var(--yes) 35%, transparent); color: var(--yes); } .verdict.yes .icon { background: var(--yes); border-radius: 50%; }
.verdict.maybe { background: var(--maybe-bg); border-color: color-mix(in srgb, var(--maybe) 35%, transparent); color: var(--maybe); } .verdict.maybe .icon { background: var(--maybe); border-radius: 7px; }
.verdict.no { background: var(--no-bg); border-color: color-mix(in srgb, var(--no) 35%, transparent); color: var(--no); } .verdict.no .icon { background: var(--no); border-radius: 4px; transform: rotate(45deg); width: 26px; height: 26px; }
.verdict.no .icon span { transform: rotate(-45deg); display: inline-block; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 4px 0 8px; }
.kv div { background: var(--panel); border-radius: var(--radius-sm); padding: 10px 12px; }
.kv b { display: block; font-size: 1.3rem; letter-spacing: -0.02em; font-weight: 700; }
.kv span { color: var(--muted); font-size: .8rem; }

.steps { list-style: none; padding: 0; margin: 4px 0 0; }
.steps li { display: grid; grid-template-columns: 78px 1fr; gap: 10px; padding: 8px 0; }
.steps .t { font-weight: 700; font-size: .92rem; padding-top: 2px; }
.steps .what { padding-left: 14px; border-left: 3px dotted var(--line-strong); }
.steps li.bus .what { border-left: 5px solid var(--rc, var(--primary)); }
.steps .what small { color: var(--muted); display: block; font-size: .83rem; }
.route { display: inline-block; min-width: 2.3em; text-align: center; padding: 0 7px; margin-right: 6px; font-weight: 800; border-radius: 6px; background: var(--rc, var(--primary)); color: var(--rt, #fff); line-height: 1.55; }
.route.sm { min-width: 1.9em; padding: 0 5px; font-size: .78rem; margin: 0 4px 4px 0; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--primary-soft); color: var(--primary); }
.badge.warn { background: var(--maybe-bg); color: var(--maybe); } .badge.bad { background: var(--no-bg); color: var(--no); }
.notice { background: var(--primary-soft); border-radius: var(--radius-sm); padding: 11px 14px; margin: 10px 0 14px; font-size: .9rem; }
.notice.floating { position: absolute; z-index: 600; left: 12px; right: 12px; top: 66px; margin: 0; background: var(--surface); box-shadow: var(--shadow); }
.empty { color: var(--muted); padding: 14px 0; }
.art-empty { text-align: left; padding: 30px 0 10px; }
.art svg { display: block; color: var(--line-strong); max-width: 100%; height: auto; margin-bottom: 10px; }
.pad-top { padding-top: 8px; }

/* shift strip */
.strip-row { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin: 10px 0 6px; }
.cell { font: inherit; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 7px 0 6px; cursor: pointer; border-radius: 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .12s, border-color .15s; }
.cell i { font-style: normal; font-size: .95rem; line-height: 1; }
.cell span { font-size: .66rem; color: var(--muted); }
.cell.yes { background: var(--yes-bg); border-color: color-mix(in srgb, var(--yes) 40%, transparent); } .cell.yes i { color: var(--yes); }
.cell.maybe { background: var(--maybe-bg); border-color: color-mix(in srgb, var(--maybe) 40%, transparent); } .cell.maybe i { color: var(--maybe); }
.cell.no { background: var(--no-bg); border-color: color-mix(in srgb, var(--no) 35%, transparent); } .cell.no i { color: var(--no); }
.cell.now { outline: 2px solid var(--ink); outline-offset: 1px; }
.cell:hover { transform: translateY(-1px); } .cell:active { transform: scale(.96); }
.cell-key.yes { color: var(--yes); } .cell-key.maybe { color: var(--maybe); } .cell-key.no { color: var(--no); }
.legend { margin-top: 4px; }

/* week view */
.week { display: grid; gap: 6px; margin-top: 8px; }
.week-row { display: grid; grid-template-columns: 90px 1fr 1fr; gap: 8px; align-items: center; background: var(--panel); border-radius: var(--radius-sm); padding: 8px 12px; font-size: .9rem; }
.week-row b { font-weight: 700; }
.vi { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.vi i { font-style: normal; } .vi.yes { color: var(--yes); } .vi.maybe { color: var(--maybe); } .vi.no { color: var(--no); }

.big-num { font-size: 1.9rem; font-weight: 800; margin-left: auto; letter-spacing: -0.03em; }
input[type=range] { width: 100%; height: 36px; accent-color: var(--primary); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.stat { background: var(--panel); border-radius: var(--radius-sm); padding: 10px 12px; }
.stat b { font-size: 1.45rem; display: block; letter-spacing: -0.02em; }
.stat span { color: var(--muted); font-size: .78rem; line-height: 1.25; display: block; }
.stat.wide { background: none; padding: 4px 0 0; }
.stat .h { font-weight: 700; color: var(--ink); display: block; margin-bottom: 4px; font-size: .85rem; }
ul.plain { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .88rem; }
ul.plain .v { font-weight: 700; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; }
.bar { height: 10px; background: var(--primary); min-width: 2px; border-radius: 5px; }
.barrow { display: grid; grid-template-columns: 84px 1fr 48px; gap: 8px; align-items: center; margin: 3px 0; white-space: nowrap; font-size: .88rem; }
.barrow.best .bar { background: var(--yes); }
svg text { fill: var(--muted); font: 11px "Public Sans", sans-serif; }
.cols { display: block; }
details.faq { border-top: 1px solid var(--line); padding: 10px 0; }
details.faq summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
details.faq p { margin: 6px 0 4px; max-width: 60ch; color: var(--muted); }
.tldr { font-size: 1.2rem; line-height: 1.5; max-width: 52ch; margin: 0 0 26px; font-weight: 500; letter-spacing: -0.01em; }

/* maps: one shape for both */
#map, #reach-map { height: 420px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.leaflet-tile-pane { filter: grayscale(1) contrast(.88) brightness(1.08); }
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) grayscale(.9) brightness(.78) contrast(.9); }
.leaflet-popup-content-wrapper { border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.leaflet-popup-tip { background: var(--surface); }
.leaflet-container { font-family: "Public Sans", system-ui, sans-serif; }
.leaflet-control-attribution { font-size: 10px; }
.leaflet-bar { border: 0 !important; box-shadow: var(--shadow) !important; border-radius: 10px; overflow: hidden; }
.leaflet-bar a { color: var(--ink) !important; background: var(--surface) !important; border-bottom-color: var(--line) !important; }
.pop-routes { margin: 6px 0 4px; }
.spot-h { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1rem; }
.dot { width: 12px; height: 12px; display: inline-block; flex: none; }
.dot.on { background: var(--yes); border-radius: 50%; } .dot.off { background: var(--no); transform: rotate(45deg); border-radius: 2px; }
.spot p { margin: 6px 0; }
.tab-map { margin: 0 -20px; }
.map-shell { position: relative; }
.tab-map #map { height: 60vh; min-height: 380px; border-radius: 0; border-left: 0; border-right: 0; }
.map-search { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 500; display: flex; gap: 8px; }
.map-search input { box-shadow: var(--shadow); border-color: transparent; }
.map-search .iconbtn { box-shadow: var(--shadow); width: 46px; height: 46px; border-radius: var(--radius-sm); }
.toast { position: absolute; z-index: 600; left: 50%; top: 70px; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 8px 14px; border-radius: 999px; font-size: .88rem; }
.map-panel { background: var(--surface); padding: 14px 20px 18px; border-bottom: 1px solid var(--line); }
.mp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mp-time { display: flex; align-items: center; gap: 10px; margin: 8px 0 2px; }
.mp-time input[type=range] { flex: 1; }
.mp-time .iconbtn { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.mp-time .iconbtn:hover { background: var(--primary-hover); color: var(--primary-ink); }
.layerchips { margin: 10px 0 4px; }
.tog { font: inherit; font-size: .82rem; font-weight: 600; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; min-height: 34px; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.tog:hover { border-color: var(--primary); }
.tog[aria-pressed=true] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
details.mp-more summary { cursor: pointer; font-weight: 700; padding: 8px 0; font-size: .9rem; }

/* About: the problem in numbers */
.problem { background: var(--navy); color: var(--on-navy); border-radius: var(--radius); padding: 26px 24px; margin: 0 0 20px; }
.problem h2 { font-size: clamp(1.4rem, 4vw, 2rem); letter-spacing: -0.03em; font-weight: 800; margin: 0 0 14px; max-width: 24ch; text-wrap: balance; }
.problem p { color: var(--on-navy-muted); max-width: 62ch; }
.problem .pgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 24px; margin-top: 18px; }
.problem .pgrid div { border-top: 1px solid rgba(255,255,255,.18); padding-top: 12px; }
.problem .pgrid b { display: block; color: var(--on-navy); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.problem .pgrid span { color: var(--on-navy-muted); font-size: .92rem; }
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 6px 0 24px; counter-reset: step; }
.flow div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.flow div::before { counter-increment: step; content: counter(step); display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font-weight: 800; font-size: .8rem; margin-bottom: 8px; }
.flow b { display: block; } .flow span { color: var(--muted); font-size: .88rem; }
.numgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 6px 0 24px; }
.num { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 14px; }
.num b { display: block; font-size: clamp(2.2rem, 6vw, 3rem); line-height: 1; letter-spacing: -0.05em; font-weight: 800; color: var(--primary); }
.num p { margin: 8px 0 4px; font-size: .93rem; max-width: 30ch; }
.num small { color: var(--muted); font-size: .74rem; }
.num.wide2 { grid-column: span 2; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 56px; margin-top: 10px; }
.spark i { flex: 1; background: var(--line-strong); min-height: 2px; border-radius: 2px 2px 0 0; }
.spark i.hi { background: var(--no); }
.hbars { display: grid; gap: 6px; margin-top: 10px; }
.hbars div { display: grid; grid-template-columns: 110px 1fr 40px; gap: 8px; align-items: center; font-size: .85rem; }
.hbars .bar { height: 12px; } .hbars .bar.you { background: var(--no); }
.sec { font-size: 1.15rem; margin: 6px 0 10px; }
.logo-card { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.logo-card img { width: 80px; height: 80px; border-radius: 18px; }

dialog { border: 0; border-radius: 18px; background: var(--surface); color: var(--ink); max-width: 640px; width: calc(100% - 24px); padding: 0; box-shadow: 0 24px 64px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(7, 13, 31, .6); }
.dlg { padding: 20px; display: grid; gap: 6px; } .dlg label { margin-top: 6px; }

.skel { display: grid; gap: 14px; padding: 24px 0; }
.skel i { display: block; height: 16px; border-radius: 8px; background: linear-gradient(90deg, var(--panel) 25%, var(--line) 37%, var(--panel) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.skel i:first-child { height: 44px; width: 60%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .skel i { animation: none; } }
#offline { max-width: var(--wrap); margin: 8px auto; }
.stagger > * { animation: rise .32s cubic-bezier(.2,.7,.2,1) both; }
.stagger > *:nth-child(2) { animation-delay: .05s; } .stagger > *:nth-child(3) { animation-delay: .1s; } .stagger > *:nth-child(4) { animation-delay: .15s; } .stagger > *:nth-child(n+5) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .stagger > * { animation: none; } * { transition: none !important; } }
::selection { background: var(--primary); color: var(--primary-ink); }

.site-foot { max-width: var(--wrap); margin: 30px auto 0; padding: 20px 20px 28px; border-top: 1px solid var(--line); font-size: .84rem; color: var(--muted); display: grid; gap: 6px; }
.site-foot p { margin: 0; max-width: 70ch; }
.print-only { display: none; }

/* desktop: tabs move into the header, the form sits beside its answer, the map gets the whole width */
@media (min-width: 900px) {
  body { padding-bottom: 24px; }
  .tabbar { position: static; height: auto; background: none; border: 0; display: flex; gap: 4px; padding: 0; margin-left: 18px; }
  .tabbar button { flex-direction: row; gap: 8px; font-size: .9rem; padding: 8px 14px; border-radius: 999px; }
  .tabbar button:hover { background: var(--panel); color: var(--ink); }
  .tabbar button[aria-current=page] { background: var(--primary-soft); color: var(--primary); }
  .tabbar button[aria-current=page]::before { display: none; }
  .hero-art { display: block; }
  .split { display: grid; grid-template-columns: minmax(360px, 420px) minmax(0, 1fr); gap: 0 36px; align-items: start; }
  .pane-form { position: sticky; top: 76px; }
  .pane-result { padding-top: 58px; }
  .grid-map { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 0 28px; align-items: start; grid-template-areas: "map ctl" "map out"; }
  .g-map { grid-area: map; position: sticky; top: 76px; } .g-ctl { grid-area: ctl; } .g-out { grid-area: out; }
  #map, #reach-map { height: calc(100vh - 110px); min-height: 480px; }
  .cols { columns: 2; column-gap: 20px; } .cols .card { break-inside: avoid; }
  #about { columns: 2; column-gap: 20px; } #about .card, #about .num, #about .logo-card { break-inside: avoid; }
  #about .problem, #about #numbers, #about .tldr, #about .flow { column-span: all; }
  .tab-map #map { height: calc(100vh - 62px); border-radius: 0; }
  .map-search { left: 428px; right: auto; width: 360px; }
  .map-panel { position: absolute; z-index: 500; top: 12px; left: 12px; width: 400px; max-height: calc(100% - 24px); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
}
@media (min-width: 1500px) { .cols { columns: 3; } }
@media (max-width: 520px) {
  .top { padding: 8px 14px; gap: 8px; } .brand .name { font-size: 1rem; }
  main { padding: 0 14px; } .hero-band { margin: 0 -14px; padding: 22px 14px 62px; } .tab-map { margin: 0 -14px; }
  .stats { gap: 6px; } .stat { padding: 8px; } .stat b { font-size: 1.15rem; } .stat span { font-size: .7rem; }
  .strip-row { grid-template-columns: repeat(5, 1fr); }
  .steps li { grid-template-columns: 68px 1fr; } .week-row { grid-template-columns: 74px 1fr 1fr; padding: 8px; font-size: .84rem; }
  .num.wide2 { grid-column: auto; }
}
@media print {
  body > *:not(#brief) { display: none !important; }
  .print-only { display: block !important; color: #000; background: #fff; padding: 0; }
  body { background: #fff; padding: 0; }
  #brief h1 { font-size: 20pt; color: #000; } #brief { font-size: 10.5pt; }
}

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.actions .btn { min-height: 42px; }
.actions .btn.primary { flex: 1 1 100%; min-height: 48px; }

.locrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.locchip { gap: 8px; display: inline-flex; align-items: center; color: var(--primary-hover); border-color: var(--primary); background: var(--primary-soft); }
.locchip:hover { background: var(--primary); color: var(--primary-ink); }
.locchip[disabled] { opacity: .6; cursor: progress; }
.loc-msg { font-size: .85rem; color: var(--muted); flex: 1 1 200px; }
.loc-msg.warn { color: var(--maybe); } .loc-msg.ok { color: var(--yes); }

details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2 { margin: 0; }
details.fold > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; flex: none; margin-right: 4px; }
details.fold[open] > summary::after { transform: rotate(-135deg); }
details.fold[open] > summary { margin-bottom: 8px; }
.examples { display: grid; gap: 8px; margin-top: 16px; max-width: 460px; }
.examples h3 { margin: 0 0 2px; color: var(--ink); }
.example { text-align: left; font: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; display: grid; gap: 2px; transition: border-color .15s, transform .12s, box-shadow .15s; }
.example { color: var(--ink); } .example b { font-size: .95rem; } .example span { color: var(--muted); font-size: .85rem; }
.example:hover { border-color: var(--primary); box-shadow: var(--shadow); } .example:active { transform: scale(.99); }

.emp-pin i { display: block; width: 16px; height: 16px; background: var(--amber, #ffb020); border: 2.5px solid #0f1b3d; border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.hbar { display: inline-flex; gap: 1px; align-items: stretch; height: 14px; vertical-align: middle; }
.hbar i { width: 5px; background: var(--line-strong); border-radius: 1px; } .hbar i.on { background: var(--primary); }
.back { position: absolute; z-index: 600; left: 50%; bottom: 16px; transform: translateX(-50%); box-shadow: var(--shadow); }
@media (min-width: 900px) { .back { left: calc(50% + 200px); } }

.netpair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.netpair figure { margin: 0; } .netpair svg { width: 100%; height: auto; display: block; }
.netpair figcaption { font-size: .78rem; margin-top: 4px; opacity: .85; }
.hero-art { max-width: 460px; width: 46%; }
.hero-art .netpair svg { color: var(--net-a); opacity: 1; margin: 0; }
.hero-art .netpair figure:last-child svg { color: var(--amber); }
@media (max-width: 899px) { .hero-art { display: none; } }
.problem .netpair { margin-top: 18px; max-width: 520px; } .problem .netpair svg { color: var(--net-a); } .problem .netpair figure:last-child svg { color: var(--amber); }

.hero-art .netpair svg { width: 100%; }
.emp-list, .city-list { list-style: none; padding: 0; margin: 8px 0 0; }
.emp-list li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.emp-main { display: grid; gap: 3px; min-width: 0; flex: 1 1 260px; } .emp-main b { font-size: .98rem; }
.emp-side { display: grid; gap: 4px; align-content: start; text-align: right; flex: 1 1 240px; min-width: 0; max-width: 100%; }
.emp-side .row { justify-content: flex-end; }
.city-list li { display: grid; grid-template-columns: 1fr minmax(120px, 36%) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.city-list li > div:first-child { display: grid; gap: 2px; min-width: 0; } .city-list .small { font-size: .78rem; }
.city-bar { display: flex; align-items: center; gap: 8px; } .city-bar .bar { height: 12px; max-width: 100%; flex: 0 1 auto; } .city-bar .bar.low { background: var(--no); } .city-bar b { font-size: .95rem; min-width: 38px; }
@media (max-width: 520px) { .city-list li { grid-template-columns: 1fr auto; } .city-list .city-bar { grid-column: 1 / -1; } .emp-side { text-align: left; } .emp-side .row { justify-content: flex-start; } }
.srcs { columns: 2; column-gap: 24px; padding-left: 18px; margin: 6px 0 0; font-size: .88rem; } .srcs li { break-inside: avoid; margin-bottom: 6px; } .srcs a { display: inline-block; padding: 4px 0; }
.empabout .emp-mini { display: grid; gap: 6px; margin-top: 10px; }
.empabout .emp-mini div { display: grid; grid-template-columns: minmax(150px, 1.2fr) auto 1fr; gap: 10px; align-items: center; font-size: .88rem; border-top: 1px solid var(--line); padding-top: 6px; }

.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -2px; }
@media (max-width: 520px) { .empabout .emp-mini div { grid-template-columns: 1fr; gap: 4px; } .hbar i { width: 4px; } th { font-size: .68rem; } }

[hidden] { display: none !important; }

.slogan { margin: 0 0 12px; color: var(--amber); font-weight: 700; font-size: .82rem; letter-spacing: .09em; text-transform: uppercase; max-width: 40ch; line-height: 1.35; }
.foot-slogan { font-weight: 700; color: var(--ink); }

.install { max-width: var(--wrap); margin: 0 auto; padding: 0 20px 20px; display: flex; gap: 12px; align-items: center; }

.mark .moon { fill: var(--amber); }
#theme svg { display: block; }
:root[data-theme="dark"] #theme .sun, :root:not([data-theme="dark"]) #theme .moon-i { display: none; }

/* region picker and weather icons */
#region { max-width: 190px; font-size: .85rem; }
@media (max-width: 420px) { #region { max-width: 136px; text-overflow: ellipsis; } }
.kv .ico { display: block; margin-bottom: 2px; color: var(--primary); }

/* weather where you wait: one compact row under the verdict */
.cond { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 10px 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: .92rem; }
.cond .ct { font-weight: 700; flex: 1 0 100%; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.cond .ci { display: inline-flex; align-items: center; gap: 6px; }
.cond .ci b { font-size: 1.05rem; }
.cond .cn { flex: 1 0 100%; font-size: .78rem; color: var(--muted); }
.cond .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--maybe); flex: none; }
.cond .dot.danger, .cond .dot.extreme_danger { background: var(--no); }
.cond .dot.cold { background: var(--primary); }
.cond .ico { color: var(--primary); }

#situations .sit { padding: 10px 0; border-top: 1px solid var(--line); }
#situations .sit:first-of-type { border-top: 0; }

/* trip summary: one line, not a row of equal tiles */
.trip-line { display: flex; align-items: flex-end; gap: 14px; margin: 4px 0 2px; }
.trip-line .tl { display: flex; flex-direction: column; }
.trip-line small { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.trip-line b { font-size: 1.9rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.trip-line .tl-arrow { font-size: 1.4rem; color: var(--primary); padding-bottom: 4px; }
.trip-meta { margin: 2px 0 12px; color: var(--muted); }

/* ===== hand-finished layer =====
   One spacing scale, a few card roles instead of one box repeated, shapes drawn in CSS rather than typed as glyphs. */
:root { --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; }

/* hero: one local number, set large, with a 24-hour ruler that marks the hour it is about */
.hero-band { padding: var(--s6) 20px 70px; }
.slogan { font-size: .74rem; letter-spacing: .12em; margin-bottom: var(--s3); }
.hero-band h1 { max-width: 12ch; margin-bottom: var(--s4); font-size: clamp(2.1rem, 7vw, 3.2rem); }
.hero-stat { display: grid; grid-template-columns: auto minmax(0, 24ch); align-items: end; gap: 0 var(--s4); font-size: 1rem; line-height: 1.35; }
.hero-stat b { font-size: clamp(3.6rem, 16vw, 6.4rem); letter-spacing: -0.06em; line-height: .82; }
.hero-stat span { padding-bottom: 4px; border-bottom: 1px solid color-mix(in srgb, var(--amber) 55%, transparent); padding-bottom: var(--s2); }
.ruler { position: relative; height: 34px; max-width: var(--wrap); margin: var(--s5) auto 0; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--on-navy-muted); }
.ruler::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 9px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.34) 0 1px, transparent 1px calc(100% / 24)); border-right: 1px solid rgba(255,255,255,.34); }
.ruler i { position: absolute; top: 14px; font-style: normal; white-space: nowrap; }
.ruler .r-start { left: 0; }
.ruler .r-at { left: calc(100% * 23 / 24); transform: translateX(-50%); color: var(--amber); font-weight: 700; }
.ruler .r-at::before { content: ""; position: absolute; left: 50%; top: -14px; width: 2px; height: 14px; margin-left: -1px; background: var(--amber); }
@media (max-width: 520px) { .hero-band { padding: var(--s5) 14px 66px; } }

/* the verdict is the loudest thing on the result */
.verdict { padding: var(--s4) var(--s5) var(--s4) calc(var(--s5) + 2px); border-radius: 10px; margin-bottom: var(--s4); }
.verdict::before { width: 8px; }
.verdict .tag { font-size: 1.85rem; }
.verdict .icon { width: 34px; height: 34px; }
.verdict.no .icon { width: 30px; height: 30px; }
.verdict .sub { font-size: 1.05rem; margin-top: var(--s2); max-width: 46ch; }

/* card roles: panels carry the answer; plain sections carry the support; notes carry warnings */
.card.panel { border-radius: 10px; border-color: var(--line-strong); border-top: 3px solid var(--primary); padding: var(--s4) var(--s5) var(--s3); }
.card.plain, details.card.fold { background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: var(--s4) 0 var(--s3); margin: 0; }
details.card.fold > summary h2, .card.plain > h2 { font-size: 1rem; }
details.card.fold > summary { min-height: 44px; }
details.card.fold > summary:hover h2 { color: var(--primary); }
.card.live { background: none; border: 0; border-left: 3px solid var(--line-strong); border-radius: 0; padding: var(--s1) var(--s3) var(--s1) var(--s4); margin: var(--s4) 0; }
.card.live h2 { font-size: .92rem; margin-bottom: var(--s1); }
.card.live .btn { min-height: 44px; }
.notice { background: none; border-radius: 0; border-left: 4px solid var(--primary); padding: var(--s2) var(--s3) var(--s2) var(--s4); margin: var(--s3) 0; }
.notice.floating { background: var(--surface); border-radius: var(--radius-sm); border-left-width: 4px; }

/* weather: a quiet line of facts, not a box */
.cond { background: none; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; padding: var(--s3) 0; margin: 0 0 var(--s4); font-size: .9rem; gap: var(--s1) var(--s4); }
.cond .ct { flex: 0 0 auto; font-size: .7rem; margin-right: var(--s1); align-self: center; }
.cond .ci b { font-size: 1rem; }
.cond .cn { font-size: .72rem; line-height: 1.35; }

/* actions: a distinct area at the end of the answer */
.actions { background: var(--panel); border-radius: 10px; padding: var(--s3); margin: var(--s5) 0 var(--s4); gap: var(--s2); }
.actions .btn { min-height: 44px; }
.actions .btn.ghost { background: var(--surface); }

/* the trip: times on the left, a line you can follow, a dot where you board */
.steps li { padding: var(--s2) 0; }
.steps .what { position: relative; }
.steps li.bus .what::before { content: ""; position: absolute; left: -11px; top: 5px; width: 15px; height: 15px; border-radius: 50%; background: var(--surface); border: 3px solid var(--rc, var(--primary)); }
.steps li:not(.bus) .what { color: var(--muted); }
.steps li:not(.bus) .what small { color: var(--muted); }
.route { border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .22); }
.trip-line b { font-size: 2.1rem; letter-spacing: -0.03em; }
.trip-line .tl-arrow { color: var(--muted); }

/* shapes drawn in CSS, so they look the same on every phone (circle = yes, square = partly, diamond = no) */
.cell i, .vi i, .cell-key i { display: inline-block; width: 12px; height: 12px; background: currentColor; flex: none; }
.cell.yes i, .vi.yes i, .cell-key.yes i { border-radius: 50%; }
.cell.maybe i, .vi.maybe i, .cell-key.maybe i { border-radius: 2px; }
.cell.no i, .vi.no i, .cell-key.no i { transform: rotate(45deg) scale(.82); border-radius: 1px; }
.cell-key { display: inline-flex; align-items: center; gap: 6px; margin-right: var(--s2); }
.badge::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; background: currentColor; vertical-align: 0; }
.badge.ok::before { border-radius: 50%; }
.badge.warn::before { clip-path: polygon(50% 0, 100% 100%, 0 100%); width: 10px; height: 9px; }
.badge.bad::before { transform: rotate(45deg) scale(.85); border-radius: 1px; }
.badge:not(.ok):not(.warn):not(.bad)::before { display: none; }
.badge.ok { background: var(--yes-bg); color: var(--yes); }
.strip-row { gap: var(--s1); }
.cell { min-height: 48px; border-radius: 6px; }

/* spacing rhythm: sections breathe the same amount everywhere */
.card { margin-bottom: var(--s4); }
h3 { margin-top: var(--s4); }
.pane-result > * + * { margin-top: 0; }
.trip-line { gap: var(--s3); }
.trip-line b { font-size: clamp(1.55rem, 7.4vw, 2.1rem); white-space: nowrap; }
.verdict .sub { text-wrap: pretty; }
.card.live .chips { gap: var(--s2); margin: var(--s2) 0; }
.card.live .btn.ghost { border-radius: 999px; font-weight: 600; font-size: .85rem; padding: 6px 14px; background: var(--surface); }
:root:not([data-theme="dark"]) { --yes: #166a2e; }   /* 5.2:1 on the green tint */

/* ===== MAP WORK (inline trip map, Map tab legend and prompt) ===== */
.trip-map-card { margin: 14px 0 6px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.trip-map-card .tm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.trip-map-card .tm-actions { display: inline-flex; gap: 6px; }
.tog.sm { min-height: 44px; padding: 6px 12px; font-size: .8rem; }
#trip-map { height: 240px; border: 0; border-radius: 0; background: var(--panel); }
@media (min-width: 700px) { #trip-map { height: 320px; } }
#trip-map.no-tiles { background: repeating-linear-gradient(45deg, var(--panel), var(--panel) 12px, var(--surface) 12px, var(--surface) 24px); }
.trip-map-card #tm-note { margin: 0; padding: 6px 12px 8px; color: var(--muted); }
.tm-pin-wrap { background: none; border: 0; }
.tm-pin, .tm-end { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; font: 700 .8rem/1 var(--font, inherit); box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0, 0, 0, .35); }
.tm-pin { background: var(--rc, var(--primary)); color: var(--rt, #fff); }
.tm-pin.home { border-radius: 6px; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--rc, var(--primary)); }
.tm-end { background: #14181f; color: #fff; }
.tm-end.start { background: #fff; color: #14181f; box-shadow: 0 0 0 2px #14181f; }
.mp-prompt { margin: 0 0 8px; font-weight: 700; font-size: 1.02rem; line-height: 1.3; }
.mp-sub { display: block; margin: 2px 0 8px; font-size: .88rem; color: var(--muted); }
.lg { list-style: none; margin: 10px 0 6px; padding: 0; display: grid; gap: 5px; font-size: .84rem; }
.lg li { display: flex; align-items: center; gap: 8px; }
.lg .sw { display: inline-block; flex: none; margin: 0 3px; width: 16px; height: 16px; border-radius: 50%; box-sizing: border-box; }
.sw-ok { background: var(--map); opacity: .8; }
.sw-lost { background: var(--maybe); }
.sw-none { background: var(--surface); border: 2px dashed var(--bad); }
.sw-run { width: 10px !important; height: 10px !important; background: var(--map); }
.sw-off { width: 10px !important; height: 10px !important; background: var(--map-off); }
.sw-trip { width: 22px !important; height: 6px !important; border-radius: 3px !important; background: var(--ink); }
.mp-layers { margin: 6px 0; }
.mp-layers summary, details.mp-more summary { cursor: pointer; font-weight: 700; padding: 10px 0; font-size: .9rem; min-height: 44px; display: flex; align-items: center; }
.mp-views { margin: 4px 0 8px; }
.map-loading { position: absolute; z-index: 450; left: 50%; top: 40%; transform: translate(-50%, -50%); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow); pointer-events: none; }
.map-loading[hidden] { display: none; }
@media (min-width: 900px) { .map-loading { left: calc(50% + 200px); } }
@media (max-width: 899px) { .tab-map #map { height: 52vh; min-height: 340px; } }
.lg li[hidden] { display: none; }

/* ===== About page: written as a document, not a stack of boxes ===== */
#about { counter-reset: abs; }
.ab-head { padding: 8px 0 4px; max-width: 46rem; }
.ab-head h1 { margin-bottom: 10px; }
.ab-intro { font-size: 1.12rem; line-height: 1.55; color: var(--ink); margin: 0; text-wrap: pretty; }
.ab-toc { position: sticky; top: 56px; z-index: 40; display: flex; gap: 4px 16px; align-items: center; overflow-x: auto; white-space: nowrap; margin: 16px 0 0; padding: 10px 2px; background: var(--bg); border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.ab-toc-l { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; flex: none; }
.ab-toc a { flex: none; color: var(--ink); text-decoration: none; font-size: .92rem; font-weight: 600; padding: 6px 0; border-bottom: 2px solid transparent; }
.ab-toc a:hover, .ab-toc a:focus-visible { border-bottom-color: var(--primary); color: var(--primary); }
.ab-sec { counter-increment: abs; margin: 0; padding: 30px 0 6px; scroll-margin-top: 112px; border-top: 1px solid var(--line); }
.ab-sec:first-of-type { border-top: 0; }
.ab-h { font-size: clamp(1.35rem, 3.6vw, 1.8rem); letter-spacing: -0.02em; margin: 0 0 14px; display: flex; align-items: baseline; gap: 12px; }
.ab-h::before { content: counter(abs, decimal-leading-zero); font-size: .8rem; font-weight: 700; color: var(--muted); letter-spacing: .06em; }
.ab-lead { font-size: 1.02rem; line-height: 1.55; max-width: 44rem; }
.ab-more { margin: 14px 0; padding-left: 14px; border-left: 3px solid var(--line-strong); max-width: 44rem; }
.ab-more h3 { margin-top: 0; }
.ab-sec h3 { font-size: 1.02rem; margin: 22px 0 8px; }
.ab-sec ul, .ab-sec ol { padding-left: 1.2rem; }
.ab-sec li { margin-bottom: 6px; max-width: 46rem; }

.ledger { list-style: none; padding: 0 !important; margin: 8px 0 0; }
.ledger li { display: grid; grid-template-columns: minmax(7.5rem, 12rem) 1fr; gap: 6px 22px; padding: 14px 0; margin: 0; max-width: none; border-top: 1px solid var(--line); }
.ledger li:last-child { border-bottom: 1px solid var(--line); }
.lf { font-size: clamp(1.25rem, 4vw, 1.75rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; color: var(--primary); }
.ledger p { margin: 0 0 4px; max-width: 40rem; }
.ledger .ll { font-size: .86rem; color: var(--muted); }
.ledger .ll b { color: var(--ink); font-weight: 600; }
.ledger .ls { display: block; margin-top: 2px; }
.ev-not { margin: 22px 0 8px; padding: 2px 0 2px 16px; border-left: 4px solid var(--maybe); max-width: 44rem; }
.ev-not h3 { margin-top: 0; }

.ds-feeds ul { list-style: none; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 8px; }
.ds-feeds li { margin: 0; max-width: none; }
.ds-feeds li a { display: inline-block; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 999px; text-decoration: none; font-size: .9rem; font-weight: 600; background: var(--surface); }
.ds-feeds li a:hover { border-color: var(--primary); }
dl.ds { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 16px 32px; margin: 8px 0 0; }
dl.ds > div { padding-top: 10px; border-top: 1px solid var(--line); }
dl.ds dt { font-weight: 700; margin: 0 0 2px; }
dl.ds dd { margin: 0; font-size: .92rem; }
dl.ds .dsm { display: block; margin-top: 4px; font-size: .8rem; color: var(--muted); }
ul.own { columns: 2 14rem; column-gap: 28px; }

ol.steps { list-style: none; padding: 0 !important; margin: 4px 0 14px 12px; border-left: 2px solid var(--line-strong); counter-reset: st; }
ol.steps li { position: relative; padding: 0 0 12px 24px; margin: 0; counter-increment: st; }
ol.steps li::before { content: counter(st); position: absolute; left: -13px; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font-size: .78rem; font-weight: 700; display: grid; place-items: center; }
.ab-callout { padding: 12px 16px; border-left: 4px solid var(--no); background: var(--no-bg); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; max-width: 44rem; }
ul.lims { list-style: none; padding: 0 !important; border-left: 4px solid var(--maybe); padding-left: 16px !important; }
.ab-sec .logo-card { margin-top: 18px; }
@media (max-width: 560px) {
  .ledger li { grid-template-columns: 1fr; }
  .ab-toc-l { display: none; }
  .ab-toc { top: 52px; }
}

/* ===== Employers tab: the decision first, then actions, then evidence ===== */
#tab-city .scope { margin: -6px 0 16px; max-width: 70ch; }
.dec-grid { display: grid; gap: 16px; margin-bottom: 16px; }
@media (min-width: 900px) { .dec-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; } }
.decision { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--primary); border-radius: var(--radius); padding: 18px 18px 14px; }
.decision h2 { margin-top: 0; font-size: 1.3rem; }
.dec-pick { display: grid; gap: 10px; margin: 8px 0 14px; }
.dec-pick select, .ev select, .ev input[type=search] { width: 100%; min-height: 44px; font: inherit; }
.ctl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.ctl-row select { width: auto; max-width: 100%; }
.answer { font-size: 1.15rem; line-height: 1.35; font-weight: 700; margin: 4px 0 12px; letter-spacing: -0.01em; }
.answer.sm { font-size: 1rem; font-weight: 600; }
.shifts { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 12px; }
.shifts li { display: grid; gap: 4px; }
@media (min-width: 440px) { .shifts li { grid-template-columns: 150px minmax(0, 1fr) 160px; align-items: center; gap: 10px; } }
.shifts .sh-l b { display: block; }
.shifts .sh-p { font-size: .88rem; color: var(--muted); } .shifts .sh-p b { color: var(--ink); font-size: 1rem; }
.meter { display: block; height: 10px; border-radius: 5px; background: var(--panel); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 5px; background: var(--primary); }
.meaning { margin: 0 0 12px; padding-left: 10px; border-left: 3px solid var(--line-strong); color: var(--muted); font-size: .92rem; max-width: 70ch; }
.decision .sub { margin: 10px 0 4px; } .decision .sub summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; color: var(--primary); }

.acts-block { padding: 4px 2px 0; }
.acts-block h2 { font-size: 1.12rem; }
.acts { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 16px; }
.acts li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: start; }
.acts .ic { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary); }
.acts b { display: block; line-height: 1.3; } .acts p { margin: 2px 0 0; font-size: .93rem; }

.agency-block { margin: 18px 0 8px; padding: 16px 0; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.agency-block p { max-width: 70ch; }
.agency-block .btn { min-height: 44px; }

.ev-h2 { margin: 22px 0 8px; font-size: 1.12rem; }
.evidence { display: grid; gap: 0; border-top: 1px solid var(--line); }
details.ev { border-bottom: 1px solid var(--line); }
details.ev > summary { list-style: none; cursor: pointer; min-height: 56px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; padding: 8px 2px; }
details.ev > summary::-webkit-details-marker { display: none; }
details.ev > summary::after { content: ""; grid-row: 1 / span 2; grid-column: 2; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
details.ev[open] > summary::after { transform: rotate(-135deg); }
details.ev > summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.ev-t { font-weight: 700; grid-column: 1; } .ev-h { grid-column: 1; font-size: .88rem; color: var(--muted); }
.ev-body { padding: 4px 2px 18px; }
.ev .seg label, .decision .seg label { min-height: 44px; display: flex; } .ev .seg span, .decision .seg span { display: flex; align-items: center; min-height: 44px; }
.ev .link { min-height: 44px; display: inline-flex; align-items: center; padding: 0 4px 0 0; }
.ev .btn { min-height: 44px; }
.emp-tools { display: grid; gap: 10px; margin-bottom: 10px; }
@media (min-width: 640px) { .emp-tools { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }
.hax { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); max-width: 260px; margin: 6px 0 0; }
.emp-rows { list-style: none; padding: 0; margin: 0; }
.emp-rows li { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 720px) { .emp-rows li { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; } }
.emp-rows .emp-main { display: grid; gap: 4px; }
.figs { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 4px; }
.figs b { font-size: 1.25rem; letter-spacing: -0.02em; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); vertical-align: middle; }
#tab-city td.r, #tab-city th.r { text-align: right; }
@media (max-width: 560px) {
  #tab-city table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  #tab-city table.stack, #tab-city table.stack tbody, #tab-city table.stack tr, #tab-city table.stack td { display: block; width: 100%; }
  #tab-city table.stack tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  #tab-city table.stack td { border: 0; padding: 2px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  #tab-city table.stack td:first-child { font-weight: 700; text-align: left; }
  #tab-city table.stack td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; text-align: left; }
  #tab-city table.stack td:first-child::before { content: none; }
}
/* Employers tab: let grid children shrink so nothing pushes the page wider than the phone */
.evidence { grid-template-columns: minmax(0, 1fr); } details.ev, .ev-body, .emp-rows li > *, .emp-tools > * { min-width: 0; }
.emp-tools { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .emp-tools { grid-template-columns: minmax(0, 1fr) auto; } }
.emp-rows .hbar { max-width: 100%; }
.tag { color: var(--ink); }

/* employers: swap-the-start-time tool, comparison table (own block) */
.swap-block { margin: 18px 0; padding: 14px 0; border-top: 2px solid var(--ink); }
.swap-block h2 { margin: 0 0 4px; }
.swap-block .dayrows { margin: 8px 0; padding-left: 18px; }
.cmp .scopeline { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
.th-sort { all: unset; cursor: pointer; font-weight: 700; padding: 6px 2px; min-height: 44px; display: inline-flex; align-items: center; }
.th-sort:hover { text-decoration: underline; }
.th-sort:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.cmp-sort { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cmp-sort select { flex: 1 1 200px; min-height: 44px; }
.cmp-sort .btn { min-height: 44px; }
@media (min-width: 700px) { .cmp-sort { display: none; } }

/* ===== map controls, Reach, print (plan/map pass) ===== */
.m-emp { margin: 0 0 10px; }
.m-emp input { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
.mp-share { margin: 8px 0 4px; }
.sw-reach { background: color-mix(in srgb, var(--primary) 35%, transparent); border: 1.5px solid var(--primary); border-radius: 50%; }
.sw-nodata { width: 8px !important; height: 8px !important; border-radius: 50%; background: var(--muted); opacity: .55; }
.emp-now { margin: 6px 0; font-weight: 700; }
.emp-now.yes { color: var(--yes); } .emp-now.no { color: var(--no); }
.hour-table { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: 6px; }
.hour-table th, .hour-table td { text-align: left; padding: 6px 8px; border-top: 1px solid var(--line); }
.hour-table td { font-variant-numeric: tabular-nums; }
/* the hour slider: a filled track that grows through the day */
.mp-time input[type=range], #r-time-range { -webkit-appearance: none; appearance: none; height: 28px; background: transparent; accent-color: var(--primary); }
.mp-time input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--primary) var(--p, 0%), var(--line-strong) var(--p, 0%)); }
.mp-time input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--line-strong); }
.mp-time input[type=range]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--primary); }
.mp-time input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); box-shadow: 0 1px 3px rgba(15, 23, 42, .25); }
.mp-time input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); }
.mp-time input[type=range]:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; border-radius: 8px; }
.big-num { transition: color .2s; }
@media (prefers-reduced-motion: reduce) { .big-num, .mp-time input[type=range]::-webkit-slider-runnable-track { transition: none; } }
/* Reach: a form and its answer, not two identical boxes */
#tab-reach .g-ctl.card, #tab-reach .g-out.card { background: transparent; box-shadow: none; border: 0; border-radius: 0; padding-left: 0; padding-right: 0; }
#tab-reach .g-ctl.card { border-top: 2px solid var(--ink); padding-top: 14px; }
#tab-reach .g-out.card { border-left: 4px solid var(--primary); padding-left: 16px; border-radius: 0; }
#tab-reach .g-ctl select, #tab-reach .g-ctl input[type=time] { min-height: 44px; }
#tab-reach #r-go { min-height: 44px; }
/* print: the map view as a clean sheet */
#print-map-head { display: none; }
@media print {
  body.print-map header, body.print-map .tabbar, body.print-map #offline, body.print-map .map-panel, body.print-map .map-search, body.print-map #m-back, body.print-map #m-toast, body.print-map .leaflet-control-container { display: none !important; }
  body.print-map #print-map-head { display: block; padding: 0 0 12px; color: #000; }
  body.print-map #print-map-head h1 { font-size: 18pt; margin: 0 0 6px; }
  body.print-map #print-map-head ul { columns: 2; padding-left: 18px; margin: 6px 0; font-size: 10pt; }
  body.print-map .tab:not(#tab-map) { display: none !important; }
  body.print-map #tab-map, body.print-map .map-shell { position: static !important; height: 120mm !important; width: 100% !important; }
  body.print-map #map { height: 120mm !important; width: 100% !important; }
}

/* ---- phones: iOS Safari and Android Chrome ---------------------------------------------------------
   iOS zooms the whole page when a text box under 16px is focused; short mobile browsers hide part of a 100vh
   box behind the address bar (dvh follows the visible height); notches and home bars need safe-area padding;
   thumbs need 44px targets (Apple and Google both recommend 44-48px). */
html { -webkit-tap-highlight-color: transparent; }
button, a, select, summary, label, [role="button"] { touch-action: manipulation; }
header.top { padding-top: calc(8px + env(safe-area-inset-top)); padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
.tabbar { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
main { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
@media (max-width: 520px) { main { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); } }
@supports (height: 100dvh) {
  .tab-map #map { height: 60dvh; }
  @media (max-width: 899px) { .tab-map #map { height: 52dvh; } }
  @media (min-width: 900px) { #map, #reach-map { height: calc(100dvh - 110px); } .tab-map #map { height: calc(100dvh - 62px); } }
}
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: 16px; }
  .chip, .chips > button, #loc, #lang, #region, .iconbtn, .btn, summary, .tabbar button, .examples button, button.example { min-height: 44px; }
  .iconbtn { min-width: 44px; }
  .brand, .skip:focus { min-height: 44px; display: inline-flex; align-items: center; }
  .leaflet-bar a, .leaflet-touch .leaflet-bar a { width: 40px; height: 40px; line-height: 40px; }
}
@media (max-width: 360px) {
  .trip-line b { font-size: 1.6rem; }
  .hero-band h1 { font-size: 1.6rem; }
  #region { max-width: 110px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .tabbar { position: static; }
  .tab-map #map { height: 80vh; min-height: 260px; }
}
@media (pointer: coarse) {
  #region, #to-quick, #end-time, #time { font-size: 16px; }
  button[id^="m-"], .btn.sm, .btn.ghost.sm, .ab-toc a, .ds-feeds a, .ds a, .own a { min-height: 44px; display: inline-flex; align-items: center; }
  .ab-toc a, .ds-feeds a { padding-top: 6px; padding-bottom: 6px; }
}
@media (max-width: 360px) {
  .tabbar button { font-size: .66rem; padding-left: 2px; padding-right: 2px; white-space: nowrap; letter-spacing: 0; }
}
