:root { --bg:#f4f6f8; --fg:#14202b; --muted:#667785; --card:#fff; --line:#dfe5ea; --accent:#0b3d5c; --ok:#1a7f4b; --warn:#b26a00; --bad:#c0392b; }
@media (prefers-color-scheme: dark) {
  :root { --bg:#10181f; --fg:#e8eef3; --muted:#8fa1af; --card:#18232d; --line:#26343f; --accent:#5fb0e0; --ok:#4cc88a; --warn:#e9a23b; --bad:#ef6b5b; }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { display: flex; flex-direction: column; background: var(--bg); color: var(--fg); font: 16px/1.35 system-ui, sans-serif; padding-top: env(safe-area-inset-top); }
header { display: flex; align-items: baseline; gap: 12px; padding: 10px 14px; background: #0b3d5c; color: #fff; }
header h1 { margin: 0; font-size: 18px; }
#status { font-size: 12px; opacity: .8; }
main { flex: 1; min-height: 0; overflow: auto; position: relative; }
section { height: 100%; }
#view-dep { padding: 10px 12px; }
.search { display: flex; gap: 8px; margin-bottom: 8px; }
input[type=search] { flex: 1; padding: 12px; font-size: 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--fg); }
button { font: inherit; color: inherit; }
#near, #fav, #back { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 18px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; padding: 11px 12px; }
.list li.tap { cursor: pointer; }
.sub { color: var(--muted); font-size: 13px; }
.board-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.board-head h2 { flex: 1; margin: 0; font-size: 18px; }
.dep { display: grid; grid-template-columns: 52px 1fr auto; gap: 4px 10px; align-items: center; }
.line { display: inline-block; min-width: 40px; text-align: center; padding: 3px 6px; border-radius: 6px; font-weight: 700; background: var(--accent); color: var(--bg); }
.dep .time { text-align: right; font-variant-numeric: tabular-nums; }
.dep .time b { font-size: 17px; }
.live { font-size: 12px; font-weight: 600; }
.live.ok { color: var(--ok); } .live.warn { color: var(--warn); } .live.bad { color: var(--bad); }
.trip { grid-column: 1 / -1; font-size: 13px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 4px; }
.trip div { display: flex; justify-content: space-between; }
nav { display: flex; border-top: 1px solid var(--line); background: var(--card); padding-bottom: env(safe-area-inset-bottom); }
nav button { flex: 1; padding: 14px; background: none; border: 0; font-weight: 600; color: var(--muted); }
nav button.on { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
#view-map { display: flex; flex-direction: column; }
#chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px; background: var(--card); border-bottom: 1px solid var(--line); }
#chips button { flex: none; padding: 4px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); font-weight: 600; }
#chips button.on { background: var(--accent); color: var(--bg); }
#map { flex: 1; min-height: 0; }
.veh { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; font: 700 12px system-ui; border: 2px solid #fff; box-shadow: 0 1px 4px #0006; }
.veh.ok { background: #1a7f4b; } .veh.warn { background: #b26a00; } .veh.bad { background: #c0392b; } .veh.none { background: #5a6b78; }
.veh.sel { outline: 3px solid var(--accent); outline-offset: 1px; }
#view-map { position: relative; }
#trasa { position: absolute; left: 0; right: 0; bottom: 0; max-height: 52%; overflow: auto; z-index: 1000;
  background: var(--card); border-top: 1px solid var(--line); border-radius: 12px 12px 0 0; box-shadow: 0 -2px 12px #0003;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
.trasa-head { display: grid; grid-template-columns: 52px 1fr auto; gap: 4px 10px; align-items: center; margin-bottom: 8px; }
.trasa-head button { background: none; border: 0; font-size: 24px; line-height: 1; color: var(--muted); padding: 0 6px; }
.trasa-chyba { padding: 4px 0 8px; }
.trasa-list { list-style: none; margin: 0; padding: 0; }
.trasa-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.trasa-list li:first-child { font-weight: 600; }
.trasa-list .cas { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
