:root {
  --bg: #f4f6f9; --card: #fff; --text: #14181f; --muted: #5d6675; --line: #dfe3ea;
  --accent: #0b5cad; --bus: #0b5cad; --tram: #e07b00; --metro: #d01c1f;
  --ok: #15803d; --warn: #b45309; --bad: #b91c1c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216; --card: #1a1f26; --text: #e8ebf0; --muted: #9aa3b2; --line: #2b323c;
    --accent: #5aa2ec; --bus: #3b82d6; --tram: #f08c1a; --metro: #ef4444;
    --ok: #4ade80; --warn: #fbbf24; --bad: #f87171;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
header { position: sticky; top: 0; z-index: 1; background: var(--bg); padding: 12px 16px 8px; border-bottom: 1px solid var(--line); }
main, footer { padding: 12px 16px; max-width: 640px; margin: 0 auto; }
header > * { max-width: 608px; margin: 0 auto; }
.dir { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--line); border-radius: 10px; padding: 3px; }
.dir button { border: 0; border-radius: 8px; padding: 8px; font: inherit; font-weight: 600; background: transparent; color: var(--muted); }
.dir button[aria-selected="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 2px #0002; }
.when { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 15px; }
.when input { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--text); }
button.ghost { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--accent); border-radius: 6px; padding: 4px 10px; }
.status { margin-left: auto; font-size: 13px; color: var(--muted); }
.status.ok::before { content: "● "; color: var(--ok); }
.status.bad::before { content: "● "; color: var(--warn); }
.banner { background: #fef3c7; color: #78350f; padding: 8px 12px; border-radius: 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.card.top { border-color: var(--accent); border-width: 2px; }
.times { display: flex; justify-content: space-between; align-items: baseline; }
.big { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dur { font-weight: 600; color: var(--muted); }
.sub { color: var(--muted); font-size: 14px; margin: 2px 0 8px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.chip { display: inline-block; min-width: 28px; text-align: center; padding: 1px 7px; border-radius: 6px; color: #fff; font-weight: 700; font-size: 14px; }
.chip.bus { background: var(--bus); } .chip.tram { background: var(--tram); } .chip.metro { background: var(--metro); }
.arrow { color: var(--muted); }
details summary { cursor: pointer; color: var(--accent); font-size: 14px; margin-top: 8px; }
ol { list-style: none; padding: 0; margin: 8px 0 0; }
ol li { padding: 6px 0; border-top: 1px solid var(--line); font-size: 15px; }
ol li.walk { color: var(--muted); font-size: 14px; }
small { color: var(--muted); }
.maps { display: flex; gap: 6px; margin-top: 4px; }
.maps a { font-size: 13px; color: var(--accent); text-decoration: none; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; background: var(--bg); }
.tag { font-size: 12px; padding: 0 6px; border-radius: 10px; margin-left: 4px; white-space: nowrap; }
.tag.live { background: #dcfce7; color: #166534; }
.tag.sched { background: #fef3c7; color: #92400e; }
.tag.none { background: var(--line); color: var(--muted); }
.tag.tight { background: #fee2e2; color: #991b1b; }
.sub.late { margin-top: -6px; }
.sub.late.risky { color: var(--bad); }
#more-wrap > summary { margin: 4px 0 10px; }
.empty { color: var(--muted); }
footer { color: var(--muted); font-size: 12px; }
