/* Пешком — мобильное приложение-маршрут. Палитра взята из PDF-гида:
   тёмно-синий заголовков, золото номеров, кремовая бумага. */

:root {
  --bg: #f6f1e7;
  --bg-2: #efe8da;
  --card: #fffdf8;
  --ink: #18233a;
  --ink-2: #4b5670;
  --muted: #7d8699;
  --line: #e3dccd;
  --navy: #1f3a5f;
  --navy-2: #2c5282;
  --gold: #c9a227;
  --gold-ink: #6b5410;
  --gold-soft: #f6ecc9;
  --green: #2f855a;
  --green-soft: #dcefe3;
  --amber: #b7791f;
  --amber-soft: #faecd2;
  --red: #c53030;
  --red-soft: #fbe1e1;
  --blue: #3b6fb6;
  --star: #e2a90b;
  --shadow: 0 1px 2px rgba(24, 35, 58, 0.06), 0 8px 24px rgba(24, 35, 58, 0.08);
  --shadow-lg: 0 -8px 40px rgba(24, 35, 58, 0.18);
  --radius: 18px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tabs-h: calc(62px + var(--safe-b));
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1a2b;
    --bg-2: #13213a;
    --card: #182742;
    --ink: #eef2f8;
    --ink-2: #c3cbdb;
    --muted: #8e9ab3;
    --line: #26385a;
    --navy: #9cc0f0;
    --navy-2: #6ea0e0;
    --gold: #e0bb45;
    --gold-ink: #f3dc92;
    --gold-soft: #3a3418;
    --green: #5cc58c;
    --green-soft: #173a2a;
    --amber: #ecb052;
    --amber-soft: #3c2f16;
    --red: #f07a7a;
    --red-soft: #432121;
    --blue: #79a6e8;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 -8px 40px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-size-adjust: 100%;
}
body.no-scroll {
  overflow: hidden;
}
a {
  color: var(--navy-2);
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
input,
textarea {
  font: inherit;
  color: var(--ink);
}
h1,
h2,
h3 {
  font-family: var(--serif);
  line-height: 1.2;
  margin: 0;
}
code {
  font-size: 0.9em;
  background: var(--bg-2);
  padding: 1px 5px;
  border-radius: 6px;
}
.icon {
  flex: none;
  display: block;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}

/* ── заставка ─────────────────────────────────────────────────────────── */
.splash {
  min-height: 100dvh;
  display: grid;
  place-items: center;
}
.splash-mark,
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--navy);
  color: var(--gold);
  font: 700 30px/1 var(--serif);
  box-shadow: var(--shadow);
}
.splash-mark {
  animation: breathe 1.4s ease-in-out infinite;
}
@media (prefers-color-scheme: dark) {
  .splash-mark,
  .brand-mark {
    background: #1f3a5f;
  }
}
@keyframes breathe {
  50% {
    transform: scale(0.92);
    opacity: 0.7;
  }
}

/* ── кнопки ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  background: var(--bg-2);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: transform 0.12s ease, background 0.2s ease;
  border: 1px solid var(--line);
}
.btn:active {
  transform: scale(0.97);
}
.btn.primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  .btn.primary {
    background: var(--gold);
    border-color: var(--gold);
    color: #1a1608;
  }
}
.btn.ghost {
  background: transparent;
}
.btn.wide {
  width: 100%;
}
.btn:disabled {
  opacity: 0.6;
}
.btn.pulse {
  animation: pulse 1.3s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(201, 162, 39, 0.55);
  }
  60% {
    box-shadow: 0 0 0 12px rgba(201, 162, 39, 0);
  }
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--ink);
}
.icon-btn:active {
  background: var(--bg-2);
}
.round {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  flex: none;
  font-weight: 700;
  font-size: 13px;
}
.round.primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  .round.primary {
    background: var(--gold);
    border-color: var(--gold);
    color: #1a1608;
  }
}
.round.big {
  width: 64px;
  height: 64px;
}
.round.ghost {
  background: transparent;
}
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--navy-2);
  font-weight: 600;
  font-size: 14px;
  padding: 6px 0;
}
.chip-btn {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  min-width: 52px;
}
.spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── бейджи номеров ───────────────────────────────────────────────────── */
.badge {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  font: 700 15px/1 var(--sans);
  font-variant-numeric: tabular-nums;
}
.badge.big {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 22px;
}
.badge-start,
.badge-finish {
  background: var(--gold);
  color: #2a2205;
}
.badge-optional {
  background: var(--blue);
  border-radius: 50%;
}
.badge-done {
  background: var(--green);
  color: #fff;
}
.badge-skipped {
  background: var(--bg-2);
  color: var(--muted);
  border: 1px dashed var(--muted);
}
.badge-next:not(.badge-done) {
  background: var(--gold);
  color: #2a2205;
  box-shadow: 0 0 0 3px var(--gold-soft);
}
@media (prefers-color-scheme: dark) {
  .badge {
    background: #2c5282;
  }
  .badge-start,
  .badge-finish,
  .badge-next:not(.badge-done) {
    background: var(--gold);
  }
  .badge-done {
    background: #2f855a;
  }
  .badge-optional {
    background: #3b6fb6;
  }
}

/* ── вход ─────────────────────────────────────────────────────────────── */
.login {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 16px calc(24px + var(--safe-b));
  background: radial-gradient(120% 60% at 50% 0%, var(--gold-soft), transparent 70%), var(--bg);
}
.login-art {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: calc(var(--safe-t) + 40px);
}
.skyline {
  width: min(420px, 100%);
  fill: var(--navy);
  opacity: 0.85;
}
.login-card {
  width: min(440px, 100%);
  margin: 0 auto;
  background: var(--card);
  border-radius: 24px;
  padding: 24px 20px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 20px/1 var(--serif);
}
.brand .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 20px;
}
.login-card h1 {
  font-size: 24px;
}
.login-card label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--ink-2);
  font-weight: 600;
}
.login-card input {
  height: 50px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 0 14px;
  font-size: 17px;
}
.login-card input:focus,
textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.form-error {
  margin: 0;
  color: var(--red);
  background: var(--red-soft);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
}

/* ── список маршрутов ─────────────────────────────────────────────────── */
.home {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 12px) 16px calc(100px + var(--safe-b));
}
.home-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.home-title {
  font-size: 34px;
  margin: 24px 0 8px;
}
.city h2 {
  font-size: 20px;
  margin: 20px 0 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.city h2 small {
  font: 500 14px var(--sans);
  color: var(--muted);
}
.flag {
  font-size: 22px;
}
.route-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  margin-bottom: 12px;
  border: 1px solid var(--line);
}
.route-card:active {
  transform: scale(0.99);
}
.route-card-main {
  flex: 1;
  display: grid;
  gap: 2px;
}
.route-card-main b {
  font: 700 19px/1.25 var(--serif);
}
.route-card-main small {
  color: var(--muted);
}
.route-card-date {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-ink);
}
.ring-bg {
  fill: none;
  stroke: var(--bg-2);
  stroke-width: 6;
}
.ring-fg {
  fill: none;
  stroke: var(--green);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}
.ring text {
  font: 700 12px var(--sans);
  fill: var(--ink-2);
}
.home-note {
  color: var(--muted);
  font-size: 13px;
  margin-top: 28px;
}

/* ── экран маршрута ───────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: calc(var(--safe-t) + 6px) 10px 8px 4px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-title {
  flex: 1;
  min-width: 0;
  display: grid;
}
.topbar-title b {
  font: 700 18px/1.2 var(--serif);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-title small {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-count {
  font: 700 22px/1 var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--green);
}
.topbar-count span {
  font-size: 14px;
  color: var(--muted);
}
.topbar-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
}
.topbar-progress div {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold));
  border-radius: 0 3px 3px 0;
  transition: width 0.6s ease;
}
.route-main {
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: calc(var(--tabs-h) + 90px);
}
.tab-map .route-main {
  max-width: none;
  padding-bottom: 0;
}

/* нижние вкладки */
.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 800;
  height: var(--tabs-h);
  padding-bottom: var(--safe-b);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
}
.tabs a {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  color: var(--muted);
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 600;
}
.tabs a.active {
  color: var(--navy);
}
@media (prefers-color-scheme: dark) {
  .tabs a.active {
    color: var(--gold);
  }
}

/* ── «маршрут»: следующая точка ───────────────────────────────────────── */
.path-view {
  padding: 12px 16px 0;
}
.chip-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--bg-2);
  color: var(--ink-2);
  margin-bottom: 10px;
}
.sched-ok,
.sched-ahead {
  background: var(--green-soft);
  color: var(--green);
}
.sched-warn {
  background: var(--amber-soft);
  color: var(--amber);
}
.sched-late {
  background: var(--red-soft);
  color: var(--red);
}
.chip-link {
  margin-left: auto;
  color: inherit;
  font-weight: 700;
}
.next-card {
  position: relative;
  background: var(--card);
  border-radius: 22px;
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  overflow: hidden;
}
.next-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--navy-2));
}
.next-card.is-near {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft), var(--shadow);
}
.next-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-ink);
}
.eyebrow-right {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.next-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  margin: 10px 0 8px;
  width: 100%;
}
.next-title .badge {
  width: 46px;
  height: 46px;
  font-size: 19px;
  border-radius: 13px;
}
.next-title b {
  display: block;
  font: 700 21px/1.2 var(--serif);
}
.next-title small {
  display: block;
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 3px;
}
.next-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 14px;
  color: var(--ink-2);
  margin-bottom: 12px;
}
.next-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dist-me {
  color: var(--navy-2);
  font-weight: 600;
}
.near-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gold-soft);
  color: var(--gold-ink);
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 12px;
  animation: pop 0.35s ease;
}
.next-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr;
  gap: 8px;
}
.next-actions .btn {
  padding: 0 8px;
  font-size: 14px;
  gap: 6px;
}
.skip {
  display: block;
  margin: 8px auto 0;
  color: var(--muted);
  font-weight: 500;
}
.next-card.finished {
  text-align: center;
  padding: 24px 18px;
}
.finished h2 {
  font-size: 26px;
  margin: 6px 0;
}
.finished p {
  color: var(--ink-2);
}
.finish-emoji {
  font-size: 48px;
  animation: pop 0.6s ease;
}
@keyframes pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  70% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ── таймлайн ─────────────────────────────────────────────────────────── */
.timeline {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}
.tl {
  position: relative;
}
.tl-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 8px 6px;
  border-radius: 14px;
}
.tl-row:active {
  background: var(--bg-2);
}
.tl-body {
  flex: 1;
  min-width: 0;
  display: grid;
}
.tl-body b {
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1.3;
}
.tl-body small {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.tl-at {
  color: var(--green);
  font-weight: 600;
}
.tl-arrived .tl-body b,
.tl-skipped .tl-body b {
  color: var(--ink-2);
}
.tl-skipped .tl-body b {
  text-decoration: line-through;
  text-decoration-color: var(--muted);
}
.tl-next .tl-row {
  background: var(--gold-soft);
}
.tl-walk {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 23px;
  padding: 2px 0 2px 22px;
  border-left: 2px dotted var(--line);
  font-size: 12px;
  color: var(--muted);
}
.tl-arrived + .tl .tl-walk {
  border-left: 2px solid var(--green);
}
.tl-section {
  font: 700 13px var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 22px 6px 6px;
}

/* ── звёзды ───────────────────────────────────────────────────────────── */
.stars {
  display: inline-flex;
  gap: 2px;
  color: var(--line);
}
.stars i {
  display: inline-flex;
}
.stars .on {
  color: var(--star);
}
.stars .on .icon {
  fill: currentColor;
}
.stars-small {
  flex: none;
}
.stars-input {
  gap: 6px;
}
.stars-input button {
  padding: 2px;
  color: var(--muted);
  opacity: 0.6;
  transition: transform 0.15s ease, color 0.15s ease;
}
.stars-input button.on {
  color: var(--star);
  opacity: 1;
}
.stars-input button:active {
  transform: scale(1.25);
}

/* ── карточка точки (bottom sheet) ────────────────────────────────────── */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 16, 28, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade 0.2s ease;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.sheet {
  width: min(720px, 100%);
  max-height: calc(100dvh - var(--safe-t) - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--card);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-lg);
  animation: rise 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
  padding-bottom: calc(24px + var(--safe-b));
}
@keyframes rise {
  from {
    transform: translateY(40%);
    opacity: 0.4;
  }
}
.grabber {
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  margin: 8px auto 6px;
}
.sheet-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--card);
  padding: 0 16px 12px;
  border-bottom: 1px solid var(--line);
}
.sheet-close {
  position: absolute;
  right: 8px;
  top: 8px;
}
.sheet-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding-right: 36px;
}
.sheet-title h2 {
  font-size: 23px;
  margin-top: 2px;
}
.aka {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}
.sheet-body {
  padding: 14px 16px 0;
}
.facts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.fact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--ink-2);
}
.fact.done {
  background: var(--green-soft);
  color: var(--green);
}
.sheet-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0 18px;
}
.sheet-actions .btn {
  font-size: 13.5px;
  padding: 0 6px;
  gap: 5px;
}
.lead {
  font: italic 18px/1.5 var(--serif);
  color: var(--navy);
  margin: 0 0 14px;
}
.where {
  background: var(--bg-2);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14.5px;
}
.story h3,
.tips h3,
.rating h3 {
  font-size: 13px;
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 20px 0 8px;
}
.story p {
  margin: 0 0 12px;
  font-size: 16.5px;
  line-height: 1.62;
}
.tips ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.tips li {
  position: relative;
  padding: 10px 12px 10px 34px;
  background: var(--gold-soft);
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.5;
}
.tips li::before {
  content: "💡";
  position: absolute;
  left: 10px;
  top: 9px;
  font-size: 15px;
}
.cost {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 600;
  font-size: 14.5px;
}
.rating {
  margin-top: 8px;
  padding: 4px 0 0;
  text-align: center;
}
.rating h3 {
  text-align: center;
}
.rating-label {
  font-weight: 600;
  color: var(--ink-2);
  min-height: 24px;
  margin: 4px 0 10px;
}
.rating textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 12px;
  font-size: 15.5px;
  resize: vertical;
  min-height: 84px;
}
.rating small {
  display: block;
  margin-top: 4px;
}
.sheet-pager {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.pager-btn {
  flex: 1;
  min-width: 0;
  text-align: left;
  font-size: 13.5px;
  color: var(--ink-2);
  padding: 8px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pager-btn.right {
  text-align: right;
}
.pager-btn span {
  font-weight: 700;
  color: var(--navy-2);
}

/* ── плеер ────────────────────────────────────────────────────────────── */
.listen {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, #1f3a5f, #2c5282);
  color: #fff;
  text-align: left;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.listen:active {
  transform: scale(0.99);
}
.listen-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--gold);
  color: #1f3a5f;
  padding-left: 3px;
}
.listen-text {
  flex: 1;
  display: grid;
}
.listen-text b {
  font-size: 17px;
}
.listen-text small {
  opacity: 0.8;
}
.listen-deco {
  opacity: 0.35;
}
.player-big {
  padding: 14px 16px 10px;
  border-radius: 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.player-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  margin-bottom: 12px;
}
.seek {
  position: relative;
  height: 22px;
  cursor: pointer;
  touch-action: none;
}
.seek::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 9px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
}
.seek-fill {
  position: absolute;
  left: 0;
  top: 9px;
  height: 4px;
  border-radius: 2px;
  background: var(--gold);
}
.seek-knob {
  position: absolute;
  top: 4px;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.player-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--safe-b) + 10px);
  z-index: 900;
  padding: 0 10px;
  pointer-events: none;
}
.dock.with-tabs {
  bottom: calc(var(--tabs-h) + 8px);
}
.mini-player {
  pointer-events: auto;
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 10px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 6px 30px rgba(10, 16, 28, 0.25);
  border: 1px solid var(--line);
  overflow: hidden;
  animation: rise 0.25s ease;
}
.mini-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: var(--gold);
  transition: width 0.25s linear;
}
.mini-player .round {
  width: 40px;
  height: 40px;
}
.mini-title {
  flex: 1;
  min-width: 0;
  text-align: left;
  display: grid;
}
.mini-title b {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-title small {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ── навигатор: action sheet ──────────────────────────────────────────── */
.nav-backdrop {
  z-index: 1100;
}
.action-sheet {
  width: min(560px, 100%);
  background: var(--card);
  border-radius: 24px 24px 0 0;
  padding: 0 16px calc(16px + var(--safe-b));
  box-shadow: var(--shadow-lg);
  animation: rise 0.25s ease;
  max-height: 92dvh;
  overflow-y: auto;
}
.action-sheet h3 {
  font-size: 21px;
}
.action-sheet > p {
  margin: 4px 0 12px;
}
.coords {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px dashed var(--gold);
  background: var(--gold-soft);
  text-align: left;
  margin-bottom: 10px;
}
.coords small {
  display: block;
  color: var(--gold-ink);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.coords b {
  font: 600 19px/1.3 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.01em;
}
.nav-list {
  display: grid;
  gap: 6px;
  margin: 6px 0 12px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--bg-2);
  text-decoration: none;
  color: var(--ink);
}
.nav-item > span:nth-child(2) {
  flex: 1;
  display: grid;
}
.nav-item small {
  color: var(--muted);
  font-size: 12.5px;
}
.nav-logo {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #fff;
  font-weight: 800;
}
.nav-google {
  background: #1a73e8;
}
.nav-apple {
  background: #111;
}
.nav-mapsme {
  background: #23a83e;
}
.nav-organic {
  background: #006c35;
}
.nav-geo {
  background: #7a5af8;
}

/* ── карта ────────────────────────────────────────────────────────────── */
.map-view {
  position: relative;
  height: calc(100dvh - var(--tabs-h) - 61px - var(--safe-t));
}
.map {
  position: absolute;
  inset: 0;
  background: var(--bg-2);
}
@media (prefers-color-scheme: dark) {
  .map .leaflet-tile-pane {
    filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9) saturate(0.6);
  }
}
.leaflet-container {
  font: inherit;
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--card);
  color: var(--ink);
}
.leaflet-control-attribution {
  font-size: 10px;
  background: color-mix(in srgb, var(--card) 80%, transparent) !important;
  color: var(--muted);
}
.leaflet-control-attribution a {
  color: var(--muted);
}
.track {
  stroke: var(--navy-2);
  stroke-opacity: 0.75;
  fill: none;
}
.track-done {
  stroke: var(--green);
  stroke-opacity: 0.85;
  fill: none;
}
.pin {
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  display: grid;
  place-items: center;
  background: #1f3a5f;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.pin span {
  transform: rotate(45deg);
  color: #fff;
  font: 700 12px/1 var(--sans);
}
.pin-start,
.pin-finish {
  background: #c9a227;
}
.pin-start span,
.pin-finish span {
  color: #2a2205;
}
.pin-arrived {
  background: #2f855a;
}
.pin-skipped {
  background: #9aa3b5;
}
.pin-next {
  background: #c9a227;
  transform: rotate(-45deg) scale(1.25);
  animation: pinpulse 1.6s ease-in-out infinite;
}
.pin-next span {
  color: #2a2205;
}
@keyframes pinpulse {
  50% {
    box-shadow: 0 0 0 10px rgba(201, 162, 39, 0.25), 0 2px 6px rgba(0, 0, 0, 0.3);
  }
}
.pin-optional {
  background: #3b6fb6;
  border-radius: 6px;
  width: 26px;
  height: 26px;
}
.pin-food {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  transform: none;
  background: #ffc72c;
  border-width: 1.5px;
}
.pin-food span {
  transform: none;
  color: #c8102e;
  font-size: 12px;
}
.me-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1a73e8;
  border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(26, 115, 232, 0.25);
}
.me-accuracy {
  stroke: #1a73e8;
  fill: #1a73e8;
  fill-opacity: 0.1;
}
.map-chips {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 450;
  display: flex;
  gap: 6px;
}
.chip {
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.chip.on {
  color: var(--navy);
  border-color: var(--navy-2);
}
.map-fabs {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 450;
  display: grid;
  gap: 8px;
}
.fab {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.fab.on {
  color: #1a73e8;
}
.fab.is-loading .icon {
  animation: spin 1.2s linear infinite;
}
.map-card {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 12px;
  z-index: 450;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  max-width: 600px;
  margin: 0 auto;
}
.map-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}
.map-card-main > span:last-child {
  min-width: 0;
  display: grid;
}
.map-card-main b {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-card-main small {
  color: var(--muted);
  font-size: 12.5px;
}
.route-screen.tab-map ~ .dock.with-tabs {
  bottom: calc(var(--tabs-h) + 80px);
}

/* ── инфо ─────────────────────────────────────────────────────────────── */
.info-view {
  padding: 16px;
}
.info-hero h1 {
  font-size: 28px;
}
.info-hero > p {
  color: var(--muted);
  margin: 6px 0 14px;
}
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}
.facts div {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
}
.facts dt {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-ink);
}
.facts dd {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 1.4;
}
.callout {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--amber-soft);
  color: var(--ink);
  font-size: 14.5px;
}
.callout .icon {
  color: var(--amber);
  margin-top: 2px;
}
.callout p {
  margin: 0;
}
.info-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 12px 0;
  overflow: hidden;
}
.info-section summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  font: 700 17px var(--serif);
  cursor: pointer;
}
.info-section summary::-webkit-details-marker {
  display: none;
}
.info-section summary::after {
  content: "›";
  margin-left: auto;
  font: 400 22px var(--sans);
  color: var(--muted);
  transition: transform 0.2s;
}
.info-section[open] summary::after {
  transform: rotate(90deg);
}
.info-section summary .icon {
  color: var(--gold);
}
.info-body {
  padding: 0 16px 16px;
  font-size: 15px;
}
.info-body > p:first-child {
  margin-top: 0;
}
.plain-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}
.tip {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.tip:last-child {
  border: 0;
}
.seg-list {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}
.seg {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-2);
  color: var(--ink);
  text-decoration: none;
}
.seg > span:nth-child(2) {
  flex: 1;
}
.seg-ids {
  font-weight: 800;
  color: var(--navy-2);
  min-width: 64px;
  font-variant-numeric: tabular-nums;
}
.food-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  display: grid;
  gap: 8px;
}
.food-list li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-2);
}
.food-list li > div {
  flex: 1;
  display: grid;
}
.food-list small {
  font-size: 12.5px;
}
.offline-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.offline-head > div {
  display: grid;
}
.offline-head small {
  color: var(--muted);
}
.offline-head .icon {
  color: var(--navy-2);
}
.offline-stats {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.offline-stats li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.offline-stats b {
  font-variant-numeric: tabular-nums;
}
.dl-progress {
  position: relative;
  height: 46px;
  border-radius: 14px;
  background: var(--bg-2);
  overflow: hidden;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
}
.dl-progress div {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--green-soft);
  transition: width 0.2s;
}
.dl-progress span {
  position: relative;
}
.ratings-avg {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.ratings-avg b {
  font: 700 32px/1 var(--serif);
}
.ratings-avg small {
  color: var(--muted);
  width: 100%;
}
.ratings-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: grid;
  gap: 4px;
}
.ratings-list button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 8px 4px;
  border-radius: 12px;
}
.ratings-body {
  flex: 1;
  min-width: 0;
  display: grid;
}
.ratings-body small {
  color: var(--ink-2);
  font-size: 13px;
  font-style: italic;
}
.toggle {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 0 12px;
}
.toggle input {
  width: 22px;
  height: 22px;
  accent-color: var(--navy);
}
.settings-actions {
  display: grid;
  gap: 8px;
}

/* ── всплывашки, конфетти ─────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  top: calc(var(--safe-t) + 12px);
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 24px);
  width: max-content;
  padding: 12px 14px 12px 16px;
  border-radius: 14px;
  background: #18233a;
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: drop 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.toast-success {
  background: #276749;
}
.toast-error {
  background: #9b2c2c;
}
.toast button {
  color: #ffd86b;
  font-weight: 800;
  padding: 4px 6px;
}
@keyframes drop {
  from {
    transform: translate(-50%, -30px);
    opacity: 0;
  }
}
.burst {
  position: fixed;
  left: 50%;
  top: 45%;
  z-index: 3000;
  pointer-events: none;
}
.burst i {
  position: absolute;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  background: hsl(calc(var(--h) * 90 + 40) 85% 55%);
  animation: burst 1s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}
@keyframes burst {
  from {
    transform: rotate(var(--a)) translateY(0) scale(1);
    opacity: 1;
  }
  to {
    transform: rotate(var(--a)) translateY(calc(var(--d) * -1)) rotate(200deg) scale(0.6);
    opacity: 0;
  }
}

.empty {
  min-height: 70dvh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 12px;
  padding: 16px;
}

@media (min-width: 760px) {
  .sheet {
    border-radius: 24px;
    margin-bottom: 24px;
    max-height: calc(100dvh - 48px);
  }
  .sheet-backdrop {
    align-items: center;
  }
}

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