/* Rozložení: telefon = skóre nahoře, pod ním mapa, pak seznam; počítač = panel vlevo, mapa vpravo přes celou výšku. */
:root {
  --bg: #0f0d16;
  --surface: #181523;
  --surface-2: #221e31;
  --line: #2f2a42;
  --fg: #f3f1f9;
  --muted: #a39dba;
  --accent: #9b8cff;
  --accent-ink: #120f1c;
  --friend: #ffb547;
  --track-no: #57516e;
  --danger: #ff7a85;
  --ok: #7fe0b0;
  --font-display: "Big Shoulders Display", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 12px;
  --tile-filter: none;
  --land: #17141f;
  --border: #4a4460;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #ebe9f2; --surface: #ffffff; --surface-2: #eeecf6; --line: #dcd8ea; --fg: #17141f; --muted: #615a78;
  --accent: #5a45e0; --accent-ink: #ffffff; --friend: #d97a00; --track-no: #b7b1cc; --danger: #c42b3a; --ok: #127a4a;
  --tile-filter: none;
  --land: #ffffff;
  --border: #b9b3cf;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
button { font: inherit; color: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- Kostra ---------- */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.panel { display: contents; }
.topbar {
  order: 0;
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.score   { order: 1; }
.map-wrap{ order: 2; }
.friend  { order: 3; }
.listing { order: 4; }
.shop    { order: 5; }
.foot    { order: 6; }

.score, .friend, .listing, .shop, .foot {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); }
.brand svg { width: 32px; height: 32px; flex: none; }
.brand-bg { fill: var(--surface-2); }
.brand-line { stroke: var(--accent); stroke-width: 3.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: .02em; text-transform: uppercase; }
.brand-text small { font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Tlačítka ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--fg);
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
.btn:hover { background: color-mix(in srgb, var(--surface-2) 80%, var(--accent)); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--fg)); }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.btn-google { width: 100%; background: #fff; color: #1f1f1f; border-color: #dadce0; }
.btn-google:hover { background: #f4f4f6; }
.btn-google svg { width: 20px; height: 20px; }
.btn[disabled] { opacity: .55; cursor: progress; }
.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font-weight: 500; }

.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ---------- Skóre ---------- */
.score { padding-block: 18px 16px; }
.score-main { display: flex; align-items: flex-end; gap: 14px; }
.score-pct {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(64px, 18vw, 92px); line-height: .82; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums; color: var(--fg);
}
.score-sub { padding-bottom: 4px; color: var(--muted); font-size: 14px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.score-sub b { color: var(--fg); font-size: 17px; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 16px 0 0; }
.stat-row div { padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.stat-row dt { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stat-row dd { margin: 2px 0 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stat-row dd b { font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1; color: var(--fg); }
.rank { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.rank-label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rank-name { font-family: var(--font-display); font-weight: 800; font-size: 28px; text-transform: uppercase; color: var(--accent); letter-spacing: .02em; line-height: 1.1; }
.progress { height: 6px; border-radius: 6px; background: var(--surface-2); margin-top: 10px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .4s ease; }
.next { margin: 8px 0 14px; font-size: 14px; color: var(--muted); }
.next b { color: var(--fg); }
.btn-trip { width: 100%; min-height: 56px; margin-bottom: 10px; font-size: 17px; border-radius: 14px; }
.btn-trip svg, .fab svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2.6; fill: none; stroke-linecap: round; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.fab {
  position: absolute; z-index: 700; right: max(12px, env(safe-area-inset-right, 0px)); bottom: 46px;
  display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 18px 0 14px;
  border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 15px; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.route-bar {
  position: absolute; z-index: 800; left: 10px; right: 10px; bottom: 10px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.route-info { display: flex; flex-direction: column; min-width: 0; flex: 1 1 200px; }
.route-info b { font-size: 15px; line-height: 1.3; }
.route-info span { font-size: 13px; color: var(--muted); }
.route-actions { display: flex; gap: 8px; }
.route-actions .btn { min-height: 42px; }
.trip-form { display: flex; flex-direction: column; gap: 12px; }
.ac { position: relative; }
.ac-list {
  position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.35);
  max-height: 240px; overflow-y: auto;
}
.ac-list li { padding: 10px 10px; border-radius: 8px; color: var(--fg); font-size: 15px; cursor: pointer; }
.ac-list li small { display: block; color: var(--muted); font-size: 12px; }
.ac-list li[aria-selected="true"], .ac-list li:hover { background: var(--surface-2); }
#tripViaBtn { align-self: flex-start; font-size: 14px; text-align: left; }
.actions .btn { flex: 1 1 140px; }
.save-hint { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- Mapa ---------- */
.map-wrap { scroll-margin-top: 62px; position: relative; height: 56vh; min-height: 340px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
#map { position: absolute; inset: 0; background: var(--bg); }
.legend {
  position: absolute; z-index: 500; left: max(10px, env(safe-area-inset-left, 0px)); bottom: 10px;
  display: flex; gap: 12px; padding: 6px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 90%, transparent); border: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 16px; height: 4px; border-radius: 2px; }
.lg-yes { background: var(--accent); }
.lg-no { background: var(--track-no); }
.lg-friend { background: repeating-linear-gradient(90deg, var(--friend) 0 5px, transparent 5px 8px); }
.loading { position: absolute; inset: 0; z-index: 600; display: grid; place-items: center; background: var(--surface); color: var(--muted); font-size: 14px; }

.leaflet-container { font-family: var(--font-body); background: var(--bg); }
.st-label span {
  position: absolute; left: 6px; top: 0; transform: translateY(-50%); white-space: nowrap;
  font: 500 11.5px/1 var(--font-body); color: var(--muted);
  text-shadow: 0 0 2px var(--land), 0 0 3px var(--land), 0 0 4px var(--land), 1px 1px 0 var(--land), -1px -1px 0 var(--land);
}
.st-label.is-major span { font: 700 12.5px/1 var(--font-body); color: var(--fg); letter-spacing: .01em; }
.st-label.is-small span { font-size: 11px; }
.st-label.is-left span { left: auto; right: 6px; }
.leaflet-tile-pane { filter: var(--tile-filter); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--fg); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.leaflet-popup-content { margin: 14px 16px; min-width: 210px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--surface); color: var(--fg); border-bottom-color: var(--line); }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 85%, transparent) !important; color: var(--muted); font-size: 10px; }
.leaflet-control-attribution a { color: var(--muted); }
.pop-ref { font-family: var(--font-mono); font-weight: 600; font-size: 13px; color: var(--accent); }
.pop-name { margin: 2px 0 4px; font-weight: 600; font-size: 15px; line-height: 1.3; }
.pop-km { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.pop-friend { margin: -4px 0 10px; font-size: 13px; color: var(--friend); }
.pop { display: flex; flex-direction: column; gap: 8px; }
.pop .pop-name, .pop .pop-km, .pop .pop-friend { margin: 0; }
.pop-seg { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 14px; font-weight: 600; }
.pop-seg small { color: var(--muted); font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pop-btn { width: 100%; min-height: 40px; }
.pop-range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.pop-range label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.pop-range select { width: 100%; min-height: 40px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; font-size: 14px; }
.pop-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pop-row .btn { min-height: 40px; padding: 0 10px; font-size: 14px; }
.pop-all { align-self: center; font-size: 14px; }
.rw-popup .leaflet-popup-content { margin: 14px 14px; }

/* ---------- Výzva ---------- */
.friend { padding-block: 16px; background: color-mix(in srgb, var(--friend) 10%, var(--bg)); border-bottom: 1px solid var(--line); }
.friend-text { margin: 0 0 8px; font-size: 16px; }
.friend-text b { color: var(--friend); }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--friend); }

/* ---------- Seznam ---------- */
.listing { padding-block: 16px 8px; }
.list-tools { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 61px; z-index: 5; background: var(--bg); padding-block: 8px; }
.search input {
  width: 100%; min-height: 46px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit;
}
.search input::placeholder { color: var(--muted); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-weight: 500; font-size: 14px; cursor: pointer; }
.chip.is-active { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip .n { font-family: var(--font-mono); font-size: 12px; opacity: .75; margin-left: 4px; }

.lines { list-style: none; margin: 4px 0 0; padding: 0; }
.line-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.line-check { display: grid; grid-template-columns: 26px 52px 1fr; align-items: center; gap: 10px; cursor: pointer; min-width: 0; grid-column: 1 / 3; }
.line-check input { width: 22px; height: 22px; accent-color: var(--accent); margin: 0; cursor: pointer; }
.line-ref { font-family: var(--font-mono); font-weight: 600; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.line-row.is-done .line-ref, .line-row.is-part .line-ref { color: var(--accent); }
.line-name { min-width: 0; font-size: 14.5px; line-height: 1.3; }
.line-name small { display: block; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.line-name .tag-friend { color: var(--friend); }
.line-zoom { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.line-zoom:hover { color: var(--fg); border-color: var(--muted); }
.line-zoom svg { width: 18px; height: 18px; }
.empty { padding: 24px 0; color: var(--muted); text-align: center; }

/* ---------- Obchod ---------- */
.shop { padding-block: 22px; margin-top: 8px; border-top: 1px solid var(--line); }
.shop-title { margin: 0 0 6px; font-family: var(--font-display); font-weight: 800; font-size: 26px; text-transform: uppercase; line-height: 1.05; text-wrap: balance; }
.shop-text { margin: 0 0 14px; color: var(--muted); max-width: 46ch; }

.foot { padding-block: 16px 28px; font-size: 12.5px; color: var(--muted); }
.foot p { margin: 0 0 6px; }
.foot a { color: var(--muted); }

/* ---------- Okna ---------- */
.modal { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: end center; background: rgba(8,6,14,.62); padding: env(safe-area-inset-top, 0px) 0 0; }
.modal-card {
  position: relative; width: 100%; max-width: 440px; max-height: calc(100% - 24px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px 18px 0 0;
  padding: 22px max(20px, env(safe-area-inset-right, 0px)) calc(22px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 12px;
}
.modal-wide { max-width: 520px; }
.modal-card h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 30px; text-transform: uppercase; line-height: 1; }
.modal-lead { margin: 0; color: var(--muted); }
.modal-x { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted); font-size: 28px; cursor: pointer; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 999px; padding: 4px; }
.tab { min-height: 38px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; }
.tab.is-active { background: var(--surface); color: var(--fg); }
#authForm { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field-note { font-size: 12px; color: var(--muted); }
.icon-btn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--fg); cursor: pointer; }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .i-moon { display: none; }
:root[data-theme="light"] .icon-btn .i-moon { display: block; }
:root[data-theme="light"] .icon-btn .i-sun { display: none; }
.list-more { margin-top: 12px; }
.field input { min-height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; font-size: 16px; }
.consent { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: 14px; line-height: 1.4; cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); }
.form-msg { margin: 0; min-height: 0; font-size: 14px; color: var(--danger); }
.form-msg.ok { color: var(--ok); }
.form-msg:empty { display: none; }
.fine { margin: 0; font-size: 12.5px; color: var(--muted); }
#forgotBtn { align-self: flex-start; font-size: 14px; }
#sharePreview { display: block; margin: 0 auto; height: min(62vh, 560px); max-width: 100%; aspect-ratio: 9 / 16; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); object-fit: contain; }

.toast {
  position: fixed; z-index: 4000; left: 50%; transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 999px;
  background: var(--fg); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.35);
}

/* ---------- Lišta se souhlasem s cookies ---------- */
.cookie-bar {
  position: fixed; z-index: 3500; left: 16px; right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  max-width: 560px; margin-inline: auto; padding: 14px 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0,0,0,.35); font-size: 14px; line-height: 1.45;
}
.cookie-bar[hidden] { display: none; }
.cookie-bar p { margin: 0; flex: 1 1 280px; }
.cookie-bar a { color: var(--accent); }
.cookie-actions { display: flex; gap: 8px; flex: 1 1 auto; justify-content: flex-end; }
.cookie-actions .btn { flex: 1 1 0; min-width: 110px; }
[data-cookie-settings][hidden] { display: none; }

/* ---------- Přepínání Mapa / Historie ---------- */
.views { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-2); margin-left: auto; }
.views a { min-height: 34px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; }
.views a.is-active { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
body.view-history .panel > *, body.view-history .map-wrap,
body.view-stats .panel > *, body.view-stats .map-wrap { display: none !important; }
body.view-history .panel, body.view-stats .panel { display: none !important; }
@media (max-width: 440px) {
  .brand-text { display: none; }
  .views a { padding: 0 9px; font-size: 13px; }
  .topbar { gap: 8px; }
  #accountBtn { padding: 0 12px; font-size: 14px; }
}
@media (max-width: 400px) {
  .brand { display: none; }
  .views { margin-left: 0; }
  .topbar { justify-content: flex-start; }
  #accountBtn { margin-left: auto; }
}

.date-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.date-row input { flex: 1 1 150px; min-height: 46px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; font-size: 16px; }

/* ---------- Historie ---------- */
.history { order: 7; padding-block: 20px 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.history-inner { max-width: 760px; margin: 0 auto; }
.history h1 { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 44px; line-height: 1; text-transform: uppercase; }
.history-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.history-hint { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.h-group { margin-top: 26px; }
.h-group h2 { margin: 0 0 10px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.trip { display: grid; grid-template-columns: 76px 1fr; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.trip + .trip { margin-top: 10px; }
.trip-day { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 10px; background: var(--surface-2); padding: 8px 4px; text-align: center; min-height: 68px; }
.trip-day b { font-family: var(--font-display); font-weight: 900; font-size: 30px; line-height: 1; }
.trip-day span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.trip-day.is-empty b { font-size: 15px; font-family: var(--font-body); font-weight: 600; color: var(--muted); }
.trip.is-fill .trip-day { background: transparent; border: 1px dashed var(--line); }
.trip-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.trip-body h3 { margin: 0; font-size: 16px; line-height: 1.3; }
.trip-meta { margin: 0; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.trip-meta b { color: var(--accent); font-weight: 600; }
.trip-added { margin: 0; font-size: 12.5px; color: var(--muted); }
.trip-when { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.trip-when input { min-height: 38px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; font-size: 15px; }
.trip-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.trip-actions .btn { min-height: 38px; padding: 0 14px; font-size: 14px; }
.trip-actions .btn.is-danger { border-color: var(--danger); color: var(--danger); }
.history-empty { margin-top: 26px; padding: 28px 18px; border: 1px dashed var(--line); border-radius: 14px; text-align: center; color: var(--muted); }

/* ---------- Statistiky ---------- */
.st-hero { margin-top: 18px; padding: 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.st-big { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.st-big b { font-family: var(--font-display); font-weight: 900; font-size: clamp(72px, 20vw, 120px); line-height: .82; font-variant-numeric: tabular-nums; }
.st-big span { color: var(--muted); padding-bottom: 6px; font-variant-numeric: tabular-nums; }
.st-big span strong { color: var(--fg); font-size: 20px; }
.bar { position: relative; height: 14px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 16px; }
.bar > i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--accent); transition: width 1.1s cubic-bezier(.2,.8,.2,1); }
.bar.is-thin { height: 8px; margin-top: 10px; }
.bar.is-el > i { background: #f2c94c; }
.bar-scale { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.st-card { padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.st-card h2 { margin: 0 0 8px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.st-card .v { font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.st-card .v small { font-family: var(--font-body); font-weight: 500; font-size: 14px; color: var(--muted); margin-left: 4px; }
.st-card p { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }
.st-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.st-list { list-style: none; margin: 4px 0 0; padding: 0; }
.st-list li { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.st-list li:last-child { border-bottom: 0; }
.st-list .r { font-family: var(--font-mono); font-weight: 600; color: var(--accent); }
.st-list .n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-list .p { font-variant-numeric: tabular-nums; color: var(--muted); }
.st-section-title { margin: 28px 0 0; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .bar > i { transition: none; } }

/* ---------- Počítač ---------- */
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 420px 1fr; grid-template-rows: auto 1fr; height: 100%; min-height: 0; }
  .topbar { grid-column: 1 / -1; position: relative; }
  .panel { display: block; grid-column: 1; grid-row: 2; overflow-y: auto; border-right: 1px solid var(--line); min-height: 0; }
  .map-wrap { grid-column: 2; grid-row: 2; height: auto; min-height: 0; border: 0; }
  .list-tools { top: 0; }
  .history { grid-column: 1 / -1; grid-row: 2; overflow-y: auto; min-height: 0; }
  .modal { place-items: center; }
  .modal-card { border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
