/* Odjezdy v2: map-first screen.
   The look borrows from what stands at a Czech stop: the red name plate of the
   stop post, boxed line numbers, a ruled timetable, and the vehicle's own LED
   sign. Squared corners and rules instead of floating pills and cards. */
:root, :root[data-theme="light"] {
  --bg: #e9ebee; --surface: #ffffff; --surface-2: #f1f2f4; --text: #16181d; --muted: #5c6470;
  --line: #dfe2e7; --ink: #16181d; --ink-text: #ffffff; --accent: #1b4fa8; --bad: #c4161c; --good: #0b7a4b;
  --sign: #c8102e; --sign-text: #ffffff; --mark: #ffd400;
  --shadow: 0 1px 2px rgba(15,18,24,.18), 0 6px 20px rgba(15,18,24,.14);
  --bus: #1d5fd1; --train: #0b7a4b; --tram: #c4161c; --night: #1b1f27;
  --text-font: Barlow, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --num-font: 'Barlow Condensed', Barlow, system-ui, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #101216; --surface: #17191d; --surface-2: #21252b; --text: #f1f2f4; --muted: #9aa3b0;
  --line: #2e333b; --ink: #f1f2f4; --ink-text: #14171b; --accent: #7aa7ff; --bad: #ff6b6f; --good: #4cd08a;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.45);
  --night: #3a4350;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--text-font); color: var(--text); background: var(--bg); overflow: hidden; }
button { font-family: inherit; color: inherit; }
#map { position: fixed; inset: 0; background: var(--bg); }
.maplibregl-ctrl-attrib { font-size: 11px; }

/* top bar */
#top { position: fixed; z-index: 5; left: 20px; right: 20px; top: 20px; display: flex; gap: 12px; align-items: flex-start; pointer-events: none; }
#top > * { pointer-events: auto; }
.search { position: relative; display: flex; align-items: center; gap: 12px; width: 400px; max-width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: 0; font: 500 16px var(--text-font); color: var(--text); }
.search input::placeholder { color: var(--muted); }
.search:focus-within { border-color: var(--text); box-shadow: var(--shadow), inset 0 -3px 0 var(--mark); }
#results { position: absolute; left: -1px; right: -1px; top: 52px; margin: 0; padding: 0; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); max-height: 50vh; overflow: auto; }
#results li + li { border-top: 1px solid var(--line); }
#results li button { width: 100%; text-align: left; padding: 12px 14px; border: 0; background: transparent; font-size: 15px; font-weight: 600; cursor: pointer; }
#results li button { display: flex; flex-direction: column; gap: 1px; }
#results .r-sub { font-size: 13px; font-weight: 500; color: var(--muted); }
#results .empty { padding: 12px 14px; font-size: 14px; line-height: 20px; }
#results li button:hover, #results li button:focus-visible { background: var(--surface-2); outline: 0; }

/* map switches: one bar, the yellow underline marks what is switched on */
.chips { margin-left: auto; display: flex; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.chip { text-decoration: none; height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; }
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip.on { color: var(--text); box-shadow: inset 0 -3px 0 var(--mark); }
.chip.icon { width: 38px; padding: 0; justify-content: center; color: var(--text); }
.chip:focus-visible, .tab:focus-visible, .close:focus-visible, .dep:focus-visible, .alert:focus-visible, .vc-btn:focus-visible, .back-link:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }
.badge[hidden] { display: none; }
.badge { min-width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; background: var(--bad); color: #fff; font: 700 13px var(--num-font); padding: 0 5px; }

/* left panel */
#panel { position: fixed; z-index: 4; left: 20px; top: 80px; bottom: 20px; width: 400px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.handle { display: none; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tab { flex: 1; height: 46px; border: 0; background: transparent; color: var(--muted); font-size: 15px; font-weight: 600; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); box-shadow: inset 0 -3px 0 var(--mark); }
section { flex: 1; min-height: 0; overflow: auto; }
.stop-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.stop-name { font-size: 22px; font-weight: 700; line-height: 26px; }
.stop-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.stop-sub:empty { display: none; }
/* the stop's name stands on the red plate of the stop post */
#stop-head { background: var(--sign); color: var(--sign-text); border-bottom: 0; padding: 16px 16px 14px; }
#stop-head .stop-name { font-size: 26px; line-height: 30px; letter-spacing: -.005em; }
#stop-head .stop-sub { color: inherit; opacity: .85; }
#stop-wc a { color: inherit; }
#stop-head .vc-btn { background: transparent; border-color: currentColor; color: inherit; }
#stop-head .vc-btn:hover { background: var(--sign-text); color: var(--sign); border-color: var(--sign-text); }
.list { list-style: none; margin: 0; padding: 0; }
.empty { margin: 0; padding: 18px 16px; font-size: 15px; line-height: 22px; color: var(--muted); }

/* departures: a ruled timetable */
.list > li { border-bottom: 1px solid var(--line); }
.dep, .alert { display: flex; align-items: center; gap: 14px; width: 100%; padding: 11px 16px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.dep:hover, .alert:hover, li.open > .dep { background: var(--surface-2); }
.line-badge { flex: none; min-width: 44px; height: 28px; padding: 0 7px; border-radius: 4px; color: #fff; font: 700 18px/1 var(--num-font); letter-spacing: .01em; display: inline-flex; align-items: center; justify-content: center; background: var(--bus); }
.line-badge.train { background: var(--train); } .line-badge.tram { background: var(--tram); } .line-badge.night { background: var(--night); }
.dep-main { flex: 1; min-width: 0; }
.dep-dest { font-size: 16px; font-weight: 600; line-height: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dep-sub { font-size: 13px; color: var(--muted); margin-top: 1px; }
.dep-sub:empty { display: none; }
.dep-when { flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.dep-when b { display: block; font: 700 24px/26px var(--num-font); font-variant-numeric: tabular-nums; }
.dep-when b small { font: 600 14px var(--text-font); color: var(--muted); margin-left: 3px; }
.late { color: var(--bad); font-size: 13px; font-weight: 600; } .ok { color: var(--good); font-size: 13px; font-weight: 600; }
.dep.passed { opacity: .5; }
.dep.static { cursor: default; } .dep.static:hover { background: transparent; }
.panel-links { display: none; }

/* an opened departure shows the sign the vehicle itself carries */
.dep-open { background: var(--surface-2); padding: 0 16px 14px; }
.dep-sign { display: flex; align-items: center; min-height: 68px; padding: 10px 12px; border-radius: 4px; background: #000; overflow: hidden; }
.dep-sign canvas, .dep-sign img { display: block; max-width: 100%; height: auto; image-rendering: pixelated; }
.dep-via { margin: 10px 0 0; font-size: 14px; line-height: 20px; color: var(--muted); }
.dep-actions { display: flex; gap: 8px; margin-top: 10px; }

/* alerts */
.alert { align-items: flex-start; flex-direction: column; gap: 6px; padding: 13px 16px; }
.alert .a-title { font-size: 16px; font-weight: 700; line-height: 21px; }
.alert .a-text { font-size: 14px; color: var(--muted); line-height: 20px; }
.alert .a-lines { display: flex; gap: 5px; flex-wrap: wrap; }
.alert .a-lines .line-badge { min-width: 34px; height: 22px; font-size: 15px; }
.alert .a-meta { font-size: 13px; color: var(--muted); }

/* vehicle card */
#veh-card { position: fixed; z-index: 6; left: 452px; right: 20px; max-width: 520px; bottom: 24px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
#veh-card[hidden] { display: none; }
.vc-main { flex: 1; min-width: 0; }
.vc-dest { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-sub { font-size: 13px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-side { text-align: right; }
.vc-eta { font: 700 22px/24px var(--num-font); font-variant-numeric: tabular-nums; } .vc-delay { font-size: 13px; font-weight: 600; }
.close { width: 36px; height: 36px; border: 0; border-radius: 5px; background: var(--surface-2); font-size: 22px; line-height: 1; cursor: pointer; }
.vc-btn { flex: none; height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); font-size: 14px; font-weight: 600; cursor: pointer; }
.vc-btn:hover { border-color: var(--text); }
.vc-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--ink-text); }
a.vc-btn { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
a.vc-btn[hidden] { display: none; }

/* on a wide screen the panel beside the card already has these buttons */
@media (min-width: 761px) { #veh-card .vc-btn { display: none; } }

/* vehicle detail, circulations */
.head-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.head-actions[hidden], .vizitka[hidden] { display: none; }
.vizitka { margin-top: 12px; padding: 12px 0 0; border-top: 1px solid var(--line); }
.vizitka .vz-title { font-size: 15px; font-weight: 700; line-height: 20px; }
.vizitka .vz-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.vizitka .vz-chip { height: 24px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; }
.vizitka .vz-chip.ok { color: var(--good); } .vizitka .vz-chip.bad { color: var(--bad); }
.vizitka .vz-note { margin: 8px 0 0; font-size: 13px; line-height: 18px; color: var(--muted); }
.day-pick { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 16px; }
.day-pick button { height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); font-size: 14px; font-weight: 600; cursor: pointer; }
.day-pick button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--ink-text); }
.run { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.run-time { flex: none; width: 96px; font: 600 18px/1 var(--num-font); font-variant-numeric: tabular-nums; }

/* alert detail */
.back-link { border: 0; background: transparent; padding: 12px 16px; font-size: 14px; font-weight: 600; color: var(--accent); cursor: pointer; }
#alert-detail { padding: 0 16px 16px; }
#alert-detail h2 { font-size: 20px; line-height: 25px; margin: 4px 0 8px; }
#alert-detail h3 { font-size: 14px; font-weight: 700; color: var(--muted); margin: 18px 0 6px; }
#alert-detail p { margin: 0 0 8px; font-size: 15px; line-height: 22px; }
#alert-detail .tags { display: flex; gap: 6px; flex-wrap: wrap; }
#alert-detail .tag { height: 24px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; }
#alert-detail ul { margin: 0; padding-left: 18px; font-size: 15px; line-height: 22px; }
#alert-detail a { color: var(--accent); word-break: break-word; }
#alert-detail img { max-width: 100%; border-radius: 4px; margin: 6px 0; display: block; }
#alert-detail .dates li { font-variant-numeric: tabular-nums; }

/* map pins drawn in the DOM */
.pin-alert { width: 28px; height: 28px; border-radius: 50%; background: var(--bad); border: 3px solid #fff; color: #fff; font: 700 16px var(--num-font); display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.4); cursor: pointer; }
.pin-stop { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 6px solid var(--sign); box-shadow: 0 0 0 2px #fff; }
.pin-user { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 0 0 7px rgba(29,95,209,.2); }

#led-pop { display: none; }
#credit { position: fixed; z-index: 3; right: 8px; bottom: 6px; font-size: 12px; color: var(--muted); background: color-mix(in srgb, var(--surface) 85%, transparent); padding: 2px 8px; border-radius: 4px; }
#credit a { color: inherit; }

/* Pages of the site (O projektu, Roadmapa, ...) as a notice posted over the map, headed by the same red plate as a stop.
   The body is plain headings, paragraphs and lists: some of it is the text of an old-design page with its design removed. */
#doc { width: 600px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); overflow: hidden; }
#doc[open] { display: flex; flex-direction: column; }
#doc::backdrop { background: rgba(10,12,16,.55); }
.doc-head { flex: none; display: flex; align-items: flex-start; gap: 12px; padding: 16px 12px 14px 20px; background: var(--sign); color: var(--sign-text); }
.doc-titles { flex: 1; min-width: 0; }
.doc-head .stop-name { margin: 0; font-size: 26px; line-height: 30px; letter-spacing: -.005em; }
.doc-head .stop-sub { color: inherit; opacity: .85; }
.doc-head .close { flex: none; background: rgba(255,255,255,.2); color: inherit; }
.doc-head .close:hover { background: rgba(255,255,255,.32); }
.doc-head .close:focus-visible { outline-color: #fff; }
.doc-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 0 20px 20px; }
.doc-body h3 { margin: 22px 0 10px; padding-bottom: 7px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 700; color: var(--muted); }
.doc-body h4 { margin: 16px 0 8px; font-size: 15px; font-weight: 700; }
.doc-body p { margin: 0 0 10px; font-size: 15px; line-height: 22px; }
.doc-body strong { font-weight: 600; }
.doc-body code { font: 500 13px ui-monospace, SFMono-Regular, Menlo, monospace; padding: 1px 4px; border-radius: 3px; background: var(--surface-2); }
.doc-body a { color: var(--accent); word-break: break-word; }
.doc-body a:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.doc-body ul { margin: 0 0 10px; padding-left: 18px; font-size: 15px; line-height: 22px; }
.doc-body li + li { margin-top: 6px; }
.doc-body .empty { padding: 18px 0; }
.doc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.doc-body a.vc-btn { color: var(--text); }
.doc-body a.vc-btn.primary, .vc-btn.primary { background: var(--ink); border-color: var(--ink); color: var(--ink-text); }
.doc-body .tags { list-style: none; display: flex; gap: 6px; flex-wrap: wrap; padding: 0; }
.doc-body .tags li { margin: 0; }
.doc-body .tag { height: 26px; padding: 0 9px; border: 1px solid var(--line); border-radius: 4px; font-size: 14px; font-weight: 600; font-style: normal; display: inline-flex; align-items: center; }
.doc-body .doc-small { margin: 10px 0 0; font-size: 13px; line-height: 19px; color: var(--muted); }
.doc-body .doc-fine { list-style: none; padding: 0; font-size: 13px; line-height: 19px; color: var(--muted); }
/* ruled rows: a name and a line under it */
.doc-body .doc-rows { list-style: none; padding: 0; }
.doc-rows li { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.doc-rows li + li { margin-top: 0; }
.doc-rows b { display: block; font-size: 15px; font-weight: 600; line-height: 20px; }
.doc-rows span { display: block; margin-top: 2px; font-size: 13px; line-height: 18px; color: var(--muted); }
.doc-menu li { padding: 0; }
.doc-body .doc-menu a { display: block; padding: 12px 4px; color: var(--text); text-decoration: none; }
.doc-menu a:hover { background: var(--surface-2); }
/* roadmap: three counts, then every item with its state */
.rm-tally { display: flex; margin: 16px 0 0; border: 1px solid var(--line); border-radius: 4px; }
.rm-tally div { flex: 1; padding: 10px 12px; }
.rm-tally div + div { border-left: 1px solid var(--line); }
.rm-tally b { display: block; font: 700 28px/30px var(--num-font); font-variant-numeric: tabular-nums; }
.rm-tally span { font-size: 13px; font-weight: 600; color: var(--muted); }
.rm-tally [data-s="done"] b { color: var(--good); }
.rm-list b { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.rm-list .tag { flex: none; height: 22px; padding: 0 7px; font-size: 12px; }
.rm-list [data-s="done"] .tag { color: var(--good); border-color: var(--good); }
.rm-list [data-s="active"] .tag { background: var(--mark); border-color: var(--mark); color: #16181d; }
.rm-list [data-s="planned"] .tag { color: var(--muted); }
/* tables and lists of links that come with the text of an old-design page */
.doc-body table { display: block; overflow-x: auto; width: 100%; border-collapse: collapse; margin: 0 0 10px; font-size: 14px; line-height: 20px; }
.doc-body th, .doc-body td { padding: 8px 10px 8px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.doc-body th { font-size: 13px; font-weight: 700; color: var(--muted); }
.doc-body a[data-lat] { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 15px; }
.doc-body a[data-lat]:hover { background: var(--surface-2); }
.doc-body a[data-lat] > span:last-child { flex: none; color: var(--muted); font-size: 13px; }
.doc-body a[data-lat] span span { color: var(--muted); font-size: 13px; }
/* tools in a popup (Zpoždění, Historie mimořádností): a filter row, then a ruled list that runs edge to edge like the panel's */
.tool-bar { display: flex; gap: 8px; margin: 16px 0 10px; }
.tool-input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--text); font: 500 15px var(--text-font); }
.tool-input:focus-visible { outline: 2px solid var(--text); outline-offset: -1px; }
select.tool-input { flex: 0 1 230px; }
.doc-body .tool-modes { padding: 0; }
.doc-body .tool-list { margin: 10px calc(-1 * var(--doc-pad, 20px)) 0; padding: 0; border-top: 1px solid var(--line); }
.doc-body .tool-list > li, .doc-body .tool-list > li + li { margin: 0; }
.tool-list .dep, .tool-list .alert { padding-left: var(--doc-pad, 20px); padding-right: var(--doc-pad, 20px); }
.tool-list .empty { padding: 18px var(--doc-pad, 20px); }
.tool-list .dep-when b { font-size: 20px; line-height: 24px; }
.tool-list .dep-when b.late { color: var(--bad); } .tool-list .dep-when b.ok { color: var(--good); }
.tool-list .dep-open { padding: 4px var(--doc-pad, 20px) 14px; }
.alert.static { cursor: default; } .alert.static:hover { background: transparent; }
.tool-list .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tool-list .tag { height: 22px; padding: 0 7px; font-size: 12px; }
.tool-list .tag.bad { color: var(--bad); border-color: var(--bad); }
.tool-list .a-text { white-space: pre-line; }
/* the day-by-day chart of one connection */
.chart svg { display: block; width: 100%; height: auto; }
.chart text { font: 500 11px var(--text-font); fill: var(--muted); }
.chart text.val { font-weight: 700; fill: var(--text); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--muted); stroke-width: 1; }
.chart .hit { fill: transparent; }
.chart .bar { fill: var(--accent); }
.chart g:hover .bar, .chart g:focus .bar { fill: var(--text); }
.chart g:focus { outline: none; } .chart g:focus-visible .hit { stroke: var(--text); stroke-width: 1; }
.doc-body .chart-read { min-height: 19px; margin: 6px 0 0; font-size: 13px; line-height: 19px; color: var(--muted); }
.chart details { margin-top: 6px; font-size: 13px; color: var(--muted); }
.chart summary { cursor: pointer; }
.doc-body .chart details ul { margin: 6px 0 0; font-size: 13px; line-height: 19px; }
.doc-body .chart details li + li { margin-top: 0; }
/* colour variants, chosen under the list of pages */
.pal-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pal-btn { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); font-size: 14px; font-weight: 600; line-height: 18px; text-align: left; cursor: pointer; }
.pal-btn:hover { border-color: var(--text); }
.pal-btn:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }
.pal-btn[aria-pressed="true"] { border-color: var(--text); box-shadow: inset 0 -3px 0 var(--mark); }
.pal-sw { flex: none; display: flex; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.pal-sw i { width: 13px; height: 24px; }
/* the other pages, under every page */
.doc-body .doc-nav { display: flex; gap: 6px 16px; flex-wrap: wrap; margin: 22px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; }
.doc-body .doc-nav a { color: var(--muted); }

@media (max-width: 760px) {
  /* dvh, not vh: with the browser's bar at the bottom (iOS Brave/Safari) vh is
     the tall viewport and the sheet swallowed the map. --sheet is set by the
     drag in v2.js; without it the sheet opens at a bit under half. */
  #top { left: 10px; right: 10px; top: 10px; flex-direction: column; gap: 8px; }
  .search { width: 100%; }
  /* every switch has to be reachable without scrolling the bar: the link to the old look moves into the sheet */
  .chips { margin-left: 0; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 1 1 auto; justify-content: center; padding: 0 8px; height: 42px; }
  .chip.icon { flex: none; width: 42px; }
  a.chip { display: none; }
  .panel-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 14px 16px 18px; }
  .panel-links > a { height: 44px; padding: 0 14px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 5px; font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none; }
  .panel-links span { flex-basis: 100%; font-size: 13px; line-height: 20px; color: var(--muted); }
  .panel-links span a { color: inherit; }
  #panel { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: var(--sheet, 42dvh); max-height: calc(100dvh - 118px); border-width: 1px 0 0; border-radius: 12px 12px 0 0; touch-action: pan-y; }
  #panel.dragging { transition: none; }
  #panel:not(.dragging) { transition: height .18s ease-out; }
  .handle { display: block; flex: none; width: 100%; height: 26px; margin: 0; background: transparent; position: relative; touch-action: none; cursor: grab; }
  .handle::before { content: ""; position: absolute; left: 50%; top: 11px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--muted); opacity: .6; }
  .tabs { touch-action: none; }
  /* The sheet's Vozidlo tab says everything the card does, and the two together left a strip of map. The card is
     only shown while the sheet is pulled down to its tabs. */
  #veh-card { display: none; left: 10px; right: 10px; bottom: calc(var(--sheet, 42dvh) + 10px); max-width: none; gap: 10px; flex-wrap: nowrap; }
  .sheet-peek #veh-card:not([hidden]) { display: flex; }
  #veh-card .vc-btn { display: none; }
  /* a finger needs more than a mouse pointer does */
  .vc-btn, .day-pick button { height: 44px; padding: 0 16px; }
  .close { width: 44px; height: 44px; }
  .back-link { padding: 14px 16px; }
  #credit { display: none; }
  /* on a phone the notice is a sheet from the bottom edge, like the panel */
  #doc { width: 100vw; max-width: 100vw; max-height: calc(100dvh - 28px); margin: auto 0 0; border-width: 1px 0 0; border-radius: 12px 12px 0 0; }
  .doc-head { padding: 14px 10px 12px 16px; }
  .doc-body { --doc-pad: 16px; padding: 0 16px calc(20px + env(safe-area-inset-bottom)); }
  .tool-bar { flex-wrap: wrap; } .tool-input { height: 44px; font-size: 16px; } select.tool-input { flex: 1 1 100%; }
  .doc-body .doc-nav { gap: 0 18px; }
  .doc-body .doc-nav a { min-height: 44px; display: inline-flex; align-items: center; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
