/* kolory i wymiary z projektu w Figmie (Szutrownik, redesign) */
:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-2: #f7f7f8;   /* grays/50 */
  --ink: #26262b;       /* grays/950 */
  --ink-2: #393941;     /* grays/900 */
  --muted: #737484;     /* grays/500 */
  --faint: #9090a0;     /* grays/400 */
  --line-2: #b7b7c2;    /* grays/300 */
  --line: #d9d9de;      /* grays/200 */
  --field: #f7f7f8;
  --accent: #26262b;
  --accent-2: #393941;
  --accent-ink: #ffffff;
  --accent-soft: #f7f7f8;
  --ok: #5ca641;        /* success/500 */
  --sign: #ffec80;
  --danger: #f34b40;    /* error/500 */
  --danger-soft: #fef3f2; /* error/50 */
  --danger-ink: #9c2018;  /* error/800 */
  --info-bg: #f1f5fd;   /* informative/50 */
  --info-ink: #2d3d7b;  /* informative/900 */
  --warn-bg: #fff9db;
  --warn-ink: #6b5600;
  --mid-ink: #9a5b00;
  --s-asfalt: #f34b40;
  --s-szuter: #ffec80;
  --s-grunt: #a3dc86;
  --s-check: #ff3b30;
  /* ślad na mapie: te same kolory co w paskach nawierzchni (podkład mapy jest wyciszony, ślad ma ciemną obwódkę) */
  --m-szuter: #ffec80;
  --m-grunt: #a3dc86;
  --shadow-lg: 0 8px 24px rgba(38, 38, 43, .10), 0 1px 3px rgba(38, 38, 43, .08);
  --shadow-sm: 0 8px 4px rgba(0, 0, 0, .04);
  --r-lg: 12px;
  --r-md: 8px;
  --f: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161815; --panel: #161815; --panel-2: #20231e; --ink: #dde2d8; --ink-2: #c4cabf; --muted: #979f91; --faint: #757d70; --line-2: #464c43; --line: #30342e; --field: #20231e;
    --accent: #dde2d8; --accent-2: #eef1ea; --accent-ink: #161815; --accent-soft: #20231e; --ok: #7cc95f; --danger: #ff6b5e; --danger-soft: #3a1d1b; --danger-ink: #ffb4ab;
    --info-bg: #1d2440; --info-ink: #b6c5ff; --warn-bg: #3a3214; --warn-ink: #ffe27a; --mid-ink: #f5b54a;
    --shadow-lg: 0 8px 24px rgba(0,0,0,.5), 0 1px 3px rgba(0,0,0,.4); --shadow-sm: 0 8px 4px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161815; --panel: #161815; --panel-2: #20231e; --ink: #dde2d8; --ink-2: #c4cabf; --muted: #979f91; --faint: #757d70; --line-2: #464c43; --line: #30342e; --field: #20231e;
  --accent: #dde2d8; --accent-2: #eef1ea; --accent-ink: #161815; --accent-soft: #20231e; --ok: #7cc95f; --danger: #ff6b5e; --danger-soft: #3a1d1b; --danger-ink: #ffb4ab;
  --info-bg: #1d2440; --info-ink: #b6c5ff; --warn-bg: #3a3214; --warn-ink: #ffe27a; --mid-ink: #f5b54a;
  --shadow-lg: 0 8px 24px rgba(0,0,0,.5), 0 1px 3px rgba(0,0,0,.4); --shadow-sm: 0 8px 4px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 500 13.5px/1.45 var(--f); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#map { position: fixed; inset: 0; background: #cfd6ca; }

/* ---------- panel ---------- */
.sheet {
  position: fixed; z-index: 1000; top: 12px; left: 12px; bottom: 12px; width: 392px;
  background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
}
.top { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px; flex: none; }
.brand { flex: 1; min-width: 0; margin: 0; line-height: 0; color: var(--ink); }
.logotype { display: block; height: 31px; width: auto; max-width: 100%; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--field); color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--accent-soft); color: var(--accent); }
.sheet[data-view="settings"] #btn-settings { background: var(--accent); color: var(--accent-ink); }

.view { display: none; flex: 1; min-height: 0; flex-direction: column; }
.sheet[data-view="route"] .view-route, .sheet[data-view="settings"] .view-settings, .sheet[data-view="account"] .view-account { display: flex; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 18px; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }

/* ---------- oś trasy ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.stop { position: relative; display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding-bottom: 10px; }
.stop::before { content: ""; position: absolute; left: 10px; top: 24px; bottom: -2px; width: 2px; background: var(--line); }
.stop:last-child::before { display: none; }
.dot { width: 14px; height: 14px; border-radius: 50%; margin: 30px 0 0 4px; background: var(--panel); border: 3px solid var(--accent); position: relative; z-index: 1; }
.stop-start .dot { background: var(--accent); }
.stop-next .dot { border-color: var(--sign); }
.stop-seg .dot { width: 22px; height: 22px; margin: 10px 0 0; border: 0; background: var(--ink); color: var(--panel); font-size: 10.5px; font-weight: 800; display: grid; place-items: center; }
.stop-body { min-width: 0; position: relative; }
.stop-label { display: block; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin: 0 0 5px; }
.search { display: flex; align-items: center; background: var(--field); border-radius: var(--r-md); border: 1.5px solid transparent; transition: border-color .15s, background .15s; }
.search:focus-within { border-color: var(--accent); background: var(--panel); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 11px 12px; font-weight: 600; outline: none; }
.search input::placeholder { color: var(--faint); font-weight: 500; }
.search input::-webkit-search-cancel-button { display: none; }
.pick { flex: none; width: 40px; height: 40px; margin-right: 2px; border: 0; background: transparent; color: var(--muted); border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.pick:hover { color: var(--accent); }
.pick.is-on { background: var(--accent); color: var(--accent-ink); }
.stop-fixed { margin: 0; padding: 11px 12px; border-radius: var(--r-md); background: var(--field); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest { position: absolute; top: 100%; left: 0; right: 0; z-index: 30; margin: 4px 0 0; padding: 6px; list-style: none; background: var(--panel); border-radius: var(--r-md); box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto; }
.suggest li { padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: 12px; color: var(--muted); }
.suggest li b { display: block; font-size: 13px; color: var(--ink); }
.suggest li:hover { background: var(--accent-soft); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chips:empty, .chips:not(:has(:not([hidden]))) { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--field); border-radius: 99px; padding: 6px 11px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--ink); }
.chip:hover { background: var(--accent-soft); color: var(--accent); }

.seg-card { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--r-md); background: var(--panel-2); cursor: pointer; border: 0; width: 100%; text-align: left; }
.seg-card:hover { background: var(--accent-soft); }
.seg-main { flex: 1; min-width: 0; }
.seg-to { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg-meta { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.seg-card .stack { width: 64px; flex: none; height: 6px; }

/* ---------- przycisk główny ---------- */
.cta { display: flex; flex-direction: column; gap: 8px; }
.btn-primary {
  position: relative; overflow: hidden; border: 0; border-radius: 99px; padding: 14px 16px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-size: 14.5px; font-weight: 800; letter-spacing: .01em;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 22%, transparent);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-2); }
.btn-primary:disabled { background: var(--field); color: var(--faint); box-shadow: none; cursor: default; }
body[data-status="running"] .btn-primary:disabled { background: var(--accent-soft); color: var(--accent); cursor: progress; }
.go-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: color-mix(in srgb, var(--accent) 22%, transparent); transition: width .3s; }
.go-text { position: relative; }
.status { margin: 0; font-size: 12px; color: var(--muted); min-height: 1.3em; }
.status.is-err { color: var(--danger); }
.status.is-warn { color: #9a6700; }


/* ---------- warianty ---------- */
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sec-head h2 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.link-btn { border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 12px; cursor: pointer; padding: 4px 0; }
.link-btn:hover { color: var(--accent); }
.variants { display: flex; flex-direction: column; gap: 10px; }
.cards { display: flex; flex-direction: column; gap: 8px; }
.card { display: grid; grid-template-columns: 34px 1fr; gap: 5px 12px; align-items: center; text-align: left; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--panel); padding: 11px 12px; cursor: pointer; width: 100%; }
.card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.card.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 55%, var(--panel)); }
.letter { grid-row: span 2; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--field); font-weight: 800; }
.card.is-on .letter { background: var(--accent); color: var(--accent-ink); }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-km { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pill { font-size: 11.5px; font-weight: 800; padding: 3px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.pill.is-mid { background: color-mix(in srgb, var(--s-szuter) 20%, transparent); color: var(--mid-ink); }
.pill.is-bad { background: var(--danger-soft); color: var(--danger); }
.card-sub { display: flex; gap: 10px; align-items: center; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-sub .stack { flex: 1; }
.card-sub .warn { color: var(--danger); font-weight: 700; white-space: nowrap; }
.stack { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--line); }
.stack i { display: block; height: 100%; }
.stack .g { background: var(--s-grunt); } .stack .s { background: var(--s-szuter); } .stack .a { background: var(--s-asfalt); }

.detail { display: flex; flex-direction: column; gap: 12px; }
.btn-add { display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 99px; padding: 13px 14px; background: var(--ink); color: var(--panel); font-size: 14px; font-weight: 800; cursor: pointer; }
.btn-add:hover { background: var(--accent-2); color: var(--accent-ink); }
.box { border-radius: var(--r-md); background: var(--panel-2); padding: 12px; display: flex; flex-direction: column; gap: 9px; }
.box h3 { margin: 0; font-size: 12.5px; font-weight: 800; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.box h3 .count { color: var(--muted); font-weight: 700; }
.note { font-size: 12px; color: var(--muted); margin: 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--field); border-radius: 99px; padding: 9px 12px; cursor: pointer; font-weight: 700; font-size: 12px; color: var(--ink); }
.box .btn { background: var(--panel); box-shadow: var(--shadow-sm); }
.btn:hover:not(:disabled) { color: var(--accent); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-solid { background: var(--accent); color: var(--accent-ink); }
.btn-solid:hover:not(:disabled) { background: var(--accent-2); color: var(--accent-ink); }
.btn-quiet { background: transparent; color: var(--muted); }
.btn-quiet.is-armed { background: var(--danger-soft); color: var(--danger); }
.btn-ok { color: var(--ok); }
.btn-no { color: var(--danger); }
.btn-no:hover:not(:disabled) { color: var(--danger); background: var(--danger-soft); }
.vlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.vlist li { border-radius: 12px; padding: 9px 10px; display: grid; gap: 7px; background: var(--panel); box-shadow: var(--shadow-sm); }
.vtop { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vtop button { border: 0; background: none; color: var(--accent); cursor: pointer; font-weight: 800; padding: 0; }
.reasons { display: flex; gap: 5px; flex-wrap: wrap; }
.tag { font-size: 10.5px; font-weight: 700; padding: 3px 7px; border-radius: 99px; background: var(--danger-soft); color: var(--danger); }
.empty { font-size: 12px; color: var(--muted); margin: 0; }

/* ---------- podsumowanie trasy ---------- */
.summary { flex: none; border-top: 1px solid var(--line); padding: 12px 16px 14px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; }
/* stopka ustawień: „Gotowe” zawsze przy dolnej krawędzi panelu */
.set-foot { flex: none; border-top: 1px solid var(--line); padding: 12px 16px 14px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; }
.set-dirty { margin: 0; font-size: 12px; font-weight: 700; color: #9a6700; }
.set-dirty[hidden] { display: none; }
.sum-full { display: flex; flex-direction: column; gap: 9px; }
.sum-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sum-km { font-size: 12px; color: var(--muted); font-weight: 700; }
.sum-km b { font-size: 22.5px; color: var(--ink); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sum-meta { font-size: 12px; color: var(--muted); font-weight: 600; text-align: right; }
.sum-actions { display: flex; gap: 6px; }
.sum-actions .btn-quiet { margin-left: auto; }

/* ---------- ustawienia ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 700; display: flex; justify-content: space-between; align-items: baseline; }
.field output { font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
select, input[type="number"] { background: var(--field); border: 1.5px solid transparent; border-radius: 11px; padding: 9px 10px; min-width: 0; width: 100%; font-weight: 600; }
select:focus, input[type="number"]:focus { border-color: var(--accent); outline: none; }
input[type="range"] { accent-color: var(--accent); width: 100%; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sub { margin: 6px 0 0; font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.chk { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; font-size: 13px; font-weight: 600; cursor: pointer; padding: 10px 12px; background: var(--panel-2); border-radius: var(--r-md); }
.chk input { margin: 2px 0 0; width: 18px; height: 18px; accent-color: var(--accent); }
.chk small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 500; margin-top: 2px; }
/* przełącznik (tryb ciemny, pętla): wyłączony szary, włączony w kolorze głównym */
.chk-switch { grid-template-columns: 1fr auto; align-items: center; }
:is(.chk, .auth-terms) input.switch { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 44px; height: 26px; margin: 0; border-radius: 99px; background: color-mix(in srgb, var(--ink) 16%, transparent); cursor: pointer; transition: background .2s; }
:is(.chk, .auth-terms) input.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25), 0 2px 6px rgba(0, 0, 0, .12); transition: transform .2s, background .2s; }
:is(.chk, .auth-terms) input.switch:checked { background: var(--accent); }
:is(.chk, .auth-terms) input.switch:checked::after { transform: translateX(18px); background: var(--accent-ink); }
@media (prefers-reduced-motion: reduce) { :is(.chk, .auth-terms) input.switch, :is(.chk, .auth-terms) input.switch::after { transition: none; } }
.inline-num { display: block; color: var(--muted); font-size: 11.5px; font-weight: 500; margin-top: 6px; }
.inline-num input { display: inline-block; width: 56px; padding: 3px 6px; margin: 0 4px; background: var(--panel); }
.foot { font-size: 11px; color: var(--muted); line-height: 1.45; margin: 6px 0 0; }

/* ---------- elementy na mapie ---------- */
.map-ui { position: fixed; inset: 0; pointer-events: none; z-index: 900; }
.map-ui > * { pointer-events: auto; }
.pickhint { position: absolute; top: 14px; left: calc(50% + 202px); transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 8px 8px 8px 16px; border-radius: 99px; font-size: 12.5px; font-weight: 700; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.pickhint button { background: color-mix(in srgb, var(--panel) 18%, transparent); border: 0; color: inherit; border-radius: 99px; padding: 5px 12px; cursor: pointer; font-weight: 700; }
.fab-row { position: absolute; bottom: 22px; left: calc(50% + 202px); transform: translateX(-50%); display: flex; gap: 8px; }
.fab { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 15px; border: 0; border-radius: 99px; background: var(--panel); color: var(--ink); font-weight: 800; font-size: 12.5px; cursor: pointer; box-shadow: var(--shadow-lg); white-space: nowrap; }
.fab:hover { color: var(--accent); }
.fab[aria-pressed="false"] { background: var(--ink); color: var(--panel); }
.fab kbd { font: 700 10.5px/1 var(--f); border: 1.5px solid currentColor; border-radius: 5px; padding: 2px 5px; opacity: .6; }
.sw { width: 18px; height: 5px; border-radius: 3px; display: inline-block; }
.sw-grunt { background: var(--s-grunt); } .sw-szuter { background: var(--s-szuter); } .sw-asfalt { background: var(--s-asfalt); }
.sw-check { background: repeating-linear-gradient(90deg, var(--s-check) 0 5px, transparent 5px 8px); }
body.map-picking #map { cursor: crosshair; }

.leaflet-container { font: 500 12px/1.4 var(--f); }
.leaflet-top.leaflet-left { left: 404px; }
.leaflet-bar, .leaflet-control-layers { border: 0 !important; border-radius: 12px !important; box-shadow: var(--shadow-sm) !important; overflow: hidden; }
.leaflet-bar a { width: 36px !important; height: 36px !important; line-height: 36px !important; }
.leaflet-control-layers-toggle { width: 40px !important; height: 40px !important; }
.pin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.35); }
.pin-start { background: #111111; }
.pin-next { background: #f2b705; }
.joint { width: 22px; height: 22px; border-radius: 50%; background: #15201a; color: #fff; border: 2.5px solid #fff; font: 800 10.5px/17px var(--f); text-align: center; box-shadow: 0 2px 6px rgba(0,0,0,.35); }

/* ---------- telefon: panel jako dolna karta ---------- */
@media (max-width: 760px) {
  .sheet { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 60vh; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto 0; flex: none; }
  .top { padding: 8px 16px; }
  .leaflet-top.leaflet-left { left: 0; }
  .pickhint { left: 50%; top: 12px; }
  .fab-row { left: auto; right: 10px; transform: none; bottom: auto; top: 64px; flex-direction: column; align-items: flex-end; }
  .fab { height: 38px; padding: 0 12px; }
  .fab kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) { .go-fill, .search { transition: none; } }

.sw-sug { background: repeating-linear-gradient(90deg, #a855f7 0 3px, transparent 3px 7px); }
.box-sug { background: color-mix(in srgb, #a855f7 9%, var(--panel-2)); }
.tag-soft { background: var(--field); color: var(--muted); }

/* ---------- v3 ---------- */
.legend { display: flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 600; color: var(--muted); padding-top: 2px; }
.legend-title { margin: 0; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.legend-row { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.icon-danger:hover { background: var(--danger-soft); color: var(--danger); }
.top .icon-btn + .icon-btn { margin-left: -4px; }
.fab-icon { width: 42px; padding: 0; justify-content: center; }
.fab.is-busy { color: var(--accent); }
.btn-primary.is-stop { background: var(--danger); box-shadow: 0 6px 16px color-mix(in srgb, var(--danger) 30%, transparent); cursor: pointer; }
.btn-primary.is-stop:hover { background: color-mix(in srgb, var(--danger) 85%, black); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { color: #fff; background: color-mix(in srgb, var(--danger) 85%, black); }

.seg-row { display: flex; gap: 6px; align-items: stretch; }
.seg-row .seg-card { flex: 1; min-width: 0; }
.seg-del { flex: none; width: 36px; border: 0; border-radius: 99px; background: var(--panel-2); color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.seg-del:hover { background: var(--danger-soft); color: var(--danger); }
.seg-card.is-busy { opacity: .55; }
.seg-card .warn-dot { color: var(--danger); font-weight: 800; }

.review-cta { display: flex; }
.btn-review { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 99px; padding: 13px 14px; background: var(--ink); color: var(--panel); font-size: 14px; font-weight: 800; cursor: pointer; }
.btn-review:hover { background: var(--accent-2); color: var(--accent-ink); }

/* drugi panel */
.side2 { position: fixed; z-index: 1001; top: 12px; left: 416px; bottom: 12px; width: 340px; background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: side2in .18s ease-out; }
@keyframes side2in { from { transform: translateX(-16px); opacity: 0; } to { transform: none; opacity: 1; } }
.side2-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 16px 8px; }
.side2-top h2 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.side2-body { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 16px 18px; display: flex; flex-direction: column; gap: 10px; }
body.has-side2 .leaflet-top.leaflet-left { left: 764px; }
body.has-side2 .pickhint, body.has-side2 .fab-row { left: calc(50% + 376px); }
.card-actions { grid-column: 2; display: flex; justify-content: flex-end; margin-top: 2px; }
.btn-pick { border: 0; border-radius: 99px; padding: 8px 14px; background: var(--ink); color: var(--panel); font-weight: 800; font-size: 12px; cursor: pointer; }
.card.is-on .btn-pick { background: var(--accent); color: var(--accent-ink); }

.rv-progress { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); font-weight: 700; }
.rv-bar { flex: 1; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.rv-bar i { display: block; height: 100%; background: var(--accent); }
.rv-card { border-radius: var(--r-md); background: var(--panel-2); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.rv-card.is-sug { background: color-mix(in srgb, #a855f7 9%, var(--panel-2)); }
.rv-kind { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.rv-title { font-size: 15px; font-weight: 800; }
.rv-big { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rv-big .btn { justify-content: center; padding: 12px; font-size: 13px; }
.rv-nav { display: flex; justify-content: space-between; gap: 8px; }
.rv-ext { text-decoration: none; background: var(--panel); box-shadow: var(--shadow-sm); }
.rv-big.rv-3 .rv-ext { grid-column: 1 / -1; }
.dt-list { display: flex; flex-direction: column; gap: 8px; }
.dt-card { grid-template-columns: 1fr; }
.dt-card .card-km { font-size: 14px; }
.dt-card .card-sub { flex-wrap: wrap; gap: 3px 10px; }
.dt-card .card-actions { grid-column: 1; }
.rv-done { text-align: center; padding: 18px 8px; color: var(--muted); }
.rv-done b { display: block; font-size: 16px; color: var(--ink); margin-bottom: 4px; }

.modal { border: 0; border-radius: var(--r-lg); padding: 22px; max-width: 420px; width: calc(100% - 32px); background: var(--panel); color: var(--ink); box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(10, 16, 12, .45); }
.modal h2 { margin: 0 0 8px; font-size: 18px; font-weight: 800; }
.modal p { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.chk-plain { margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.loc-dot { width: 16px; height: 16px; border-radius: 50%; background: #2f7cf6; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(47,124,246,.25), 0 2px 6px rgba(0,0,0,.35); }
.leaflet-popup-content .btn { margin-top: 6px; }
.joint { cursor: pointer; }

@media (max-width: 760px) {
  .side2 { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 55vh; border-radius: 22px 22px 0 0; z-index: 1002; }
  body.has-side2 .leaflet-top.leaflet-left { left: 0; }
  body.has-side2 .pickhint { left: 50%; }
  body.has-side2 .fab-row { left: auto; }
}

/* zaznaczony odcinek na osi trasy */
.seg-card.is-on { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }


.btn-more { width: 100%; justify-content: center; display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 10px; border-radius: 99px; border: 1.5px dashed color-mix(in srgb, var(--ink) 25%, transparent); }
.btn-more:hover { border-color: var(--accent); color: var(--accent); }
/* przy wąskiej mapie przyciski pokazują tylko ikonę i skrót */
@media (max-width: 1500px) { body.has-side2 .fab-row .fab span { display: none; } }
@media (max-width: 1400px) and (min-width: 761px) { .fab-row .fab span { display: none; } }

/* tryby planowania */
.modes { display: flex; gap: 4px; padding: 4px; margin: 0 0 14px; background: var(--panel-2); border-radius: 99px; }
.modes button { flex: 1; border: 0; background: transparent; color: var(--muted, inherit); font: inherit; font-weight: 800; font-size: 12.5px; padding: 8px 10px; border-radius: 99px; cursor: pointer; }
.modes button.is-on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
body[data-mode="komin"] #stop-next, body[data-mode="komin"] .stop-seg, body[data-mode="komin"] #stop-add { display: none !important; }
body[data-mode="seg"] #stop-komin { display: none !important; }
.komin-row { display: flex; align-items: center; gap: 8px; margin: 2px 0 8px; }
.komin-row input { width: 84px; text-align: center; font: inherit; font-size: 19px; font-weight: 800; padding: 8px; border-radius: var(--r-md); border: 0; background: var(--panel-2); color: var(--ink); }
.k-unit { font-weight: 700; color: var(--muted, inherit); }
.k-step { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--panel-2); color: var(--ink); font-size: 19px; font-weight: 800; cursor: pointer; }
.k-step:hover { background: var(--accent-soft); }
.k-loop { margin-top: 8px; }

/* instrukcja w panelu: [hidden] ma pierwszeństwo przed display z trybów */
/* przewodnik na start */
.intro { max-width: 440px; padding: 22px 22px 18px; }
.intro-art { height: 110px; display: grid; place-items: center; margin: -4px -4px 12px; border-radius: var(--r-md); background: var(--panel-2); }
.intro-art svg { width: 150px; height: 100px; }
.intro-step { margin: 0 0 4px !important; font-size: 11.5px !important; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent) !important; }
.intro h2 { font-size: 19.5px; }
.intro p { font-size: 13.5px; line-height: 1.5; }
.intro-dots { display: flex; gap: 6px; justify-content: center; margin: 4px 0 16px; }
.intro-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: width .2s; }
.intro-dots i.is-on { width: 22px; border-radius: 4px; background: var(--accent); }
.intro-actions { align-items: center; }
.intro-sp { flex: 1; }
/* „wokół komina”: bez osi z kropkami po lewej, to nie jest lista kolejnych punktów */
body[data-mode="komin"] .timeline .stop { display: block; }
body[data-mode="komin"] .timeline .stop::before,
body[data-mode="komin"] .timeline .dot { display: none; }

/* ręczna edycja śladu */
.fab#btn-edit.is-on { background: var(--accent); color: var(--accent-ink); }
body.is-editing .leaflet-interactive { cursor: crosshair; }
/* przycisk mapa/zdjęcie nie jest „wciśnięty” – ciemne tło tylko dla schowanego śladu i warstw */
.fab#btn-base[aria-pressed] { background: var(--panel); color: var(--ink); }

/* menu punktu śladu */
.vmenu { display: flex; flex-direction: column; gap: 6px; min-width: 210px; }
.vmenu .btn { width: 100%; justify-content: flex-start; text-align: left; }
.vmenu-pop .leaflet-popup-content { margin: 8px; }
.ctx-menu { min-width: 230px; gap: 2px; }
.ctx-menu .btn { margin-top: 0; text-decoration: none; color: var(--ink); }
.ctx-coords { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; padding: 4px 12px 6px; user-select: all; }

/* moje trasy */
.my-save { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.my-name { font: inherit; font-size: 13.5px; font-weight: 700; padding: 11px 12px; border-radius: var(--r-md); border: 0; background: var(--panel-2); color: var(--ink); }
.my-save-row { display: flex; gap: 8px; }
.my-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.my-item { padding: 11px 12px; border-radius: var(--r-md); background: var(--panel-2); display: flex; flex-direction: column; gap: 8px; }
.my-item.is-on { box-shadow: inset 0 0 0 2px var(--accent); }
.my-name-t { font-weight: 800; font-size: 13px; overflow-wrap: anywhere; }
.my-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.my-acts .btn { padding: 7px 12px; font-size: 12px; }
.sum-actions .btn { padding-left: 11px; padding-right: 11px; }
.top .icon-btn { width: 36px; height: 36px; border-radius: 50%; }

/* komunikat na mapie */
.toast { position: fixed; top: 16px; left: calc(50% + 202px); transform: translate(-50%, -12px); z-index: 2000; max-width: min(520px, calc(100vw - 32px));
  background: var(--ink); color: var(--panel); padding: 12px 16px; border-radius: 14px; font-weight: 700; font-size: 13px; line-height: 1.4;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast.is-warn { background: #7a4b00; color: #fff; }
.toast.is-err { background: var(--danger); color: #fff; }
body.has-side2 .toast { left: calc(50% + 376px); }
@media (max-width: 760px) { .toast, body.has-side2 .toast { left: 50%; top: 10px; } }

/* ---------- edycja hurtem: pasek narzędzi na mapie ---------- */
.edit-bar { position: absolute; top: 14px; left: calc(50% + 202px); transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; align-items: center; padding: 6px; border-radius: 22px; background: var(--ink); color: var(--panel); box-shadow: var(--shadow-lg); white-space: nowrap; max-width: calc(100vw - 440px); }
@media (max-width: 1150px) and (min-width: 761px) { .edit-bar .eb kbd { display: none; } }
.edit-bar[hidden], .edit-bar [hidden] { display: none !important; }
.eb { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 0; border-radius: 99px; background: color-mix(in srgb, var(--panel) 14%, transparent); color: inherit; font: 800 12px/1 var(--f); cursor: pointer; }
.eb:hover:not(:disabled) { background: color-mix(in srgb, var(--panel) 26%, transparent); }
.eb:disabled { opacity: .45; cursor: default; }
.eb.is-on { background: #ff8a00; color: #1a1206; }
.eb kbd { font: 700 10px/1 var(--f); border: 1.5px solid currentColor; border-radius: 5px; padding: 2px 4px; opacity: .6; }
.eb b { background: #ff8a00; color: #1a1206; border-radius: 99px; padding: 2px 7px; font-size: 11.5px; }
.eb b:empty { display: none; }
.eb-del:not(:disabled):hover { background: #c0392b; color: #fff; }
.eb-ok { background: var(--accent); color: var(--accent-ink); }
.eb-cls { display: inline-flex; align-items: center; gap: 3px; padding: 0 4px; }
.eb-cls small { font-size: 11px; font-weight: 700; opacity: .7; margin-right: 3px; }
.eb-cls button { border: 0; border-radius: 99px; padding: 6px 9px; background: transparent; color: inherit; font: 700 11.5px/1 var(--f); cursor: pointer; opacity: .75; }
.eb-cls button.is-on { background: color-mix(in srgb, var(--panel) 22%, transparent); opacity: 1; }
body.is-editing .pickhint { display: none; }
body.is-drawing #map, body.is-drawing .leaflet-interactive { cursor: crosshair; }
body.has-side2 .edit-bar { left: calc(50% + 376px); }
@media (max-width: 760px) {
  .edit-bar { left: 50%; top: 12px; max-width: calc(100vw - 20px); overflow-x: auto; }
  .eb kbd { display: none; }
  body.has-side2 .edit-bar { left: 50%; }
}


/* ---------- konto ---------- */
#btn-account { position: relative; }
#btn-account .acct-dot { position: absolute; right: 6px; bottom: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px var(--field); display: none; }
#btn-account.is-in .acct-dot { display: block; }
.sheet[data-view="account"] #btn-account { background: var(--accent); color: var(--accent-ink); }
.sheet[data-view="account"] #btn-account .acct-dot { box-shadow: 0 0 0 2px var(--accent); }
.acct-tabs { margin: 0; }
.acct-form { display: flex; flex-direction: column; gap: 10px; }
.acct-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 700; }
.acct-field input { background: var(--field); border: 1.5px solid transparent; border-radius: 11px; padding: 10px 12px; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); min-width: 0; }
.acct-field input:focus { border-color: var(--accent); outline: none; background: var(--panel); }
.acct-form .link-btn { align-self: center; }
.form-err { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--danger); }
.form-ok { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--ok); }
.acct-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-md); background: var(--panel-2); }
.acct-avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 15px; }
.acct-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acct-who b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.acct-privacy { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }
.acct-privacy summary { cursor: pointer; font-weight: 800; color: var(--ink); font-size: 12.5px; }
.acct-privacy p { margin: 8px 0 0; line-height: 1.5; }
.acct-hint { gap: 8px; }
/* moje trasy na koncie */
.my-import { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.badge-gpx { display: inline-block; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 99px; background: color-mix(in srgb, #7c3aed 14%, transparent); color: #7c3aed; vertical-align: 1px; }
:root[data-theme="dark"] .badge-gpx { color: #b69cff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge-gpx { color: #b69cff; } }
#side2-body.is-busy { opacity: .55; pointer-events: none; transition: opacity .15s; }

/* ---------- ekran wejściowy: logowanie przed aplikacją ---------- */
.gate { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 24px; background: var(--bg); overflow-y: auto; }
.gate-card { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 1080px; height: min(700px, calc(100vh - 48px)); height: min(700px, calc(100dvh - 48px)); min-height: 560px; padding: 10px; border-radius: 26px; background: var(--panel); box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 18px 50px rgba(20, 30, 22, .10); }
/* lewy panel: szare tło z hasłem (docelowo zdjęcie) */
.gate-art { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding: 44px 44px 30px; border-radius: 18px; background: #d7dad4 center / cover no-repeat; overflow: hidden; }
.gate-claim { position: relative; }
.gate-kicker { margin: 0 0 16px; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #5d655f; }
.gate-claim h2 { margin: 0; font-size: clamp(40px, 4.6vw, 64px); line-height: .98; font-weight: 800; letter-spacing: -.035em; color: #111; }
.gate-claim h2 + p { margin: 18px 0 0; max-width: 400px; font-size: 15px; line-height: 1.5; color: #4d544f; }
.gate-src { position: relative; margin: 0; font-size: 11.5px; font-weight: 600; color: #6b736d; }
/* prawy panel: formularz */
.gate-panel { display: flex; overflow-y: auto; padding: 28px 24px; }
.gate-inner { display: flex; flex-direction: column; gap: 30px; width: 100%; max-width: 372px; margin: auto; }
.gate-logo { color: var(--ink); line-height: 0; }
.gate-logo .logotype { height: 30px; width: auto; }
.gate-body { display: flex; flex-direction: column; gap: 18px; }
.auth-head { display: flex; flex-direction: column; gap: 6px; }
.gate-title { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.025em; line-height: 1.12; }
.auth-sub { margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.gate .acct-form { gap: 14px; }
.acct-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.acct-label-row label { font-size: 12.5px; font-weight: 700; }
.field-hint { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.gate .acct-field { gap: 7px; }
.gate .acct-field input { background: var(--panel); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; font-weight: 600; transition: border-color .15s, box-shadow .15s; }
.gate .acct-field input::placeholder { color: var(--faint); font-weight: 500; }
.gate .acct-field input:hover { border-color: color-mix(in srgb, var(--ink) 22%, transparent); }
.gate .acct-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); background: var(--panel); }
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { flex: 1; padding-right: 46px !important; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.pw-eye:hover { color: var(--ink); background: var(--field); }
.pw-eye .eye-slash { display: none; }
.pw-eye.is-on .eye-slash { display: inline; }
.link-strong { border: 0; background: none; padding: 0; font: inherit; font-weight: 800; color: var(--ink); cursor: pointer; text-underline-offset: 3px; }
.link-strong:hover { text-decoration: underline; }
.link-small { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.link-small:hover { color: var(--ink); }
.auth-terms { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; line-height: 1.4; cursor: pointer; padding: 2px 0; }
.auth-terms a { color: var(--ink); font-weight: 800; text-underline-offset: 3px; }
.gate .btn-primary { width: 100%; margin-top: 4px; }
.auth-switch { margin: 0; text-align: center; font-size: 13.5px; color: var(--muted); }
/* ze zdjęciem: ciemny gradient od dołu i biały tekst */
.gate-art.has-photo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0, 0, 0, .55), rgba(0, 0, 0, .12) 50%, rgba(0, 0, 0, .45)); }
.gate-art.has-photo .gate-claim h2 { color: #fff; }
.gate-art.has-photo .gate-kicker, .gate-art.has-photo .gate-claim h2 + p, .gate-art.has-photo .gate-src { color: rgba(255, 255, 255, .86); }
:root[data-theme="dark"] .gate-card { box-shadow: 0 18px 50px rgba(0, 0, 0, .4); }
:root[data-theme="dark"] .gate-art:not(.has-photo) { background-color: #262c28; }
:root[data-theme="dark"] .gate-art:not(.has-photo) .gate-claim h2 { color: #f1f3f1; }
:root[data-theme="dark"] .gate-art:not(.has-photo) :is(.gate-kicker, .gate-claim h2 + p, .gate-src) { color: #a3ada6; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .gate-card { box-shadow: 0 18px 50px rgba(0, 0, 0, .4); }
  :root:not([data-theme="light"]) .gate-art:not(.has-photo) { background-color: #262c28; }
  :root:not([data-theme="light"]) .gate-art:not(.has-photo) .gate-claim h2 { color: #f1f3f1; }
  :root:not([data-theme="light"]) .gate-art:not(.has-photo) :is(.gate-kicker, .gate-claim h2 + p, .gate-src) { color: #a3ada6; }
}
/* telefon: pasek z hasłem na górze, formularz pod nim */
@media (max-width: 860px) {
  .gate { place-items: stretch; padding: 0; }
  .gate-card { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 100%; max-width: none; border-radius: 0; box-shadow: none; padding: 8px; gap: 8px; }
  .gate-art { padding: 22px 20px; border-radius: 16px; gap: 0; }
  .gate-kicker { margin-bottom: 8px; font-size: 11px; }
  .gate-claim h2 { font-size: 30px; }
  .gate-claim h2 + p, .gate-src { display: none; }
  .gate-panel { padding: 18px 12px 28px; overflow: visible; }
  .gate-inner { margin: 0 auto; gap: 22px; }
  .gate-title { font-size: 24px; }
}
.auth-terms input.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- „Dlaczego nie tędy?” ---------- */
body.is-asking #map { cursor: help; }
#btn-why.is-on { background: var(--accent); color: var(--accent-ink); }
.why-panel { position: fixed; top: 14px; right: 14px; z-index: 1500; width: 360px; max-height: calc(100vh - 110px); display: flex; flex-direction: column; background: var(--panel); color: var(--ink); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; }
.why-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 6px 18px; }
.why-head h2 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.why-body { display: flex; flex-direction: column; gap: 10px; padding: 6px 14px 16px; overflow-y: auto; }
.why-card { display: flex; flex-direction: column; gap: 6px; padding: 11px 12px; border-radius: var(--r-md); background: var(--panel-2); border-left: 4px solid var(--why-c, var(--line)); }
.why-card.is-ok { --why-c: #1f8a4c; } .why-card.is-no { --why-c: #d64545; } .why-card.is-sug { --why-c: #7c3aed; } .why-card.is-cut { --why-c: #d98b00; }
.why-top { display: flex; align-items: baseline; gap: 8px; }
.why-top b { font-size: 13.5px; flex: 1; min-width: 0; }
.why-verdict { margin: 0; font-size: 13px; font-weight: 700; line-height: 1.4; }
.why-list { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.why-tags { margin: 0; font-size: 11.5px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-word; }
.why-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.why-acts .btn { padding: 6px 12px; font-size: 12px; }
@media (max-width: 760px) { .why-panel { top: 60px; left: 10px; right: 10px; width: auto; max-height: 52vh; } }

.leaflet-interactive.check-hit { cursor: pointer; }
.modes button:disabled { opacity: .55; cursor: default; }
.var-tabs { margin-bottom: 4px; }

/* =====================================================================
   Wygląd z projektu w Figmie (Szutrownik): panel przy lewej krawędzi,
   pasek ikon obok, pola, kafle wariantów, stopka trasy, logowanie.
   ===================================================================== */
body { background: var(--bg); color: var(--ink); font: 400 13px/normal var(--f); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ti { flex: none; display: block; }

/* panel i pasek ikon */
.sheet { top: 0; left: 0; bottom: 0; width: 415px; border-radius: 0; box-shadow: none; background: var(--panel); }
.rail { position: fixed; z-index: 1000; top: 0; bottom: 0; left: 415px; width: 64px; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 16px 0; background: var(--panel); border-left: 1px solid var(--line); }
.rail-btn { position: relative; width: 40px; height: 40px; padding: 8px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; }
.rail-btn:hover, body[data-view="settings"] #btn-settings, body[data-view="account"] #btn-account { background: var(--panel-2); }
#btn-account .acct-dot { right: 7px; bottom: 7px; box-shadow: 0 0 0 2px var(--panel); }
.sheet[data-view="account"] #btn-account { background: var(--panel-2); color: var(--ink); }

/* nagłówek */
.top { gap: 8px; padding: 24px; border-bottom: 1px solid var(--line); }
.brand { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; line-height: normal; }
.logo-box, .letter { position: relative; flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: .833px solid var(--muted); border-radius: 9.167px; }
.logo-in, .letter b { width: 33.333px; height: 33.333px; display: grid; place-items: center; background: var(--panel); border: .833px solid var(--line); border-radius: 6.667px; color: var(--ink); }
.brand-name { font-size: 24px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-icon { width: 28px; height: 28px; padding: 4px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--ink); cursor: pointer; }
.hdr-icon:hover:not(:disabled) { background: var(--panel-2); }
.hdr-icon:disabled { opacity: .28; cursor: default; }
.hdr-reset { display: inline-flex; align-items: center; gap: 8px; margin-left: 4px; padding: 0; border: 0; background: none; color: var(--danger); font: 600 13px/normal var(--f); cursor: pointer; white-space: nowrap; }
.hdr-reset:hover { color: color-mix(in srgb, var(--danger) 80%, black); }

/* przewijana część panelu */
.scroll { padding: 24px; gap: 24px; }
.modes { gap: 8px; padding: 8px; margin: 0; background: var(--panel-2); border-radius: 12px; }
.modes button { height: 32px; padding: 8px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--faint); }
.modes button.is-on { background: var(--panel); color: var(--ink); box-shadow: none; }

/* oś trasy: znaczniki po lewej, pola po prawej */
.stop { grid-template-columns: 12px 1fr; gap: 16px; padding-bottom: 16px; --dt: 42px; }
.stop:last-child { padding-bottom: 0; }
.stop-seg { --dt: 27px; }
.stop-next:has(.sr-only) { --dt: 18px; }
.stop::before, .stop::after { content: none; position: absolute; left: 5.5px; width: 1px; background: var(--line); }
.timeline .stop:has(~ :is(.stop-seg, .stop-next:not([hidden])))::before { content: ""; top: calc(var(--dt) + 20px); bottom: 0; }
.timeline :is(.stop-seg, .stop-next)::after { content: ""; top: 0; height: calc(var(--dt) - 8px); }
.dot { width: 12px; height: 12px; margin: var(--dt) 0 0; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); }
.stop-start .dot { border: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='6' r='5.5' fill='%23fff' stroke='%2326262b'/%3E%3Cpath d='M6 .5A5.5 5.5 0 0 0 .5 6H6zM6 11.5A5.5 5.5 0 0 0 11.5 6H6z' fill='%2326262b'/%3E%3C/svg%3E") center / 12px no-repeat; }
.stop-next .dot { border-color: var(--line); }
.stop-seg .dot { width: 12px; height: 12px; margin: var(--dt) 0 0; border: 1px solid var(--line); background: var(--panel); color: transparent; font-size: 0; }
.stop-add .dot { visibility: hidden; }
.stop-label { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); text-transform: none; letter-spacing: 0; }
.search { height: 48px; gap: 8px; padding: 8px 16px 8px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); transition: border-color .15s; }
.search:focus-within { border-color: var(--ink-2); background: var(--panel); }
.search input { padding: 0; font-size: 13px; font-weight: 400; color: var(--ink); height: 100%; }
.search input::placeholder { color: var(--muted); font-weight: 400; }
.pick { width: 32px; height: 32px; margin: 0; border-radius: 4px; background: var(--panel-2); color: var(--ink); }
.pick:hover { color: var(--ink); background: var(--line); }
.pick.is-on { background: var(--ink); color: var(--accent-ink); }
.stop-fixed { height: 48px; padding: 0 16px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-size: 13px; font-weight: 400; color: var(--ink-2); }
.suggest { margin-top: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow-sm); }
.suggest li { display: flex; align-items: baseline; gap: 6px; min-height: 24px; padding: 4px 8px; border-radius: 4px; font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; }
.suggest li b { display: inline; font-size: 13px; font-weight: 600; }
.suggest li:hover { background: var(--panel-2); }
.sug-name { flex: none; }
.sug-rest { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: var(--faint); }
.chip { border-radius: 8px; background: var(--panel-2); font-weight: 600; }

/* odcinek na osi trasy */
.seg-card { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 36px 12px 16px; border: 1px solid #dadada; border-radius: 8px; background: var(--panel); cursor: pointer; }
.seg-card:hover { background: var(--panel); border-color: var(--line-2); }
.seg-card.is-on { background: var(--panel); box-shadow: none; border-color: var(--ink); outline: 1px solid var(--ink); }
.seg-to { font-size: 13px; font-weight: 500; color: var(--ink); }
.seg-meta { display: flex; align-items: center; gap: 8px; height: 16px; font-size: 12px; color: color-mix(in srgb, var(--ink) 55%, transparent); white-space: nowrap; }
.seg-chk { display: inline-flex; align-items: center; gap: 4px; color: var(--danger); }
.seg-card .stack { width: 69px; flex: none; height: 4px; }
.seg-del { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; padding: 4px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .15s; }
.seg-card:hover .seg-del, .seg-card:focus-within .seg-del, .seg-del:focus-visible { opacity: 1; }
.seg-del:hover { background: var(--danger-soft); color: var(--danger); }
.btn-addpt { display: inline-flex; align-items: center; gap: 4px; height: 48px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--panel-2); color: var(--ink); font: 600 13px/normal var(--f); cursor: pointer; }
.btn-addpt:hover { background: var(--line); }

/* pasek nawierzchni: przerwy 2 px, zaokrąglone końce */
.stack { display: flex; gap: 2px; height: 4px; border-radius: 8px; overflow: hidden; background: none; }
.stack i { flex: 0 0 auto; height: 100%; }
.stack .g { background: var(--s-grunt); } .stack .s { background: var(--s-szuter); } .stack .a { background: var(--s-asfalt); }
.stack-lg { height: 8px; }

/* przycisk główny i podpowiedź na dole panelu */
.cta { gap: 0; }
.btn-primary { display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 8px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 600; letter-spacing: 0; box-shadow: none; }
.btn-primary:hover:not(:disabled) { background: var(--accent-2); }
.btn-primary .ti, .go-text { position: relative; }
.btn-primary.is-stop { background: var(--danger); box-shadow: none; }
.btn-primary.is-stop .go-ico { display: none; }
body[data-status="running"] .btn-primary:disabled { background: var(--panel-2); color: var(--ink); }
.go-fill { background: color-mix(in srgb, var(--accent-ink) 22%, transparent); }
.status-box { margin-top: auto; display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 8px; background: var(--info-bg); color: var(--info-ink); }
.status-box .ti { margin-top: 0; }
.status { flex: 1; min-height: 0; font-size: 13px; line-height: 20px; color: inherit; }
.status-box .st-warn { display: none; }
.status-box:has(.status.is-err) { background: var(--danger-soft); color: var(--danger-ink); }
.status-box:has(.status.is-warn) { background: var(--warn-bg); color: var(--warn-ink); }
.status-box:has(.status:is(.is-err, .is-warn)) .st-warn { display: block; }
.status-box:has(.status:is(.is-err, .is-warn)) .st-info { display: none; }
.status.is-err, .status.is-warn { color: inherit; }

/* stopka trasy */
.summary { gap: 16px; padding: 24px; border-top: 1px solid var(--line); }
.summary:not(:has(.sum-full:not([hidden]))) { display: none; }
.sum-full { gap: 16px; }
.sum-warn { display: flex; align-items: flex-start; gap: 8px; padding: 16px 12px; border-radius: 8px; background: var(--danger-soft); color: var(--danger-ink); }
.sum-warn p { flex: 1; display: flex; gap: 8px; margin: 0; font-size: 13px; line-height: 20px; }
.sum-warn p span { flex: 1; }
.link-u { padding: 0; border: 0; background: none; color: inherit; font: 600 13px/inherit var(--f); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; white-space: nowrap; }
.sum-row { align-items: center; gap: 8px; }
.sum-km { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; color: var(--ink); font-size: 13px; font-weight: 400; }
.sum-km b { font-size: 32px; font-weight: 700; color: var(--ink); letter-spacing: 0; line-height: normal; }
.btn-dark, .btn-gray { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 48px; padding: 0 16px; border: 0; border-radius: 8px; font: 600 13px/normal var(--f); cursor: pointer; white-space: nowrap; }
.btn-dark { background: var(--accent); color: var(--accent-ink); }
.btn-dark:hover { background: var(--accent-2); }
.btn-gray { background: var(--panel-2); color: var(--ink); }
.btn-ico { width: 48px; padding: 0; flex: none; }
.sum-acts { display: flex; gap: 8px; }
.sum-acts > button { flex: 1 1 0; min-width: 0; width: auto; }
.btn-gray:hover { background: var(--line); }
.legend { flex-direction: row; flex-wrap: wrap; gap: 4px 12px; padding: 0; font-size: 11px; font-weight: 400; color: var(--ink); }
.legend span { gap: 4px; }
.sw { width: 6px; height: 6px; border-radius: 50%; }
.sw-check { width: 10px; height: 2px; border-radius: 0; background: repeating-linear-gradient(90deg, var(--s-check) 0 3px, transparent 3px 5px); }
.legend-end { justify-content: flex-end; margin-top: -8px; }

/* drugi panel: warianty i sprawdzanie */
.side2 { top: 0; left: 415px; bottom: 0; width: 415px; border-radius: 0; box-shadow: none; border-left: 1px solid var(--line); animation: none; }
.side2-top { gap: 8px; padding: 20px 24px; border-bottom: 1px solid var(--line); min-height: 89px; }
.side2-top h2 { flex: 1; font-size: 16px; font-weight: 600; color: var(--ink-2); letter-spacing: 0; }
.side2-top .icon-btn, .why-head .icon-btn { width: 48px; height: 48px; padding: 8px; border-radius: 8px; background: transparent; color: var(--ink); }
.side2-top .icon-btn:hover, .why-head .icon-btn:hover { background: var(--panel-2); }
.side2-body { padding: 24px; gap: 24px; }
.info-box { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 8px; background: var(--info-bg); color: var(--info-ink); }
.info-box p { margin: 0; font-size: 13px; line-height: 20px; }
.card { display: flex; flex-direction: column; align-items: stretch; gap: 24px; padding: 24px 16px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); text-align: left; }
.card:hover { border-color: var(--ink-2); }
.card.is-on { border: 2px solid var(--ink); padding: 23px 15px; background: var(--panel); }
.card-head { display: flex; align-items: flex-start; gap: 16px; }
.letter { grid-row: auto; background: none; font-weight: 600; }
.letter b { font-size: 16px; font-weight: 600; color: #000; }
:root[data-theme="dark"] .letter b { color: var(--ink); }
.card.is-on .letter { background: none; color: inherit; }
.card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.card-top { display: flex; align-items: center; justify-content: flex-start; gap: 12px; font-size: 16px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.card-sep { width: 4px; height: 4px; border-radius: 50%; background: currentColor; flex: none; }
.card-chk { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--danger); white-space: nowrap; }
.card-chk.is-ok { color: var(--ok); }
.card .btn-pick { display: none; flex: none; height: 40px; padding: 8px 16px; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font: 600 13px/normal var(--f); cursor: pointer; }
.card.is-on .btn-pick { display: inline-flex; align-items: center; background: var(--accent); color: var(--accent-ink); }
.card .stack { width: 100%; }
.btn-more { width: 100%; justify-content: center; border: 0; margin-top: 0; }
.dt-card .card-km { font-size: 14px; }

/* przyciski i pola w ustawieniach i na koncie */
.btn { height: 40px; padding: 0 14px; border-radius: 8px; background: var(--panel-2); font: 600 13px/normal var(--f); }
.btn:hover:not(:disabled) { color: var(--ink); background: var(--line); }
.btn-solid { background: var(--accent); color: var(--accent-ink); }
.btn-solid:hover:not(:disabled) { background: var(--accent-2); color: var(--accent-ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-quiet { background: transparent; }
.box .btn { background: var(--panel); box-shadow: none; border: 1px solid var(--line); }
.chk { border-radius: 8px; background: var(--panel-2); font-weight: 500; }
.sub { font-size: 13px; font-weight: 600; color: var(--ink-2); text-transform: none; letter-spacing: 0; }
.sec-head h2 { font-size: 16px; font-weight: 600; }
.acct-field { font-size: 13px; font-weight: 600; color: var(--ink); }
.acct-field input, .my-name, select, input[type="number"] { height: 48px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-size: 13px; font-weight: 500; color: var(--ink); }
.acct-field input:focus, .my-name:focus, select:focus, input[type="number"]:focus { border-color: var(--ink-2); outline: none; box-shadow: none; }
.acct-field input::placeholder { color: color-mix(in srgb, var(--ink) 50%, transparent); }
.box, .my-item, .rv-card, .acct-card { border-radius: 8px; }
.komin-row input { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.k-step { border-radius: 8px; }
.set-foot { padding: 24px; }
.modal { border-radius: 12px; }

/* elementy na mapie: mapa zaczyna się za panelem i paskiem ikon (415 + 64 px) */
.leaflet-top.leaflet-left { left: 479px; }
body.has-side2 .leaflet-top.leaflet-left { left: 830px; }
.pickhint, .fab-row, .edit-bar, .toast { left: calc(50% + 239.5px); }
body.has-side2 :is(.pickhint, .fab-row, .edit-bar, .toast) { left: calc(50% + 415px); }
.fab { height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-sm); font-weight: 600; font-size: 13px; }
.fab-icon { width: 40px; }
.fab kbd, .eb kbd { border-width: 1px; border-radius: 4px; }
.pickhint { border-radius: 8px; font-weight: 600; }
.pickhint button { border-radius: 6px; }
.edit-bar { border-radius: 12px; }
.eb { border-radius: 8px; font-weight: 600; }
.toast { border-radius: 8px; font-weight: 600; }
.leaflet-bar, .leaflet-control-layers { border-radius: 8px !important; border: 1px solid var(--line) !important; box-shadow: var(--shadow-sm) !important; }
.why-panel { border-radius: 12px; border: 1px solid var(--line); }
.why-head { padding: 16px 16px 8px 24px; }
.why-head h2 { font-size: 16px; font-weight: 600; }

/* ---------- logowanie (ekran wejściowy) ---------- */
.gate { padding: 0; background: var(--bg); display: block; }
.gate-card { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 0; width: 100%; max-width: none; height: 100%; min-height: 600px; padding: 24px; border: 0; border-radius: 0; background: var(--panel); box-shadow: none; overflow: hidden; }
.gate-panel { position: relative; isolation: isolate; display: flex; flex-direction: column; padding: 20px 25px; overflow: hidden; }
.gate-logo { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; color: var(--ink); line-height: normal; }
.gate-logo .brand-name { font-size: 24px; }
.gate-inner { flex: 1; width: 100%; max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; gap: 0; padding: 40px 0 180px; }
.gate-body { gap: 18px; }
.gate-deco { position: absolute; left: -95px; top: calc(50% + 31px); width: 428px; height: 720px; pointer-events: none; z-index: -1; }
.auth-head { margin-bottom: 27px; }
.gate-title { font-size: 32px; font-weight: 500; letter-spacing: 0; line-height: normal; color: #000; }
:root[data-theme="dark"] .gate-title { color: var(--ink); }
.gate .acct-form { gap: 18px; }
.gate .acct-field { gap: 8px; }
.acct-label-row label { font-size: 13px; font-weight: 600; color: #000; }
:root[data-theme="dark"] .acct-label-row label { color: var(--ink); }
.gate .acct-field input { height: 48px; padding: 8px 4px 8px 16px; border: 1px solid #dadada; border-radius: 8px; background: var(--panel); font-size: 13px; font-weight: 500; box-shadow: none; }
.gate .acct-field input:hover { border-color: var(--line-2); }
.gate .acct-field input:focus { border-color: var(--ink-2); box-shadow: none; }
.gate .acct-field input::placeholder { color: rgba(0, 0, 0, .5); font-weight: 500; }
.auth-forgot { margin: -8px 0 0; text-align: right; font-size: 13px; font-weight: 600; color: #000; }
:root[data-theme="dark"] .auth-forgot { color: var(--ink); }
.gate .btn-primary { margin-top: 7px; background: #545b51; color: #ffec80; }
.gate .btn-primary .ti { display: none; }
.gate .auth-switch { position: absolute; top: 31px; right: 48px; z-index: 1; margin: 0; font-size: 13px; color: #000; }
:root[data-theme="dark"] .gate .auth-switch { color: var(--ink); }
.gate .auth-switch .link-u { font-size: 13px; }
.auth-sub { font-size: 13px; color: var(--muted); }
/* panel ze zdjęciem (gradient z Figmy jest już na zdjęciu) i animacja z Figmy (gate-demo.js) – karta, hasło i pinezka w układzie 951 × 1152, skalowane do panelu */
.gate-art { position: relative; display: block; padding: 0; border-radius: 32px; background: #141414 url("login.jpg") center / cover no-repeat; overflow: hidden; }
.gd { --gd-s: .7; position: absolute; left: 50%; top: 50%; width: 951px; height: 1152px; transform: translate(-50%, -50%) scale(var(--gd-s)); pointer-events: none; user-select: none; font-family: Figtree, system-ui, sans-serif; }
.gd, .gd * { box-sizing: border-box; }
.gd img { display: block; max-width: none; }
.gd-claim { position: absolute; left: 0; right: 0; top: 770px; margin: 0; text-align: center; font-size: 52px; font-weight: 500; line-height: normal; color: #fff; }
.gd-claim span { color: #ffec80; }
.gd-logo { position: absolute; left: 444px; top: 927px; }
/* wejście napisów: linijki wysuwają się spod maski, potem pinezka */
.gd-claim > span { display: block; overflow: hidden; padding-bottom: 6px; margin-bottom: -6px; }
.gd-claim > span > span { display: inline-block; transform: translateY(105%); opacity: 0; color: inherit; }
.gd-claim > span:first-child > span { color: #fff; }
.gd-logo { opacity: 0; transform: translateY(14px) scale(.85); }
.gd.is-in .gd-claim > span > span { animation: gd-rise .9s cubic-bezier(.2, .75, .2, 1) forwards; }
.gd.is-in .gd-claim > span:nth-child(2) > span { animation-delay: .18s; }
.gd.is-in .gd-logo { animation: gd-pop .6s cubic-bezier(.3, 1.5, .5, 1) .55s forwards; }
.gd.is-in .gd-card { animation: gd-fade .7s ease backwards; }
@keyframes gd-rise { to { transform: none; opacity: 1; } }
@keyframes gd-pop { to { transform: none; opacity: 1; } }
@keyframes gd-fade { from { opacity: 0; transform: translateY(12px); } }
.gd-card { position: absolute; left: 283px; top: 359px; width: 386px; height: 366px; border-radius: 8px; background: #fff; box-shadow: 8px 4px 4px rgba(0, 0, 0, .06); overflow: hidden; color: #26262b; font-size: 13px; line-height: normal; text-align: left; transition: opacity .5s ease, transform .5s ease; }
/* sama karta animacji o 25% większa niż w projekcie; rośnie w górę, odstęp do napisu bez zmian */
.gd-card { scale: 1.25; transform-origin: 50% 100%; }
.gd-card[data-step="out"] { opacity: 0; transform: translateY(8px); }
.gd-scene { position: absolute; inset: 0; opacity: 0; visibility: hidden; transform: translateX(28px); transition: opacity .45s ease, transform .45s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .45s; }
.gd-card[data-step="plan"] .gd-plan, .gd-card:is([data-step="vars"], [data-step="done"], [data-step="out"]) .gd-vars, .gd-card[data-step="done"] .gd-done, .gd-card[data-step="out"] .gd-done { opacity: 1; visibility: visible; transform: none; transition: opacity .45s ease .1s, transform .45s cubic-bezier(.2, .7, .2, 1) .1s, visibility 0s; }
.gd-card[data-step="vars"] .gd-plan { transform: translateX(-28px); }
/* wybrany wariant: ślad zostaje i przesuwa się w górę na środek mapy szczegółów, równo z nim od dołu wjeżdża detal; nagłówek i karta wariantu znikają */
.gd-card .gd-done { transform: none; }
.gd-head, .gd-track, .gd-dots { transition: opacity .5s ease, transform .8s cubic-bezier(.65, 0, .35, 1); }
.gd-card:is([data-step="done"], [data-step="out"]) .gd-head { opacity: 0; transform: translateY(-64px); }
.gd-card:is([data-step="done"], [data-step="out"]) :is(.gd-track, .gd-dots) { opacity: 0; transform: translateY(24px); }
.gd-card .gd-route-b { will-change: transform; transition: opacity .3s ease, transform .9s cubic-bezier(.45, 0, .2, 1); }
.gd-card:is([data-step="done"], [data-step="out"]) .gd-route-b { --on: 1; transform: translateY(-47.5px); }
/* krok 1: Start i cel */
.gd-tabs { position: absolute; left: 0; top: 0; width: 322px; height: 64px; display: flex; }
.gd-tabs span { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 8px; border-bottom: 1px solid #e6e6e6; font-weight: 600; color: #9090a0; white-space: nowrap; }
.gd-tabs .is-on { border-bottom-color: #000; color: #26262b; }
.gd-rail { position: absolute; left: 322px; top: 0; width: 64px; height: 366px; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 16px 0; border-left: 1px solid #d9d9de; }
.gd-rail i { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; }
.gd-rail .is-on { background: #edefed; }
.gd-field { position: absolute; left: 52px; width: 246px; display: flex; flex-direction: column; gap: 8px; }
.gd-from { top: 97px; } .gd-to { top: 185px; }
.gd-label { font-weight: 600; color: #393941; }
.gd-input { display: flex; align-items: center; gap: 8px; height: 48px; padding: 8px 8px 8px 16px; border: 1px solid #d9d9de; border-radius: 8px; }
.gd-val { flex: 1; min-width: 0; height: 16px; color: #26262b; white-space: nowrap; }
.gd-val.is-typing::after { content: ""; display: inline-block; width: 1px; height: 15px; margin-left: 1px; vertical-align: -3px; background: #26262b; animation: gd-caret .8s steps(1) infinite; }
.gd-ico { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 4px; }
.gd-axis-s { position: absolute; left: 24px; top: 141px; }
.gd-axis-line { position: absolute; left: 29.5px; top: 161px; width: 1px; height: 58px; background: #d9d9de; }
.gd-axis-e { position: absolute; left: 24px; top: 227px; width: 12px; height: 12px; border: 1px solid #d9d9de; border-radius: 50%; }
.gd-btn { display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 8px; background: #545b51; color: #ffec80; font-weight: 700; white-space: nowrap; transition: transform .15s ease, filter .15s ease; }
.gd-btn.is-pressed { transform: scale(.96); filter: brightness(.82); }
.gd-go { position: absolute; left: 24px; top: 281px; width: 274px; height: 48px; padding: 8px; }
.gd-go img { transition: transform .6s ease; }
.gd-go.is-pressed img { transform: rotate(90deg) scale(1.15); }
/* krok 2 i 3: warianty */
.gd-head { position: absolute; left: 0; top: 0; width: 386px; height: 64px; display: flex; align-items: center; padding: 24px; border-bottom: 1px solid #e6e6e6; font-weight: 600; }
/* nagłówek „Wariant A” → „Wariant B”: napis wysuwa się w górę razem z przesunięciem kart */
.gd-head-t { display: grid; overflow: hidden; }
.gd-head-t b { grid-area: 1 / 1; font-weight: 600; transition: transform .6s cubic-bezier(.65, 0, .25, 1), opacity .6s ease; }
.gd-head-t b:nth-child(2) { transform: translateY(100%); opacity: 0; }
.gd-card[data-v="b"] .gd-head-t b:nth-child(1) { transform: translateY(-100%); opacity: 0; }
.gd-card[data-v="b"] .gd-head-t b:nth-child(2) { transform: none; opacity: 1; }
.gd-route { position: absolute; inset: 0; }
.gd-line { position: absolute; overflow: visible; }
.gd-line path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0s; }
.gd-pin { position: absolute; transform: scale(0); transition: transform 0s; }
.gd-card[data-step="vars"][data-v="a"] .gd-route-a, .gd-card[data-step="vars"][data-v="b"] .gd-route-b { --on: 1; }
.gd-route { opacity: var(--on, 0); transition: opacity .3s ease; }
.gd-card[data-step="vars"][data-v="a"] .gd-route-a path, .gd-card[data-step="vars"][data-v="b"] .gd-route-b path { stroke-dashoffset: 0; transition: stroke-dashoffset 1.1s cubic-bezier(.45, 0, .2, 1) .45s; }
.gd-card:is([data-step="done"], [data-step="out"]) .gd-route-b path { stroke-dashoffset: 0; }
.gd-card[data-step="vars"][data-v="a"] .gd-route-a .gd-pin, .gd-card[data-step="vars"][data-v="b"] .gd-route-b .gd-pin { transform: none; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1) .3s; }
.gd-card:is([data-step="done"], [data-step="out"]) .gd-route-b .gd-pin { transform: none; }
.gd-card[data-step="vars"][data-v="a"] .gd-route-a .gd-pin-e, .gd-card[data-step="vars"][data-v="b"] .gd-route-b .gd-pin-e { transition-delay: 1.45s; }
.gd-track { position: absolute; left: 0; top: 194px; width: 386px; overflow: hidden; }
.gd-slides { display: flex; transition: transform .6s cubic-bezier(.65, 0, .25, 1); }
.gd-card[data-v="b"] .gd-slides { transform: translateX(-386px); }
.gd-slide { flex: 0 0 386px; min-width: 0; padding: 0 24px; }
.gd-var { display: flex; flex-direction: column; gap: 24px; min-width: 0; padding: 25px 17px; border: 1px solid #d9d9de; border-radius: 8px; transform: translateY(16px); opacity: 0; transition: transform 0s, opacity 0s; }
.gd-card[data-step="vars"] .gd-var { transform: none; opacity: 1; transition: transform .5s cubic-bezier(.2, .7, .2, 1) .35s, opacity .4s ease .35s; }
.gd-var-row { display: flex; align-items: flex-start; gap: 16px; }
.gd-letter { display: flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border: .833px solid #d9d9de; border-radius: 9.167px; }
.gd-letter b { font-size: 16px; font-weight: 600; color: #9090a0; }
.gd-var-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.gd-var-top { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: #000; white-space: nowrap; }
.gd-dot { flex: none; width: 4px; height: 4px; border-radius: 50%; background: #000; }
.gd-chk { display: flex; align-items: center; gap: 4px; width: 160px; font-size: 12px; color: #f34b40; white-space: nowrap; }
.gd-pick { flex: none; height: 40px; padding: 8px 16px; }
.gd-bar { display: flex; align-items: center; gap: 2px; width: 100%; height: 4px; }
.gd-bar i { height: 100%; }
.gd-bar .g { flex: 1; min-width: 1px; border-radius: 8px 0 0 8px; background: #a3dc86; }
.gd-bar .s { flex: none; background: #ffec80; }
.gd-bar .a { flex: none; border-radius: 0 8px 8px 0; background: #f34b40; }
.gd-dots { position: absolute; left: 176px; top: 333px; display: flex; align-items: center; gap: 5px; }
.gd-dots i { width: 6px; height: 6px; border-radius: 16px; background: #d9d9de; transition: width .35s ease, background-color .35s ease; }
.gd-card[data-v="a"] .gd-dots i:nth-child(1), .gd-card[data-v="b"] .gd-dots i:nth-child(2) { width: 12px; background: #393941; }
/* krok 4: szczegóły trasy */
.gd-sum { position: absolute; left: 0; top: 163px; width: 386px; display: flex; flex-direction: column; gap: 16px; padding: 24px; border-top: 1px solid #d9d9de; background: #fff; transform: translateY(calc(100% + 8px)); transition: transform 0s; }
.gd-card:is([data-step="done"], [data-step="out"]) .gd-sum { transform: none; transition: transform .9s cubic-bezier(.45, 0, .2, 1); }
.gd-km { display: flex; flex-direction: column; justify-content: center; height: 54px; }
.gd-km b { font-size: 32px; font-weight: 700; color: #26262b; }
.gd-meta { display: flex; align-items: center; gap: 12px; color: #737484; }
.gd-meta .gd-dot { background: #737484; }
.gd-surf { display: flex; flex-direction: column; gap: 8px; }
.gd-surf .gd-bar { height: 8px; }
.gd-surf .gd-bar .s, .gd-surf .gd-bar .a { transform-origin: left; }
.gd-legend { display: flex; align-items: center; gap: 12px; font-size: 11px; color: #26262b; }
.gd-legend span { display: flex; align-items: center; gap: 4px; }
.gd-legend i { width: 6px; height: 6px; border-radius: 50%; }
.gd-legend .g { background: #a3dc86; } .gd-legend .s { background: #ffec80; } .gd-legend .a { background: #f34b40; }
.gd-acts { display: flex; gap: 8px; height: 40px; }
.gd-acts > span { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 0 16px; border-radius: 8px; background: #f7f7f8; color: #26262b; }
.gd-acts > .gd-btn { background: #545b51; color: #ffec80; }
.gd-acts b { font-weight: 600; }
.gd-surf .gd-bar .g { transform-origin: left; }
.gd-surf .gd-bar i { transform: scaleX(0); transition: transform 0s; }
.gd-card[data-step="done"] .gd-surf .gd-bar i, .gd-card[data-step="out"] .gd-surf .gd-bar i { transform: none; transition: transform .7s cubic-bezier(.3, 0, .2, 1) .85s; }
.gd-card[data-step="done"] .gd-surf .gd-bar .s { transition-delay: 1.05s; }
.gd-card[data-step="done"] .gd-surf .gd-bar .a { transition-delay: 1.25s; }
@keyframes gd-caret { 50% { opacity: 0; } }
@media (max-width: 860px) {
  .gate { padding: 0; }
  .gate-card { grid-template-columns: 1fr; grid-template-rows: 220px auto; height: auto; min-height: 100%; padding: 12px; border: 0; border-radius: 0; gap: 12px; }
  .gate-art { grid-row: 1; border-radius: 20px; }
  .gd { left: 0; top: auto; bottom: 20px; width: 100%; height: auto; transform: none; }
  .gd-card, .gd-logo { display: none; }
  .gd-claim { position: static; font-size: 32px; }
  .gate-panel { grid-row: 2; padding: 8px 8px 24px; overflow: visible; }
  .gate .auth-switch { position: static; margin-top: 16px; text-align: center; }
  .gate-deco { display: none; }
  .gate-inner { padding: 28px 0 0; }
  .gate-title { font-size: 28px; }
}

/* ---------- telefon: panel jako dolna karta, ikony menu w rogu mapy ---------- */
@media (max-width: 760px) {
  .sheet { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 60vh; border-radius: 16px 16px 0 0; border-top: 1px solid var(--line); }
  .top { padding: 8px 16px 12px; }
  .brand-name { font-size: 20px; }
  .scroll { padding: 16px; gap: 16px; }
  .summary { padding: 16px; }
  .rail { top: 10px; bottom: auto; left: auto; right: 10px; width: auto; height: auto; flex-direction: row; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); }
  .leaflet-top.leaflet-left, body.has-side2 .leaflet-top.leaflet-left { left: 0; }
  .pickhint, .fab-row, .edit-bar, .toast, body.has-side2 :is(.pickhint, .edit-bar, .toast) { left: 50%; }
  .fab-row, body.has-side2 .fab-row { left: auto; top: 64px; }
  .side2 { top: auto; left: 0; right: 0; width: auto; border-left: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; }
  .side2-top { min-height: 0; padding: 12px 16px; }
  .side2-body { padding: 16px; gap: 16px; }
}

/* ---------- telefon: zwijany pasek narzędzi mapy ---------- */
.fab-toggle { display: none; }
@media (max-width: 760px) {
  .fab-row, body.has-side2 .fab-row { top: 64px; right: 10px; left: auto; bottom: auto; transform: none; display: grid; grid-template-columns: repeat(2, 40px); grid-auto-flow: row dense; gap: 8px; justify-content: end; align-content: start;
    max-height: calc(40vh - 74px); overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
  body.has-side2 .fab-row { max-height: calc(45vh - 74px); }
  .fab-toggle { display: grid; place-items: center; grid-column: 2; grid-row: 1; }
  .fab-toggle .t-close, body.tools-open .fab-toggle .t-open { display: none; }
  body.tools-open .fab-toggle .t-close { display: block; }
  body.tools-open .fab-toggle { background: var(--ink); color: var(--panel); border-color: var(--ink); }
  .fab-row > .fab:not(.fab-toggle) { display: none; width: 40px; padding: 0; justify-content: center; }
  body.tools-open .fab-row > .fab:not(.fab-toggle):not([hidden]) { display: inline-flex; }
  .fab-row .fab span, .fab-row .fab kbd { display: none; }
  .pickhint, body.has-side2 .pickhint { top: 64px; left: 10px; right: 64px; transform: none; max-width: none; white-space: normal; }
  .toast, body.has-side2 .toast { top: 64px; left: 10px; right: 64px; transform: translate(0, -12px); max-width: none; }
  .toast.is-on { transform: none; }
}
@media (max-width: 760px) {
  body.tools-open :is(.pickhint, .toast) { right: 112px; }
}

/* ---------- telefon: dolny pasek nawigacji, nagłówki sekcji ---------- */
.top-title { display: none; flex: 1; margin: 0; font-size: 20px; font-weight: 600; color: var(--ink); }
#btn-plan { display: none; }
@media (max-width: 760px) {
  :root { --navh: calc(60px + env(safe-area-inset-bottom)); }
  .rail { top: auto; bottom: 0; left: 0; right: 0; width: auto; height: var(--navh); flex-direction: row; justify-content: space-around; align-items: flex-start; gap: 0;
    padding: 8px 8px env(safe-area-inset-bottom); border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; z-index: 1004; }
  .rail-btn { width: 52px; height: 44px; }
  #btn-plan { display: grid; }
  /* aktywna sekcja */
  .rail-btn { color: var(--muted); }
  body[data-view="route"]:not([data-side2="my"]) #btn-plan, body[data-view="settings"]:not([data-side2="my"]) #btn-settings,
  body[data-view="account"]:not([data-side2="my"]) #btn-account, body[data-side2="my"] #btn-my { background: var(--panel-2); color: var(--ink); }
  body[data-side2="my"] :is(#btn-settings, #btn-account) { background: transparent; }
  /* panel planowania nad paskiem; sekcje na cały ekran */
  .sheet { bottom: var(--navh); max-height: 55vh; padding-bottom: 0; }
  body:not([data-view="route"]) .sheet { top: 0; max-height: none; border-radius: 0; border-top: 0; }
  body:not([data-view="route"]) .sheet::before { display: none; }
  .side2 { bottom: var(--navh); }
  body[data-side2="my"] .side2 { top: 0; max-height: none; border-radius: 0; border-top: 0; z-index: 1003; }
  /* nagłówek: logo tylko na ekranie planowania, w sekcjach jej nazwa */
  body:not([data-view="route"]) .top :is(.brand, .hdr-icon, .hdr-reset) { display: none; }
  body:not([data-view="route"]) .top-title { display: block; }
  body:not([data-view="route"]) .top { padding: 16px; }
  .view-settings .sec-head, .view-account .sec-head { display: none; }
  .side2-top h2 { font-size: 20px; }
  /* elementy na mapie: pasek menu już nie jest u góry */
  .fab-row, body.has-side2 .fab-row { top: 10px; max-height: calc(45vh - var(--navh) - 20px); }
  .pickhint, body.has-side2 .pickhint, .toast, body.has-side2 .toast { top: 10px; }
}

/* ---------- telefon: zwijany panel (uchwyt u góry) ---------- */
.grip { display: none; }
@media (max-width: 760px) {
  .sheet::before { content: none; }
  .grip { display: block; flex: none; width: 100%; height: 22px; margin: 0; padding: 0; border: 0; background: transparent; cursor: pointer; position: relative; touch-action: none; }
  .grip::before { content: ""; position: absolute; left: 50%; top: 8px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line-2); }
  body:not([data-view="route"]) .sheet .grip, body[data-side2="my"] .side2 .grip { display: none; }
  .top, .side2-top { touch-action: pan-x; }
  body.sheet-min .sheet > :not(.grip):not(.top) { display: none !important; }
  body.sheet-min .sheet .top { border-bottom: 0; }
  body.side2-min .side2 > :not(.grip):not(.side2-top) { display: none !important; }
  body.side2-min .side2 .side2-top { border-bottom: 0; }
  body.sheet-min:not(.has-side2) .fab-row, body.side2-min .fab-row { max-height: calc(100vh - var(--navh) - 150px); }
}
@media (max-width: 760px) {
  /* warianty i sprawdzanie należą do planowania: w innych sekcjach schowane (wracają po powrocie do planowania) */
  body:not([data-view="route"]) .side2:not([data-kind="my"]) { display: none; }
  /* Moje trasy jak pozostałe sekcje: nagłówek bez krzyżyka, powrót ikoną Planowanie */
  body[data-side2="my"] #side2-close { display: none; }
  body[data-side2="my"] .side2-top { min-height: 0; padding: 16px; }
  .side2-top h2, .top-title { font-size: 20px; font-weight: 600; color: var(--ink); }
}

/* =====================================================================
   Mikroanimacje: krótkie i subtelne; wyłączone przy „ogranicz ruch”.
   ===================================================================== */
@media (prefers-reduced-motion: no-preference) {
  /* naciśnięcie: przycisk lekko się „wciska” */
  :is(.btn-primary, .btn-dark, .btn-gray, .btn-addpt, .btn, .btn-pick, .rail-btn, .fab, .eb, .hdr-icon, .hdr-reset, .pick, .modes button, .chip, .seg-card, .card) {
    transition: transform .12s ease, background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, opacity .2s ease;
  }
  :is(.btn-primary, .btn-dark, .btn-gray, .btn-addpt, .btn, .btn-pick, .fab, .eb, .chip):active:not(:disabled) { transform: scale(.96); }
  :is(.rail-btn, .hdr-icon, .pick):active:not(:disabled) { transform: scale(.88); }
  .hdr-reset:active { transform: scale(.95); }
  :is(.seg-card, .card):active { transform: scale(.99); }
  .modes button:active:not(:disabled) { transform: scale(.97); }
  .hdr-reset .ti { transition: transform .25s ease; }
  .hdr-reset:hover .ti { transform: rotate(90deg); }
  .btn-primary .go-ico { transition: transform .3s ease; }
  .btn-primary:hover:not(:disabled) .go-ico { transform: rotate(18deg) scale(1.12); }

  /* karty wariantów i odcinków pojawiają się kolejno */
  @keyframes sz-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  #side2[data-kind="var"] #side2-body > * { animation: sz-up .24s ease both; }
  #side2[data-kind="var"] #side2-body > :nth-child(2) { animation-delay: .03s; } #side2[data-kind="var"] #side2-body > :nth-child(3) { animation-delay: .06s; }
  #side2[data-kind="var"] #side2-body > :nth-child(4) { animation-delay: .09s; } #side2[data-kind="var"] #side2-body > :nth-child(5) { animation-delay: .12s; }
  #side2[data-kind="var"] #side2-body > :nth-child(n+6) { animation-delay: .15s; }
  .stop-seg.is-new { animation: sz-up .28s ease both; }
  .card .btn-pick { animation: sz-pop .2s ease both; }
  @keyframes sz-pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
  .sum-warn, .status-box, .info-box { animation: sz-up .24s ease both; }

  /* pasek nawierzchni „rośnie” od lewej */
  @keyframes sz-grow { from { transform: scaleX(0); } to { transform: none; } }
  :is(#side2[data-kind="var"] .card, .stop-seg.is-new) .stack { transform-origin: left center; animation: sz-grow .45s .1s cubic-bezier(.2, .8, .2, 1) both; }

  /* podpowiedzi adresów */
  .suggest:not([hidden]) { animation: sz-up .16s ease both; }
  .suggest li { transition: background-color .15s ease; }
}

@media (max-width: 760px) and (prefers-reduced-motion: no-preference) {
  /* dolny pasek: ikona aktywnej sekcji podskakuje */
  @keyframes sz-tab { 0% { transform: scale(.85); } 60% { transform: scale(1.08); } 100% { transform: none; } }
  body[data-view="route"]:not([data-side2="my"]) #btn-plan .ti, body[data-view="settings"]:not([data-side2="my"]) #btn-settings .ti,
  body[data-view="account"]:not([data-side2="my"]) #btn-account .ti, body[data-side2="my"] #btn-my .ti { animation: sz-tab .3s ease both; }

  /* sekcje na cały ekran wjeżdżają od dołu */
  @keyframes sz-screen { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
  body:not([data-view="route"]) .sheet .view { animation: sz-screen .22s ease both; }
  body[data-side2="my"] .side2 { animation: sz-screen .22s ease both; }
  body[data-view="route"] .sheet { animation: sz-screen .22s ease both; }

  /* rozwinięcie zwiniętego panelu: zawartość wysuwa się płynnie */
  body:not(.sheet-min) .sheet > .view, body:not(.side2-min) .side2 > .side2-body { animation: sz-up .22s ease both; }
  .grip::before { transition: width .2s ease, margin-left .2s ease, background-color .2s ease; }
  .grip:active::before { width: 56px; margin-left: -28px; background: var(--muted); }

  /* narzędzia mapy: przycisk obraca się, ikony wyskakują po kolei */
  .fab-toggle .ti { transition: transform .25s ease; }
  body.tools-open .fab-toggle .t-close { animation: sz-spin .25s ease both; }
  body:not(.tools-open) .fab-toggle .t-open { animation: sz-spin-back .25s ease both; }
  @keyframes sz-spin { from { transform: rotate(-90deg) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes sz-spin-back { from { transform: rotate(90deg) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
  body.tools-open .fab-row > .fab:not(.fab-toggle) { animation: sz-pop .2s cubic-bezier(.2, .9, .3, 1.3) both; }
  body.tools-open .fab-row > .fab:nth-child(2) { animation-delay: .00s; } body.tools-open .fab-row > .fab:nth-child(3) { animation-delay: .03s; }
  body.tools-open .fab-row > .fab:nth-child(4) { animation-delay: .06s; } body.tools-open .fab-row > .fab:nth-child(5) { animation-delay: .09s; }
  body.tools-open .fab-row > .fab:nth-child(6) { animation-delay: .12s; } body.tools-open .fab-row > .fab:nth-child(7) { animation-delay: .15s; }
  body.tools-open .fab-row > .fab:nth-child(8) { animation-delay: .18s; } body.tools-open .fab-row > .fab:nth-child(9) { animation-delay: .21s; }
  body.tools-open .fab-row > .fab:nth-child(n+10) { animation-delay: .24s; }
}

/* ---------- szukanie miejsca na mapie ---------- */
.map-search { position: absolute; z-index: 5; top: 14px; left: calc(50% + 239.5px); transform: translateX(-50%); width: min(440px, calc(100vw - 520px)); }
body.has-side2 .map-search { left: calc(50% + 415px); width: min(440px, calc(100vw - 870px)); }
.ms-box { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 6px 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow-lg); color: var(--muted); }
.ms-box input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font-size: 14px; color: var(--ink); }
.ms-box input::-webkit-search-cancel-button { display: none; }
.map-search .suggest { position: static; margin-top: 4px; box-shadow: var(--shadow-lg); }
.fab-search.is-on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.ms-pin { width: 18px; height: 18px; border-radius: 50%; background: var(--danger); border: 3px solid #fff; box-shadow: 0 0 0 6px color-mix(in srgb, var(--danger) 25%, transparent), 0 2px 6px rgba(0, 0, 0, .35); }
body.is-editing .map-search { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .map-search:not([hidden]) { animation: sz-up .18s ease both; }
  .ms-pin { animation: sz-pin 1.2s ease-out 3; }
  @keyframes sz-pin { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 45%, transparent), 0 2px 6px rgba(0,0,0,.35); } 100% { box-shadow: 0 0 0 16px transparent, 0 2px 6px rgba(0,0,0,.35); } }
}
@media (max-width: 760px) {
  /* prawy górny róg: [warstwy] [szukaj] [narzędzia] w jednym rzędzie, bez nachodzenia */
  .fab-search, body.tools-open .fab-row > .fab-search { display: grid !important; place-items: center; grid-column: 1; grid-row: 1; width: 40px; padding: 0; animation: none !important; }
  .leaflet-top.leaflet-right { top: 0; right: 96px; }
  .leaflet-top.leaflet-right .leaflet-control { margin-top: 12px; margin-right: 0; }
  .pickhint, body.has-side2 .pickhint, .toast, body.has-side2 .toast, body.tools-open :is(.pickhint, .toast) { right: 160px; }
  .map-search, body.has-side2 .map-search { top: 10px; left: 10px; right: 10px; width: auto; transform: none; z-index: 6; }
}

/* „Generuj warianty” przyklejony do dołu przewijanej części panelu (widać go także przy długiej osi trasy) */
.cta { position: sticky; bottom: -24px; z-index: 3; margin: -12px -24px -24px; padding: 12px 24px 24px; background: linear-gradient(to bottom, color-mix(in srgb, var(--panel) 0%, transparent), var(--panel) 12px); }
.cta:not(:has(#go:not([hidden]))) { display: none; }
@media (max-width: 760px) { .cta { bottom: -16px; margin: -8px -16px -16px; padding: 8px 16px 16px; } }

/* „wokół komina”: pole km na całą szerokość, przełącznik pętli z lewej bez tła */
.komin-row input { flex: 1; min-width: 0; width: auto; }
.chk-switch.k-loop { grid-template-columns: auto 1fr; gap: 12px; margin-top: 16px; padding: 0; background: none; }
.chk-switch.k-loop input.switch { order: -1; }
.k-test { margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: #ffec80; color: #26262b; font-size: 10px; font-weight: 700; font-style: normal; text-transform: uppercase; letter-spacing: .04em; vertical-align: 1px; }
.k-step { width: 48px; height: 48px; flex: none; }
.k-field { position: relative; flex: 1; min-width: 0; display: flex; }
.k-field input { width: 100%; padding: 0 44px; font-size: 16px; font-weight: 700; }
.k-field .k-unit { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); pointer-events: none; font-size: 13px; color: var(--muted); }

/* w trakcie liczenia przycisk zostaje ciemny i pokazuje, co robi silnik; klik zatrzymuje */
.btn-primary.is-stop, .btn-primary.is-stop:hover { background: var(--accent); box-shadow: none; }
.btn-primary.is-stop .go-text { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
/* loader na przycisku w trakcie liczenia (klik nic nie robi; przerywa „Zatrzymaj” w nagłówku) */
.go-spin { display: none; position: relative; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--accent-ink) 25%, transparent); border-top-color: var(--accent-ink); animation: go-spin .8s linear infinite; }
.btn-primary.is-stop { cursor: progress; }
.btn-primary.is-stop .go-spin { display: block; order: -1; }
@keyframes go-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .go-spin { animation-duration: 2s; } }
.status-box:not(:has(.status:is(.is-err, .is-warn))) { display: none; }   /* zwykłe (niebieskie) podpowiedzi nie są pokazywane; zostają tylko ostrzeżenia i błędy */
.k-field input { padding: 0 16px; }

/* przycisk warstw jak pozostałe przyciski na mapie: 40×40 z ramką, ikona Tablera zamiast obrazka Leafleta */
.leaflet-control-layers { background: var(--panel) !important; color: var(--ink); }
.leaflet-control-layers-toggle { width: 38px !important; height: 38px !important; background-image: none !important; position: relative; color: var(--ink) !important; }
.leaflet-control-layers-toggle:hover { color: var(--accent) !important; }
.leaflet-control-layers-toggle::before { content: ""; position: absolute; inset: 9px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4l-8 4l8 4l8 -4l-8 -4'/%3E%3Cpath d='M4 12l8 4l8 -4'/%3E%3Cpath d='M4 16l8 4l8 -4'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4l-8 4l8 4l8 -4l-8 -4'/%3E%3Cpath d='M4 12l8 4l8 -4'/%3E%3Cpath d='M4 16l8 4l8 -4'/%3E%3C/svg%3E") center / contain no-repeat; }
.leaflet-control-layers-toggle:hover { color: var(--accent); }
@media (max-width: 760px) {
  .leaflet-top.leaflet-right { right: 108px; }
  .leaflet-top.leaflet-right .leaflet-control { margin-top: 12px; }
}

/* zakładki „Planowanie” / „Twoja trasa” (gdy trasa ma odcinki) */
.rtabs { display: flex; flex: none; padding: 0 24px; border-bottom: 1px solid var(--line); }
.rtabs[hidden] { display: none; }
.rtabs button { flex: 1; height: 48px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--faint); cursor: pointer; transition: color .15s, border-color .15s; }
.rtabs button:hover { color: var(--ink); }
.rtabs button.is-on { color: var(--ink); border-bottom-color: var(--ink); }
/* zakładki Planowanie / Szczegóły trasy tylko na telefonie; na komputerze planowanie u góry, szczegóły przyklejone do dołu panelu */
@media (max-width: 760px) {
  .rtabs { padding: 0 16px; }
  body.has-route[data-rtab="route"] .view-route > .scroll { display: none; }
  body.has-route[data-rtab="route"] .summary { flex: 1; overflow-y: auto; border-top: 0; justify-content: flex-start; }
  body.has-route:not([data-rtab="route"]) .summary { display: none; }
}
@media (min-width: 761px) {
  .rtabs { display: none !important; }
  body.has-route .summary { max-height: 55vh; overflow-y: auto; }
}
@media (max-width: 760px) {
  /* warianty i sprawdzanie zastępują panel planowania; zwinięte zostawiają samą mapę */
  body[data-view="route"].has-side2:not([data-side2="my"]) .sheet { display: none; }
  body[data-view="route"].has-side2:not([data-side2="my"]) .side2 { max-height: 70vh; }
}
@media (max-width: 760px) {
  body.side2-min[data-side2="var"] .side2 > .side2-body { display: flex !important; flex: none; overflow: hidden; padding-top: 0; gap: 8px; animation: none; }
  /* zwinięte warianty: same karty do przesuwania (z paskiem nawierzchni) i kropki; zakładki, podpowiedź, legenda i „Generuj nowe” po rozwinięciu */
  body.side2-min[data-side2="var"] #side2-body > :not(.var-cards):not(.var-dots) { display: none; }
  body.side2-min[data-side2="var"] .var-dots { margin-top: 0; }
}

/* karty wariantów: na komputerze jedna pod drugą, na telefonie przewijane w bok */
.var-cards { display: flex; flex-direction: column; gap: inherit; }
.var-dots { display: none; }
@media (max-width: 760px) {
  .var-cards { flex-direction: row; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; scroll-padding: 0 16px; overscroll-behavior-x: contain; }
  .var-cards::-webkit-scrollbar { display: none; }
  .var-cards > .card { flex: 0 0 calc(100% - 28px); scroll-snap-align: center; }
  .var-dots { display: flex; justify-content: center; gap: 6px; margin-top: -4px; }
  .var-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--line-2); transition: width .2s, background .2s; }
  .var-dots i.is-on { width: 18px; background: var(--ink); }
  /* nagłówek drugiego panelu niżej przy uchwycie */
  .side2 .grip { height: 16px; }
  .side2 .grip::before { top: 6px; }
  .side2-top { padding: 0 8px 4px 16px; }
}
@media (max-width: 760px) {
  /* karuzela: wybrany jest wariant na środku, więc bez czarnej ramki; „Wybierz” na każdej karcie; karty zwinięte i rozwinięte tej samej wielkości */
  .var-cards > .card.is-on { border: 1px solid var(--line-2); padding: 24px 16px; }
  .var-cards > .card .btn-pick { display: inline-flex; align-items: center; }
}
.var-count { margin-left: 6px; font-size: 14px; font-weight: 400; color: var(--faint); }
@media (max-width: 760px) {
  /* ekran planowania: nagłówek z logo bliżej uchwytu, jak w panelu wariantów */
  .sheet .grip { height: 16px; }
  .sheet .grip::before { top: 6px; }
  body[data-view="route"] .sheet .top { padding: 0 16px 8px; }
}
/* trasa ma odcinki: tryb jest już ustalony, zakładki Segmenty / Wokół komina znikają (wracają po resecie) */
body.has-route .view-route .modes { display: none; }
/* logotyp: grubsza ikona i napis */
.logo-in .ti { stroke-width: 2.6; }
.brand-name { font-weight: 600; }
/* nagłówek drugiego panelu: miejsce na przycisk po prawej (np. „Wgraj GPX” w Moich trasach) */
.side2-extra { display: flex; align-items: center; gap: 8px; }
.side2-extra:empty { display: none; }
.side2-extra .btn-sm { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; font-size: 13px; }
#side2-title .my-count { margin-left: 6px; vertical-align: middle; font-size: 12px; font-weight: 600; padding: 2px 8px; background: var(--panel-2); color: var(--ink-2); }
.my-plan { margin: 0 0 4px; }
/* przełączniki: bez cienia; klikalny tylko sam przełącznik (nie cały wiersz z opisem), bez niebieskiego podświetlenia przy dotknięciu */
:is(.chk, .auth-terms) input.switch::after { box-shadow: none; top: 4px; left: 4px; width: 18px; height: 18px; }
.chk-switch { cursor: default; pointer-events: none; -webkit-tap-highlight-color: transparent; user-select: none; }
.chk-switch input.switch { pointer-events: auto; -webkit-tap-highlight-color: transparent; }
/* komunikat silnika na przycisku: jedna linijka (ucięta „…”), licznik sekund obok, zawsze widoczny */
.go-sec { position: relative; flex: none; font-size: 13px; font-weight: 500; opacity: .7; font-variant-numeric: tabular-nums; }
.go-sec:empty { display: none; }

/* ---------- przyciski mapy (ślad, zdjęcia/mapa, edytuj, warstwy) ---------- */
.fab[hidden] { display: none !important; }
@media (max-width: 760px) {
  /* telefon: wszystkie widoczne, w jednym rzędzie tuż nad panelem; jadą w górę i w dół razem z nim */
  .fab-row, body.has-side2 .fab-row, body.sheet-min:not(.has-side2) .fab-row, body.side2-min .fab-row {
    top: auto; bottom: calc(var(--cov, 45vh) + 10px); right: 10px; left: auto; transform: none; max-height: none;
    display: flex; flex-direction: row; gap: 8px; transition: bottom .3s ease; }
  body .fab-row > .fab:not([hidden]) { display: inline-flex; width: 40px; padding: 0; justify-content: center; }
  /* szukanie zostaje w prawym górnym rogu, obok wyboru warstw Leafleta */
  body .fab-row > .fab-search { position: fixed; top: 12px; right: 10px; bottom: auto; }
  .leaflet-top.leaflet-right { right: 58px; }
  .pickhint, body.has-side2 .pickhint, .toast, body.has-side2 .toast { right: 112px; }
  /* przybliżanie „−” „+”: na dole po lewej, w rzędzie z przyciskami mapy (jadą razem z panelem) */
  .leaflet-control-zoom.leaflet-bar { position: fixed; left: 10px; bottom: calc(var(--cov, 45vh) + 10px); margin: 0; display: flex; flex-direction: row-reverse; gap: 8px;
    border: 0 !important; box-shadow: none !important; background: none; overflow: visible; transition: bottom .3s ease; }
  .leaflet-control-zoom.leaflet-bar a { width: 40px !important; height: 40px !important; line-height: 38px !important; border: 1px solid var(--line) !important; border-radius: 8px !important;
    background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); font-size: 20px; }
  .leaflet-control-zoom.leaflet-bar a.leaflet-disabled { color: var(--faint); }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) { .fab-row { transition: none; } }
.next-x { flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin-right: -8px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--danger); cursor: pointer; }
.next-x:hover { background: var(--danger-soft); color: var(--danger); }
.next-x[hidden] { display: none; }
/* „Dodaj punkt” i „Zamknij pętlę” obok siebie */
.add-row { display: flex; flex-wrap: wrap; gap: 8px; }
.add-row .btn-addpt[hidden] { display: none; }
.add-row { flex-wrap: nowrap; }
.add-row .btn-addpt { flex: 1 1 0; min-width: 0; justify-content: center; padding: 0 10px; white-space: nowrap; }
@media (max-width: 760px) { .add-row .btn-addpt .ti { display: none; } }
/* start i cel na mapie wyglądają jak kropki przy polach po lewej: kółko z szachownicą (start ciemny, cel zielony) */
:root {
  --chk-start: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='6' r='5.5' fill='%23fff' stroke='%2326262b'/%3E%3Cpath d='M6 .5A5.5 5.5 0 0 0 .5 6H6zM6 11.5A5.5 5.5 0 0 0 11.5 6H6z' fill='%2326262b'/%3E%3C/svg%3E");
  --chk-finish: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='6' r='5.5' fill='%23fff' stroke='%235ca641'/%3E%3Cpath d='M6 .5A5.5 5.5 0 0 0 .5 6H6zM6 11.5A5.5 5.5 0 0 0 11.5 6H6z' fill='%235ca641'/%3E%3C/svg%3E");
}
.stop-next .dot { border: 0; background: var(--chk-finish) center / 12px no-repeat; }
.pin { width: 22px; height: 22px; border: 0; border-radius: 50%; box-shadow: 0 0 0 2.5px #fff, 0 2px 6px rgba(0, 0, 0, .4); }
.pin-start { background: #fff var(--chk-start) center / 22px no-repeat; }
.pin-next { background: #fff var(--chk-finish) center / 22px no-repeat; }
#btn-account .acct-dot, #btn-account.is-in .acct-dot { display: none; } /* bez zielonej kropki „zalogowany” przy ikonie konta */
/* pinezki startu i celu tej samej wielkości co kropki przy polach (12 px) */
.pin-hit { display: grid; place-items: center; }
.pin { width: 12px; height: 12px; box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0, 0, 0, .45); }
.pin-start, .pin-next { background-size: 12px; }
.pin { width: 16px; height: 16px; } .pin-start, .pin-next { background-size: 16px; } /* trochę większe niż kropki przy polach */
.nick-row { display: flex; gap: 8px; } .nick-row input { flex: 1; min-width: 0; } .nick-row .btn { flex: none; height: 48px; }
.acct-nick { margin-top: 4px; }

/* ---------- Moje trasy: karta z menu „⋮” ---------- */
.my-item { position: relative; flex-direction: row; align-items: center; gap: 4px; padding: 4px 4px 4px 0; }
.my-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 12px; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.my-dots { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.my-dots:hover, .menu-open .my-dots { background: var(--panel); color: var(--ink); }
.my-menu { position: absolute; z-index: 5; top: calc(100% - 6px); right: 4px; min-width: 190px; display: flex; flex-direction: column; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow-lg); }
.my-menu button { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 6px; background: none; text-align: left; font: 500 13px/1.2 var(--f); color: var(--ink); cursor: pointer; }
.my-menu button:hover { background: var(--panel-2); }
.my-menu .is-danger { color: var(--danger); }
.my-menu .is-danger:hover { background: var(--danger-soft); }
.my-list { overflow: visible; }
.badge-pub { display: inline-block; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 99px; background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); vertical-align: 2px; }

/* ---------- warstwa „Opublikowane trasy”: karta trasy ---------- */
.pub-pop .leaflet-popup-content { margin: 14px 16px; }
.pub-card { display: flex; flex-direction: column; gap: 4px; font-family: var(--f); }
.pub-name { font-weight: 700; font-size: 14px; color: var(--ink); }
.pub-acts { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; margin-top: 8px; }
.pub-acts .btn { flex: none; width: auto; min-width: 0; height: 36px; margin: 0; padding: 0 12px; font-size: 12px; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; }
.pub-acts .btn-ico { width: 36px; padding: 0; }
.pub-modal p { margin: 0 0 12px; }
.pub-modal .auth-terms { margin: 12px 0; }
.pub-votes { display: flex; gap: 6px; margin-top: 6px; }
.vote { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); color: var(--muted); font: 600 12px/1 var(--f); cursor: pointer; font-variant-numeric: tabular-nums; }
.vote:hover { color: var(--ink); }
.vote.is-on { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--panel)); color: var(--ok); }
.vote-down.is-on { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.vote:disabled { opacity: .6; cursor: progress; }
/* menu warstw: przycisk zostaje na miejscu, lista rozwija się pod nim (nie zasłania go) */
.leaflet-control-layers { overflow: visible !important; }
.leaflet-control-layers-expanded { padding: 0 !important; }
.leaflet-control-layers-expanded .leaflet-control-layers-toggle { display: block !important; color: var(--accent) !important; }
.leaflet-control-layers-expanded .leaflet-control-layers-list { position: absolute; top: calc(100% + 8px); right: -1px; min-width: 240px; max-width: calc(100vw - 32px); max-height: 60vh; overflow: auto; padding: 10px 14px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-sm); }
.leaflet-control-layers-list label { white-space: nowrap; }
.leaflet-control-layers-expanded .leaflet-control-layers-list { min-width: 0; }
.leaflet-control-layers-list label { padding: 3px 0; }
.leaflet-control-layers-list label > span, .leaflet-control-layers-list label > div { display: flex; align-items: center; }
.leaflet-control-layers-list input.leaflet-control-layers-selector { width: 20px; height: 20px; margin: 0 6px 0 0; flex: none; accent-color: var(--accent); }
/* karty w „Moich trasach” w stylu kart wariantów: biała karta z obramowaniem, nazwa jak „Wariant A”, dane w jednej linii z kropkami */
.my-item { background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; padding: 12px 8px 12px 0; }
.my-item:hover { border-color: var(--ink-2); }
.my-item.is-on { box-shadow: none; border: 2px solid var(--ink); padding: 11px 7px 11px 0; }
.my-main { gap: 6px; padding: 4px 16px; }
.my-name-t { font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.my-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.my-meta .card-sep { width: 3px; height: 3px; }
.my-list { gap: 12px; }
.my-load { flex: none; height: 40px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font: 600 13px/normal var(--f); cursor: pointer; }
.my-item { padding-right: 4px; }
.my-item.is-on { padding-right: 3px; }
.my-meta { flex-wrap: nowrap; white-space: nowrap; }
.my-date { font-size: 12px; color: var(--faint, var(--muted)); }
.my-main { gap: 4px; cursor: default; }
.my-item { flex-wrap: wrap; }
.my-stack { flex: 0 0 100%; padding: 8px 12px 2px 16px; }
.my-stack .stack { width: 100%; }
/* Szczegóły trasy: czas przejazdu, las */
.sum-extra { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.sum-extra li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sum-extra li:last-child { border-bottom: 0; }
.sum-extra li > .ti { flex: none; color: var(--muted); margin-top: 1px; }
.sum-extra li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sum-extra b { font-size: 14px; font-weight: 600; color: var(--ink); }
.sum-extra span { font-size: 13px; line-height: 18px; color: var(--muted); }
.sum-extra .link-u { flex: none; font-size: 13px; font-weight: 600; }
/* odcinki: numer nad nazwą; zaznaczone odcinki → Szczegóły trasy tylko dla nich */
.seg-n { font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: -6px; }
.seg-card .seg-meta { flex-wrap: wrap; row-gap: 4px; }
.sum-sel { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px; background: var(--panel-2); font-size: 13px; font-weight: 600; color: var(--ink); }
/* karta wariantu: linia z odcinkami do sprawdzenia */
.card-info { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
/* most pod przyciskiem warstw: przerwa między przyciskiem a listą nie zamyka menu przy najechaniu myszą */
.leaflet-control-layers-expanded { position: relative; }
.leaflet-control-layers-expanded::after { content: ""; position: absolute; top: 100%; right: -1px; width: 260px; max-width: calc(100vw - 32px); height: 10px; }
/* „Moje adresy”: nagłówki w liście podpowiedzi i lista w Koncie */
.suggest li.sug-head { min-height: 0; padding: 8px 8px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint, var(--muted)); cursor: default; }
.suggest li.sug-head:hover { background: none; }
.suggest li.sug-head + li.sug-head, .suggest li:not(.sug-head) + li.sug-head { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0; padding-top: 10px; }
.place-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.place-item { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 40px 10px 14px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); }
.place-item > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.place-item b { font-size: 14px; font-weight: 600; color: var(--ink); }
.place-item .seg-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-item .place-del { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); opacity: 1; color: var(--danger); }
.place-add { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.place-add input { width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; font-size: 14px; box-sizing: border-box; }
.place-q { position: relative; }
/* „×” czyszczący wpisaną frazę: widoczny po najechaniu na pole albo w trakcie pisania, tylko gdy coś jest wpisane */
.q-clear { display: none; flex: none; place-items: center; width: 28px; height: 28px; margin: 0 -6px 0 0; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.q-clear:hover { background: var(--panel-2); color: var(--ink); }
:is(.search, .place-q):hover input:not(:placeholder-shown) + .q-clear, input:focus:not(:placeholder-shown) + .q-clear { display: grid; }
.place-q .q-clear { position: absolute; right: 8px; top: 10px; margin: 0; }
.place-q input:not(:placeholder-shown) { padding-right: 40px; }
/* przy wybranym kolejnym punkcie jest już czerwony „×” (usuwa punkt) – drugiego nie pokazujemy */
.search:has(.next-x:not([hidden])) .q-clear { display: none; }
.my-menu.is-up { top: auto; bottom: calc(100% - 6px); }

/* ---------- Konto: profil, plan i Pro, płatności i faktury ---------- */
.acct-hero { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 8px; background: var(--panel-2); }
.acct-hero .acct-avatar { width: 44px; height: 44px; font-size: 17px; font-weight: 700; }
.acct-hero .acct-who { flex: 1; }
.acct-hero .acct-who b { font-size: 15px; font-weight: 600; }
.plan-badge { flex: none; padding: 4px 10px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.plan-badge.is-pro { background: #ffec80; border-color: #ffec80; color: #26262b; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.acct-sec { display: flex; flex-direction: column; gap: 12px; padding-top: 20px; border-top: 1px solid var(--line); }
.acct-sec > .sub { margin: 0; }
.acct-sec .place-list { margin: 0; }
.plan-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; }
.plan-top { display: flex; align-items: center; gap: 8px; }
.plan-top b { font-size: 15px; font-weight: 600; }
.plan-top .seg-meta { margin-left: auto; }
.meter { display: flex; flex-direction: column; gap: 8px; }
.meter-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); min-height: 24px; }
.meter-row b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.meter-row .link-btn { font-size: 13px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.meter-bar { height: 6px; border-radius: 99px; background: var(--panel-2); overflow: hidden; margin-top: -2px; }
.meter-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ink); }
.meter-bar.is-near i { background: #e5a000; }
.meter-bar.is-full i { background: var(--danger); }
.plan-st { margin: 0; font-size: 13px; font-weight: 600; }
.plan-st.is-ok { color: var(--ok); } .plan-st.is-warn { color: var(--mid-ink); } .plan-st.is-bad { color: var(--danger); }
.plan-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.plan-card.is-pro { border-color: #545b51; }
.pro-tag { flex: none; padding: 2px 7px; border-radius: 5px; background: #ffec80; color: #26262b; font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.pro-card { display: flex; flex-direction: column; gap: 14px; padding: 20px 16px; border-radius: 8px; color: #fff; background: linear-gradient(160deg, #5d6559 0%, #42483f 100%); }
.pro-card .plan-top b { color: #fff; font-size: 16px; }
.pro-soon { margin-left: auto; font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .7); }
.pro-int { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 8px; background: rgba(0, 0, 0, .22); }
.pro-int button, .pro-int label { height: 32px; border: 0; border-radius: 6px; background: none; color: rgba(255, 255, 255, .8); font: 600 13px/32px var(--f); cursor: pointer; text-align: center; }
.pro-int .is-on { background: #fff; color: #26262b; }
.pro-int small { font-size: 11px; font-weight: 700; color: #2f8a3a; }
.pro-int button:not(.is-on) small { color: #ffec80; }
.pro-price { display: flex; align-items: baseline; gap: 6px; }
.pro-price b { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.pro-price span { font-size: 13px; color: rgba(255, 255, 255, .75); }
.pro-perks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.pro-perks li { display: flex; align-items: flex-start; gap: 8px; }
.pro-perks .ti { flex: none; margin-top: 1px; color: #ffec80; }
.btn.btn-pro { justify-content: center; height: 48px; background: #ffec80; color: #26262b; font-weight: 700; }
.btn.btn-pro:hover:not(:disabled) { background: #fff3ad; color: #26262b; }
.btn.btn-pro.is-done, .btn.btn-pro.is-done:hover:not(:disabled) { background: rgba(255, 255, 255, .14); color: #fff; cursor: default; }
.btn.btn-pro.is-done .ti { color: #ffec80; }
.pro-note { margin: 0; font-size: 12px; line-height: 18px; color: rgba(255, 255, 255, .75); }
.pro-note .link-btn { color: #fff; font-size: 12px; text-decoration: underline; text-underline-offset: 2px; padding: 0; }
.kv { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.kv > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv-l { font-size: 12px; color: var(--muted); }
.kv-v { font-size: 13.5px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.kv-s { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.kv .link-btn { flex: none; font-size: 13px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.bill-form { padding: 16px; border-radius: 8px; background: var(--panel-2); gap: 14px; }
.bill-form .bill-kind { background: var(--panel); border: 1px solid var(--line); }
.bill-form .bill-kind label { color: var(--muted); }
.bill-form .bill-kind .is-on { background: var(--ink); color: var(--panel); }
.bill-kind input { position: absolute; opacity: 0; pointer-events: none; }
.bill-kind label:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 1px; }
.bill-form[data-kind="person"] .only-company { display: none; }
.bill-row2 { display: grid; grid-template-columns: 120px 1fr; gap: 10px; }
.bill-row2 .acct-field { min-width: 0; }
.inv-head { margin-top: 4px; }
.inv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.inv { display: grid; grid-template-columns: 1fr auto auto 36px; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.inv:last-child { border-bottom: 0; }
.inv-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inv-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.inv-pdf { text-align: right; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.chip { padding: 2px 8px; border-radius: 99px; background: var(--panel-2); color: var(--muted); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.chip.is-ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.chip.is-warn { background: var(--warn-bg); color: var(--warn-ink); }
.chip.is-bad { background: var(--danger-soft); color: var(--danger); }
.acct-danger .note { line-height: 18px; }
.acct-sec + .acct-privacy { border-top: 1px solid var(--line); padding-top: 20px; }
@media (max-width: 760px) {
  .inv { grid-template-columns: 1fr auto 36px; }
  .inv .chip { grid-column: 1; justify-self: start; grid-row: 2; margin-top: -4px; }
}

/* =====================================================================================================
   Redesign 2 (Figma „Szutrownik”, ekrany planowania): pływająca karta nad mapą, oliwkowe przyciski z żółtym
   tekstem, zakładki z podkreśleniem, ikony paska z projektu, znak wodny z pinezką. Wymiary i kolory 1:1 z Figmy.
   ===================================================================================================== */
:root {
  --accent: #545b51; --accent-2: #4a5047; --accent-ink: #ffec80; --accent-soft: #edefed;
  --olive-soft: #edefed; --olive-ink: #545b51; --olive-hover: #e2e5e1;
  --tab-line: #e6e6e6; --card-line: #b7b7c2;
  --ok-btn: #78be5d; --no-btn: #fb776e;
  --warn2-bg: #fdf9f0; --warn2-line: #f9e24b; --warn2-ink: #9e650a;
  --err-line: #ffccc9;
  --ri-a: #c6c6d5; --ri-b: #e2e2ec; --ri-a-on: #545b51; --ri-b-on: #919a8d;
  --float-shadow: 8px 4px 4px rgba(0, 0, 0, .06);
  --pub-bg: #d6eeca; --pub-ink: #3d5e2d;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #5e665a; --accent-2: #6b7466; --accent-ink: #ffec80; --accent-soft: #2a2d29;
    --olive-soft: #2a2d29; --olive-ink: #c9d1c4; --olive-hover: #343833; --tab-line: #30342e; --card-line: #464c43;
    --warn2-bg: #3a3214; --warn2-line: #7a6a1a; --warn2-ink: #ffe27a; --err-line: #5a2a26;
    --ri-a: #464c43; --ri-b: #30342e; --ri-a-on: #c9d1c4; --ri-b-on: #8e9889;
    --float-shadow: 8px 4px 12px rgba(0, 0, 0, .35); --pub-bg: #26381e; --pub-ink: #b5dca0;
  }
}
:root[data-theme="dark"] {
  --accent: #5e665a; --accent-2: #6b7466; --accent-ink: #ffec80; --accent-soft: #2a2d29;
  --olive-soft: #2a2d29; --olive-ink: #c9d1c4; --olive-hover: #343833; --tab-line: #30342e; --card-line: #464c43;
  --warn2-bg: #3a3214; --warn2-line: #7a6a1a; --warn2-ink: #ffe27a; --err-line: #5a2a26;
  --ri-a: #464c43; --ri-b: #30342e; --ri-a-on: #c9d1c4; --ri-b-on: #8e9889;
  --float-shadow: 8px 4px 12px rgba(0, 0, 0, .35); --pub-bg: #26381e; --pub-ink: #b5dca0;
}

/* ---------- komputer: karta 16 px od krawędzi, pasek ikon w karcie, drugi panel nachodzi na pasek ---------- */
@media (min-width: 761px) {
  .sheet { top: 16px; left: 16px; bottom: 16px; width: 415px; border-radius: 8px 0 0 8px; box-shadow: var(--float-shadow); overflow: hidden; }
  .rail { top: 16px; bottom: 16px; left: 431px; width: 64px; border-radius: 0 8px 8px 0; box-shadow: var(--float-shadow); border-left: 1px solid var(--line); }
  /* dodatkowe okna (warianty, sprawdzanie): osobna karta po prawej stronie głównej, 16 px odstępu */
  .side2 { top: 16px; bottom: 16px; left: 511px; width: 415px; z-index: 1002; border-radius: 8px; box-shadow: var(--float-shadow); border-left: 0; }
  /* „Moje trasy” zajmują panel planowania pod nagłówkiem z logo (jak w projekcie), pasek ikon zostaje widoczny */
  body[data-side2="my"] .side2 { top: 89px; left: 16px; width: 415px; border-radius: 0 0 0 8px; border-left: 0; box-shadow: none; }
  body[data-side2="my"] #side2-close { display: none; }
  .leaflet-top.leaflet-left { left: 511px; }
  body.has-side2:not([data-side2="my"]) .leaflet-top.leaflet-left { left: 942px; }
  body.has-side2[data-side2="my"] .leaflet-top.leaflet-left { left: 511px; }
  :is(.pickhint, .fab-row, .edit-bar, .toast, .map-search) { left: calc(50% + 247.5px); }
  body.has-side2:not([data-side2="my"]) :is(.pickhint, .fab-row, .edit-bar, .toast, .map-search) { left: calc(50% + 463px); }
  body.has-side2[data-side2="my"] :is(.pickhint, .fab-row, .edit-bar, .toast, .map-search) { left: calc(50% + 247.5px); }
  body.has-side2:not([data-side2="my"]) .map-search { width: min(440px, calc(100vw - 982px)); }
  #btn-plan { display: grid; }
  /* znak wodny i hasło na pustym panelu planowania */
  .view-route { position: relative; overflow: hidden; }
  .view-route::before { content: ""; position: absolute; left: -101px; bottom: -208px; width: 428px; height: 720px; background: url("img/mark.svg") no-repeat 0 0 / 428px 720px; pointer-events: none; }
  .view-route::after { content: "Kurz, szuter i święty spokój"; position: absolute; left: 0; right: 0; bottom: 50px; text-align: center; font: 700 20px/32px var(--f); color: #9eaa98; pointer-events: none; }
  .view-route > * { position: relative; z-index: 1; }
  .view-route:has(#sum-full:not([hidden]))::before, .view-route:has(#sum-full:not([hidden]))::after { display: none; }
  .view-route:not(:has(#sum-full:not([hidden]))) > .scroll { padding-bottom: 116px; }
  .view-route > .scroll { background: transparent; }
}

/* ---------- nagłówek: logotyp z Figmy, „Resetuj” ---------- */
.top { min-height: 72px; padding: 16px 24px; gap: 8px; }
.brand { display: flex; align-items: center; color: var(--ink); line-height: 0; }
.brand-logo { display: block; width: 162px; height: 40px; flex: none; color: var(--ink); }
:root[data-theme="dark"] .brand-logo { color: var(--ink); }
.hdr-reset { font: 600 13px/normal var(--f); color: var(--danger); }

/* ---------- zakładki z podkreśleniem (Segmenty / Wokół komina, Szutry / Asfalt, Planowanie / Szczegóły) ---------- */
.scroll, .side2-body { --sp: 24px; }
.modes, .rtabs { display: flex; gap: 0; padding: 0; margin: 0; background: var(--panel); border-radius: 0; }
.modes button, .rtabs button { flex: 1; height: 64px; padding: 24px 8px; border: 0; border-bottom: 1px solid var(--tab-line); border-radius: 0; background: transparent; box-shadow: none;
  font: 600 13px/16px var(--f); color: var(--faint); cursor: pointer; }
.modes button.is-on, .modes button[aria-selected="true"], .rtabs button[aria-selected="true"] { background: transparent; color: var(--ink); border-bottom-color: var(--ink); box-shadow: none; }
.modes button:hover:not(.is-on):not([aria-selected="true"]):not(:disabled), .rtabs button:hover:not([aria-selected="true"]) { color: var(--ink-2); }
.scroll > .modes:first-child, .side2-body > .modes:first-child { margin: calc(-1 * var(--sp)) calc(-1 * var(--sp)) 8px; }
.side2-body > .var-tabs:first-child { margin-bottom: 0; }
.rtabs { flex: none; }

/* ---------- pola Start / Dokąd: ikona wskazania po prawej ---------- */
.stop-label { font: 600 13px/16px var(--f); color: var(--ink-2); margin: 0 0 8px; }
.search { height: 48px; gap: 8px; padding: 8px 8px 8px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.search:focus-within { border-color: var(--ink-2); }
.search input { order: 0; font-size: 13px; font-weight: 400; color: var(--ink); }
.search input::placeholder { color: var(--muted); }
.search .q-clear { order: 1; }
.search .pick { order: 2; width: 32px; height: 32px; border-radius: 4px; background: transparent; color: var(--faint); }
.search .pick:hover { background: var(--panel-2); color: var(--ink-2); }
.search .pick.is-on { background: var(--accent); color: var(--accent-ink); }
.search .next-x { order: 3; }
.stop-fixed { font-size: 13px; font-weight: 400; color: var(--ink); }

/* ---------- przyciski ---------- */
.btn-primary { height: 48px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font: 700 13px/normal var(--f); }
.btn-primary:hover:not(:disabled) { background: var(--accent-2); color: var(--accent-ink); }
.btn-solid { background: var(--accent); color: var(--accent-ink); }
.btn-solid:hover:not(:disabled) { background: var(--accent-2); color: var(--accent-ink); }
.add-row { display: flex; gap: 16px; }
.btn-addpt { flex: 1; justify-content: center; height: 40px; padding: 0 16px; border-radius: 8px; background: var(--olive-soft); color: var(--olive-ink); font: 600 13px/normal var(--f); white-space: nowrap; }
.btn-addpt:hover:not(:disabled) { background: var(--olive-hover); color: var(--olive-ink); }
.add-row .btn-addpt .ti { display: none; }
.btn-more { flex: none; width: 100%; }

/* ---------- Wokół komina: długość i przełącznik ---------- */
.komin-row { gap: 8px; margin: 0 0 16px; }
.k-step { width: 48px; height: 48px; flex: none; border-radius: 8px; background: var(--olive-soft); color: var(--olive-ink); display: grid; place-items: center; font-size: 0; }
.k-step:hover { background: var(--olive-hover); }
.k-field { flex: 1; min-width: 0; }
.komin-row input, .k-field input { width: 100%; height: 48px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font: 400 13px/normal var(--f); color: var(--ink); text-align: center; }
.k-loop { gap: 8px; }
.k-loop > span { font-size: 13px; font-weight: 400; color: #41414b; }
:root[data-theme="dark"] .k-loop > span { color: var(--ink-2); }
:is(.chk, .auth-terms) input.switch { width: 41px; height: 24px; border-radius: 12px; background: var(--olive-soft); border: 0; }
:is(.chk, .auth-terms) input.switch::after { top: 4px; left: 5px; width: 16px; height: 16px; background: #fff; box-shadow: none; }
:is(.chk, .auth-terms) input.switch:checked { background: var(--accent); }
:is(.chk, .auth-terms) input.switch:checked::after { transform: translateX(15px); background: var(--accent-ink); }
body[data-mode="komin"] .timeline .stop::before, body[data-mode="komin"] .timeline .stop::after { content: none; }
body[data-mode="komin"] .timeline .stop { grid-template-columns: 1fr; gap: 0; }
body[data-mode="komin"] .timeline .dot { display: none; }

/* ---------- odcinki trasy ---------- */
.seg-card { gap: 8px; padding: 12px 36px 12px 16px; border: 1px solid #dadada; border-radius: 8px; background: var(--panel); }
:root[data-theme="dark"] .seg-card { border-color: var(--line); }
.seg-card.is-on { border-color: var(--accent); outline: 1px solid var(--accent); }
.seg-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.seg-n { flex: none; width: 16px; height: 16px; margin: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 2px; font: 500 10px/1 var(--f); color: var(--ink); }
.seg-to { font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg-meta { font-size: 12px; color: color-mix(in srgb, var(--ink) 50%, transparent); }

/* ---------- pasek nawierzchni i legenda ---------- */
.stack { gap: 2px; height: 4px; border-radius: 8px; background: none; }
.stack i:first-child { border-radius: 8px 0 0 8px; } .stack i:last-child { border-radius: 0 8px 8px 0; } .stack i:only-child { border-radius: 8px; }
.stack .g { background: #a3dc86; } .stack .s { background: #ffec80; } .stack .a { background: #f34b40; }
.stack-lg { height: 8px; }
.legend { flex-direction: row; flex-wrap: wrap; gap: 4px 12px; font: 400 11px/normal var(--f); color: var(--ink); padding: 0; }
.legend span { gap: 4px; }
.legend .sw:not(.sw-check):not(.sw-sug) { width: 6px; height: 6px; border-radius: 50%; }
.legend .sw-grunt { background: #a3dc86; } .legend .sw-szuter { background: #ffec80; } .legend .sw-asfalt { background: #f34b40; }
.legend-end { justify-content: flex-end; }

/* ---------- drugi panel: nagłówek, informacja, karty wariantów ---------- */
.side2-top { min-height: 72px; padding: 16px 24px; gap: 8px; border-bottom: 1px solid var(--line); }
.side2-top h2 { font: 600 16px/normal var(--f); color: var(--ink-2); }
.side2-top .icon-btn { width: 40px; height: 40px; padding: 8px; border-radius: 8px; color: #697962; }
.side2-top .icon-btn:hover { background: var(--olive-soft); }
.info-box { min-height: 40px; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; background: var(--info-bg); color: var(--info-ink); }
.info-box p { font-size: 13px; line-height: 16px; }
.card { gap: 24px; padding: 24px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.card:hover { border-color: var(--card-line); }
.card.is-on { border: 2px solid var(--accent); padding: 23px 15px; background: var(--panel); }
.card-head { gap: 16px; align-items: flex-start; }
.card .letter { width: 40px; height: 40px; border: .833px solid var(--card-line); border-radius: 9.167px; background: none; }
.card.is-on .letter { border-color: var(--line); background: none; }
.card .letter b, .card.is-on .letter b { font: 600 16px/normal var(--f); color: var(--faint); }
.card-main { gap: 4px; }
.card-top { gap: 12px; font: 600 16px/normal var(--f); color: var(--ink); }
.card-top { color: #000; }
:root[data-theme="dark"] .card-top { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card-top { color: var(--ink); } }
.card-sep { width: 4px; height: 4px; }
.card-chk { gap: 4px; font: 400 12px/normal var(--f); color: var(--danger); }
.card-chk.is-ok { color: var(--ok); }
.card .btn-pick, .card.is-on .btn-pick { height: 40px; padding: 8px 16px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font: 700 13px/normal var(--f); }
.card.is-on .btn-pick:hover { background: var(--accent-2); }

/* ---------- podsumowanie trasy ---------- */
.summary { gap: 16px; padding: 24px; }
.sum-full { gap: 16px; }
.sum-warn { align-items: flex-start; gap: 8px; padding: 12px; border: 1px solid var(--err-line); border-radius: 8px; background: var(--danger-soft); color: var(--danger-ink); }
.sum-warn p { font-size: 13px; line-height: normal; }
.sum-warn .link-u { font-weight: 600; text-decoration: underline; color: inherit; }
.sum-km b { font-size: 32px; font-weight: 700; color: var(--ink); }
.sum-km > span { font-size: 13px; color: var(--muted); }
.sum-acts { gap: 8px; }
.btn-dark, .btn-gray { height: 40px; padding: 0 16px; gap: 4px; border-radius: 8px; font: 600 13px/normal var(--f); }
.btn-dark { background: var(--accent); color: var(--accent-ink); }
.btn-dark:hover:not(:disabled) { background: var(--accent-2); color: var(--accent-ink); }
.btn-gray { background: var(--panel-2); color: var(--ink); }
.btn-gray:hover:not(:disabled) { background: var(--line); }

/* ---------- sprawdzanie odcinków ---------- */
.side2-body > .rv-head:first-child { margin: calc(-1 * var(--sp)) calc(-1 * var(--sp)) -8px; }
.rv-head { display: flex; align-items: center; gap: 8px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.rv-head span { flex: 1; text-align: center; font: 600 13px/normal var(--f); color: var(--ink-2); }
.rv-arrow { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 8px; background: var(--olive-soft); color: var(--olive-ink); cursor: pointer; }
.rv-arrow:hover { background: var(--olive-hover); }
.rv-body { display: flex; flex-direction: column; gap: 16px; }
.rv-body.is-sug .rv-len { color: #7c3aed; }
.rv-f { display: flex; flex-direction: column; gap: 8px; }
.rv-l { font: 600 13px/normal var(--f); color: var(--ink-2); }
.rv-len { font: 700 32px/normal var(--f); color: var(--ink); cursor: pointer; width: fit-content; }
.rv-sub { margin-top: -6px; font-size: 12px; color: var(--muted); }
.rv-reason { display: flex; align-items: center; gap: 8px; padding: 12px; border: 1px solid var(--warn2-line); border-radius: 8px; background: var(--warn2-bg); color: var(--warn2-ink); font-size: 13px; }
.rv-reason span::first-letter { text-transform: uppercase; }
.rv-reason .ti { flex: none; }
.rv-dec { display: flex; gap: 16px; }
.rv-dec button { flex: 1; min-width: 0; height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 16px; border: 0; border-radius: 8px;
  font: 600 13px/normal var(--f); color: #fff; cursor: pointer; white-space: nowrap; }
.rv-dec .btn-yes { background: var(--ok-btn); }
.rv-dec .btn-nope { background: var(--no-btn); }
.rv-dec .btn-yes:hover { background: color-mix(in srgb, var(--ok-btn) 88%, black); }
.rv-dec .btn-nope:hover { background: color-mix(in srgb, var(--no-btn) 88%, black); }
.rv-gm { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 40px; border-radius: 8px; font: 600 13px/normal var(--f); color: var(--olive-ink); text-decoration: none; }
.rv-gm:hover { background: var(--olive-soft); }
.rv-hint { font-size: 12px; }
.rv-card { background: var(--panel-2); border-radius: 8px; }

/* ---------- Moje trasy ---------- */
#side2-title .my-count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin-left: 8px; padding: 0 4px; border-radius: 4px; background: var(--olive-soft); color: var(--ink); font: 600 13px/1 var(--f); vertical-align: 1px; }
body[data-side2="my"] .side2-top { min-height: 64px; padding: 12px 24px; }
body[data-side2="my"] .side2-top h2 { color: var(--ink); }
#my-import { height: 40px; padding: 0 16px; gap: 4px; border: 0; border-radius: 8px; background: var(--olive-soft); color: var(--olive-ink); font: 600 13px/normal var(--f); box-shadow: none; }
#my-import:hover { background: var(--olive-hover); }
.my-item { position: relative; display: block; padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: none; }
.my-item:hover { border-color: var(--card-line); }
.my-item.is-on { border: 2px solid var(--accent); padding: 23px; box-shadow: none; }
.my-main { display: flex; flex-direction: column; gap: 8px; padding-right: 24px; min-width: 0; }
.my-name-t { font: 600 16px/normal var(--f); color: var(--ink); }
.my-name-t { color: #000; }
:root[data-theme="dark"] .my-name-t { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .my-name-t { color: var(--ink); } }
.my-meta { gap: 16px; font-size: 12px; color: color-mix(in srgb, var(--ink) 50%, transparent); }
.my-meta .card-sep { display: none; }
.my-dots { position: absolute; top: 7px; right: 7px; width: 40px; height: 40px; color: var(--ink); }
.my-item.is-on .my-dots { top: 6px; right: 6px; }
.my-stack { padding: 0; margin-top: 24px; }
.badge-pub { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; margin-left: 8px; border-radius: 4px; background: var(--pub-bg); color: var(--pub-ink); font: 400 12px/1 var(--f); text-transform: uppercase; vertical-align: 2px; }

/* ---------- pasek ikon (ikony dwukolorowe z projektu) ---------- */
.rail { gap: 16px; padding: 16px 0; }
.rail-btn { border-radius: 8px; background: transparent; }
.rail-btn .ri { display: block; overflow: visible; }
.rail-btn .ri-a { fill: var(--ri-a); } .rail-btn .ri-b { fill: var(--ri-b); }
.rail-btn:hover { background: color-mix(in srgb, var(--olive-soft) 60%, transparent); }
body[data-view="route"]:not([data-side2="my"]) #btn-plan, body[data-side2="my"] #btn-my,
body[data-view="account"]:not([data-side2="my"]) #btn-account, body[data-view="settings"]:not([data-side2="my"]) #btn-settings { background: var(--olive-soft); --ri-a: var(--ri-a-on); --ri-b: var(--ri-b-on); }
.sheet[data-view="account"] #btn-account, .sheet[data-view="settings"] #btn-settings { color: inherit; }

/* ---------- telefon: te same elementy, układ bez zmian ---------- */
@media (max-width: 760px) {
  .scroll, .side2-body { --sp: 16px; }
  .side2-top { min-height: 0; padding: 12px 16px; }
  .rv-head { padding: 12px 16px; }
  .rail-btn { width: 52px; height: 44px; }
  .top { min-height: 0; }
  .brand-logo { width: 132px; height: 32px; }
}
/* punkt docelowy na osi: puste kółko jak w projekcie */
.timeline .stop-next .dot { width: 12px; height: 12px; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); }
.my-item .my-main { padding: 0 24px 0 0; }
/* karta odcinka: km, asfalt, czas, do sprawdzenia i pasek nawierzchni zawsze w jednej linii (pasek się zwęża) */
.seg-card .seg-meta { flex-wrap: nowrap; white-space: nowrap; min-width: 0; overflow: hidden; }
.seg-card .seg-meta > span { flex: none; }
.seg-card .seg-meta .stack { flex: 0 1 69px; min-width: 20px; width: auto; }
/* podsumowanie jak w projekcie: km, „% asfaltu • czas”, pasek z legendą pod spodem, przyciski 40 px */
.sum-meta2 { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.sum-meta2 .card-sep { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.sum-meta2:has(#sum-time:empty) .card-sep { display: none; }
.sum-bar { display: flex; flex-direction: column; gap: 8px; }
.sum-extra:empty { display: none; }
.sum-acts > :is(.btn-dark, .btn-gray) { height: 40px; }
.sum-warn { align-items: center; }
.sum-warn p { align-items: center; }
/* Zapisz / Wyślij: ten sam styl co pozostałe przyciski drugorzędne (jasnooliwkowe tło, oliwkowy tekst) */
.btn-gray { background: var(--olive-soft); color: var(--olive-ink); }
.btn-gray:hover:not(:disabled) { background: var(--olive-hover); color: var(--olive-ink); }
/* liczenie: bez paska postępu w przycisku, zostaje kręciołek, napis i sekundy */
#go .go-fill { display: none; }
/* litera wariantu: jedna ramka (w projekcie wewnętrzny kwadrat nie ma obrysu) */
.card .letter b, .card.is-on .letter b { border: 0; background: none; }
/* nagłówek karty wariantu (km • % asfaltu): 13 px */
.card .card-top { font-size: 13px; }
/* włączony przełącznik: biała gałka na oliwkowym tle */
:is(.chk, .auth-terms) input.switch:checked::after { background: #fff; }
/* odstęp między kartami wariantów: 12 px */
.var-cards { gap: 12px; }

/* ---------- komputer: Konto, Ustawienia i Moje trasy w oknie obok panelu (jak warianty), panel planowania zostaje ---------- */
@media (min-width: 761px) {
  .sheet:is([data-view="settings"], [data-view="account"]) .view-route { display: flex; }
  .sheet .view-settings, .sheet .view-account { position: fixed; top: 16px; bottom: 16px; left: 511px; width: 415px; z-index: 2;
    flex-direction: column; background: var(--panel); border-radius: 8px; box-shadow: var(--float-shadow); overflow: hidden; }
  body:is([data-view="settings"], [data-view="account"]) .side2 { display: none; }
  /* nagłówek okna: jak w wariantach (72 px, linia pod spodem, krzyżyk) */
  :is(.view-settings, .view-account) .scroll > .sec-head:first-child { margin: calc(-1 * var(--sp)) calc(-1 * var(--sp)) 0; min-height: 72px; padding: 16px 24px;
    align-items: center; border-bottom: 1px solid var(--line); }
  :is(.view-settings, .view-account) .sec-head h2 { font: 600 16px/normal var(--f); color: var(--ink-2); }
  /* Moje trasy też obok panelu, z krzyżykiem */
  body[data-side2="my"] .side2 { top: 16px; left: 511px; width: 415px; border-radius: 8px; box-shadow: var(--float-shadow); }
  body[data-side2="my"] #side2-close { display: grid; }
  body.has-side2[data-side2="my"] .leaflet-top.leaflet-left,
  body:is([data-view="settings"], [data-view="account"]) .leaflet-top.leaflet-left { left: 942px; }
  body.has-side2[data-side2="my"] :is(.pickhint, .fab-row, .edit-bar, .toast, .map-search),
  body:is([data-view="settings"], [data-view="account"]) :is(.pickhint, .fab-row, .edit-bar, .toast, .map-search) { left: calc(50% + 463px); }
}
.sec-x { flex: none; width: 40px; height: 40px; padding: 8px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #697962; cursor: pointer; }
.sec-x:hover { background: var(--olive-soft); }
@media (max-width: 760px) { .sec-x { display: none; } }

/* subtelny pasek przewijania: cienki, jasny, bez strzałek */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink) 16%, transparent) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 8px; background: color-mix(in srgb, var(--ink) 16%, transparent) padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--ink) 30%, transparent); }
::-webkit-scrollbar-button { display: none; }

/* ---------- Moje trasy: karty jak karty wariantów (numer w kwadracie, nazwa 13 px, dane 12 px, pasek na dole) ---------- */
.my-list { gap: 12px; }
.my-item { display: flex; flex-direction: column; gap: 24px; padding: 24px 16px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.my-item:hover { border-color: var(--card-line); }
.my-item.is-on { border: 2px solid var(--accent); padding: 23px 15px; }
.my-row { display: flex; align-items: flex-start; gap: 16px; min-width: 0; }
.my-item .my-num { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: .833px solid var(--card-line); border-radius: 9.167px; background: none; }
.my-item.is-on .my-num { border-color: var(--line); }
.my-item .my-num b { font: 600 16px/normal var(--f); color: var(--faint); border: 0; background: none; width: auto; height: auto; }
.my-item .my-main { flex: 1; min-width: 0; gap: 4px; padding: 0; align-self: center; }
.my-item .my-name-t { font: 600 13px/normal var(--f); overflow-wrap: anywhere; }
.my-item .my-meta { gap: 12px; font-size: 12px; }
.my-item .my-meta .card-sep { display: inline-block; width: 4px; height: 4px; }
.my-item .my-dots, .my-item.is-on .my-dots { position: static; flex: none; width: 40px; height: 40px; margin: 0; }
.my-item .my-stack { margin: 0; padding: 0; }
.my-item .my-stack:empty { display: none; }
.my-item .badge-pub, .my-item .badge-gpx { margin-left: 6px; }
.my-item { align-items: stretch; }
.my-item .my-stack .stack { width: 100%; }
/* komputer: bez ikony planowania w pasku (panel planowania jest zawsze widoczny) */
@media (min-width: 761px) { #btn-plan { display: none; } }
.my-item > .my-row, .my-item > .my-stack { flex: none; width: 100%; }

/* ---------- komputer: okna po prawej (warianty, sprawdzanie, Moje trasy, Ustawienia, Konto) przyklejone do panelu, bez przerwy ---------- */
@media (min-width: 761px) {
  .side2, body[data-side2="my"] .side2, .sheet .view-settings, .sheet .view-account { left: 495px; border-radius: 0 8px 8px 0; border-left: 1px solid var(--line); }
  body.has-side2 .rail, body:is([data-view="settings"], [data-view="account"]) .rail { border-radius: 0; }
  body:is([data-view="settings"], [data-view="account"]) .side2 { display: none; }
  body.has-side2 .leaflet-top.leaflet-left, body.has-side2[data-side2="my"] .leaflet-top.leaflet-left,
  body:is([data-view="settings"], [data-view="account"]) .leaflet-top.leaflet-left { left: 926px; }
  body.has-side2 :is(.pickhint, .fab-row, .edit-bar, .toast, .map-search), body.has-side2[data-side2="my"] :is(.pickhint, .fab-row, .edit-bar, .toast, .map-search),
  body:is([data-view="settings"], [data-view="account"]) :is(.pickhint, .fab-row, .edit-bar, .toast, .map-search) { left: calc(50% + 455px); }
  body.has-side2 .map-search { width: min(440px, calc(100vw - 966px)); }
}

/* ---------- komputer: nagłówki wszystkich paneli tej samej wysokości, bez cienia paska na oknie obok, tooltipy ikon ---------- */
@media (min-width: 761px) {
  .top, .side2-top, body[data-side2="my"] .side2-top, :is(.view-settings, .view-account) .scroll > .sec-head:first-child { height: 73px; min-height: 73px; box-sizing: border-box; }
  body[data-side2="my"] .side2-top { padding: 16px 24px; }
  /* pasek ikon nad oknami obok (tooltipy nie chowają się pod nimi); przy otwartym oknie cień tylko w dół, nie na okno */
  .rail { z-index: 1003; }
  body.has-side2 .rail, body:is([data-view="settings"], [data-view="account"]) .rail { box-shadow: 0 4px 4px rgba(0, 0, 0, .06); }
  /* tooltipy: mała ciemna etykieta z białym napisem i prostą strzałką (trójkąt), żeby nie wyglądała jak przycisk */
  .rail-btn[data-tip]::after { content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; transform: translate(-4px, -50%); z-index: 5;
    padding: 5px 8px; border-radius: 4px; background: #1d1f1b; color: #fff; font: 500 11px/14px var(--f); white-space: nowrap;
    opacity: 0; pointer-events: none; transition: opacity .12s ease, transform .12s ease; }
  .rail-btn[data-tip]::before { content: ""; position: absolute; left: calc(100% + 5px); top: 50%; z-index: 5; width: 0; height: 0;
    border-style: solid; border-width: 5px 5px 5px 0; border-color: transparent #1d1f1b transparent transparent;
    transform: translate(-4px, -50%); opacity: 0; pointer-events: none; transition: opacity .12s ease, transform .12s ease; }
  .rail-btn[data-tip]:hover::after, .rail-btn[data-tip]:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
  .rail-btn[data-tip]:hover::before, .rail-btn[data-tip]:focus-visible::before { opacity: 1; transform: translate(0, -50%); }
  /* ciemny motyw: etykieta odróżnia się od ciemnego panelu */
  :root[data-theme="dark"] .rail-btn[data-tip]::after { background: #3b4038; } :root[data-theme="dark"] .rail-btn[data-tip]::before { border-right-color: #3b4038; }
}
#my-import { height: 40px; min-height: 0; padding-top: 0; padding-bottom: 0; line-height: 1; }
/* Moje trasy: bez numeru; nazwa w jednej linii z etykietą (za długa – ucięta), mniejsza etykieta */
.my-item .my-name-t { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; }
.my-item .my-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.my-item .badge-pub, .my-item .badge-gpx { flex: none; margin: 0; height: 16px; padding: 0 6px; display: inline-flex; align-items: center; border-radius: 4px; font: 500 10px/1 var(--f); letter-spacing: .02em; vertical-align: 0; }
.my-item .my-main { align-items: stretch; overflow: hidden; }
.my-item .my-name-t { max-width: 100%; }
/* nagłówki, zakładki i pasek nawigacji sprawdzania zostają na górze okna – przewija się tylko treść */
:is(.view-settings, .view-account) .scroll > .sec-head:first-child,
.scroll > .modes:first-child, .side2-body > .modes:first-child, .side2-body > .rv-head:first-child {
  position: sticky; top: calc(-1 * var(--sp)); z-index: 3; background: var(--panel); }
/* Moje trasy: „⋮” w rogu karty (8 px od góry i prawej), ghost jak krzyżyk zamykania; menu tuż pod przyciskiem */
.my-item .my-dots, .my-item.is-on .my-dots { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; padding: 8px; border-radius: 8px; background: transparent; color: #697962; }
.my-item.is-on .my-dots { top: 7px; right: 7px; }
.my-item .my-dots:hover, .my-item.menu-open .my-dots { background: var(--olive-soft); color: #697962; }
.my-item .my-main { padding-right: 40px; }
.my-item .my-menu { top: 52px; right: 8px; bottom: auto; }
.my-item.is-on .my-menu { top: 51px; right: 7px; }
.my-item .my-menu.is-up { top: auto; bottom: calc(100% - 4px); }

/* ---------- komputer: panel dociągnięty do krawędzi (góra, dół, lewo) – bez marginesu, bez zaokrągleń ---------- */
@media (min-width: 761px) {
  .sheet { top: 0; left: 0; bottom: 0; border-radius: 0; }
  .rail { top: 0; bottom: 0; left: 415px; border-radius: 0; }
  .side2, body[data-side2="my"] .side2, .sheet .view-settings, .sheet .view-account { top: 0; bottom: 0; left: 479px; border-radius: 0; }
  .leaflet-top.leaflet-left, body.has-side2[data-side2="my"] .leaflet-top.leaflet-left { left: 495px; }
  body.has-side2 .leaflet-top.leaflet-left, body.has-side2[data-side2="my"] .leaflet-top.leaflet-left,
  body:is([data-view="settings"], [data-view="account"]) .leaflet-top.leaflet-left { left: 910px; }
  :is(.pickhint, .fab-row, .edit-bar, .toast, .map-search) { left: calc(50% + 239.5px); }
  body.has-side2 :is(.pickhint, .fab-row, .edit-bar, .toast, .map-search), body.has-side2[data-side2="my"] :is(.pickhint, .fab-row, .edit-bar, .toast, .map-search),
  body:is([data-view="settings"], [data-view="account"]) :is(.pickhint, .fab-row, .edit-bar, .toast, .map-search) { left: calc(50% + 447px); }
  body.has-side2 .map-search { width: min(440px, calc(100vw - 934px)); }
  /* znak wodny: ta sama pozycja względem dołu panelu */
  .view-route::after { bottom: 66px; }
}

/* leśne km na kartach wariantów i w Szczegółach trasy */
.card-forest, .sum-forest { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); white-space: nowrap; }
.card-forest { font: 400 12px/normal var(--f); }
.sum-meta2:has(#sum-forest:empty) .sep-forest { display: none; }
.sum-meta2 { flex-wrap: wrap; row-gap: 4px; }

/* napis w logotypie: ciemniejszy odcień oliwki z przycisków głównych (#545b51); w ciemnym motywie jasny jak dotąd */
:root { --logo-ink: #363b34; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --logo-ink: #e6eae2; } }
:root[data-theme="dark"] { --logo-ink: #e6eae2; }
.brand-logo, :root[data-theme="dark"] .brand-logo, .gate-logo { color: var(--logo-ink); }

/* telefon: marginesy 24 px z każdej strony; aktywna ikona w dolnym pasku jako kwadrat, nie szeroka pigułka */
@media (max-width: 760px) {
  .top, body[data-view="route"] .sheet .top, body:not([data-view="route"]) .top { padding-left: 24px; padding-right: 24px; }
  .scroll, .side2-body, .summary, .set-foot { padding-left: 24px; padding-right: 24px; }
  .side2-top, .rv-head, body[data-side2="my"] .side2-top { padding-left: 24px; padding-right: 24px; }
  .scroll > .modes:first-child, .side2-body > .modes:first-child { margin-left: -24px; margin-right: -24px; }
  .side2-body > .rv-head:first-child { margin-left: -24px; margin-right: -24px; }
  :is(.view-settings, .view-account) .scroll > .sec-head:first-child { margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px; }
  .var-cards { margin: 0 -24px; padding: 0 24px; scroll-padding: 0 24px; }
  .cta { margin: -8px -24px -16px; padding: 8px 24px 16px; }
  .rail { justify-content: space-between; padding-left: 24px; padding-right: 24px; }
  .rail-btn { width: 44px; height: 44px; }
}
@media (max-width: 760px) {
  .card-head .card-main { flex: 1; min-width: 0; }
  .card-head .card-chk { white-space: normal; align-items: flex-start; }
  .card-head .card-chk .ti { flex: none; margin-top: 1px; }
}

/* Moje trasy: km w lesie w linii z km i % asfaltu */
.my-meta .my-forest { display: inline-flex; align-items: center; gap: 3px; color: var(--ok); white-space: nowrap; }
.my-meta .my-forest .ti { width: 14px; height: 14px; }
.my-meta { flex-wrap: nowrap; min-width: 0; overflow: hidden; }
.my-meta > span { flex: none; }
.my-meta > .my-forest { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { .my-meta { gap: 8px; } }

/* podkład mapy (OSM, OpenTopoMap) wyciszony: trasa i drogi z danych odcinają się od tła; w ciemnym motywie mapa przyciemniona */
.leaflet-layer.base-muted { filter: saturate(.4) brightness(1.03) contrast(.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .leaflet-layer.base-muted { filter: invert(.9) hue-rotate(180deg) saturate(.35) brightness(.95) contrast(.85); } }
:root[data-theme="dark"] .leaflet-layer.base-muted { filter: invert(.9) hue-rotate(180deg) saturate(.35) brightness(.95) contrast(.85); }
/* km w lesie tym samym szarym co reszta informacji (bez zieleni) */
.sum-forest, .my-meta .my-forest { color: inherit; }
.card-forest { color: var(--muted); }
/* nagłówek z logo: wstecz / dalej jako przyciski ghost 40×40, wszystko wyśrodkowane w pionie */
.top { align-items: center; }
.top .hdr-icon { width: 40px; height: 40px; padding: 10px; border-radius: 8px; background: transparent; color: var(--ink); }
.top .hdr-icon:hover:not(:disabled) { background: var(--olive-soft); }
.top .hdr-icon + .hdr-icon { margin-left: -4px; }
.top .hdr-reset { margin-left: 8px; }
@media (max-width: 760px) {
  body[data-view="route"] .sheet .top { padding-top: 4px; padding-bottom: 4px; }
}

/* telefon: delikatniejszy uchwyt panelu; zwinięty panel w trakcie liczenia zostawia przycisk (postęp / zatrzymaj) */
@media (max-width: 760px) {
  .grip::before, .sheet .grip::before, .side2 .grip::before { width: 32px; height: 3px; margin-left: -16px; border-radius: 2px; background: color-mix(in srgb, var(--muted) 35%, transparent); }
  .grip:active::before { width: 44px; margin-left: -22px; background: color-mix(in srgb, var(--muted) 60%, transparent); }
  body.sheet-min:is([data-status="running"], .go-ready) .sheet > .view-route { display: flex !important; flex-direction: column; min-height: 0; overflow: visible; animation: none; }
  body.sheet-min:is([data-status="running"], .go-ready) .sheet > .view-route > :not(.scroll) { display: none !important; }
  body.sheet-min:is([data-status="running"], .go-ready) .sheet .view-route > .scroll { padding-top: 0; overflow: visible; }
  body.sheet-min:is([data-status="running"], .go-ready) .sheet .view-route > .scroll > :not(.cta) { display: none !important; }
  body.sheet-min:is([data-status="running"], .go-ready) .sheet .cta { position: static; margin: 0; padding: 0 0 4px; background: none; }
}
/* telefon: uchwyt leży na górze panelu, nie zajmuje miejsca – logo i tytuły stoją pośrodku między krawędzią panelu a linią pod nagłówkiem */
@media (max-width: 760px) {
  .sheet > .grip, .side2 > .grip { position: absolute; top: 0; left: 0; right: 0; z-index: 2; }
  body[data-view="route"] .sheet .top { padding-top: 16px; padding-bottom: 16px; }
  .side2 .side2-top { padding-top: 16px; padding-bottom: 16px; }
}

/* sprawdzanie odcinka: między „Jest droga” i „Wytycz objazd” przycisk z okiem – mapa na tym odcinku */
.rv-dec { gap: 8px; align-items: center; }
.rv-dec .rv-zoom { flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 8px; background: var(--olive-soft); color: var(--olive-ink); display: grid; place-items: center; cursor: pointer; }
.rv-dec .rv-zoom:hover { background: var(--olive-hover); }

/* zwijanie / rozwijanie panelu: przycisk na dole panelu nie jedzie razem z krawędzią – znika na czas animacji i wraca łagodnie */
.sheet .cta { transition: opacity .18s ease; }
body.panel-anim .sheet .cta { opacity: 0; transition: none; }

/* telefon: komunikaty (toast) po lewej, nad mapą – obok przycisków warstw i szukania w prawym górnym rogu */
@media (max-width: 760px) {
  .toast, body.has-side2 .toast, body.tools-open .toast { top: 12px; left: 10px; right: auto; width: max-content; max-width: calc(100vw - 130px); transform: translate(0, -12px); }
  .toast.is-on, body.has-side2 .toast.is-on, body.tools-open .toast.is-on { transform: none; }
}
/* telefon, „wokół komina” przed policzeniem trasy: panel rośnie do wysokości treści (start, długość, pętla, przycisk) – bez przewijania
   w środku; nad panelem zostaje co najmniej 150 px mapy */
@media (max-width: 760px) {
  /* pusty panel planowania (każdy tryb): wysokość według treści, bez przewijania; nad panelem zostaje 150 px mapy */
  body[data-view="route"]:not(.has-route) .sheet { max-height: calc(100vh - var(--navh) - 150px); max-height: calc(100dvh - var(--navh) - 150px); }
}

/* Wokół komina: odstęp switcha „Pętla” od przycisku jak między polami (24px) */
#stop-komin { padding-bottom: 8px; }
.chk-switch.k-loop { margin-bottom: 0; }

/* toast: długie nazwy plików bez spacji łamiemy, żeby tekst nie wychodził poza dymek */
.toast { overflow-wrap: anywhere; }

/* Moje trasy: czas przejazdu z ikoną zegarka, jak km w lesie */
.my-meta .my-time { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.my-meta .my-time .ti { width: 14px; height: 14px; }

/* Bez niebieskiego podświetlenia przy dotknięciu (np. cała karta w Moich trasach po kliknięciu w menu) */
html { -webkit-tap-highlight-color: transparent; }
/* Każdy przełącznik (też w publikowaniu i rejestracji) reaguje tylko na sam suwak, nie na cały wiersz z opisem */
label:has(> input.switch) { cursor: default; pointer-events: none; user-select: none; }
label:has(> input.switch) input.switch, label:has(> input.switch) a { pointer-events: auto; }

/* „Dodaj punkt”, „Zamknij pętlę” i na końcu kwadratowy przycisk odwrócenia trasy */
.add-row .btn-rev { flex: none; width: 40px; padding: 0; }
.add-row .btn-rev .ti { display: block; width: 20px; height: 20px; }

/* Toasty: jasny, subtelny dymek z kolorową ikoną (zamiast pełnego koloru tła) */
.toast, .toast.is-warn, .toast.is-err, .toast.is-ok { display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px 10px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); color: var(--ink); font-weight: 500; font-size: 13px; line-height: 18px; box-shadow: var(--shadow-lg); }
.toast .toast-i { flex: none; width: 18px; height: 18px; color: var(--muted); }
.toast.is-ok .toast-i { color: var(--ok); }
.toast.is-warn .toast-i { color: #d99a00; }
.toast.is-err .toast-i { color: var(--danger); }
.toast-t { min-width: 0; }

/* „Gotowe” po sprawdzeniu wszystkich odcinków: zielona ikona sukcesu 24×24 nad napisem */
.rv-done-i { display: block; width: 24px; height: 24px; margin: 0 auto 8px; color: var(--ok); }
.rv-done-i svg { display: block; }

/* pole kolejnego punktu: tylko jeden krzyżyk – stały czerwony „usuń punkt”; szare „wyczyść” po najechaniu wtedy się nie pokazuje */
.search:has(.next-x:not([hidden])) .q-clear { display: none !important; }

/* nieaktywne ikony w pasku nawigacji: neutralna szarość z lekką nutą oliwki z przycisków (zamiast chłodnej, fioletowawej) */
:root { --ri-a: #b2b5b0; --ri-b: #dcdedb; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ri-a: #575a55; --ri-b: #393b38; } }
:root[data-theme="dark"] { --ri-a: #575a55; --ri-b: #393b38; }

/* pola Start / Dokąd: ikona wskazania na mapie na początku, na końcu tylko krzyżyk (wyczyść albo – przy kolejnym punkcie – usuń punkt) */
.search { padding: 8px 8px 8px 8px; }
.search .pick { order: -1; flex: none; }
.search input:not(:placeholder-shown) + .q-clear { display: grid; }

/* Moje trasy: dane trasy z ikonami, bez kropek; w jednej linii, na wąskim ekranie zawijają się całymi kawałkami */
.my-item .my-meta, .my-meta { flex-wrap: wrap; overflow: visible; white-space: normal; gap: 4px 10px; }
.my-meta .my-mi { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; flex: none; }
.my-meta .my-mi .ti { width: 14px; height: 14px; flex: none; }
/* miejsce na „⋮” tylko obok nazwy; linia z danymi sięga do prawej krawędzi karty */
.my-item .my-main { padding-right: 0; }
.my-item .my-name-t { padding-right: 40px; }

/* „Rysuj”: punkty to kliknięcia w mapę – bez pola „Dokąd”, „Dodaj punkt” i długości; własny wiersz z nowym segmentem i dociąganiem */
body[data-mode="draw"] #stop-next, body[data-mode="draw"] #stop-add, body[data-mode="draw"] #stop-komin { display: none !important; }
body:not([data-mode="draw"]) #stop-draw { display: none !important; }
#stop-draw .btn-addpt.is-on { background: var(--olive-ink); color: var(--olive-soft); }
#stop-draw .d-snap { margin-top: 16px; margin-bottom: 0; }
#stop-draw .dot { visibility: hidden; }
/* pusta karta nowego segmentu w „Rysuj”: przerywana ramka, podpowiedź zamiast danych, krzyżyk zawsze widoczny */
.seg-card.seg-new { border-style: dashed; cursor: default; }
.seg-card.seg-new:hover { border-color: #dadada; }
.seg-card.seg-new .seg-to { color: var(--muted); }
.seg-card.seg-new .seg-del { opacity: 1; }

/* pusty panel planowania (desktop): animowany motocykl nad hasłem „Go offroad or go home!”, w kolorze hasła */
.moto-hero { display: none; }
@media (min-width: 761px) {
  .view-route > .moto-hero { display: block; position: absolute; z-index: 0; left: 50%; bottom: 106px; width: 110px; height: auto; transform: translateX(-50%); pointer-events: none; }
  .view-route:has(#sum-full:not([hidden])) > .moto-hero { display: none; }
  .view-route:not(:has(#sum-full:not([hidden]))) > .scroll { padding-bottom: 190px; }
}

/* „Wokół komina”: + przy limicie i − przy minimum wyszarzone */
.k-step:disabled { opacity: .4; cursor: default; pointer-events: none; }

/* niebieskie ramki informacyjne: obrys jak w alercie o niepewnych odcinkach, ikona wyrównana do pierwszej linii tekstu */
:root { --info-line: #c9d5f3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --info-line: #34407a; } }
:root[data-theme="dark"] { --info-line: #34407a; }
.info-box { align-items: flex-start; padding: 12px 12px 10px; border: 1px solid var(--info-line); } /* dół o 2 px mniej: optycznie równy z górą (linia bazowa tekstu) */
.info-box > .ti { flex: none; margin-top: -2px; }
#stop-draw.no-segs .add-row { display: none; }
#stop-draw.no-segs .d-snap { margin-top: 0; }
/* Chrome na telefonie powiększa czcionkę akapitów („font boosting”), a przy sztywnej wysokości linii tekst się ściskał
   i dół ramki wyglądał krzywo: bez automatycznego powiększania, wysokość linii względna */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.info-box p { line-height: 1.4; }
/* panel to kolumna (flex) o ograniczonej wysokości: przy większej czcionce systemowej ramka się ściskała i tekst wychodził poza nią */
.info-box, .sum-warn, .status-box { flex-shrink: 0; }

/* ---------- przewodnik po aplikacji (projekt z Figmy): przyciemniony ekran, złota ramka biegnąca po obrysie, dymek ---------- */
.tour { --t-ink: #363d34; --t-ink-2: #545b51; --t-line: #d9d9de; --t-soft: #edefed; --t-bar: #9090a0; --t-go: #545b51; --t-go-ink: #ffec80; --t-bg: #fff; --t-skip: rgba(84, 91, 81, .6);
  position: fixed; inset: 0; z-index: 2500; animation: tour-in .22s ease both; }
.tour.is-out { opacity: 0; transition: opacity .18s ease; }
@keyframes tour-in { from { opacity: 0; } }
.tour-hole {
  position: fixed; border-radius: 0; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .6);
  transition: left .38s cubic-bezier(.2, .8, .2, 1), top .38s cubic-bezier(.2, .8, .2, 1), width .38s cubic-bezier(.2, .8, .2, 1), height .38s cubic-bezier(.2, .8, .2, 1), border-radius .38s;
}
/* ramka: bardzo jasny czarny obrys po wewnętrznej stronie wycięcia (na jasnym tle elementu), bez animacji */
.tour-ring { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.tour-ring rect { x: 1px; y: 1px; width: calc(100% - 2px); height: calc(100% - 2px); rx: calc(var(--r, 0px) - 1px); fill: none; stroke-width: 1.5; }
.tour-ring .tr-base { stroke: rgba(0, 0, 0, .1); }
:root[data-theme="dark"] .tour-ring .tr-base { stroke: rgba(255, 255, 255, .14); }
.tour-hole.is-none { left: 50% !important; top: 50% !important; width: 0 !important; height: 0 !important; }
.tour-hole.is-none .tour-ring { display: none; }
.tour.no-anim .tour-hole, .tour.no-anim .tour-tip { transition: none; }
.tour-tip {
  position: fixed; background: var(--t-bg); color: var(--t-ink); border-radius: 8px; outline: none;
  filter: drop-shadow(0 8px 2px rgba(0, 0, 0, .06));
  transition: left .38s cubic-bezier(.2, .8, .2, 1), top .38s cubic-bezier(.2, .8, .2, 1);
}
/* strzałka: wystaje 10 px, podstawa 20 px */
.tour-arrow { position: absolute; width: 14.142px; height: 14.142px; background: var(--t-bg); transform: rotate(45deg); transition: left .38s cubic-bezier(.2, .8, .2, 1), top .38s cubic-bezier(.2, .8, .2, 1); }
.tour-tip[data-side="below"] .tour-arrow { top: -7.071px; left: calc(var(--ax) - 7.071px); }
.tour-tip[data-side="above"] .tour-arrow { bottom: -7.071px; left: calc(var(--ax) - 7.071px); }
.tour-tip[data-side="right"] .tour-arrow { left: -7.071px; top: calc(var(--ay) - 7.071px); }
.tour-tip[data-side="left"] .tour-arrow { right: -7.071px; top: calc(var(--ay) - 7.071px); }
.tour-tip[data-side="none"] .tour-arrow { display: none; }
.tour-in { position: relative; padding: 24px; }
.tour-in.is-swap { animation: tour-swap .28s ease both; }
@keyframes tour-swap { from { opacity: 0; transform: translateY(4px); } }
.tour-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.tour-t { flex: 1; min-width: 0; font-size: 12px; font-weight: 700; line-height: normal; color: var(--t-ink); }
.tour-prog { display: flex; align-items: center; gap: 11px; flex: none; }
.tour-prog:has(.tour-n:empty) { display: none; }
.tour-bar { display: flex; gap: 2px; width: 55px; height: 2px; }
.tour-bar i { flex: 1 0 0; height: 2px; background: var(--t-soft); transition: background-color .3s ease; }
.tour-bar i:first-child { border-radius: 8px 0 0 8px; }
.tour-bar i:last-child { border-radius: 0 8px 8px 0; }
.tour-bar i.is-on { background: var(--t-bar); }
.tour-n { font-size: 12px; line-height: normal; color: var(--t-ink); white-space: nowrap; }
.tour-p { margin: 0; font-size: 12px; line-height: normal; color: var(--t-ink-2); }
.tour-btns { display: flex; align-items: center; gap: 8px; padding: 8px; border-top: 1px solid var(--t-line); }
.tour-sp { flex: 1; }
/* przyciski jak w reszcie aplikacji: „Dalej” = btn-dark, „Wstecz” = btn-gray (te same klasy), „Pomiń” jako tekst */
.tour-btns .tour-skip { height: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--t-skip); font: 600 13px/normal var(--f); white-space: nowrap; cursor: pointer; }
.tour-btns .tour-skip:hover { color: var(--t-ink-2); }
.tour-btns .btn-dark, .tour-btns .btn-gray { display: inline-flex; align-items: center; justify-content: center; border: 0; white-space: nowrap; cursor: pointer; }
.tour-btns button:focus-visible { outline: 2px solid var(--t-go); outline-offset: 2px; }
/* ciemny motyw: te same proporcje na ciemnym tle */
:root[data-theme="dark"] .tour { --t-ink: #dde2d8; --t-ink-2: #b9bfb5; --t-line: #30342e; --t-soft: #2a2c27; --t-go: #6b7466; --t-bg: #1d201b; --t-skip: rgba(185, 191, 181, .7); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tour { --t-ink: #dde2d8; --t-ink-2: #b9bfb5; --t-line: #30342e; --t-soft: #2a2c27; --t-go: #6b7466; --t-bg: #1d201b; --t-skip: rgba(185, 191, 181, .7); } }
@media (prefers-reduced-motion: reduce) {
  .tour, .tour-in.is-swap { animation: none; }
  .tour-hole, .tour-tip, .tour-arrow { transition: none; }
}

/* ---------- powitanie po zalogowaniu (projekt z Figmy: 500 px, kafle przewijane same) ---------- */
.welcome { --w-ink: #363d34; --w-ink-2: #545b51; --w-line: #d9d9de; --w-ic: #becab4; --w-soft: #edefed; --w-dot: #d9d9d9; --w-go: #545b51; --w-go-ink: #ffec80;
  width: calc(100% - 32px); max-width: 500px; padding: 0; overflow: hidden; border-radius: 8px; background: #fff; color: var(--w-ink); box-shadow: 8px 4px 4px rgba(0, 0, 0, .06); }
.welcome[open] { animation: welcome-in .32s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes welcome-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.welcome::backdrop { background: rgba(17, 18, 21, .62); }
.welcome-body { display: flex; flex-direction: column; align-items: center; padding: 36px 24px 31px; }
.welcome-moto { display: grid; place-items: center; width: 122px; height: 74px; }
.welcome-moto img { display: block; width: 122px; height: auto; }
.welcome h2 { margin: 10px 0 0; max-width: 327px; font-size: 24px; font-weight: 700; line-height: 32.28px; letter-spacing: 0; text-align: center; color: var(--w-ink); }
.welcome h2:focus { outline: none; }
.welcome .welcome-lead { margin: 10px 0 0; max-width: 327px; font-size: 14px; line-height: normal; text-align: center; color: var(--w-ink-2); }
.welcome-car { width: 100%; margin-top: 42px; overflow: hidden; touch-action: pan-y; }
.welcome-track { display: flex; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.welcome-card { flex: 0 0 100%; display: flex; gap: 15px; align-items: flex-start; padding: 16px; border: 1px solid var(--w-line); border-radius: 8px; }
.welcome-ic { flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 2px; border-radius: 5.333px; background: var(--w-ic); color: #fff; }
.welcome-ct { display: flex; flex-direction: column; gap: 8px; min-width: 0; line-height: normal; }
.welcome-ct b { font-size: 14px; font-weight: 700; color: var(--w-ink); }
.welcome-ct p { margin: 0; font-size: 13px; color: var(--w-ink-2); }
.welcome-dots { display: flex; gap: 4px; margin-top: 31px; }
.welcome-dots button { width: 6px; height: 6px; padding: 0; border: 0; border-radius: 3px; background: var(--w-dot); cursor: pointer; transition: width .35s ease, background-color .35s ease; }
.welcome-dots button.is-on { width: 17px; background: var(--w-go); }
.welcome-dots button:focus-visible { outline: 2px solid var(--w-go); outline-offset: 3px; }
.welcome-actions { display: flex; gap: 16px; align-items: center; padding: 16px 24px; border-top: 1px solid var(--w-line); }
.welcome-btn { flex: 1 0 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 24px; border: 0; border-radius: 8px; font: inherit; font-size: 13px; line-height: normal; white-space: nowrap; cursor: pointer; transition: filter .15s ease, transform .1s ease; }
.welcome-self { background: var(--w-soft); color: var(--w-ink-2); font-weight: 600; }
.welcome-go { background: var(--w-go); color: var(--w-go-ink); font-weight: 700; }
.welcome-btn:hover { filter: brightness(.96); }
.welcome-go:hover { filter: brightness(1.1); }
.welcome-btn:active { transform: scale(.98); }
.welcome-btn:focus-visible { outline: 2px solid var(--w-go); outline-offset: 2px; }
.welcome-go svg { flex: none; }
@media (max-width: 380px) { .welcome-actions { gap: 10px; padding: 16px; } .welcome-btn { padding: 0 12px; } }
/* ciemny motyw: te same proporcje, ciemne tło */
:root[data-theme="dark"] .welcome { --w-ink: #dde2d8; --w-ink-2: #b9bfb5; --w-line: #30342e; --w-ic: #6f7a67; --w-soft: #2a2c27; --w-dot: #464c43; --w-go: #6b7466; background: #161815; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .welcome { --w-ink: #dde2d8; --w-ink-2: #b9bfb5; --w-line: #30342e; --w-ic: #6f7a67; --w-soft: #2a2c27; --w-dot: #464c43; --w-go: #6b7466; background: #161815; } }
@media (prefers-reduced-motion: reduce) { .welcome[open] { animation: none; } .welcome-track { transition: none; } }

/* ---------- logowanie przez Google ---------- */
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px 16px;
  border: 1.5px solid var(--line); border-radius: 99px; background: var(--panel); color: var(--ink);
  font: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer; transition: border-color .15s, background .15s;
}
.btn-google:hover:not(:disabled) { border-color: color-mix(in srgb, var(--ink) 28%, transparent); background: var(--accent-soft); }
.btn-google:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-google.is-busy { opacity: .6; cursor: progress; }
.btn-google .g-logo { flex: none; }
.auth-gnote { margin: -8px 0 0; text-align: center; font-size: 12px; line-height: 1.45; color: var(--muted); }
.auth-gnote a { color: var(--ink); font-weight: 700; text-underline-offset: 3px; }
.auth-or { display: flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.kv-g { display: inline-flex; align-items: center; gap: 6px; }
.kv-g .g-logo { width: 16px; height: 16px; }

/* w trakcie liczenia wariantów start i cel zostają: bez krzyżyków usuwania */
body[data-status="running"] .timeline .q-clear, body[data-status="running"] .timeline .next-x { display: none !important; }
.move-ask p { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.leaflet-marker-draggable { cursor: pointer; }
.leaflet-marker-draggable:active { cursor: grabbing; }

/* edycja śladu na komputerze: kursor z palcem nad punktem, „trzymam” w trakcie przeciągania */
.leaflet-container.h-grab, .leaflet-container.h-grab .leaflet-interactive { cursor: pointer !important; }
.leaflet-container.h-grabbing, .leaflet-container.h-grabbing * { cursor: grabbing !important; }
/* pinezki startu, celu i punktów trasy (da się je przeciągać): na komputerze powiększenie po najechaniu, „wciśnięcie” przy złapaniu */
@media (hover: hover) {
  .leaflet-marker-draggable .joint, .leaflet-marker-draggable .pin { transition: transform .15s ease, filter .15s ease; }
  .leaflet-marker-draggable:hover .joint, .leaflet-marker-draggable:hover .pin { transform: scale(1.2); filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .35)); }
  .leaflet-marker-draggable:active .joint, .leaflet-marker-draggable:active .pin { transform: scale(1.32); filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .45)); }
}

/* szczegóły trasy: ikonki przy % asfaltu, czasie i lesie (jak w „Moich trasach”), bez kropek między nimi */
.sum-meta2 { gap: 6px 14px; }
.sum-meta2 > span:not([hidden]) { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.sum-meta2 .ti { width: 16px; height: 16px; flex: none; }
.sum-meta2 .card-sep { display: none; }

/* logowanie na telefonie (projekt z Figmy): logo pionowe na środku, formularz, „Lub”, Google, pod spodem przełącznik
   logowanie / rejestracja; w tle znak wodny (duża pinezka w prawym dolnym rogu, przycięta krawędzią ekranu) */
.gate-slogo { display: none; }
@media (max-width: 860px) {
  .gate { background: #fff; overflow-x: hidden; }
  :root[data-theme="dark"] .gate { background: var(--panel); }
  .gate-card { position: relative; display: flex; flex-direction: column; min-height: 100%; padding: 0; gap: 0; background: #fff; overflow: hidden; }
  :root[data-theme="dark"] .gate-card { background: var(--panel); }
  .gate-art, .gate-logo { display: none; }
  .gate-panel { position: static; isolation: auto; flex: 1; align-items: center; padding: 36px 32px 40px; overflow: visible; }
  .gate-deco { display: block; position: absolute; z-index: 0; left: auto; right: -196px; top: 419px; width: 428px; height: 720px; pointer-events: none; }
  .gate-slogo, .gate-inner { position: relative; z-index: 1; }
  .gate-slogo { display: block; flex: none; width: 177px; height: 80px; color: #000; }
  :root[data-theme="dark"] .gate-slogo { color: var(--ink); }
  .gate-inner { flex: none; justify-content: flex-start; width: 100%; max-width: 375px; padding: 44px 0 0; margin: 0 auto; }
  .gate-body { gap: 24px; }
  .gate .acct-form { gap: 18px; }
  .auth-forgot { margin: -2px 0 0; font-weight: 400; }
  .auth-forgot .link-u { font-weight: 600; }
  .gate .btn-primary { height: 56px; margin-top: 6px; padding: 8px; border-radius: 8px; font-size: 13px; font-weight: 700; box-shadow: none; }
  .gate .auth-or { gap: 24px; font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: #000; }
  :root[data-theme="dark"] .gate .auth-or { color: var(--ink); }
  .gate .auth-or::before, .gate .auth-or::after { background: #d9d9de; }
  .gate .btn-google { height: 56px; padding: 8px; border: 0; border-radius: 8px; background: #edefed; color: #000; font-size: 13px; font-weight: 700; }
  :root[data-theme="dark"] .gate .btn-google { background: var(--panel-2); color: var(--ink); }
  .gate .btn-google .g-logo { width: 24px; height: 24px; }
  .gate .auth-gnote { margin-top: -14px; }
  /* „Nie posiadasz konta? Zarejestruj się” wyśrodkowane pod Google */
  .gate .auth-switch { position: static; margin: 15px 0 0; text-align: center; font-size: 13px; color: #000; }
  :root[data-theme="dark"] .gate .auth-switch { color: var(--ink); }
  .gate .auth-switch .link-u { font-weight: 600; }
  .gate .auth-head.is-q { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .gate-title { font-size: 22px; font-weight: 600; }
  .auth-head { margin-bottom: 0; }
}


/* „Wokół komina”: długość z „km” zaraz za liczbą; ramka na całym polu, kliknięcie w nią ustawia kursor w liczbie */
.k-field { display: flex; align-items: center; justify-content: center; gap: 4px; height: 48px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); cursor: text; font: 400 13px/normal var(--f); color: var(--ink); }
.k-field:focus-within { border-color: var(--ink-2); }
.komin-row .k-field input, .k-field input { flex: none; width: 2.6ch; min-width: 0; height: auto; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; outline: none; font: inherit; color: inherit; text-align: right; -moz-appearance: textfield; appearance: textfield; }
.k-field input::-webkit-outer-spin-button, .k-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.k-field .k-unit { position: static; transform: none; font: inherit; color: inherit; }

/* potwierdzenie resetu: mały dymek przy przycisku „Resetuj” */
.reset-pop { position: fixed; z-index: 2200; width: 264px; max-width: calc(100vw - 24px); padding: 14px; border-radius: 10px; background: var(--panel); color: var(--ink); box-shadow: 0 10px 30px rgba(0, 0, 0, .18), 0 1px 3px rgba(0, 0, 0, .12); animation: reset-pop-in .16s ease both; }
.reset-pop::before { content: ""; position: absolute; left: calc(var(--ax) - 6px); width: 12px; height: 12px; background: var(--panel); transform: rotate(45deg); }
.reset-pop[data-side="below"]::before { top: -6px; }
.reset-pop[data-side="above"]::before { bottom: -6px; }
@keyframes reset-pop-in { from { opacity: 0; transform: translateY(-4px); } }
.reset-pop p { position: relative; margin: 0 0 12px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.reset-pop p b { display: block; margin-bottom: 2px; font-size: 14px; color: var(--ink); }
.reset-pop-acts { position: relative; display: flex; gap: 8px; }
.reset-pop-acts button { flex: 1; display: inline-flex; align-items: center; justify-content: center; border: 0; cursor: pointer; }
.reset-pop .reset-yes { background: var(--danger); color: #fff; }
.reset-pop .reset-yes:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 85%, black); color: #fff; }
@media (prefers-reduced-motion: reduce) { .reset-pop { animation: none; } }

/* przyciski +/− na mapie w kolorach panelu (w ciemnym motywie nie świecą na biało) */
.leaflet-container .leaflet-bar a { background-color: var(--panel); color: var(--ink); border-bottom-color: var(--line); }
.leaflet-container .leaflet-bar a:hover, .leaflet-container .leaflet-bar a:focus { background-color: var(--panel-2); }
.leaflet-container .leaflet-bar a.leaflet-disabled { background-color: var(--panel-2); color: var(--faint); }
/* ciemny motyw: znak wodny ledwie widoczny (jasna pinezka na ciemnym tle była za mocna) */
:root[data-theme="dark"] .view-route::before, :root[data-theme="dark"] .gate-deco { opacity: .4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .view-route::before, :root:not([data-theme="light"]) .gate-deco { opacity: .4; } }

/* lokalizacja: tylko telefon; włączona – niebieska ikona, prowadzi mapę – wypełniony środek, szuka sygnału – pulsuje */
.fab-locate { display: none !important; }
@media (max-width: 760px) { body .fab-row > .fab-locate { display: inline-flex !important; } }
.fab-locate.is-on { color: #2f7cf6; }
.fab-locate.is-follow .loc-c { fill: #2f7cf6; }
.fab-locate.is-busy svg { animation: loc-pulse 1.1s ease-in-out infinite; color: #2f7cf6; }
@keyframes loc-pulse { 50% { opacity: .35; } }
.loc-dot { position: relative; }
.loc-dot .loc-head { display: none; position: absolute; left: 50%; top: 50%; width: 0; height: 0; margin: -19px 0 0 -6px; border: 6px solid transparent; border-bottom: 9px solid #2f7cf6; transform-origin: 6px 19px; transform: rotate(var(--h, 0deg)); }
.loc-dot.has-head .loc-head { display: block; }
@media (prefers-reduced-motion: reduce) { .fab-locate.is-busy svg { animation: none; } }

/* ---------- ustawienia: układ z Figmy (nagłówek z „Zapisz”, sekcje z małym nagłówkiem, przełącznik po lewej) ---------- */
.view-settings .sec-head { align-items: center; gap: 8px; }
.view-settings .sec-head h2 { flex: 1; }
.view-settings .set-save { flex: none; height: 40px; padding: 0 16px; }
/* nieaktywny „Zapisz” (nic nie zmieniono): wygaszony w obu motywach, a nie przezroczysty oliwkowy (w ciemnym wyglądał na aktywny) */
.view-settings [data-set-save]:disabled, .view-settings [data-set-save]:disabled:hover { background: var(--olive-soft); color: var(--faint); opacity: 1; cursor: default; box-shadow: none; }
.view-settings .set-sec { display: flex; flex-direction: column; gap: 16px; }
.view-settings .set-h { margin: 0; font: 400 11px/normal var(--f); text-transform: uppercase; letter-spacing: .02em; color: var(--faint); }
.view-settings .set-rows { display: flex; flex-direction: column; gap: 24px; }
.view-settings .chk.set-row { grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 0; background: none; border-radius: 0; font: 400 13px/normal var(--f); color: var(--ink); }
.view-settings .set-row small { margin-top: 2px; font-size: 11.5px; font-weight: 400; }
.set-theme { display: flex; height: 56px; padding: 8px; border-radius: 8px; background: var(--olive-soft); }
.set-theme button { flex: 1 1 0; min-width: 0; height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 0; border-radius: 4px; background: transparent; color: var(--olive-ink); font: 400 13px/normal var(--f); cursor: pointer; transition: background .15s; }
/* przesuwane tło wybranej opcji (z lekkim odbiciem); ikona wybranej opcji ożywa: słońce obraca się i błyska, księżyc się kołysze */
.set-theme { position: relative; isolation: isolate; }
.set-theme::before { content: ""; position: absolute; z-index: -1; top: 8px; bottom: 8px; left: 8px; width: calc(50% - 8px); border-radius: 4px; background: var(--panel);
  transition: transform .5s cubic-bezier(.34, 1.18, .55, 1); }
.set-theme[data-on="dark"]::before { transform: translateX(100%); }
.set-theme button { transition: color .3s, background .15s; }
.set-theme button[aria-checked="true"] { color: var(--ink); font-weight: 600; }
.set-theme button:hover:not([aria-checked="true"]) { background: transparent; color: var(--ink); }
.set-theme button svg { transition: transform .4s; }
.set-theme button[data-theme-set="light"][aria-checked="true"] svg { animation: set-sun .7s cubic-bezier(.3, 1.4, .5, 1); color: #e0a400; }
.set-theme button[data-theme-set="dark"][aria-checked="true"] svg { animation: set-moon .8s ease-out; color: #7d8cff; }
@keyframes set-sun { 0% { transform: rotate(-90deg) scale(.4); opacity: .3; } 60% { transform: rotate(20deg) scale(1.25); opacity: 1; } 100% { transform: rotate(0) scale(1); } }
@keyframes set-moon { 0% { transform: rotate(40deg) scale(.5); opacity: .3; } 45% { transform: rotate(-22deg) scale(1.15); opacity: 1; } 70% { transform: rotate(10deg); } 100% { transform: rotate(0) scale(1); } }
@media (prefers-reduced-motion: reduce) { .set-theme::before { transition: none; } .set-theme button svg { animation: none !important; } }
.set-theme button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.view-settings .foot { margin-top: auto; }
/* komputer: „Zapisz” jest w nagłówku, dolny pasek zbędny; telefon: nagłówka panelu nie ma, „Zapisz” zostaje na dole */
@media (min-width: 761px) { .view-settings .set-foot { display: none; } }
@media (max-width: 760px) { .view-settings .set-save { display: none; } }
.view-settings .set-sec + .set-sec { margin-top: 8px; }

/* karta wariantu: układ z Figmy – rząd (litera, km • asfalt, „Wybierz”), pasek nawierzchni, pod nim las i odcinki do sprawdzenia */
.card, .var-cards > .card { gap: 8px; padding: 16px 16px 24px; }
.card.is-on { padding: 15px 15px 23px; }
.var-cards > .card.is-on { padding: 16px 16px 24px; }
.card-head { align-items: center; gap: 8px; }
.card-head .letter { width: 32px; height: 32px; }
.card .card-info { gap: 4px 8px; }
.card .card-info .card-chk, .card .card-info .card-forest { white-space: nowrap; }

/* nagłówek: Wstecz / Dalej – przyciski bez tła 40×40; „Resetuj” jak krzyżyki w polach: czerwony, jasnoczerwone tło po najechaniu */
.top .hdr-icon { width: 40px; height: 40px; padding: 10px; }
.top .hdr-icon + .hdr-icon { margin-left: 0; }
.top .hdr-reset { height: 40px; margin-left: 0; padding: 0 14px; border-radius: 8px; background: transparent; color: var(--danger); }
.top .hdr-reset:hover { background: var(--danger-soft); color: var(--danger); }
.top .hdr-reset:focus-visible { outline: 2px solid var(--danger); outline-offset: 2px; }

/* krzyżyki w polach: czerwone, po najechaniu jasnoczerwone tło; odstęp od prawej krawędzi taki jak od góry i dołu */
.q-clear, .next-x, #ms-close { color: var(--danger); }
.q-clear:hover, .next-x:hover, #ms-close:hover { background: var(--danger-soft); color: var(--danger); }
.search { padding-right: 7px; }
.search .q-clear, .search .next-x { width: 32px; height: 32px; margin: 0; border-radius: 6px; }
.place-q .q-clear { top: 50%; right: 8px; width: 28px; height: 28px; transform: translateY(-50%); }
.ms-box { padding-right: 7px; }
#ms-close { width: 32px; height: 32px; padding: 0; border-radius: 6px; }

@media (min-width: 761px) and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rail-btn[data-tip]::after { background: #3b4038; } :root:not([data-theme="light"]) .rail-btn[data-tip]::before { border-right-color: #3b4038; } }

/* podpowiedzi (title) w całej aplikacji: ta sama mała ciemna etykieta co przy pasku z boku */
.ttip { position: fixed; z-index: 3000; max-width: 260px; padding: 5px 8px; border-radius: 4px; background: #1d1f1b; color: #fff; font: 500 11px/14px var(--f); pointer-events: none; animation: ttip-in .12s ease; }
.ttip[hidden] { display: none; }
.ttip::after { content: ""; position: absolute; left: calc(var(--ax, 50%) - 5px); width: 0; height: 0; border-style: solid; }
.ttip[data-side="top"]::after { top: 100%; border-width: 5px 5px 0; border-color: #1d1f1b transparent transparent; }
.ttip[data-side="bottom"]::after { bottom: 100%; border-width: 0 5px 5px; border-color: transparent transparent #1d1f1b; }
@keyframes ttip-in { from { opacity: 0; } }
:root[data-theme="dark"] .ttip { background: #3b4038; }
:root[data-theme="dark"] .ttip[data-side="top"]::after { border-top-color: #3b4038; } :root[data-theme="dark"] .ttip[data-side="bottom"]::after { border-bottom-color: #3b4038; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ttip { background: #3b4038; }
  :root:not([data-theme="light"]) .ttip[data-side="top"]::after { border-top-color: #3b4038; } :root:not([data-theme="light"]) .ttip[data-side="bottom"]::after { border-bottom-color: #3b4038; }
}
@media (prefers-reduced-motion: reduce) { .ttip { animation: none; } }

/* Wstecz / Dalej jak krzyżyk zamykania: bez tła, oliwkowa ikona, jasne tło po najechaniu */
.top .hdr-icon { color: #697962; }
.top .hdr-icon:hover:not(:disabled) { background: var(--olive-soft); color: #697962; }
.top .hdr-icon:disabled { opacity: .35; }

/* lista warstw jak menu w „Moich trasach”: pozycje z podświetleniem, przełączniki zamiast pól wyboru, okrągłe znaczniki podkładu */
.leaflet-control-layers-expanded .leaflet-control-layers-list { min-width: 248px; padding: 6px; border-radius: 10px; box-shadow: var(--shadow-lg); }
.leaflet-control-layers-list label { display: block; margin: 0; padding: 0; }
.leaflet-control-layers-list label > span, .leaflet-control-layers-list label > div { display: flex; flex-direction: row-reverse; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 10px 9px 12px; border-radius: 6px; font: 500 13px/1.2 var(--f); color: var(--ink); cursor: pointer; transition: background .12s; }
.leaflet-control-layers-list label > span > span { flex: 1; min-width: 0; }
.leaflet-control-layers-list label:hover > span { background: var(--panel-2); }
.leaflet-control-layers-separator { height: 0; margin: 4px 6px; border-top: 1px solid var(--line); }
.leaflet-control-layers-list input.leaflet-control-layers-selector { -webkit-appearance: none; appearance: none; position: relative; flex: none; margin: 0; cursor: pointer; transition: background .15s, border-color .15s; }
/* warstwy: przełącznik jak w ustawieniach */
.leaflet-control-layers-list input[type="checkbox"].leaflet-control-layers-selector { width: 36px; height: 20px; border-radius: 10px; background: var(--olive-soft); }
.leaflet-control-layers-list input[type="checkbox"].leaflet-control-layers-selector::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s cubic-bezier(.3, 1.3, .5, 1), background .15s; }
.leaflet-control-layers-list input[type="checkbox"].leaflet-control-layers-selector:checked { background: var(--accent); }
.leaflet-control-layers-list input[type="checkbox"].leaflet-control-layers-selector:checked::after { transform: translateX(16px); background: #fff; }
/* podkład: okrągły znacznik */
.leaflet-control-layers-list input[type="radio"].leaflet-control-layers-selector { width: 18px; height: 18px; border: 1.5px solid var(--line-2); border-radius: 50%; background: transparent; }
.leaflet-control-layers-list input[type="radio"].leaflet-control-layers-selector:checked { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 4px, transparent 4.5px); }
.leaflet-control-layers-list input.leaflet-control-layers-selector:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* warstwa niedostępna przy tym przybliżeniu (np. drogi przy dużym oddaleniu) */
.leaflet-control-layers-list label:has(input:disabled) > span { opacity: .45; cursor: default; }
.leaflet-control-layers-list label:has(input:disabled):hover > span { background: none; }
@media (prefers-reduced-motion: reduce) { .leaflet-control-layers-list input.leaflet-control-layers-selector, .leaflet-control-layers-list input.leaflet-control-layers-selector::after { transition: none; } }

/* pokaz (?demo=…): przezroczysta zasłona nad aplikacją – nic nie da się kliknąć ani przewinąć */
.demo-block { position: fixed; inset: 0; z-index: 9998; background: transparent; touch-action: none; }

/* telefon: krzyżyk usuwania punktu przy odcinku widać zawsze, na czerwono (nie ma najechania myszą) */
@media (max-width: 760px) {
  .seg-del { opacity: 1; color: var(--danger); }
  .seg-del:active { background: var(--danger-soft); }
}

/* Postoje (wiaty, ogniska, woda, biwaki…): okrągła pinezka z ikoną w kolorze rodzaju */
.pos-pin span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: var(--c); box-shadow: 0 0 0 1.5px var(--c), 0 2px 5px rgba(0, 0, 0, .22); }
.pos-pin:hover span { transform: scale(1.12); }
.pos-popup .leaflet-popup-content-wrapper { border-radius: 10px; }
.pos-popup .leaflet-popup-content { margin: 12px 14px; font: 400 13px/1.4 var(--f); color: var(--ink); }
.pos-pop b { display: block; font-size: 14px; font-weight: 700; }
.pos-pop span { display: block; color: var(--muted); font-size: 12px; }
.pos-pop p { margin: 6px 0 0; }
.pos-pop .pos-d { color: var(--muted); }
.pos-pop a { display: inline-block; margin-top: 8px; font-weight: 600; color: var(--accent); }
.pos-pop small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

/* postój dodany do GPX: żółta obwódka; przycisk w dymku jak w aplikacji */
.pos-pin.is-wpt span { box-shadow: 0 0 0 2px var(--c), 0 0 0 5px #ffd60a, 0 2px 6px rgba(0, 0, 0, .25); }
.pos-pop .pos-wpt { display: flex; align-items: center; justify-content: center; width: 100%; height: 36px; margin-top: 10px; border: 0; border-radius: 8px; background: #545b51; color: #ffec80; font: 600 13px var(--f); cursor: pointer; }
.pos-pop .pos-wpt:hover { background: #4a5047; }
.pos-pop .pos-wpt.is-on { background: var(--panel-2); color: var(--danger); }
.pos-pop .pos-wpt.is-on:hover { background: var(--danger-soft); }

/* telefon: karta wariantu na całą szerokość (równo z ramką informacji nad nią); kolejne warianty pokazują kropki pod kartą */
@media (max-width: 760px) {
  .var-cards > .card { flex: 0 0 100%; scroll-snap-align: start; }
}
