/* Cojede – vizuální styl
   Světlý „papírový" design: chladné pozadí, inkoustová modročerná,
   svěží zelený akcent, oranžová na upozornění. Bricolage Grotesque + Inter.
   Mobile-first, velké dotykové plochy, přístupné kontrasty. */

:root {
  /* Paleta inspirovaná Bolt: Bolt Green + čistá téměř bílá + tmavý inkoust */
  --paper: #f6f7f9;     /* jemné chladné pozadí */
  --paper-2: #ffffff;   /* karty */
  --paper-3: #ffffff;   /* zvednuté prvky */
  --ink: #191a1f;       /* hlavní text (Bolt dark) */
  --ink-soft: #585e66;  /* sekundární text */
  --ink-faint: #8a9099; /* placeholdery, popisky */
  --line: #e8eaee;      /* hairlines */
  --line-2: #f0f1f4;

  --green: #34d186;       /* Bolt Green */
  --green-deep: #0e7a50;  /* tmavší zelená pro text/malá tlačítka (kontrast) */
  --green-tint: #e7f9f0;
  --green-line: #c7ecd8;
  --orange: #d08a3a;
  --orange-tint: #faf1e5;
  --red: #e0574f;
  --red-tint: #fbeae8;

  /* Barvy druhů dopravy (PID) */
  --metro: #c8102e;
  --tram: #7b1fa2;
  --bus: #1560bd;
  --train: #0b7a4b;
  --other: #5c5c64;

  /* Semantika času do odjezdu */
  --soon: #d08a3a;   /* 0–2 min */
  --good: #0e7a50;   /* 3–7 min */
  --std: #191a1f;    /* 8+ min */
  --miss: #e0574f;   /* nestihnutelné / problém */

  --shadow-sm: 0 1px 2px rgba(20, 32, 42, 0.05), 0 1px 3px rgba(20, 32, 42, 0.04);
  --shadow: 0 2px 8px rgba(20, 32, 42, 0.06), 0 8px 24px rgba(20, 32, 42, 0.05);
  --shadow-lg: 0 12px 40px rgba(20, 32, 42, 0.14);

  --r-sm: 12px;
  --r: 18px;
  --r-lg: 26px;
  --max-w: 640px;

  --font-display: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px; line-height: 1.55; letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

h1, h2, h3, .display { font-family: var(--font-display); letter-spacing: 0; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--paper-3); color: var(--ink); border: 1px solid var(--line);
  padding: 10px 14px; z-index: 100; border-radius: 10px;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---- Hlavička ---- */
.app-header {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px 6px;
  max-width: var(--max-w); margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand__logo svg { width: 20px; height: 20px; fill: var(--green-deep); display: block; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: 0; text-transform: lowercase; }
.brand__name::after { content: '.'; color: var(--green); }

.header-right { display: flex; align-items: center; gap: 8px; }

/* tlačítko cíle vpravo nahoře */
.dest-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--paper-3); color: var(--ink); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 14px; font-weight: 600; font-size: 14px;
  cursor: pointer; box-shadow: var(--shadow-sm); min-height: 42px; max-width: 60vw;
  transition: background 0.15s, border-color 0.15s;
}
.dest-btn svg { width: 17px; height: 17px; fill: var(--green-deep); flex: none; }
.dest-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dest-btn:hover { background: var(--paper-2); }
.dest-btn.is-set { background: var(--green-tint); border-color: var(--green-line); color: var(--green-deep); }
.dest-btn.is-set svg { fill: var(--green-deep); }
.dest-btn:focus-visible { outline: 2px solid var(--green-deep); outline-offset: 2px; }

.demo-badge {
  background: transparent; color: var(--ink-faint);
  border: 1px solid var(--line); font-weight: 700; font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 999px;
}

.offline-banner {
  background: var(--orange-tint); color: #7a5b00; border-bottom: 1px solid #f0dcc2;
  padding: 11px 16px; font-size: 13px; text-align: center; position: relative; z-index: 1;
}

/* ---- Hlavní obsah ---- */
.app-main { position: relative; z-index: 1; max-width: var(--max-w); margin: 0 auto; padding: 0 16px 44px; }

/* ---- Lišta cíle ---- */
.destbar { margin: 10px 0 2px; }
.dest-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--green-tint); border: 1px solid var(--green-line); border-radius: var(--r-sm);
  padding: 11px 12px;
}
.dest-chip__ic { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--paper-3);
  display: grid; place-content: center; }
.dest-chip__ic svg { width: 17px; height: 17px; fill: var(--green-deep); }
.dest-chip__text { flex: 1; min-width: 0; }
.dest-chip__label { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--green-deep); font-weight: 700; }
.dest-chip__name { font-weight: 600; font-size: 15px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dest-chip__go {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-deep); color: #fff; border: none; border-radius: 10px;
  padding: 9px 13px; font-weight: 600; font-size: 13px; cursor: pointer; min-height: 40px;
}
.dest-chip__go svg { width: 15px; height: 15px; fill: #fff; }
.dest-chip__clear { flex: none; width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--paper-3); color: var(--ink-soft); font-size: 18px; line-height: 1; }

.hero { text-align: center; padding: 26px 0 8px; }
/* Úvodní obrazovka: tlačítko vždy na střed stránky */
body.state-initial .hero {
  min-height: calc(100vh - 150px);
  min-height: calc(100dvh - 150px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0;
}

/* Hlavní tlačítko – zelený kulatý button „Co jede?", pod ním větší radar */
.main-btn {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  width: min(86vw, 320px); height: min(86vw, 320px); border-radius: 50%;
  border: none; cursor: pointer; outline: transparent;
  font-family: var(--font-display); font-weight: 700; letter-spacing: 0.03em;
  background: radial-gradient(circle at 50% 45%, hsl(154, 40%, 96%), hsl(154, 34%, 91%));
  box-shadow: 0 12px 26px -14px hsla(154, 45%, 30%, 0.3), 0 0 0 1px hsla(154, 40%, 60%, 0.14) inset;
  transition: transform 0.12s ease, opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
/* animovaná šedivá mapa města pod radarem */
.citymap {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  opacity: 0.5; pointer-events: none;
}
/* radarová mřížka – nad mapou, pod buttonem */
.main-btn::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%; z-index: 1;
  background:
    linear-gradient(hsla(154, 45%, 42%, 0.10), hsla(154, 45%, 42%, 0.10)) 50% / 1px 100% no-repeat,
    linear-gradient(hsla(154, 45%, 42%, 0.10), hsla(154, 45%, 42%, 0.10)) 50% / 100% 1px no-repeat,
    repeating-radial-gradient(circle at 50% 50%, transparent 0 24px, hsla(154, 45%, 42%, 0.10) 24px 25px);
}
/* rotující paprsek radaru – pod buttonem */
.main-btn::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; z-index: 2;
  background: conic-gradient(from 0deg,
    hsla(150, 75%, 55%, 0) 0deg,
    hsla(150, 75%, 55%, 0) 235deg,
    hsla(150, 75%, 55%, 0.12) 330deg,
    hsla(150, 82%, 60%, 0.5) 359deg,
    hsla(150, 82%, 60%, 0) 360deg);
  animation: radar-sweep 2.6s linear infinite;
}
/* vnitřní zelený kulatý button s textem */
.main-btn__label {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: center; text-align: center;
  width: 168px; height: 168px; border-radius: 50%;
  background: radial-gradient(circle at 50% 36%, #57e0a1, var(--green) 55%, #14b877);
  color: #06301f; font-size: 23px; line-height: 1.05;
  box-shadow:
    0 0 0 7px hsla(0, 0%, 100%, 0.7),
    0 10px 20px -6px hsla(154, 55%, 26%, 0.5),
    inset 0 2px 6px hsla(0, 0%, 100%, 0.5),
    inset 0 -10px 16px hsla(154, 60%, 22%, 0.35);
  transition: transform 0.15s ease, box-shadow 0.3s ease;
}
@keyframes radar-sweep { to { transform: rotate(1turn); } }
.main-btn:active .main-btn__label { transform: scale(0.96); }
.main-btn:focus-visible .main-btn__label {
  box-shadow:
    0 0 0 7px hsla(0, 0%, 100%, 0.7),
    0 0 0 11px hsla(154, 75%, 45%, 0.6),
    0 10px 20px -6px hsla(154, 55%, 26%, 0.5),
    inset 0 2px 6px hsla(0, 0%, 100%, 0.5);
}
.main-btn:disabled { opacity: 0.8; cursor: default; }

/* radarové „blipy" – jen občas a jemně */
.main-btn .blip {
  position: absolute; z-index: 3;
  width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle, hsl(150, 78%, 62%), hsl(150, 72%, 46%));
  box-shadow: 0 0 6px 1px hsla(150, 78%, 52%, 0.4);
  opacity: 0; pointer-events: none;
  transform: translate(-50%, -50%);
  animation: blip 9s ease-out infinite;
}
.main-btn .blip:nth-of-type(1) { top: 20%; left: 70%; animation-duration: 8s;   animation-delay: -1s; }
.main-btn .blip:nth-of-type(2) { top: 72%; left: 76%; animation-duration: 11s;  animation-delay: -5.5s; }
.main-btn .blip:nth-of-type(3) { top: 66%; left: 22%; animation-duration: 9.5s; animation-delay: -3s; }
@keyframes blip {
  0%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  4%       { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  12%      { opacity: 0; transform: translate(-50%, -50%) scale(1.6); }
}

/* Po prvním hledání – menší tmavá varianta */
.main-btn--refresh {
  width: 196px; height: 196px;
  background: radial-gradient(circle at 50% 45%, hsl(154, 16%, 20%), hsl(154, 16%, 13%));
  box-shadow: 0 12px 24px -14px rgba(0, 0, 0, 0.55), 0 0 0 1px hsla(154, 30%, 40%, 0.2) inset;
}
.main-btn--refresh::before {
  background:
    linear-gradient(hsla(154, 55%, 60%, 0.14), hsla(154, 55%, 60%, 0.14)) 50% / 1px 100% no-repeat,
    linear-gradient(hsla(154, 55%, 60%, 0.14), hsla(154, 55%, 60%, 0.14)) 50% / 100% 1px no-repeat,
    repeating-radial-gradient(circle at 50% 50%, transparent 0 18px, hsla(154, 55%, 60%, 0.12) 18px 19px);
}
.main-btn--refresh::after {
  animation-duration: 3.6s;
  background: conic-gradient(from 0deg,
    hsla(150, 80%, 60%, 0) 0deg,
    hsla(150, 80%, 60%, 0) 255deg,
    hsla(150, 80%, 60%, 0.16) 335deg,
    hsla(150, 85%, 64%, 0.5) 359deg,
    hsla(150, 85%, 64%, 0) 360deg);
}
.main-btn--refresh .main-btn__label {
  width: 120px; height: 120px; font-size: 13px; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase; line-height: 1.15;
  background: radial-gradient(circle at 50% 38%, hsl(154, 22%, 32%), hsl(154, 22%, 20%));
  color: #eafff5;
  box-shadow:
    0 0 0 6px hsla(0, 0%, 100%, 0.06),
    0 8px 16px -6px rgba(0, 0, 0, 0.5),
    inset 0 1px 3px hsla(0, 0%, 100%, 0.15),
    inset 0 -8px 14px rgba(0, 0, 0, 0.35);
}
.main-btn--refresh .blip { display: none; }

.tagline { color: var(--ink-soft); font-size: 15px; margin: 18px auto 0; max-width: 300px; }

/* ---- Stavy / spinner ---- */
.status {
  margin: 16px 0; padding: 15px 16px; border-radius: var(--r);
  background: var(--paper-2); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  font-size: 15px;
}
.status--loading { color: var(--ink-soft); }
.status--warn { background: var(--orange-tint); border-color: #f0dcc2; color: #7a5b00; }
.status--error { background: var(--paper-2); }
.spinner {
  display: inline-block; width: 15px; height: 15px; vertical-align: -2px;
  border: 2.5px solid var(--line); border-top-color: var(--green);
  border-radius: 50%; animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.err__title { font-family: var(--font-display); font-weight: 700; font-size: 16px; margin-bottom: 5px; }
.err__hint { color: var(--ink-soft); font-size: 14px; }
.err__actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

.btn {
  border: none; border-radius: 13px; padding: 13px 18px; font-weight: 700;
  font-size: 15px; cursor: pointer; background: var(--ink); color: #fff;
  min-height: 46px; box-shadow: var(--shadow-sm);
}
.btn--ghost { background: var(--paper-3); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--green-deep); outline-offset: 2px; }

.updated { text-align: center; color: var(--ink-faint); font-size: 12px; margin: 6px 0 12px; }

/* ---- Záložky ---- */
.tabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 14px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; display: flex; align-items: center; gap: 7px;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 14px; font-size: 14px; font-weight: 500;
  color: var(--ink-soft); cursor: pointer; min-height: 44px;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.tab__icon svg { width: 17px; height: 17px; fill: currentColor; display: block; }
.tab__count {
  background: var(--line-2); color: var(--ink-soft); font-size: 12px; font-weight: 600;
  border-radius: 999px; padding: 1px 7px; min-width: 20px; text-align: center;
}
.tab--active { background: var(--ink); border-color: var(--ink); color: #fff; }
.tab--active .tab__count { background: rgba(255, 255, 255, 0.18); color: #fff; }
.tab[aria-disabled="true"] { opacity: 0.42; }
.tab:focus-visible { outline: 2px solid var(--green-deep); outline-offset: 2px; }

/* ---- Nejlepší volba (tmavý „klenot") ---- */
.best {
  position: relative; overflow: hidden;
  background: var(--ink); color: #eaf0f4;
  border-radius: var(--r-lg); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.best::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 170px; height: 170px;
  background: radial-gradient(circle, rgba(16, 200, 153, 0.32), transparent 65%); pointer-events: none;
}
.best__label { color: var(--green); font-weight: 700; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.best__main { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; margin: 12px 0 14px; }
.best__text { flex: 1; min-width: 0; }
.best__dir { font-family: var(--font-display); font-weight: 500; font-size: 17px; }
.best__stop { color: #9fb0be; font-size: 13px; margin-top: 2px; }
.best__time { font-family: var(--font-display); font-weight: 600; font-size: 19px; white-space: nowrap; color: var(--green); }
.best .nav-btn { position: relative; z-index: 1; width: 100%; justify-content: center; background: var(--green); color: #08231b; }
.best .nav-btn svg { fill: #08231b; }

/* ---- Karta zastávky ---- */
.card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm); padding: 16px; margin-bottom: 14px;
}
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card__head-text { flex: 1; min-width: 0; }
.card__name { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin: 0 0 3px; }
.card__meta { color: var(--ink-soft); font-size: 13px; }
.card__meta .walk { display: inline-flex; align-items: center; gap: 4px; }
.card__meta .walk svg { width: 13px; height: 13px; fill: currentColor; }

.alert {
  background: var(--red-tint); border: 1px solid #eac9c5; color: #7e332c;
  border-radius: var(--r-sm); padding: 10px 12px; font-size: 14px; margin: 14px 0 4px; cursor: pointer;
}

/* ---- Linky / odjezdy ---- */
.lines { list-style: none; margin: 12px 0 0; padding: 0; }
.line {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 0; border-top: 1px solid var(--line-2);
}
.line--miss { opacity: 0.5; }
.line__body { flex: 1; min-width: 0; }
.line__dir { font-weight: 600; font-size: 15px; }
.line__dir .platform {
  font-weight: 600; font-size: 11px; color: var(--ink-soft);
  background: var(--line-2); border-radius: 6px; padding: 1px 7px; margin-left: 5px;
}
.line__sub { font-size: 12px; margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.line__times { text-align: right; white-space: nowrap; }
.line__time { font-family: var(--font-display); font-weight: 600; font-size: 17px; display: block; font-variant-numeric: tabular-nums; }
.line__more-times { font-size: 11px; color: var(--ink-faint); }

.rt--live { color: var(--green-deep); font-weight: 600; }
.rt--plan { color: var(--ink-faint); }
/* Živá zpoždění v rozpisu / Nejlepší volbě – plné pilulky (čitelné na světlé i tmavé) */
.rt--late,
.rt--early,
.plan .rt--live,
.best .rt--live {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 700; vertical-align: middle; white-space: nowrap;
}
.rt--late { background: #e0522f; color: #fff; }
.rt--early,
.plan .rt--live,
.best .rt--live { background: var(--green); color: #06210f; }
.miss { color: var(--miss); font-weight: 600; }

/* číslo linky – barva podle druhu dopravy */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--other); color: #fff; border-radius: 10px;
  padding: 7px 11px; font-weight: 600; min-width: 54px; justify-content: center;
}
.badge svg { width: 15px; height: 15px; fill: rgba(255, 255, 255, 0.9); }
.badge b { font-family: var(--font-display); font-weight: 600; font-size: 16px; line-height: 1; }
.badge--metro { background: var(--metro); }
.badge--tram { background: var(--tram); }
.badge--bus { background: var(--bus); }
.badge--train { background: var(--train); }
.badge--other { background: var(--other); }

/* barvy času */
.time--soon, .line__time.time--soon { color: var(--soon); }
.time--good, .line__time.time--good { color: var(--good); }
.time--std, .line__time.time--std { color: var(--std); }
.time--miss, .line__time.time--miss { color: var(--miss); }

/* tlačítka v kartě */
.nav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-deep); color: #fff; border: none; border-radius: var(--r-sm);
  padding: 10px 15px; font-weight: 600; font-size: 14px; cursor: pointer;
  min-height: 44px; white-space: nowrap;
}
.nav-btn svg { width: 15px; height: 15px; fill: #fff; }
.nav-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.more-btn, .map-btn {
  display: block; width: 100%; margin-top: 12px; background: var(--paper-3);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px; font-weight: 600;
  color: var(--ink); cursor: pointer; min-height: 44px;
}
.more-btn:hover, .map-btn:hover { background: var(--paper-2); }
.map { margin-top: 12px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); }
.map iframe { width: 100%; height: 220px; border: 0; display: block; }

.empty {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 26px; text-align: center; color: var(--ink-soft);
}
.empty__actions { margin-top: 14px; display: flex; justify-content: center; }

/* ---- Rozpis cesty s přestupy (plán) ---- */
.plan {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; margin-bottom: 14px;
}
.plan--busy { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 14px; }
.plan--note { color: var(--ink-soft); font-size: 14px; line-height: 1.45; }
.plan__head { margin-bottom: 12px; }
.plan__title { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.plan__meta { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.plan__legs { list-style: none; margin: 0; padding: 0; }
.leg { display: flex; gap: 12px; align-items: flex-start; padding: 5px 0; position: relative; }
.leg:not(:last-child)::before {
  content: ''; position: absolute; left: 16px; top: 34px; bottom: -5px; width: 2px;
  background: var(--line);
}
.leg__ic {
  width: 34px; height: 34px; flex: none; display: grid; place-content: center;
  border-radius: 50%; background: var(--paper); border: 1px solid var(--line); z-index: 1;
}
.leg__ic svg { width: 17px; height: 17px; fill: var(--ink-soft); }
.leg .badge { flex: none; z-index: 1; }
.leg__body { min-width: 0; padding-top: 2px; }
.leg__main { font-weight: 600; font-size: 14px; }
.leg__sub { color: var(--ink-soft); font-size: 12.5px; margin-top: 1px; }
.plan__actions { margin-top: 12px; display: flex; gap: 8px; }
.plan__mission {
  flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 14px; border: none; border-radius: var(--r-sm); cursor: pointer;
  background: var(--green); color: #06210f; font-family: var(--font-display);
  font-weight: 800; font-size: 14px; letter-spacing: 0.01em;
}
.plan__mission:active { transform: scale(0.99); }
.plan__nav {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--paper); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer;
}
.plan__nav svg { width: 18px; height: 18px; fill: currentColor; }
.plan__nav:active { transform: scale(0.99); }

/* Mise pro celou cestu: kroky úseků + ikona chůze v hlavičce */
.mission__walkic {
  width: 44px; height: 44px; flex: none; display: grid; place-content: center; border-radius: 12px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12);
}
.mission__walkic svg { width: 24px; height: 24px; fill: #d7f3e6; }
/* Checkpointy mise – svislá osa: hotové ✓, tady (progres), co čeká */
.mission__checkpoints { margin-top: 16px; text-align: left; }
.cp { display: flex; gap: 12px; align-items: flex-start; padding: 5px 0; position: relative; }
.cp:not(:last-child)::before {
  content: ''; position: absolute; left: 6px; top: 18px; bottom: -5px; width: 2px;
  background: rgba(255, 255, 255, 0.12);
}
.cp--done:not(:last-child)::before { background: hsla(150, 60%, 45%, 0.55); }
.cp__dot {
  width: 14px; height: 14px; flex: none; margin-top: 2px; border-radius: 50%; z-index: 1;
  background: rgba(255, 255, 255, 0.12); border: 2px solid rgba(255, 255, 255, 0.28);
}
.cp--done .cp__dot { background: var(--green); border-color: var(--green); }
.cp--now .cp__dot { background: #fff; border-color: var(--green); box-shadow: 0 0 0 4px hsla(150, 70%, 45%, 0.25); }
.cp__body { min-width: 0; flex: 1; }
.cp__label { font-weight: 700; font-size: 14px; color: #eafff5; }
.cp--todo .cp__label { color: #8fb3a1; font-weight: 600; }
.cp--done .cp__label { color: #b8e8cf; }
.cp__sub { font-size: 12px; color: #9fc3b1; margin-top: 1px; }
.cp__bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; margin: 7px 0 3px; }
.cp__fill { height: 100%; background: var(--green); border-radius: 999px; transition: width 0.5s ease; }
.cp__now { font-size: 12px; font-weight: 700; color: #c7e9d8; }

/* ---- Spodní list ---- */
.sheet {
  position: fixed; inset: 0; background: rgba(20, 32, 42, 0.42);
  display: flex; align-items: flex-end; justify-content: center; z-index: 200;
  animation: fade 0.2s ease;
}
@keyframes fade { from { opacity: 0; } }
.sheet__panel {
  background: var(--paper); width: 100%; max-width: 480px;
  border-radius: 24px 24px 0 0; padding: 20px 18px calc(22px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg); animation: rise 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.sheet__title { text-align: center; color: var(--ink-soft); font-size: 14px; margin-bottom: 16px; }
.sheet__title b { color: var(--ink); font-size: 17px; font-family: var(--font-display); }
.sheet__opt {
  display: block; width: 100%; text-align: center; text-decoration: none;
  background: var(--paper-2); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 15px; font-weight: 600; font-size: 16px; margin-bottom: 10px; cursor: pointer;
}
.sheet__opt:hover { background: var(--paper-3); }
.sheet__opt:focus-visible { outline: 2px solid var(--green-deep); outline-offset: 2px; }
.sheet__cancel {
  display: block; width: 100%; background: none; border: none;
  color: var(--ink-soft); font-weight: 600; font-size: 15px; padding: 14px; cursor: pointer;
}
.sheet__opt--quick { padding: 12px; font-size: 15px; }
.sheet__sep {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink-faint); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; margin: 10px 0 12px;
}
.sheet__sep::before, .sheet__sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---- Našeptávač míst ---- */
.geo { position: relative; margin-bottom: 16px; }
.geo__input {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  padding: 15px; font-size: 16px; color: var(--ink); background: var(--paper-3);
  outline: none; min-height: 50px;
}
.geo__input::placeholder { color: var(--ink-faint); }
.geo__input:focus { border-color: var(--green); }
.geo__list {
  list-style: none; margin: 8px 0 0; padding: 5px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper-3);
  max-height: 264px; overflow-y: auto; box-shadow: var(--shadow);
}
.geo__opt {
  padding: 12px; border-radius: 9px; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
}
.geo__opt--active, .geo__opt:hover { background: var(--green-tint); }
.geo__opt-name { font-weight: 600; font-size: 15px; }
.geo__opt-sub { color: var(--ink-soft); font-size: 12px; }
.geo__hint { color: var(--ink-soft); font-size: 13px; margin-top: 8px; min-height: 18px; }
.geo__attr { color: var(--ink-faint); font-size: 11px; text-align: center; margin-top: 4px; }

/* ---- Kompas (směr k zastávce) ---- */
.compass { flex: 0 0 auto; display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.best__main .compass { align-self: center; }
.compass__dial {
  position: relative; width: 46px; height: 46px; border-radius: 50%;
  background: var(--paper-3); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm), inset 0 1px 2px rgba(20, 32, 42, 0.05);
  display: flex; align-items: center; justify-content: center;
}
.compass__dial::before {
  content: ''; position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  width: 2px; height: 5px; border-radius: 1px; background: var(--ink-faint);
}
.compass__needle { width: 22px; height: 22px; display: block; transform-origin: 50% 50%;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1); }
.compass__needle svg { width: 22px; height: 22px; display: block; fill: var(--green-deep); }
.compass__dir { font-size: 10px; font-weight: 700; color: var(--ink-faint); letter-spacing: 0.08em; text-transform: uppercase; }
.compass--live .compass__dial { border-color: var(--green); background: var(--green-tint); }
.compass--live .compass__needle svg { fill: var(--green-deep); filter: drop-shadow(0 0 4px rgba(16, 200, 153, 0.6)); }
.compass--live .compass__dir { color: var(--green-deep); }
/* kompas v tmavé kartě „Nejlepší volba" */
.best .compass__dial { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.2); box-shadow: none; }
.best .compass__dial::before { background: rgba(255, 255, 255, 0.4); }
.best .compass__needle svg { fill: var(--green); }
.best .compass__dir { color: #9fb0be; }

/* ---- Debug ---- */
.debug {
  margin-top: 22px; background: var(--ink); color: #9fb0be; border-radius: var(--r-sm);
  padding: 13px; font-size: 12px; font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}
.debug__title { color: var(--green); font-weight: 700; letter-spacing: 0.08em; margin-bottom: 7px; }
.debug__places { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 6px; }
.debug__places button {
  background: rgba(255, 255, 255, 0.06); color: #eaf0f4; border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px; padding: 6px 9px; font-size: 12px; cursor: pointer;
}

/* ---- Zápatí ---- */
.app-footer { margin-top: 30px; color: var(--ink-faint); font-size: 12px; text-align: center; }
.app-footer p { margin: 7px 0; }

/* ---- Hlášky (tone of voice) ---- */
.quip-bar {
  text-align: center; color: var(--ink-soft); font-size: 14px;
  margin: 2px 0 14px; padding: 0 8px; line-height: 1.4;
}
/* hláška ke konkrétní zastávce (z Gemini) */
.card__quip {
  color: var(--green-deep); font-size: 13px; font-style: italic;
  line-height: 1.4; margin: 10px 0 2px;
}
.best .card__quip { color: #9ff0c4; position: relative; z-index: 1; margin-top: 4px; }
.sheet__quip { text-align: center; color: var(--ink-soft); font-size: 13px; font-style: italic; margin: -6px 0 14px; }
.empty__quip { display: inline-block; margin-top: 6px; font-style: italic; color: var(--green-deep); font-size: 13px; }

/* ---- Akce v kartě Nejlepší volba ---- */
.best__actions { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 8px; }
.best__actions .nav-btn { width: 100%; }
.mission-btn {
  width: 100%; border: none; border-radius: var(--r-sm); cursor: pointer;
  padding: 12px 15px; font-weight: 700; font-size: 15px; min-height: 46px;
  background: var(--green); color: #06301f;
  box-shadow: 0 8px 18px -8px hsla(154, 55%, 30%, 0.5);
  transition: transform 0.12s ease;
}
.mission-btn:active { transform: scale(0.98); }
.mission-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* malé „▶ Mise" u každého spoje */
.mission-mini {
  flex: none; width: 34px; height: 34px; border-radius: 50%; margin-left: 6px;
  border: none; cursor: pointer; font-size: 11px;
  background: var(--green-tint); color: var(--green-deep);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.12s ease, background 0.15s ease;
}
.mission-mini:hover { background: var(--green-line); }
.mission-mini:active { transform: scale(0.92); }
.mission-mini:focus-visible { outline: 2px solid var(--green-deep); outline-offset: 2px; }
.line--miss .mission-mini { opacity: 0.55; }

/* ---- Survival mise (celoobrazovkový mód) ---- */
.mission {
  position: fixed; inset: 0; z-index: 300;
  background: radial-gradient(120% 90% at 50% 0%, #12321f, #0b1a12 60%, #070f0a);
  color: #eafff5; display: flex; align-items: safe center; justify-content: center;
  animation: fade 0.2s ease;
  padding: calc(env(safe-area-inset-top) + 16px) 20px calc(env(safe-area-inset-bottom) + 16px);
  /* Na nízkých displejích je obsah vyšší než okno – povolíme scroll a „safe center“,
     aby se coach dole (hláška) nikdy neořízl za hranou obrazovky. */
  overflow-y: auto;
}
.mission__panel { width: 100%; max-width: 440px; text-align: center; position: relative; }
.mission__quit {
  position: absolute; top: -4px; right: -2px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.06);
  color: #eafff5; font-size: 22px; line-height: 1; cursor: pointer; z-index: 2;
}
.mission__count {
  font-family: var(--font-display); font-weight: 800; font-size: 92px; letter-spacing: 0.02em;
  color: var(--green); text-shadow: 0 0 40px hsla(150, 80%, 50%, 0.5);
  animation: mcount 0.7s ease infinite;
}
@keyframes mcount { 0% { transform: scale(1.25); opacity: 0.25; } 45% { transform: scale(1); opacity: 1; } 100% { opacity: 1; } }
.mission__eyebrow { text-transform: uppercase; letter-spacing: 0.18em; font-size: 11px; color: #7fd3ac; font-weight: 700; margin-bottom: 10px; }
.mission__target { display: inline-flex; align-items: center; gap: 12px; text-align: left; margin-bottom: 12px; }
.mission__target .badge svg { fill: rgba(255, 255, 255, 0.9); }
.mission__dir { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.mission__stop { color: #9fc3b1; font-size: 13px; margin-top: 2px; }
.mission__clock {
  font-family: var(--font-display); font-weight: 800; font-size: 68px; line-height: 1;
  font-variant-numeric: tabular-nums; margin: 4px 0;
}
.mission__verdict {
  display: inline-block; font-weight: 800; font-size: 18px; padding: 6px 16px; border-radius: 999px;
  margin: 6px 0 16px; text-transform: uppercase; letter-spacing: 0.04em;
}
.mission__verdict--ok { background: hsla(150, 70%, 45%, 0.18); color: #6ff0b0; }
.mission__verdict--warn { background: hsla(38, 80%, 55%, 0.18); color: #ffca7a; }
.mission__verdict--bad { background: hsla(4, 80%, 60%, 0.2); color: #ff9a90; }
.mission__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.mstat { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: var(--r-sm); padding: 12px 8px; }
.mstat span { display: block; font-family: var(--font-display); font-weight: 800; font-size: 17px; }
.mstat small { color: #8fb3a1; font-size: 11px; }
.mission__coach {
  font-size: 15px; line-height: 1.45; color: #d7f3e6; min-height: 44px;
  background: rgba(255, 255, 255, 0.05); border-radius: var(--r-sm); padding: 12px 14px;
}
.mission__result-ic {
  width: 84px; height: 84px; margin: 0 auto 12px; border-radius: 50%;
  display: grid; place-content: center; font-size: 44px; font-weight: 800;
}
.mission__result.win .mission__result-ic { background: hsla(150, 70%, 45%, 0.2); color: #6ff0b0; }
.mission__result.lose .mission__result-ic { background: hsla(4, 80%, 60%, 0.2); color: #ff9a90; }
.mission__result-t { font-family: var(--font-display); font-weight: 800; font-size: 30px; letter-spacing: 0.06em; margin-bottom: 10px; }
.mission__result .btn { margin-top: 16px; background: var(--green); color: #06301f; }

/* ---- Přístupnost ---- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---- Desktop ---- */
@media (min-width: 600px) {
  .main-btn { width: 360px; height: 360px; }
  .main-btn__label { width: 190px; height: 190px; font-size: 26px; }
  .hero { padding: 34px 0 10px; }
}
