/* Musze Jechac – interfejs.
   Kierunek: tablica odjazdow. Granatowe tlo, bursztynowy sygnal tylko dla czasu i wybranych elementow,
   kolory linii zarezerwowane dla danych. Jedna rodzina krojow (Overpass, z oznakowania drogowego)
   z cyframi tabelarycznymi w godzinach i liczbach. */

:root {
  color-scheme: dark;
  --bg: #0c1524;
  --panel: #111d30;
  --raised: #182741;
  --sunk: #0a1220;
  --hover: rgba(150, 180, 225, .08);
  --rule: rgba(150, 180, 225, .13);
  --rule-strong: rgba(150, 180, 225, .26);
  --text: #e8edf4;
  --text-2: #b8c5d8;
  --muted: #8494ad;
  --signal: #f5b700;          /* wypelnienia: zegar, kursor osi czasu, wybrane przelaczniki */
  --signal-ink: #1b1300;      /* tekst na bursztynie */
  --signal-text: #f5b700;     /* bursztyn jako kolor tekstu na tle panelu */
  --signal-soft: rgba(245, 183, 0, .14);
  --live: #ff5a4e;
  --good: #3ecf8e;
  --warn: #f5b700;
  --bad: #ff5a4e;
  --early: #6aa8ff;
  --shadow: 0 12px 32px rgba(2, 6, 14, .45), 0 1px 3px rgba(2, 6, 14, .4);
  --halo: rgba(12, 21, 36, .9);

  --font: 'Overpass', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-lg: 14px;
  --r: 9px;
  --r-sm: 6px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  --gap: 12px;
  --panel-w: 372px;
  --peek: 104px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --dock-top: 88px;           /* odleglosc gornej krawedzi osi czasu od dolu ekranu - liczona w app.js */
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e9eef5;
  --panel: #ffffff;
  --raised: #f2f5f9;
  --sunk: #e7ecf3;
  --hover: rgba(20, 32, 51, .05);
  --rule: rgba(20, 32, 51, .11);
  --rule-strong: rgba(20, 32, 51, .22);
  --text: #142033;
  --text-2: #33445f;
  --muted: #5d6c83;
  --signal: #f5b700;
  --signal-ink: #1b1300;
  --signal-text: #8a5b00;
  --signal-soft: rgba(245, 183, 0, .2);
  --live: #e0382c;
  --good: #108a55;
  --warn: #a86a00;
  --bad: #d3352a;
  --early: #2563c9;
  --shadow: 0 10px 28px rgba(20, 32, 51, .14), 0 1px 3px rgba(20, 32, 51, .1);
  --halo: rgba(255, 255, 255, .92);
}

/* ------------------------------------------------ podstawy */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--bg); color: var(--text);
  font: 400 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; }
a { color: var(--signal-text); text-underline-offset: 2px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
small { font-size: 12px; }
em { font-style: normal; }
::selection { background: var(--signal); color: var(--signal-ink); }
input[type="search"]::-webkit-search-cancel-button { filter: grayscale(1); opacity: .6; }

#map { position: fixed; inset: 0; }
.maplibregl-canvas { outline: none; }
/* Trasa: os czasu dnia nic tu nie daje - godzine wybiera sie w formularzu */
body[data-tab="route"] #dock { display: none; }
body.picking .maplibregl-canvas, body.reach-on:not([data-tab="route"]) .maplibregl-canvas { cursor: crosshair; }
.maplibregl-ctrl-bottom-right { bottom: calc(var(--dock-top) + 4px); right: calc(var(--gap) + var(--safe-r) - 10px); transition: bottom .35s var(--ease); }
.maplibregl-ctrl-attrib { font: 11px/1.4 var(--font); background: var(--halo) !important; color: var(--muted); border-radius: var(--r-sm) !important; }
.maplibregl-ctrl-attrib a { color: var(--muted); }
.maplibregl-ctrl-attrib-button { filter: invert(var(--attrib-invert, 1)); }
:root[data-theme="light"] .maplibregl-ctrl-attrib-button { --attrib-invert: 0; }

/* ------------------------------------------------ wspolne kontrolki */
.icon-btn, .pop-close {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r);
  color: var(--muted); transition: background .15s, color .15s;
}
.icon-btn:hover, .pop-close:hover { background: var(--hover); color: var(--text); }
.pop-close svg { width: 16px; height: 16px; }

.link-btn {
  color: var(--signal-text); font-weight: 600; font-size: 13px; padding: 4px 2px; border-radius: var(--r-sm);
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color .15s;
}
.link-btn:hover { text-decoration-color: currentColor; }
.link-btn:disabled { color: var(--muted); opacity: .6; text-decoration: none; }

/* przelacznik segmentowy */
.seg { display: flex; padding: 3px; gap: 2px; border-radius: var(--r); background: var(--sunk); border: 1px solid var(--rule); }
.seg button {
  flex: 1; min-width: 0; padding: 6px 8px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--muted);
  white-space: nowrap; transition: background .15s, color .15s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--raised); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .25), inset 0 0 0 1px var(--rule-strong); }
:root[data-theme="light"] .seg button.on { background: #fff; box-shadow: 0 1px 2px rgba(20, 32, 51, .15), inset 0 0 0 1px var(--rule); }

/* wlacznik z kropka (Automatycznie, Zasieg) */
.toggle {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 11px 6px 9px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--sunk); border: 1px solid var(--rule); white-space: nowrap;
}
.toggle i { width: 26px; height: 15px; border-radius: 999px; background: var(--rule-strong); position: relative; transition: background .2s; flex: none; }
.toggle i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: var(--text); transition: transform .2s var(--ease); }
.toggle.on, .toggle[aria-pressed="true"], body.reach-on #reachToggle { color: var(--text); border-color: var(--rule-strong); }
.toggle.on i, .toggle[aria-pressed="true"] i, body.reach-on #reachToggle i { background: var(--signal); }
.toggle.on i::after, .toggle[aria-pressed="true"] i::after, body.reach-on #reachToggle i::after { transform: translateX(11px); background: var(--signal-ink); }

/* pole wyszukiwania */
.search {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: var(--r);
  background: var(--panel); border: 1px solid var(--rule-strong); color: var(--muted); transition: border-color .15s;
}
.search:focus-within { border-color: var(--signal); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font-size: 14px; }
.search input::placeholder { color: var(--muted); }
.search.small { height: 36px; background: var(--sunk); border-color: var(--rule); }
.search.small input { font-size: 13px; }

.note-text { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.note-text.busy::before { content: ''; display: inline-block; vertical-align: -2px; margin-right: 8px; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--rule-strong); border-top-color: var(--signal); animation: spin .8s linear infinite; }
.day-name { color: var(--muted); font-size: 13px; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--signal); color: var(--signal-ink); font-size: 11.5px; font-weight: 800; }
.gps-tag { display: inline-block; margin-left: 6px; padding: 1px 5px; border-radius: 4px; font-size: 10px; font-weight: 800; letter-spacing: .04em;
  color: var(--live); background: color-mix(in srgb, var(--live) 14%, transparent); vertical-align: 1px; }
.gps-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--live); flex: none; }
.flag { display: inline-flex; width: 18px; height: 12px; border-radius: 2px; overflow: hidden; box-shadow: 0 0 0 1px var(--rule); flex: none; }
.flag svg { width: 100%; height: 100%; stroke: none; }
.spinner { display: inline-block; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--rule-strong); border-top-color: var(--signal); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(290%); } }

/* etykieta linii w kolorze linii */
.bd-line {
  display: inline-block; min-width: 30px; max-width: 150px; height: 22px; padding: 0 6px; border-radius: 5px; text-align: center; vertical-align: middle;
  overflow: hidden; text-overflow: ellipsis; background: var(--c, #64748b); color: #fff; font-size: 12.5px; font-weight: 800; line-height: 23px; white-space: nowrap; flex: none;
  text-shadow: 0 0 2px rgba(0, 0, 0, .35);
}
.bd-line.ink { color: #111827; text-shadow: none; }

/* ================================================================ panel */
.panel {
  position: fixed; z-index: 20; top: calc(var(--gap) + var(--safe-t)); bottom: calc(var(--gap) + var(--safe-b)); left: calc(var(--gap) + var(--safe-l));
  width: var(--panel-w); display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow);
  transition: transform .4s var(--ease);
}
.panel.min { transform: translateX(calc(-100% - var(--gap) - var(--safe-l) - 4px)); }

.panel-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 6px 14px; }
.grabber { display: none; }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 4px; margin: -4px; border-radius: var(--r); text-align: left; }
.brand .logo { border-radius: 7px; flex: none; }
.brand span { font-weight: 800; font-size: 16px; letter-spacing: -.02em; }
.brand:hover span { color: var(--signal-text); }
.mobile-panel-icon { display: none; }

.tabs { display: flex; gap: 2px; padding: 4px 10px 0; border-bottom: 1px solid var(--rule); }
.tabs button {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px 9px;
  color: var(--muted); font-size: 12.5px; font-weight: 600; border-radius: var(--r) var(--r) 0 0; transition: color .15s, background .15s;
}
.tabs button svg { width: 19px; height: 19px; }
.tabs button:hover { color: var(--text); background: var(--hover); }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ''; position: absolute; left: 18%; right: 18%; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--signal); }

.panel-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 14px 18px; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
.tab-page { display: flex; flex-direction: column; gap: 18px; }

.block { display: flex; flex-direction: column; gap: 10px; }
.block + .block { padding-top: 18px; border-top: 1px solid var(--rule); }
.block h3 { font-size: 14px; color: var(--text); }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.block-hint { color: var(--muted); font-size: 11.5px; text-align: right; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid2 > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.grid2 .seg button { padding: 6px 4px; }

.panel-foot { padding: 10px 12px 12px; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 8px; }
.stats-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: var(--r); text-align: left;
  background: var(--raised); border: 1px solid var(--rule); transition: border-color .15s, background .15s;
}
.stats-btn:hover { border-color: var(--signal); }
.stats-btn svg { width: 22px; height: 22px; color: var(--signal-text); }
.stats-btn span { display: flex; flex-direction: column; line-height: 1.25; }
.stats-btn b { font-size: 14px; }
.stats-btn small { color: var(--muted); }
.foot-row { display: flex; align-items: center; gap: 4px; }
.foot-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: var(--r-sm); color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.foot-btn svg { width: 15px; height: 15px; }
.foot-btn:hover { background: var(--hover); color: var(--text); }
.foot-credit { margin-left: auto; color: var(--muted); font-size: 11.5px; text-decoration: none; padding: 6px 4px; }
.foot-credit:hover { color: var(--text); }

.panel-reveal {
  position: fixed; z-index: 19; left: calc(var(--safe-l)); top: 50%; transform: translateY(-50%);
  width: 22px; height: 64px; display: grid; place-items: center; border-radius: 0 var(--r) var(--r) 0;
  background: var(--panel); border: solid var(--rule); border-width: 1px 1px 1px 0; color: var(--muted); box-shadow: var(--shadow);
}
.panel-reveal:hover { color: var(--text); }

/* ------------------------------------------------ zakladka Trasa */
.plan-box { position: relative; display: flex; flex-direction: column; gap: 6px; }
.plan-field { display: flex; align-items: center; gap: 4px; height: 42px; padding: 0 4px 0 12px; border-radius: var(--r); background: var(--sunk); border: 1px solid var(--rule); }
.plan-field:focus-within { border-color: var(--signal); }
.plan-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-right: 6px; }
.plan-dot.from { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.plan-dot.to { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .2); }
.plan-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 14px; color: var(--text); }
.plan-field input::placeholder { color: var(--muted); }
.plan-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 7px; color: var(--muted); flex: none; }
.plan-btn svg { width: 16px; height: 16px; }
.plan-btn:hover { color: var(--text); background: var(--hover); }
.plan-btn.on { color: var(--signal-ink); background: var(--signal); }

.plan-sug {
  position: absolute; z-index: 30; left: 14px; right: 14px; max-height: 320px; overflow-y: auto; padding: 4px;
  background: var(--panel); border: 1px solid var(--rule-strong); border-radius: var(--r); box-shadow: var(--shadow);
}
.city-float .plan-sug { position: static; margin-top: 6px; }
.plan-sug button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 6px; text-align: left; }
.plan-sug button:hover, .plan-sug button.on { background: var(--hover); }
.plan-sug button > b { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.plan-sug button span { display: flex; flex-direction: column; min-width: 0; }
.plan-sug button small { color: var(--muted); }
.city-float .plan-sug button { flex-direction: column; align-items: flex-start; gap: 0; }
.plan-sug i { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.plan-sug .sug-stop { background: var(--signal); }
.plan-sug .note-text { padding: 8px 10px; }

.plan-results { display: flex; flex-direction: column; gap: 8px; }
.jcard { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 11px 12px; border-radius: var(--r); text-align: left;
  background: var(--sunk); border: 1px solid var(--rule); transition: border-color .15s; }
.jcard:hover { border-color: var(--rule-strong); }
.jcard.on { border-color: var(--signal); background: var(--raised); }
.jc-walk { font-size: 12px; color: var(--text-2); }
.jc-live { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px; font-size: 11px; font-weight: 700; color: var(--live);
  background: color-mix(in srgb, var(--live) 14%, transparent); }
/* kroki trasy: os z kropkami (bez belki z boku) */
.jsteps { list-style: none; margin: 2px 0 0; padding: 4px 0; display: flex; flex-direction: column; }
.jsteps li { display: grid; grid-template-columns: 44px 14px 1fr; gap: 0 8px; align-items: start; padding: 5px 0; position: relative; }
.jsteps li::before { content: ''; grid-column: 2; grid-row: 1; width: 10px; height: 10px; margin: 4px 2px 0; border-radius: 50%; background: var(--c, var(--muted)); }
.jsteps li.st-walk::before { background: none; box-shadow: inset 0 0 0 2px var(--muted); }
.jsteps li.st-end::before { background: #ef4444; }
.jsteps time { grid-column: 1; font-weight: 700; font-size: 13px; }
.jsteps li > div { grid-column: 3; font-size: 13px; min-width: 0; }
.jsteps li > div small { display: block; color: var(--muted); margin-top: 2px; }
.jactions { display: flex; justify-content: flex-end; align-items: center; gap: 6px; flex-wrap: wrap; }

/* opcje wyszukiwania */
.plan-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.plan-opts .seg { flex: 1 1 200px; }
.seg-sm button { padding: 5px 6px; font-size: 12.5px; }
#planTime { height: 34px; padding: 0 8px; border-radius: var(--r); background: var(--sunk); border: 1px solid var(--rule); color: var(--text); font: inherit; font-weight: 700; }
.plan-sel { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 4px 0 10px; border-radius: var(--r); background: var(--sunk);
  border: 1px solid var(--rule); font-size: 12px; color: var(--muted); flex: 1 1 140px; min-width: 0; }
.plan-sel select { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: inherit; font-weight: 700; font-size: 12.5px; outline: 0; }
.plan-sel select option { background: var(--raised); color: var(--text); }

/* wyniki: naglowek, etykiety, pasek czasu, fakty */
.jhead { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; color: var(--text-2); padding: 2px 2px 0; }
.jhead-when { color: var(--muted); font-weight: 600; }
.jc-walk { display: inline-flex; align-items: center; gap: 1px; }
.jc-walk svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.jc-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12px; color: var(--text-2); font-weight: 600; }
/* ikona i tekst w jednej linii, wysrodkowane w pionie */
.jc-facts > span { display: inline-flex; align-items: center; gap: 4px; line-height: 1.2; }
.jc-facts .ico { flex: none; }
.jc-dis { color: #f59e0b; font-weight: 700; }
.jc-cancel { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 800; color: #fff; background: #dc2626; text-transform: uppercase; }
.jskel { height: 92px; border-radius: var(--r); background: linear-gradient(90deg, var(--sunk) 30%, var(--hover) 50%, var(--sunk) 70%); background-size: 300% 100%;
  animation: skel 1.2s linear infinite; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* kroki: czekanie, ceny, utrudnienia */
.jsteps li.st-wait::before { background: none; }
.jsteps li.st-wait > div { font-size: 12px; color: var(--muted); font-style: italic; }
.st-tix { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 5px; }
.st-fare { font-size: 12px; font-weight: 700; color: #16a34a; }
:root[data-theme="dark"] .st-fare { color: #4ade80; }
.st-fare small { display: inline !important; font-weight: 600; }
.st-buy { font-size: 12px; font-weight: 700; color: var(--signal-text); text-decoration: none; padding: 3px 8px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--signal) 45%, transparent); }
.st-buy:hover { background: color-mix(in srgb, var(--signal) 12%, transparent); }
.st-dis { margin: 5px 0 0; padding: 6px 8px; border-radius: 6px; font-size: 12px; line-height: 1.35; color: var(--text);
  background: rgba(245, 158, 11, .12); }
.jtotal { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 10px 12px; border-radius: var(--r); background: var(--sunk); border: 1px dashed var(--rule-strong); }
.jtotal > span { font-size: 12px; font-weight: 700; color: var(--text-2); }
.jtotal b { font-size: 17px; font-weight: 800; color: #16a34a; margin-left: auto; }
:root[data-theme="dark"] .jtotal b { color: #4ade80; }
.jtotal small { flex-basis: 100%; font-size: 11.5px; color: var(--muted); }
.pill-btn { padding: 7px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--text); background: var(--sunk); border: 1px solid var(--rule); }
.pill-btn:hover { border-color: var(--rule-strong); background: var(--hover); }

/* ostrzezenia IMGW */
.jalerts { display: flex; flex-direction: column; gap: 6px; }
.jalert { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: var(--r); font-size: 12.5px; background: rgba(234, 179, 8, .12); }
.jalert.lv2 { background: rgba(249, 115, 22, .13); }
.jalert.lv3 { background: rgba(220, 38, 38, .13); }
.jalert small { color: var(--muted); }
.jsrc { margin: 0; font-size: 10.5px; color: var(--muted); }

.legend { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.legend > div { display: flex; align-items: center; gap: 8px; }
.legend i { width: 14px; height: 10px; border-radius: 3px; flex: none; }
.legend em { margin-left: auto; color: var(--muted); }
.legend .day-name { margin-top: 4px; font-size: 12px; }
.only-travel, .only-live { display: none; }
body.reach-on .only-travel { display: flex; flex-direction: column; gap: 10px; }
body.is-live .only-live { display: block; }

/* ------------------------------------------------ zakladka Widok */
.kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.kind {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px 10px; border-radius: var(--r);
  background: var(--sunk); border: 1px solid var(--rule); color: var(--muted); font-size: 13px; font-weight: 600; transition: border-color .15s, color .15s;
}
.kind:hover { color: var(--text); }
.kind.on { color: var(--text); border-color: var(--signal); background: var(--raised); }
.kind i { width: 30px; height: 14px; position: relative; }
.k-veh::before { content: ''; position: absolute; inset: 5px 8px 5px 0; border-radius: 2px; background: linear-gradient(90deg, transparent, currentColor); opacity: .55; }
.k-veh::after { content: ''; position: absolute; right: 2px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.k-net::before { content: ''; position: absolute; left: 0; right: 0; top: 6px; height: 2px; border-radius: 1px; background: currentColor; transform: skewY(-12deg); }
.k-net::after { content: ''; position: absolute; left: 6px; right: 4px; top: 9px; height: 2px; border-radius: 1px; background: currentColor; opacity: .55; transform: skewY(10deg); }
.k-stop::before { content: ''; position: absolute; left: 9px; top: 1px; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 2.5px currentColor; }
.kind.on i { color: var(--signal-text); }

.cats { display: flex; flex-direction: column; gap: 2px; }
.cat { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: var(--r-sm); font-size: 13.5px; text-align: left; transition: background .15s, opacity .15s; }
.cat:hover { background: var(--hover); }
.cat i { width: 22px; height: 4px; border-radius: 2px; flex: none; }
.cat span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat em { color: var(--muted); font-size: 12.5px; }
.cat.off { opacity: .4; }
.cat.off span { text-decoration: line-through; text-decoration-color: var(--muted); }
#langNote { margin-top: -8px; font-size: 12px; }

/* ------------------------------------------------ zakladka Warstwy */
/* co wczytane: najwyzej ok. jedna trzecia panelu, dalej przewija sie w srodku */
.view-status { display: flex; flex-direction: column; gap: 10px; max-height: min(260px, 34vh); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
.vs-grp { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--r); background: var(--sunk); border: 1px solid var(--rule); }
.vs-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.vs-h svg { width: 15px; height: 15px; align-self: center; color: var(--muted); }
.vs-h b { font-size: 14px; }
.vs-h small { color: var(--muted); }
.view-status .lyr { padding: 4px 0; }
.view-status .lyr .t { font-size: 13px; font-weight: 600; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat:empty { display: none; }
.st { font-size: 12px; color: var(--muted); }
.st.ok { color: var(--text-2); }
.st.err { color: var(--bad); }
.bar { height: 3px; border-radius: 2px; background: var(--rule); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--signal); transition: width .3s; }
.bar.indet i { width: 35% !important; animation: indet 1.2s ease-in-out infinite; }

.layers-tools { display: flex; align-items: center; gap: 10px; }
.layers-tools .search { flex: 1; }
.groups { display: flex; flex-direction: column; gap: 4px; }
.country { border-radius: var(--r); }
.country-h { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; border-radius: var(--r); text-align: left; }
.country-h:hover { background: var(--hover); }
.country-h .t { display: block; font-weight: 700; font-size: 14px; }
.country-h .s { display: block; color: var(--muted); font-size: 12px; }
.grow { flex: 1; min-width: 0; }
.chev { width: 16px; height: 16px; color: var(--muted); transition: transform .2s var(--ease); }
.open > .country-h .chev, .open > .grp-top .chev { transform: rotate(90deg); }
.country-b { display: none; flex-direction: column; gap: 2px; padding: 0 0 6px 10px; }
.country.open > .country-b { display: flex; }
.grp-top { display: flex; align-items: center; gap: 4px; }
.grp-h { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 7px 8px; border-radius: var(--r); text-align: left; }
.grp-h:hover { background: var(--hover); }
.grp-h .mono { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; flex: none; font-size: 11px; font-weight: 800;
  text-transform: uppercase; background: var(--sunk); color: var(--text-2); border: 1px solid var(--rule); }
.grp-h .mono svg { width: 15px; height: 15px; }
.grp.act .grp-h .mono { background: var(--signal-soft); border-color: transparent; color: var(--signal-text); }
.grp-h .t { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-h .s { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-b { display: none; flex-direction: column; gap: 2px; padding: 2px 0 8px 38px; }
.grp.open > .grp-b { display: flex; }
.check { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; flex: none; border: 1.5px solid var(--rule-strong); transition: background .15s, border-color .15s; }
.check svg { width: 12px; height: 12px; stroke-width: 3; opacity: 0; color: var(--signal-ink); }
.grp-all { padding: 6px; border-radius: var(--r-sm); }
.grp-all.on .check, .grp-all.some .check, .lyr.on .check { background: var(--signal); border-color: var(--signal); }
.grp-all.on .check svg, .grp-all.some .check svg, .lyr.on .check svg { opacity: 1; }
.lyr-row { display: flex; align-items: flex-start; gap: 4px; }
.groups .lyr { display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 0; padding: 7px 8px; border-radius: var(--r-sm); text-align: left; }
.groups .lyr:hover:not(:disabled) { background: var(--hover); }
.groups .lyr .check { margin-top: 1px; }
.groups .lyr .t { font-size: 13px; font-weight: 600; }
.groups .lyr .s { color: var(--muted); font-size: 12px; line-height: 1.4; }
.groups.locked .check { opacity: .55; }
.groups.locked .grp-all, .groups.locked .lyr { cursor: not-allowed; }
.swatch { position: relative; width: 26px; height: 26px; margin-top: 4px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: none; }
.swatch::before { content: ''; width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--rule-strong);
  background: conic-gradient(#f5b700, #ff5a4e, #a855f7, #3b82f6, #22c55e, #f5b700); opacity: .55; }
.swatch.set::before { background: var(--c); opacity: 1; box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--c); }
.swatch:hover::before { opacity: 1; }
.swatch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.swatch-reset { width: 22px; height: 22px; margin-top: 6px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.swatch-reset svg { width: 12px; height: 12px; }
.swatch-reset:hover { color: var(--text); background: var(--hover); }
.sources { margin: 0; padding-top: 14px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 12px; line-height: 1.55; }
.sources:empty { display: none; }
.sources b { color: var(--text-2); }
.sources a { color: var(--text-2); }

/* ------------------------------------------------ zakladka Dane */
.data-seg { position: sticky; top: -14px; z-index: 2; box-shadow: 0 0 0 6px var(--panel); }
#dataBody { display: flex; flex-direction: column; gap: 12px; }
.dcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; }
.dcard { display: flex; flex-direction: column; padding: 10px; border-radius: var(--r); background: var(--sunk); border: 1px solid var(--rule); min-width: 0; }
.dcard b { font-size: 20px; font-weight: 800; line-height: 1.1; }
.dcard span { font-size: 12.5px; color: var(--text-2); }
.dcard small { color: var(--muted); font-size: 11.5px; }
.dhist { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; height: 92px; align-items: end; }
.dhist > div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 2px; font-size: 11px; color: var(--muted); }
.dhist i { width: 100%; border-radius: 3px 3px 0 0; min-height: 2px; }
.dhist b { color: var(--text-2); font-size: 11.5px; }
.early { color: var(--early); } .ok { color: var(--good); } .late { color: var(--bad); }
.dhist i.early, .st-hist i.early { background: var(--early); }
.dhist i.ok, .st-hist i.ok { background: var(--good); }
.dhist i.late, .st-hist i.late { background: var(--bad); }
.dworst { font-size: 12.5px; color: var(--muted); }
.dworst > span { display: block; margin-bottom: 4px; }
.dworst-row { display: flex; align-items: center; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.dworst-row::-webkit-scrollbar { display: none; }
.dworst button { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px 2px 2px; border-radius: var(--r-sm); background: var(--sunk); border: 1px solid var(--rule); white-space: nowrap; }
.dworst em { font-weight: 700; font-size: 12px; }
.dtable-wrap { overflow-x: auto; margin: 0 -4px; }
.dtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.dtable th { position: sticky; top: 28px; background: var(--panel); text-align: left; padding: 6px 4px; color: var(--muted); font-weight: 600; font-size: 12px;
  border-bottom: 1px solid var(--rule); cursor: pointer; white-space: nowrap; user-select: none; }
.dtable th:hover { color: var(--text); }
.dtable th.asc::after { content: ' ↑'; color: var(--signal-text); }
.dtable th.desc::after { content: ' ↓'; color: var(--signal-text); }
.dtable td { padding: 6px 4px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.dtable tbody tr { cursor: pointer; }
.dtable tbody tr:hover td { background: var(--hover); }
.dtable td em { font-weight: 700; }
.dtable td small { color: var(--muted); }
.bd-more { align-self: center; }

/* ================================================================ mapa: wyszukiwarka, zegar, przyciski */
.city-float { position: fixed; z-index: 12; top: calc(var(--gap) + var(--safe-t)); left: calc(var(--gap) * 2 + var(--safe-l) + var(--panel-w));
  width: 300px; display: flex; flex-direction: column; gap: 6px; transition: left .4s var(--ease); }
body.panel-hidden .city-float { left: calc(var(--gap) + var(--safe-l) + 18px); }
.city-float .search { box-shadow: var(--shadow); border-color: var(--rule); }
.view-chip {
  align-self: flex-start; max-width: 100%; display: flex; flex-direction: column; gap: 4px; padding: 6px 11px; border-radius: var(--r);
  background: var(--panel); border: 1px solid var(--rule); box-shadow: var(--shadow); font-size: 12.5px; color: var(--text-2); text-align: left;
}
.view-chip:hover { border-color: var(--rule-strong); color: var(--text); }
.vc-names { display: flex; align-items: center; gap: 7px; font-weight: 600; min-width: 0; }
.vc-names i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex: none; }
.vc-names em { color: var(--muted); font-weight: 500; }
.vc-load { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.view-chip.loading .vc-names i { background: var(--signal); }

.hud-right { position: fixed; z-index: 12; top: calc(var(--gap) + var(--safe-t)); right: calc(var(--gap) + var(--safe-r));
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.hud-right > * { pointer-events: auto; }

/* zegar: jedyny glosny element interfejsu - jak godzina na tablicy odjazdow */
.clock-card {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding: 10px 14px 9px; min-width: 196px;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow);
}
.clock { font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -.02em; color: var(--signal-text); padding-top: 4px; }
:root:not([data-theme="light"]) .clock { text-shadow: 0 0 18px rgba(245, 183, 0, .25); }
.clock-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-size: 12.5px; color: var(--text-2); text-align: right; }
.clock-meta .live b { color: var(--text); font-weight: 800; }
.live-info { display: flex; flex-direction: column; align-items: flex-end; color: var(--muted); font-size: 12px; }
.live-info small { font-size: 11px; }
.mode-live { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 600; }
.mode-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: blink 1.8s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }

.map-btns { display: flex; flex-direction: column; gap: 6px; }
.map-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r);
  background: var(--panel); border: 1px solid var(--rule); box-shadow: var(--shadow); color: var(--text-2); }
.map-btn:hover { color: var(--text); border-color: var(--rule-strong); }
.map-btn:disabled { opacity: .5; }
.compass svg { transition: transform .1s; }
.compass .n { fill: var(--live); stroke: none; }
.compass .s { fill: var(--muted); stroke: none; }
.me-marker { width: 16px; height: 16px; border-radius: 50%; background: #3d8bff; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(61, 139, 255, .25), 0 2px 6px rgba(0, 0, 0, .4); }

/* ------------------------------------------------ tablica odjazdow i rozklad kursu */
.board {
  position: fixed; z-index: 14; right: calc(var(--gap) + var(--safe-r)); bottom: calc(var(--dock-top) + 10px);
  width: 372px; max-height: calc(100vh - var(--dock-top) - 190px); min-height: 160px; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden;
  transition: bottom .35s var(--ease);
}
.bd-head { display: flex; align-items: flex-start; gap: 8px; padding: 12px 8px 10px 14px; border-bottom: 1px solid var(--rule); }
.bd-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bd-head b { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.bd-head small { color: var(--muted); }
.bd-mode { display: flex; gap: 2px; margin: 10px 14px 0; padding: 3px; border-radius: var(--r); background: var(--sunk); border: 1px solid var(--rule); }
.bd-mode button { flex: 1; padding: 5px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.bd-mode button.on { background: var(--raised); color: var(--text); box-shadow: inset 0 0 0 1px var(--rule-strong); }
.bd-lines { display: flex; flex: none; gap: 4px; padding: 8px 14px 2px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.bd-lines::-webkit-scrollbar { display: none; }
.bd-lines button { flex: none; padding: 3px 8px; border-radius: var(--r-sm); font-size: 12px; font-weight: 700; border: 1px solid var(--rule); color: var(--text-2); white-space: nowrap; }
.bd-lines button.on { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.bd-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 6px 4px; }
.bd-row { display: grid; grid-template-columns: 52px max-content minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 8px; border-radius: var(--r-sm); cursor: pointer; font-size: 13.5px; }
.bd-row:hover { background: var(--hover); }
.bd-time { font-weight: 700; display: flex; flex-direction: column; line-height: 1.15; }
.bd-time s { color: var(--muted); font-weight: 500; font-size: 11px; }
.bd-dest { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-in { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.bd-in em { font-weight: 800; font-size: 12px; }
.bd-row.rt .bd-time { color: var(--text); }
.bd-note { padding: 8px 14px 12px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.board .bd-more { margin: 4px auto 8px; }
/* rozklad kursu (kropka zamiast etykiety linii); tablica odjazdow tez ma klase tp-row */
.tp-row:has(.tp-dot) { grid-template-columns: 52px 14px minmax(0, 1fr) auto; }
.tp-dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 2.5px var(--c); background: var(--panel); justify-self: center; }
/* os trasy: odcinek linii przez cala wysokosc wiersza, kropka na srodku */
.tp-rail { position: relative; align-self: stretch; margin: -7px 0; display: grid; place-items: center; }
.tp-rail::after { content: ''; position: absolute; z-index: 0; left: 50%; width: 3px; transform: translateX(-50%); top: 0; bottom: 0; background: var(--c); opacity: .85; }
.tp-rail.done::after { background: var(--muted); opacity: .5; }
.tp-rail.half::after { background: linear-gradient(var(--muted) 50%, var(--c) 50%); opacity: .8; }
.tp-rail.first::after { top: 50%; }
.tp-rail.last::after { bottom: 50%; }
.tp-rail.first.last::after { display: none; }
.tp-rail .tp-dot { position: relative; z-index: 1; }
.tp-past { opacity: .5; }
.tp-past .tp-dot { box-shadow: inset 0 0 0 2.5px var(--muted); }
.tp-next { background: var(--signal-soft); }
.tp-next .tp-dot { background: var(--c); width: 12px; height: 12px; box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px var(--c); }
.tp-row .bd-time.tp-late { color: var(--bad); }
.tp-row .bd-time s { color: var(--muted); }
.tp-prog { padding: 10px 14px; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 6px; }
.tp-bar { height: 6px; border-radius: 999px; background: var(--sunk); overflow: hidden; }
.tp-bar i { display: block; height: 100%; border-radius: inherit; background: var(--c); transition: width .4s var(--ease); }
.tp-facts { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.tp-facts span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text); }
.tp-facts span:last-child { white-space: nowrap; }
.tp-fold { display: flex; align-items: center; gap: 6px; width: calc(100% - 4px); margin: 0 2px 4px; padding: 6px 10px; border-radius: var(--r-sm); background: var(--sunk); border: 1px dashed var(--rule-strong); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.tp-fold:hover { color: var(--text); background: var(--hover); }
.tp-fold .ico-chev { width: 14px; height: 14px; transform: rotate(-90deg); transition: transform .2s; }

/* ================================================================ os czasu */
.dock {
  position: fixed; z-index: 15; bottom: calc(var(--gap) + var(--safe-b)); right: calc(var(--gap) + var(--safe-r));
  left: calc(var(--gap) * 2 + var(--safe-l) + var(--panel-w));
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 9px 12px;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow);
  transition: transform .4s var(--ease), left .4s var(--ease);
}
body.panel-hidden .dock { left: calc(var(--gap) + var(--safe-l) + 18px); }
.dock.min { transform: translateY(calc(100% + var(--gap) + var(--safe-b) + 2px)); }
.dock-tab {
  position: absolute; left: 18px; top: -27px; height: 27px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px;
  border-radius: var(--r) var(--r) 0 0; background: var(--panel); border: 1px solid var(--rule); border-bottom: 0; color: var(--muted); font-size: 12px; font-weight: 600;
}
.dock-tab:hover { color: var(--text); }
.dock-tab svg { width: 14px; height: 14px; transition: transform .3s var(--ease); }
.dock-tab .lbl { display: none; }
.dock.min .dock-tab svg { transform: rotate(180deg); }
.dock.min .dock-tab .lbl { display: inline; }

.when { display: flex; align-items: center; gap: 8px; }
.mode-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 10px; }
.mode-seg button i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.mode-seg button.on i { background: var(--live); }
.date-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 11px; border-radius: var(--r);
  background: var(--sunk); border: 1px solid var(--rule); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.date-chip:hover { border-color: var(--rule-strong); }
.date-chip svg { width: 15px; height: 15px; color: var(--muted); }
.date-chip.on { border-color: var(--signal); color: var(--signal-text); }
.date-chip.on svg { color: currentColor; }
.date-chip input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.play { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--signal); color: var(--signal-ink); flex: none; }
.play svg { fill: currentColor; stroke: none; width: 16px; height: 16px; }
.play:hover { filter: brightness(1.06); }
.play .i-play, .paused .play .i-pause { display: none; }
.paused .play .i-play { display: block; }

.timeline { position: relative; height: 50px; cursor: pointer; touch-action: none; border-radius: var(--r-sm); min-width: 0; }
.timeline:focus-visible { outline-offset: 4px; }
#hist { position: absolute; left: 0; right: 0; top: 0; height: 34px; width: 100%; border-radius: 4px; background: var(--sunk); }
.cursor { position: absolute; left: 0; top: -3px; height: 40px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--signal); will-change: transform; pointer-events: none; }
.cursor::before { content: ''; position: absolute; left: -5px; top: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 3px var(--panel); transition: transform .15s; }
.timeline.drag .cursor::before { transform: scale(1.3); }
.ticks { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); pointer-events: none; }
.ticks span { width: 0; display: flex; justify-content: center; }
.ticks span:first-child { justify-content: flex-start; }
.ticks span:last-child { justify-content: flex-end; }

.speed { position: relative; }
.speed-val { display: flex; flex-direction: column; align-items: flex-end; min-width: 76px; padding: 4px 8px; border-radius: var(--r); line-height: 1.15; text-align: right; }
.speed-val:hover, .speed.open .speed-val { background: var(--hover); }
.speed-val b { font-size: 15px; font-weight: 800; }
.speed-val small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.speed-slider { display: none; position: absolute; right: 0; bottom: calc(100% + 14px); width: 280px; padding: 12px 14px 10px;
  background: var(--panel); border: 1px solid var(--rule-strong); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.speed.open .speed-slider { display: block; }
.speed-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.speed-head b { color: var(--text); }
.speed-scale { position: relative; height: 16px; margin-top: 4px; font-size: 11px; color: var(--muted); }
.speed-scale span { position: absolute; left: calc(var(--at) * 100%); transform: translateX(calc(var(--at) * -100%)); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: none; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--signal) var(--p, 50%), var(--rule-strong) var(--p, 50%)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--rule-strong); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--signal); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: var(--signal); border: 3px solid var(--panel); box-shadow: 0 0 0 1px var(--signal); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--signal); border: 3px solid var(--panel); }

/* na zywo: os czasu stoi na biezacej chwili, data i tempo nie maja znaczenia */
body.is-live .date-chip, body.is-live .play, body.is-live .speed { display: none; }
body.is-live .timeline { cursor: default; }
body.is-live .cursor, body.is-live .cursor::before { background: var(--live); }

/* ================================================================ dymek, komunikaty */
#tooltip {
  position: fixed; z-index: 40; left: 0; top: 0; max-width: 320px; padding: 10px 12px; pointer-events: none;
  background: var(--panel); border: 1px solid var(--rule-strong); border-radius: var(--r); box-shadow: var(--shadow); font-size: 13px;
}
#tooltip > b { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 800; }
#tooltip > b > i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.tt-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tt-flags { display: inline-flex; gap: 2px; font-size: 12px; }
.tt-dest { margin-top: 2px; font-weight: 600; color: var(--text-2); }
.tt-sub { color: var(--muted); font-size: 12px; }
.tt-grid { display: grid; gap: 2px; margin: 8px 0 0; }
.tt-row { display: flex; justify-content: space-between; gap: 14px; font-size: 12.5px; }
.tt-row span { color: var(--muted); }
.tt-row em { text-align: right; }
.tt-row small { color: var(--muted); }
.tt-progress { height: 3px; margin: 8px 0 4px; border-radius: 2px; background: var(--rule); overflow: hidden; }
.tt-progress i { display: block; height: 100%; }
.tt-delay { margin-top: 4px; font-weight: 800; font-size: 13px; }
.tt-delay.good { color: var(--good); } .tt-delay.bad { color: var(--bad); } .tt-delay.warn { color: var(--early); }
.tt-lines { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 8px; }
.tt-lines span { padding: 1px 5px; border-radius: 4px; background: var(--sunk); border: 1px solid var(--rule); font-size: 11.5px; font-weight: 700; }
.tt-src { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 11.5px; }

#toast {
  position: fixed; z-index: 60; left: 50%; top: calc(var(--gap) + var(--safe-t) + 4px); transform: translateX(-50%); max-width: min(480px, calc(100vw - 32px));
  padding: 10px 16px; border-radius: var(--r); background: var(--text); color: var(--bg); font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow);
  animation: toastIn .25s var(--ease);
}
#toast.ok::before { content: '✓ '; color: var(--good); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -8px); } }
.empty-hint {
  position: fixed; z-index: 11; left: calc(var(--gap) * 2 + var(--panel-w) + (100vw - var(--panel-w) - var(--gap) * 3) / 2); top: 50%; transform: translate(-50%, -50%);
  max-width: 340px; padding: 12px 16px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--rule); box-shadow: var(--shadow);
  color: var(--text-2); font-size: 13.5px; text-align: center; pointer-events: none;
}
body.panel-hidden .empty-hint { left: 50%; }

/* ================================================================ okna: O projekcie, ekran powitalny */
dialog { padding: 0; border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(6, 11, 20, .62); }
:root[data-theme="light"] dialog::backdrop { background: rgba(20, 32, 51, .35); }
#about { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 40px); }
#about[open] { display: flex; flex-direction: column; }
.about-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 12px 20px; border-bottom: 1px solid var(--rule); }
.about-head h2 { font-size: 18px; }
.about-body { overflow-y: auto; padding: 8px 20px 20px; font-size: 14px; line-height: 1.6; max-width: 72ch; }
.about-body h3 { margin: 22px 0 8px; font-size: 15px; }
.about-body ul { padding-left: 18px; margin: 0; }
.about-body .note { color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; max-height: 300px; border: 1px solid var(--rule); border-radius: var(--r); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 12.5px; line-height: 1.4; }
.table-wrap th { position: sticky; top: 0; background: var(--raised); text-align: left; padding: 7px 10px; color: var(--muted); font-weight: 600; }
.table-wrap td { padding: 6px 10px; border-top: 1px solid var(--rule); vertical-align: top; }

#welcome { width: min(500px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; }
.welcome-card { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px 18px; }
.welcome-brand { display: flex; align-items: flex-start; gap: 14px; }
.welcome-brand img { border-radius: 9px; flex: none; }
.welcome-brand > div { flex: 1; }
.welcome-brand h2 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.welcome-brand p { margin: 2px 0 0; color: var(--text-2); font-size: 14px; }
.welcome-x { margin: -6px -8px 0 0; }
.welcome-locate {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border-radius: var(--r); text-align: left;
  background: var(--signal); color: var(--signal-ink); transition: filter .15s;
}
.welcome-locate:hover { filter: brightness(1.05); }
.welcome-locate:disabled { opacity: .7; }
.welcome-locate .pulse { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(27, 19, 0, .12); flex: none; }
.welcome-locate span:last-child { display: flex; flex-direction: column; }
.welcome-locate b { font-size: 15px; font-weight: 800; }
.welcome-locate small { opacity: .75; }
.welcome-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.welcome-or::before, .welcome-or::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
#welcome .search { background: var(--sunk); }
.welcome-cities { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wc-head { width: 100%; color: var(--muted); font-size: 12.5px; }
.welcome-cities button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--rule); font-size: 13.5px; font-weight: 600; }
.welcome-cities button:hover { border-color: var(--signal); }
.welcome-cities.list { flex-direction: column; align-items: stretch; gap: 2px; }
.welcome-cities.list button { border: 0; border-radius: var(--r-sm); padding: 8px 10px; justify-content: flex-start; }
.welcome-cities.list button:hover { background: var(--hover); }
.welcome-cities.list small { margin-left: auto; color: var(--muted); font-weight: 400; }
.welcome-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.welcome-modes button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: var(--r); border: 1px solid var(--rule); background: var(--sunk); font-size: 13px; color: var(--text-2); }
.welcome-modes button.on { border-color: var(--signal); color: var(--text); background: var(--raised); }
.welcome-modes i { width: 10px; height: 10px; border-radius: 50%; }
.wm-live { background: var(--live); }
.wm-sched { background: var(--signal); }
.wm-travel { background: linear-gradient(90deg, #fde725, #21918c, #443a83); width: 24px !important; border-radius: 3px !important; }
.welcome-mode-desc { margin: -4px 0 0; color: var(--muted); font-size: 13px; min-height: 2.9em; }
.welcome-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-top: 12px; border-top: 1px solid var(--rule); font-size: 12.5px; color: var(--muted); }
.welcome-how { flex: 1 1 100%; order: 3; }
.welcome-how summary { cursor: pointer; color: var(--text-2); font-weight: 600; }
.welcome-how ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.5; }
.welcome-close { margin-left: auto; padding: 7px 12px; border-radius: var(--r); border: 1px solid var(--rule-strong); font-weight: 700; color: var(--text); }
.welcome-close:hover { background: var(--hover); }

/* ================================================================ statystyki */
body.stats-open { overflow: hidden; }
body.stats-open .city-float, body.stats-open #tooltip { display: none; }
.stats { position: fixed; inset: 0; z-index: 50; overflow-y: auto; background: var(--bg); padding: 0 0 40px; scrollbar-width: thin; }
.stats:focus { outline: none; }
.st-head {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: calc(14px + var(--safe-t)) 24px 12px; background: var(--bg); border-bottom: 1px solid var(--rule);
}
.st-title h2 { font-size: 22px; font-weight: 800; }
.st-title p { margin: 0; color: var(--muted); font-size: 13px; }
.st-ctrl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.st-time { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.st-time input { width: 220px; }
.st-time b { color: var(--signal-text); font-size: 18px; font-weight: 800; min-width: 52px; }

/* zakres i zrodla */
.st-scope { margin: 16px 24px 0; padding: 14px 16px; border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--rule); display: flex; flex-direction: column; gap: 12px; }
.st-scope-top { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 8px 16px; }
.st-scope-top h3 { font-size: 15px; }
.st-scope-top .seg { width: 280px; }
.st-scope-note { margin: 0; color: var(--text-2); font-size: 13px; max-width: 80ch; }
.st-sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.st-src { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); background: var(--sunk); border: 1px solid var(--rule); min-width: 0; }
.st-src.off { opacity: .55; }
.st-src-cats { display: flex; flex-direction: column; gap: 2px; flex: none; }
.st-src-cats i { width: 16px; height: 4px; border-radius: 2px; }
.st-src-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.st-src-t b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-src-t small { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-src-n { display: flex; flex-direction: column; align-items: flex-end; font-size: 12.5px; font-weight: 700; text-align: right; color: var(--text-2); }
.st-src-n small { color: var(--muted); font-weight: 400; font-size: 11.5px; }
.st-src.off .st-src-n { font-weight: 500; color: var(--muted); }
.st-src-notes { grid-column: 1 / -1; margin: 2px 0 0; color: var(--signal-text); font-size: 12.5px; }
.st-sources .note-text { grid-column: 1 / -1; }

.st-bar-row { padding: 14px 24px 0; }
.st-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); }
.st-tabs button { position: relative; padding: 10px 14px; font-size: 14px; font-weight: 600; color: var(--muted); }
.st-tabs button:hover { color: var(--text); }
.st-tabs button.on { color: var(--text); }
.st-tabs button.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--signal); }
.st-empty { padding: 40px 24px; text-align: center; }

.st-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; padding: 16px 24px 0; }
.st-card { grid-column: span 12; min-width: 0; padding: 16px 18px; border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--rule); display: flex; flex-direction: column; gap: 10px; }
.st-card.st-off { display: none; }
.st-card > h3, .st-cardhead h3 { font-size: 15px; }
.s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; } .s7 { grid-column: span 7; } .s8 { grid-column: span 8; }
.st-cardhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.st-note { margin: -4px 0 0; color: var(--muted); font-size: 12.5px; max-width: 90ch; }
.st-kpicard { padding: 0; background: none; border: 0; }
.st-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1000px) { .st-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.st-kpi { display: flex; flex-direction: column; gap: 1px; padding: 12px 14px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--rule); min-width: 0; }
.st-kpi b { font-size: 24px; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; overflow-wrap: anywhere; }
.st-kpi.sm b { font-size: 19px; }
.st-kpi span { font-size: 13px; color: var(--text-2); font-weight: 600; }
.st-kpi small { color: var(--muted); font-size: 11.5px; }
.st-kpi.good b { color: var(--good); } .st-kpi.bad b { color: var(--bad); } .st-kpi.warn b { color: var(--early); }
#stLive .st-kpi { background: var(--sunk); }

.st-chart { min-height: 220px; }
.st-svg { display: block; overflow: visible; }
.st-grid-l { stroke: var(--rule); stroke-width: 1; }
.st-ax { fill: var(--muted); font: 11px var(--font); }
.st-now { stroke: var(--signal); stroke-width: 1.5; stroke-dasharray: 3 3; }
.st-now-t { fill: var(--signal-text); font-weight: 700; }
.st-cross { stroke: var(--text-2); stroke-width: 1; }
.st-hit { cursor: crosshair; }
.st-legend-row { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12.5px; color: var(--text-2); }
.st-legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.st-legend-row i { width: 12px; height: 12px; border-radius: 3px; }

.st-table-wrap { overflow-x: auto; }
.st-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.st-table th { text-align: left; padding: 7px 8px; color: var(--muted); font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--rule); white-space: nowrap; cursor: pointer; user-select: none; }
.st-compact th { cursor: default; }
.st-table th:hover { color: var(--text); }
.st-table th.asc::after { content: ' ↑'; color: var(--signal-text); }
.st-table th.desc::after { content: ' ↓'; color: var(--signal-text); }
.st-table td { padding: 7px 8px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.st-table .num { text-align: right; white-space: nowrap; }
.st-table td small { color: var(--muted); }
.st-table tbody tr { cursor: pointer; }
.st-compact tbody tr { cursor: default; }
.st-click tbody tr { cursor: pointer; }
.st-table tbody tr:hover td { background: var(--hover); }
.st-table tr.sel td { background: var(--signal-soft); }
.st-bar { height: 4px; margin-top: 4px; border-radius: 2px; background: var(--rule); overflow: hidden; }
.st-bar i { display: block; height: 100%; background: var(--signal); border-radius: 2px; }
.st-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.st-ell { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.st-cats { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: 1px; }
.st-cats i { width: 8px; height: 8px; border-radius: 2px; }
.st-muted { color: var(--muted); }
.st-rc { display: inline-block; padding: 1px 6px; border-radius: 4px; background: var(--c); color: #0b1220; font-weight: 800; font-size: 12px; }
.st-spark { width: 84px; height: 16px; display: block; }
.st-spark rect { fill: var(--signal); opacity: .85; }

.st-dists { display: flex; flex-direction: column; gap: 14px; }
.st-hist-box { display: flex; flex-direction: column; gap: 6px; }
.st-hist-title { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; }
.st-hist-title em { color: var(--muted); font-weight: 500; }
.st-hist { display: flex; align-items: flex-end; gap: 3px; height: 64px; }
.st-hist > div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; cursor: default; }
.st-hist > div:hover i { filter: brightness(1.2); }
.st-hist i { display: block; width: 100%; border-radius: 3px 3px 0 0; background: var(--signal); opacity: .85; min-height: 0; }
.st-hist-lab { height: 120px; }
.st-hist-lab > div { gap: 3px; }
.st-hist-lab b { font-size: 11px; color: var(--text-2); font-weight: 700; }
.st-hist-lab span { font-size: 11px; color: var(--muted); }
.st-hist-ax { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.st-day > div { cursor: pointer; }
.st-day i { background: var(--rule-strong); opacity: 1; }
.st-day i.cur { background: var(--signal); }
.st-day i.wait { background: var(--rule); animation: blink 1.4s ease-in-out infinite; }

.st-heat { display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(14px, 1fr)); gap: 2px; overflow-x: auto; }
.st-heat-h { font-size: 10.5px; color: var(--muted); text-align: center; }
.st-heat-l { display: flex; align-items: center; }
.st-heat-l .bd-line { font-size: 11px; height: 18px; line-height: 19px; min-width: 26px; max-width: 60px; }
.st-heat-c { height: 18px; border-radius: 3px; background: color-mix(in srgb, var(--signal) calc(var(--a) * 100%), var(--sunk)); }
.st-heat-c:hover { outline: 1px solid var(--text); }
.st-scale { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.st-scale i { width: 120px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--sunk), var(--signal)); }

.st-sub-t { margin: 4px 0 2px; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.st-gap { margin-top: 14px; }
.st-hbars { display: flex; flex-direction: column; gap: 4px; }
.st-hbars > div { display: grid; grid-template-columns: 56px 1fr 40px; align-items: center; gap: 8px; font-size: 12.5px; }
.st-hbars .st-bar { margin: 0; height: 8px; }
.st-hbars em { text-align: right; color: var(--text-2); font-weight: 700; }
.st-hubbars > div { grid-template-columns: minmax(0, 150px) 1fr 32px; cursor: pointer; border-radius: 4px; }
.st-hubbars > div:hover { background: var(--hover); }
.st-hubbars .st-ell { max-width: 100%; }
.st-rank { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.st-rank li { display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 4px 6px; border-radius: var(--r-sm); font-size: 12.5px; cursor: pointer; }
.st-rank li:hover { background: var(--hover); }
.st-rank li span:not(.bd-line) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.st-rank li em { font-weight: 700; }
.st-live-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 18px; margin-top: 14px; }

.st-mapcard { padding-bottom: 12px; }
.st-map { height: 520px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--rule); background: var(--sunk); }
.st-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12.5px; color: var(--text-2); }
.st-legend span { display: inline-flex; align-items: center; gap: 6px; }
.st-legend i { width: 14px; height: 10px; border-radius: 3px; }
.st-legend em { color: var(--muted); }
.st-leg-t { color: var(--muted); }
.st-focus { flex-wrap: wrap; gap: 8px !important; }
.st-focus > span:not(.bd-line) { font-weight: 600; }
.st-tip { position: fixed; z-index: 70; left: 0; top: 0; }
.st-tip, .st-deck-tip {
  max-width: 300px; padding: 8px 10px; pointer-events: none;
  background: var(--panel) !important; color: var(--text) !important; border: 1px solid var(--rule-strong); border-radius: var(--r); box-shadow: var(--shadow); font: 12.5px/1.45 var(--font) !important;
}
.st-tip-row { display: flex; align-items: center; gap: 6px; }
.st-tip-row i { width: 9px; height: 9px; border-radius: 2px; }
.st-tip-row em { margin-left: auto; padding-left: 12px; font-weight: 700; }
.st-deck-tip b { font-weight: 800; }

/* ================================================================ mniejsze ekrany */
@media (max-width: 1240px) {
  .s4, .s5, .s6, .s7, .s8 { grid-column: span 12; }
  .st-live-grid { grid-template-columns: 1fr; }
  .st-live-grid .st-span2 { grid-column: auto; }
  .st-scope-top { grid-template-columns: auto 1fr; }
  .st-scope-note { grid-column: 1 / -1; }
}
@media (max-width: 1100px) {
  :root { --panel-w: 340px; }
  .city-float { width: 240px; }
  .dock { grid-template-columns: auto 1fr; }
  .dock .speed { grid-column: 2; grid-row: 1; justify-self: end; }
  .dock .timeline { grid-column: 1 / -1; }
}

/* telefon: panel jest arkuszem od dolu, zwinietym do naglowka i zakladek */
@media (max-width: 720px) {
  :root { --gap: 8px; --peek: 104px; }
  .panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: min(70vh, 640px); border-radius: var(--r-lg) var(--r-lg) 0 0;
    border-bottom: 0; padding-bottom: var(--safe-b); }
  .panel.min { transform: translateY(calc(100% - var(--peek) - var(--safe-b))); }
  .panel.dragging { transition: none; }
  .panel.min:not(.dragging) .panel-body, .panel.min:not(.dragging) .panel-foot { visibility: hidden; transition: visibility 0s .4s; }
  .panel-head { padding: 14px 10px 4px 14px; touch-action: none; cursor: grab; }
  .grabber { display: block; position: absolute; left: 50%; top: 6px; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: var(--rule-strong); }
  .desktop-panel-icon { display: none; }
  .mobile-panel-icon { display: block; transition: transform .3s var(--ease); }
  .panel.min .mobile-panel-icon { transform: rotate(180deg); }
  .panel-reveal { display: none !important; }
  .tabs { padding: 2px 6px 0; }
  .tabs button { padding: 6px 2px 8px; font-size: 12px; }

  .city-float { left: var(--gap); top: calc(var(--gap) + var(--safe-t)); width: calc(100vw - 168px); }
  body.panel-hidden .city-float { left: var(--gap); }
  .city-float .search { height: 40px; }
  .view-chip { font-size: 12px; padding: 5px 9px; }
  body.sheet-open .view-chip { display: none; }
  .clock-card { min-width: 0; padding: 8px 10px 7px; }
  .clock { font-size: 28px; }
  .clock-meta { font-size: 11.5px; }
  .live-info small { display: none; }
  .map-btn { width: 38px; height: 38px; }

  .dock { left: var(--gap) !important; right: var(--gap); bottom: calc(var(--peek) + var(--safe-b) + 8px); padding: 8px 10px; gap: 8px;
    grid-template-columns: 1fr auto; border-radius: var(--r); }
  .dock .when { grid-column: 1; }
  .dock .speed { grid-column: 2; }
  .dock .timeline { grid-column: 1 / -1; height: 44px; }
  #hist { height: 28px; }
  .cursor { height: 34px; }
  .dock.min { transform: translateY(calc(100% + var(--peek) + var(--safe-b) + 10px)); }
  .dock-tab { left: 12px; }
  body.sheet-open .dock, body.sheet-open .hud-right .map-btns { visibility: hidden; }
  .date-chip { height: 34px; padding: 0 9px; }
  .mode-seg button { padding: 6px 8px; font-size: 12.5px; }
  .play { width: 34px; height: 34px; }
  .speed-slider { width: min(280px, calc(100vw - 24px)); }

  .board { left: var(--gap); right: var(--gap); width: auto; bottom: calc(var(--peek) + var(--safe-b) + 8px); max-height: calc(100vh - var(--peek) - 170px); z-index: 21; }
  .empty-hint, body.panel-hidden .empty-hint { left: 50%; top: 40%; }
  body.sheet-open .empty-hint { display: none; }
  .maplibregl-ctrl-bottom-right { bottom: calc(var(--dock-top) + 2px); }

  .st-head { padding: calc(10px + var(--safe-t)) 14px 10px; }
  .st-time input { width: 140px; }
  .st-scope { margin: 12px 14px 0; padding: 12px; }
  .st-scope-top { grid-template-columns: 1fr; }
  .st-scope-top .seg { width: 100%; }
  .st-bar-row { padding: 10px 14px 0; position: static; }
  .st-tabs { overflow-x: auto; }
  .st-tabs button { padding: 9px 10px; font-size: 13px; white-space: nowrap; }
  .st-grid { padding: 12px 14px 0; gap: 10px; }
  .st-card { padding: 14px; }
  .st-map { height: 380px; }
  .st-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-kpi b { font-size: 20px; }
  .grid2 { gap: 10px; }
}
@media (max-width: 380px) {
  .clock { font-size: 24px; }
  .city-float { width: calc(100vw - 140px); }
  .tabs button svg { display: none; }
}
@media (max-height: 600px) and (min-width: 721px) {
  .clock { font-size: 30px; }
  .board { max-height: calc(100vh - var(--dock-top) - 140px); }
  .st-map { height: 380px; }
}
@media (pointer: coarse) {
  .seg button { padding: 8px 8px; }
  .cat { padding: 9px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ================================================================ tryb osadzenia (?embed=1): sama mapa */
.embed body > *:not(#map):not(#tooltip):not(.embed-open):not(.embed-src):not(.embed-info):not(.embed-load):not(.embed-empty):not(.embed-hud):not(.embed-legend) { display: none !important; }
.embed .maplibregl-ctrl-bottom-right { bottom: 0; right: 0; }
.embed .maplibregl-cooperative-gesture-screen { font: 500 13px/1.4 var(--font); }
.embed-open, .embed-src { position: absolute; z-index: 15; display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 var(--font);
  color: var(--text); background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 6px 9px; text-decoration: none; cursor: pointer; opacity: .88; transition: opacity .15s; }
.embed-open:hover, .embed-src:hover, .embed-src[aria-expanded="true"] { opacity: 1; }
.embed-open { top: 10px; right: 10px; padding: 7px; }
.embed-open svg { width: 14px; height: 14px; }
.embed-src { left: 10px; bottom: 10px; font-weight: 500; font-size: 11px; padding: 4px 8px; color: var(--muted); }
.embed-info { position: absolute; z-index: 16; left: 10px; bottom: 40px; width: min(360px, calc(100% - 20px)); max-height: calc(100% - 60px); overflow: auto;
  padding: 12px 14px; border-radius: 12px; background: var(--panel); color: var(--text); border: 1px solid var(--rule); box-shadow: var(--shadow); font: 12.5px/1.45 var(--font); }
.embed-info h3 { margin: 0 0 8px; font-size: 13px; }
.embed-info ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.embed-info li { display: grid; gap: 1px; }
.embed-info li span, .embed-meta { color: var(--muted); font-size: 11.5px; }
.embed-meta { margin: 8px 0 0; }
.embed-load { position: absolute; z-index: 15; left: 50%; bottom: 14px; transform: translateX(-50%); }
.embed-empty { position: absolute; z-index: 15; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 8px 12px; border-radius: 10px;
  background: var(--panel); color: var(--muted); border: 1px solid var(--rule); font: 13px var(--font); }
.embed-hud { position: absolute; z-index: 15; top: 10px; left: 10px; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.embed-hud b { font: 800 15px/1 var(--font); color: var(--signal-text); padding: 6px 9px; border-radius: 8px; background: var(--panel); border: 1px solid var(--rule); }
.embed-live { display: inline-flex; align-items: center; gap: 6px; font: 700 11.5px/1 var(--font); color: #fff; background: var(--live); padding: 6px 10px 6px 8px; border-radius: 999px; }
.embed-live i { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1.6s ease-in-out infinite; }
.embed-legend { position: absolute; z-index: 15; right: 10px; bottom: 10px; max-width: calc(100% - 110px); display: flex; flex-wrap: wrap; justify-content: flex-end;
  gap: 4px 10px; padding: 6px 9px; border-radius: 8px; background: var(--panel); border: 1px solid var(--rule); pointer-events: none; font: 500 11px/1.2 var(--font); color: var(--muted); }
.embed-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.embed-legend i { width: 12px; height: 3px; border-radius: 2px; }

/* wyszukiwarka na mapie: naglowki sekcji */
.sug-h { margin: 8px 10px 2px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sug-h:first-child { margin-top: 2px; }
.city-float .plan-sug { max-height: min(70vh, 560px); overflow-y: auto; }
.tp-gone .bd-time, .tp-gone .bd-dest { text-decoration: line-through; opacity: .55; }
.plan-sug .sug-addr { background: #ef4444; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.sug-attr { padding: 4px 10px 2px; text-align: right; }

/* statystyki: kolej i ceny */
.st-kbars { display: flex; flex-direction: column; gap: 6px; }
.st-kbar { display: grid; grid-template-columns: minmax(0, 1fr) 2fr auto; align-items: center; gap: 8px; font-size: 12.5px; }
.st-kbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-kbar i { justify-self: start; height: 10px; border-radius: 3px; background: #f59e0b; }
.st-kbar b { font-variant-numeric: tabular-nums; }
.st-dislist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; font-size: 12.5px; }
.st-dislist li { padding: 8px 10px; border-radius: var(--r); background: rgba(245, 158, 11, .1); }
.st-dislist li span { color: var(--text-2); }
.st-dislist li em { font-style: normal; color: var(--muted); margin-left: 4px; }
.st-dislist li small { display: block; margin-top: 3px; color: var(--muted); line-height: 1.35; }
.st-fares td, .st-fares th { white-space: nowrap; }
.st-fare-svg { width: 100%; height: auto; max-height: 340px; display: block; }
.st-fare-svg text { font-size: 11px; fill: var(--muted); }
.st-fare-svg .grid { stroke: var(--rule); stroke-width: 1; }
.st-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.st-legend span { display: inline-flex; align-items: center; gap: 6px; }
.st-legend i { width: 14px; height: 3px; border-radius: 2px; }
.st-span2 { grid-column: span 2; }
.st-pl-wrap { max-height: 320px; overflow-y: auto; }
.st-kbar .st-sw { display: inline-block; margin-right: 6px; }
