/* ==========================================================================
   Вёрсты — дизайн-система
   Светлая тема рассчитана на чтение на солнце, тёмная — на вечер и OLED.
   ========================================================================== */

@font-face {
  font-family: "Onest";
  src: url("../fonts/onest-cyrillic.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  src: url("../fonts/onest-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --bg: #f4f3ee;
  --surface: #ffffff;
  --surface-2: #efede6;
  --surface-3: #e4e1d7;
  --ink: #121a15;
  --ink-2: #4a544e;
  --ink-3: #7b847e;
  --line: rgba(18, 26, 21, 0.09);
  --line-strong: rgba(18, 26, 21, 0.16);

  --brand: #0f3d2c;
  --brand-ink: #f4f3ee;
  --accent: #ff5a1f;
  --accent-2: #e2430b;
  --accent-ink: #1b0b03;

  --route: #f0561d;
  --route-casing: #ffffff;
  --poi: #0f3d2c;
  --poi-ring: #ffffff;
  --you: #1e6bff;

  --ok: #12804b;
  --ok-bg: #dcf2e4;
  --warn: #9a6400;
  --warn-bg: #fdf0d2;
  --danger: #cf2f24;
  --danger-bg: #fde3df;

  --tone-violet: #5a4de0;
  --tone-green: #16925a;
  --tone-orange: #e0620f;
  --tone-rose: #d22f68;
  --tone-sky: #1a86cc;
  --tone-amber: #b98000;

  --r-lg: 24px;
  --r: 18px;
  --r-sm: 12px;
  --shadow-1: 0 1px 2px rgba(16, 24, 20, 0.05), 0 2px 10px rgba(16, 24, 20, 0.05);
  --shadow-2: 0 10px 30px rgba(16, 24, 20, 0.16), 0 2px 6px rgba(16, 24, 20, 0.08);
  --shadow-3: 0 -8px 40px rgba(16, 24, 20, 0.18);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gutter: 16px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b100d;
    --surface: #141b17;
    --surface-2: #1b241f;
    --surface-3: #25302a;
    --ink: #edf2ee;
    --ink-2: #a8b4ac;
    --ink-3: #75817a;
    --line: rgba(237, 242, 238, 0.08);
    --line-strong: rgba(237, 242, 238, 0.15);
    --brand: #1f5c43;
    --brand-ink: #edf2ee;
    --accent: #ff6a33;
    --accent-2: #ff8657;
    --ok: #4fd18d;
    --ok-bg: rgba(79, 209, 141, 0.14);
    --warn: #f3c04f;
    --warn-bg: rgba(243, 192, 79, 0.14);
    --danger: #ff6b5e;
    --danger-bg: rgba(255, 107, 94, 0.15);
    --tone-violet: #8f86ff;
    --tone-green: #3ccf85;
    --tone-orange: #ff8a3d;
    --tone-rose: #ff5c93;
    --tone-sky: #4db3f5;
    --tone-amber: #f0b429;
    --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-2: 0 10px 30px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-3: 0 -8px 40px rgba(0, 0, 0, 0.55);
  }
}

@media (min-width: 720px) {
  :root {
    --gutter: 24px;
  }
}

.tone-violet { --tone: var(--tone-violet); }
.tone-green { --tone: var(--tone-green); }
.tone-orange { --tone: var(--tone-orange); }
.tone-rose { --tone: var(--tone-rose); }
.tone-sky { --tone: var(--tone-sky); }
.tone-amber { --tone: var(--tone-amber); }

/* --- База ---------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg);
}

html.lock-scroll,
html.route-open {
  overflow: hidden;
}

/* Каталог под открытым маршрутом не рисуем (после завершения анимации) — экономия GPU */
.catalog-view {
  transition: visibility 0s;
}

html.route-open .catalog-view {
  visibility: hidden;
  transition: visibility 0s 0.34s;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent);
  outline-offset: 2px;
  border-radius: 10px;
}

.i {
  flex: none;
  display: block;
}

.inline-icon {
  display: inline-block;
  vertical-align: -3px;
}

.muted {
  color: var(--ink-3);
  font-size: 14px;
}

.noscript {
  padding: 24px;
}

/* --- Кнопки -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 0.12s var(--ease),
    background-color 0.2s,
    opacity 0.2s;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.btn--primary {
  background: var(--ink);
  color: var(--bg);
}

.btn--go {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent);
}

.btn--ghost {
  background: var(--surface-2);
  color: var(--ink);
}

.btn--danger {
  background: var(--danger);
  color: #fff;
}

.btn--danger-text {
  color: var(--danger);
}

.btn--block {
  width: 100%;
}

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: var(--ink);
  transition: background-color 0.2s, transform 0.12s var(--ease);
}

.icon-btn:hover {
  background: var(--surface-2);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn--sm {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--ink-3);
}

.icon-btn__badge {
  position: absolute;
  top: 4px;
  right: 3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--ok);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
  font-variant-numeric: tabular-nums;
}

.fab {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-2);
  transition: transform 0.12s var(--ease), background-color 0.2s, color 0.2s;
}

.fab:active {
  transform: scale(0.92);
}

.fab[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}

/* ==========================================================================
   Каталог
   ========================================================================== */

.catalog-view {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--gutter) calc(32px + var(--safe-b));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-t) + 10px) 0 4px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand__mark {
  width: 34px;
  height: 34px;
}

.brand__name {
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.net-pill {
  display: none;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px 0 10px;
  border-radius: 99px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 13px;
  font-weight: 600;
}

.is-offline .net-pill {
  display: inline-flex;
}

.hero {
  padding: 18px 0 16px;
}

.hero__title {
  font-size: clamp(32px, 8.4vw, 46px);
  line-height: 1.02;
  font-weight: 780;
  letter-spacing: -0.035em;
}

.hero__sub {
  margin-top: 10px;
  max-width: 34em;
  color: var(--ink-2);
  font-size: 15.5px;
  text-wrap: pretty;
}

/* --- Панель поиска и фильтров --------------------------------------------- */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 calc(var(--gutter) * -1);
  padding: 8px var(--gutter) 10px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-bottom: 1px solid transparent;
}

.toolbar__row {
  display: flex;
  gap: 8px;
}

.search {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 6px 0 14px;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink-3);
  box-shadow: var(--shadow-1);
  border: 1px solid var(--line);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search:focus-within {
  border-color: color-mix(in srgb, var(--ink) 40%, transparent);
}

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: none;
  color: var(--ink);
  font-size: 16px;
}

.search input::placeholder {
  color: var(--ink-3);
}

.search input::-webkit-search-cancel-button {
  display: none;
}

.search__clear {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: var(--ink-3);
}

.seg {
  display: flex;
  padding: 4px;
  gap: 2px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}

.seg button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 38px;
  border-radius: 12px;
  color: var(--ink-3);
  transition: background-color 0.2s, color 0.2s;
}

.seg button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}

.chips {
  display: flex;
  gap: 8px;
  margin: 10px calc(var(--gutter) * -1) 0;
  padding: 0 var(--gutter) 2px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-padding: 0 var(--gutter);
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone);
}

.chip__n {
  color: var(--ink-3);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.chip[aria-pressed="true"] .chip__n {
  color: color-mix(in srgb, var(--bg) 65%, transparent);
}

.chip--saved .i {
  color: var(--ok);
}

.chip--saved[aria-pressed="true"] .i {
  color: inherit;
}

/* --- Список маршрутов ------------------------------------------------------ */

.catalog {
  padding-top: 6px;
}

.group + .group {
  margin-top: 26px;
}

.group__title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 10px 2px 12px;
  font-size: 18px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.group__dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--tone);
  transform: rotate(45deg);
}

.group__n {
  margin-left: 2px;
  color: var(--ink-3);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.group__cards {
  display: grid;
  gap: 10px;
}

@media (min-width: 720px) {
  .group__cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (min-width: 1100px) {
  .group__cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 10px 14px 10px 10px;
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  text-decoration: none;
  color: inherit;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.15s var(--ease), box-shadow 0.2s;
  content-visibility: auto;
  contain-intrinsic-size: auto 96px;
}

a.card:active {
  transform: scale(0.985);
}

@media (hover: hover) {
  a.card:hover {
    box-shadow: var(--shadow-2);
  }
}

.card__thumb {
  position: relative;
  display: block;
  width: 76px;
  height: 76px;
  border-radius: 14px;
  overflow: hidden;
  background-color: color-mix(in srgb, var(--tone, var(--ink-3)) 9%, var(--surface-2));
  background-image: radial-gradient(color-mix(in srgb, var(--tone, var(--ink-3)) 22%, transparent) 0.8px, transparent 1px);
  background-size: 8px 8px;
}

.thumb {
  width: 100%;
  height: 100%;
  display: block;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.thumb__casing {
  stroke: var(--surface);
  stroke-width: 5;
  opacity: 0.9;
}

.thumb__line {
  stroke: var(--tone, var(--route));
  stroke-width: 2.2;
}

.thumb__start {
  fill: var(--tone, var(--route));
  stroke: var(--surface);
  stroke-width: 1.6;
}

.thumb__end {
  fill: var(--surface);
  stroke: var(--tone, var(--route));
  stroke-width: 1.6;
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.card__kicker {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tone, var(--ink-3));
  letter-spacing: 0.01em;
}

.card__title {
  font-size: 16.5px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.012em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: pretty;
}

.card__meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--ink-3);
}

.card__km {
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.card__km b {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.card__saved {
  position: absolute;
  top: 6px;
  left: 64px;
  display: none;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  box-shadow: 0 0 0 2.5px var(--surface);
}

.card.is-saved .card__saved {
  display: grid;
}

/* Кольцо прогресса скачивания на миниатюре */
.card__ring {
  --p: 0;
  position: absolute;
  top: 6px;
  left: 64px;
  display: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    radial-gradient(var(--surface) 52%, transparent 54%),
    conic-gradient(var(--accent) calc(var(--p) * 360deg), var(--surface-3) 0);
  box-shadow: 0 0 0 2.5px var(--surface);
}

.card.is-downloading .card__ring {
  display: block;
}

.card.is-downloading .card__saved {
  display: none;
}

.card--skeleton {
  pointer-events: none;
}

.card--skeleton .card__thumb,
.card--skeleton .card__body span,
.skeleton-lines span {
  background: var(--surface-2);
  border-radius: 8px;
  animation: pulse 1.4s ease-in-out infinite;
}

.card--skeleton .card__body span {
  display: block;
  height: 14px;
  width: 70%;
}

.card--skeleton .card__body span + span {
  width: 40%;
  margin-top: 8px;
}

.skeleton-lines {
  display: grid;
  gap: 10px;
}

.skeleton-lines span {
  height: 14px;
}

.skeleton-lines span:nth-child(2) {
  width: 80%;
}

.skeleton-lines span:nth-child(3) {
  width: 55%;
}

@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}

.empty {
  padding: 40px 12px;
  text-align: center;
}

.empty--compact {
  padding: 20px 8px 8px;
}

.empty__title {
  font-size: 18px;
  font-weight: 700;
}

.empty__text {
  max-width: 28em;
  margin: 8px auto 18px;
  color: var(--ink-2);
  font-size: 15px;
}

/* --- Обзорная карта -------------------------------------------------------- */

.catalog-view[data-mode="map"] {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding-bottom: 0;
}

.catalog-view[data-mode="map"] .hero {
  display: none;
}

.overview {
  position: relative;
  isolation: isolate;
  flex: 1;
  margin: 0 calc(var(--gutter) * -1);
  min-height: 0;
}

.overview__map {
  position: absolute;
  inset: 0;
  background: var(--surface-2);
}

@media (min-width: 720px) {
  .overview {
    margin: 0 0 var(--gutter);
  }
  .overview__map {
    border-radius: var(--r-lg);
    overflow: hidden;
  }
}

.overview__card {
  position: absolute;
  z-index: 500;
  left: 12px;
  right: 12px;
  bottom: calc(12px + var(--safe-b));
  max-width: 440px;
  margin: 0 auto;
  padding: 6px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-2);
  animation: rise 0.28s var(--ease-out);
}

.overview__card .card {
  box-shadow: none;
}

.overview__open {
  width: 100%;
  margin-top: 4px;
}

@keyframes rise {
  from {
    transform: translateY(16px);
    opacity: 0;
  }
}

/* ==========================================================================
   Экран маршрута
   ========================================================================== */

.route-view {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  background: var(--surface-2);
  transform: translate3d(100%, 0, 0);
  transition: transform 0.32s var(--ease-out);
  contain: strict;
}

.route-view.is-open {
  transform: none;
}

.route-map {
  position: absolute;
  isolation: isolate;
  inset: 0;
  background: var(--surface-2);
}

.map-top {
  position: absolute;
  z-index: 600;
  top: calc(var(--safe-t) + 12px);
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.map-top > *,
.map-top__right > * {
  pointer-events: auto;
}

.map-top__right {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* В поездке сверху только HUD */
.is-navigating .map-top {
  display: none;
}

/* «Экран» — в правом нижнем углу над панелью поездки, рядом с остальным управлением */
.fab--screen {
  position: absolute;
  z-index: 700;
  right: max(10px, calc((100% - 520px) / 2));
  bottom: calc(var(--navbar-top, 90px) + 12px);
  animation: rise 0.3s var(--ease-out);
}

.fab--screen[aria-expanded="true"] {
  background: var(--ink);
  color: var(--bg);
}

.fab--pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  height: 44px;
  padding: 0 16px 0 12px;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
  animation: fade 0.2s ease;
}

/* --- Шторка ---------------------------------------------------------------- */

.sheet {
  position: absolute;
  z-index: 700;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(100% - var(--safe-t) - 70px);
  display: flex;
  flex-direction: column;
  border-radius: 26px 26px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-3);
  will-change: transform;
}

.sheet.is-animating {
  transition: transform 0.42s var(--ease-out);
}

.sheet__head {
  flex: none;
  padding: 8px 18px calc(14px + var(--safe-b));
  touch-action: none;
  cursor: grab;
}

.sheet[data-state="full"] .sheet__head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.sheet__grabber {
  width: 40px;
  height: 5px;
  margin: 0 auto 12px;
  border-radius: 3px;
  background: var(--line-strong);
}

.sheet__kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 18px;
  font-size: 13px;
  font-weight: 650;
  color: var(--tone);
}

.tone-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--tone);
  transform: rotate(45deg);
}

.sheet__title {
  margin-top: 4px;
  font-size: 23px;
  line-height: 1.15;
  font-weight: 760;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.stats {
  display: flex;
  gap: 4px 20px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat__value {
  font-size: 22px;
  font-weight: 720;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat__value small {
  margin-left: 3px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}

.stat__label {
  font-size: 12.5px;
  color: var(--ink-3);
}

.sheet__actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.sheet__actions > .btn {
  flex: 1;
}

.sheet__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 6px 18px calc(28px + var(--safe-b));
}

.sheet[data-state="peek"] .sheet__body,
.sheet[data-state="collapsed"] .sheet__body {
  overflow: hidden;
}

@media (min-width: 900px) {
  .sheet {
    top: calc(var(--safe-t) + 16px);
    bottom: 16px;
    left: 16px;
    right: auto;
    width: 400px;
    height: auto;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-2);
    transform: none !important;
  }
  .sheet__head {
    padding-top: 70px;
    padding-bottom: 16px;
    touch-action: auto;
    cursor: auto;
    border-bottom: 1px solid var(--line);
  }
  .sheet__grabber {
    display: none;
  }
  .sheet[data-state="peek"] .sheet__body {
    overflow-y: auto;
  }
  .sheet[data-state="hidden"] {
    display: none;
  }
  .map-top {
    z-index: 800;
    left: 30px;
    top: calc(var(--safe-t) + 28px);
    right: 16px;
  }
}

/* --- Офлайн-статус ------------------------------------------------------------ */

.offline {
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--r);
  background: var(--surface-2);
}

.offline__row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.offline__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-2);
}

.offline__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.offline__text b {
  font-size: 15.5px;
  font-weight: 680;
  line-height: 1.25;
}

.offline__text span {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.35;
}

.offline[data-state="ready"] {
  background: var(--ok-bg);
}

.offline[data-state="ready"] .offline__icon {
  background: var(--ok);
  color: #fff;
}

.offline[data-state="ready"] .offline__text b {
  color: color-mix(in srgb, var(--ok) 75%, var(--ink));
}

.offline[data-state="partial"] {
  background: var(--warn-bg);
}

.offline[data-state="partial"] .offline__icon {
  color: var(--warn);
}

.offline[data-state="error"] {
  background: var(--danger-bg);
}

.offline[data-state="error"] .offline__icon {
  color: var(--danger);
}

.offline[data-state="checking"] .offline__text b {
  color: var(--ink-3);
  font-weight: 550;
}

.offline__icon--spin .i {
  animation: bob 1.1s ease-in-out infinite;
}

@keyframes bob {
  50% {
    transform: translateY(3px);
  }
}

/* Прогресс в полоску — как верстовой столб */
.progress {
  --p: 0;
  position: relative;
  height: 10px;
  margin-top: 12px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}

.progress span {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 8px, var(--ink) 8px 16px);
  background-size: 22.6px 22.6px;
  clip-path: inset(0 calc((1 - var(--p)) * 100%) 0 0 round 99px);
  transition: clip-path 0.3s linear;
  animation: stripes 0.8s linear infinite;
}

@keyframes stripes {
  to {
    background-position: 22.6px 0;
  }
}

/* --- Содержимое шторки ---------------------------------------------------------- */

.block {
  padding: 18px 0 4px;
}

.block + .block {
  border-top: 1px solid var(--line);
  margin-top: 14px;
}

.block__title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 17px;
  font-weight: 720;
  letter-spacing: -0.015em;
}

.block__n {
  color: var(--ink-3);
  font-weight: 500;
}

.prose {
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.prose p + p {
  margin-top: 0.7em;
}

.prose b,
.prose strong {
  color: var(--ink);
  font-weight: 650;
}

.prose a {
  color: var(--ink);
  text-decoration-color: color-mix(in srgb, var(--accent) 70%, transparent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.prose ul,
.prose ol {
  padding-left: 1.2em;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 6px;
  font-size: 14.5px;
  font-weight: 550;
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend__main,
.legend__alt {
  width: 26px;
  height: 5px;
  border-radius: 3px;
  background: var(--route);
}

.legend__alt {
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--route) 0 3px, transparent 3px 7px);
}

.poi-list {
  list-style: none;
  margin: 0 -8px;
  padding: 0;
}

.poi {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 8px;
  border-radius: 12px;
  text-align: left;
  -webkit-user-select: text;
  user-select: text;
}

.poi:active {
  background: var(--surface-2);
}

.poi__n {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--poi);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.poi__name {
  flex: 1;
  font-size: 15.5px;
  line-height: 1.3;
}

.poi__chev {
  color: var(--ink-3);
}

.profile {
  display: block;
  width: 100%;
  height: 84px;
}

.profile__area {
  fill: color-mix(in srgb, var(--route) 16%, transparent);
}

.profile__line {
  fill: none;
  stroke: var(--route);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.profile__legend {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.link-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 4px;
  border-radius: 12px;
  text-decoration: none;
  text-align: left;
  font-size: 15.5px;
  font-weight: 600;
}

.link-row .i {
  color: var(--ink-3);
}

.link-row span {
  display: flex;
  flex-direction: column;
}

.link-row small {
  font-size: 13px;
  font-weight: 450;
  color: var(--ink-3);
}

.attribution {
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--ink-3);
}

/* --- Навигация: HUD ------------------------------------------------------------ */

.hud {
  position: absolute;
  z-index: 700;
  top: calc(var(--safe-t) + 10px);
  left: 10px;
  right: 10px;
  max-width: 520px;
  margin: 0 auto;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  animation: drop 0.3s var(--ease-out);
}

@keyframes drop {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
}

.hud__main {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 18px 12px;
}

.hud__speed {
  display: flex;
  flex-direction: column;
  min-width: 92px;
}

.hud__speed b {
  font-size: 46px;
  line-height: 1;
  font-weight: 780;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.hud__speed span {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
}

.hud__progress {
  flex: 1;
  min-width: 0;
}

.hud__progress-label {
  font-size: 20px;
  font-weight: 720;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hud__muted {
  color: var(--ink-3);
  font-weight: 550;
}

.hud__bar {
  height: 8px;
  margin-top: 8px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}

.hud__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--route);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.6s var(--ease);
}

.hud__status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 18px;
  font-size: 15.5px;
  font-weight: 650;
  background: var(--surface-2);
  transition: background-color 0.3s, color 0.3s;
}

.hud__status::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
}

.hud__status[data-tone="ok"] {
  color: var(--ok);
  background: var(--ok-bg);
}

.hud__status[data-tone="wait"] {
  color: var(--warn);
  background: var(--warn-bg);
}

.hud__status[data-tone="wait"]::before {
  animation: pulse 1.2s ease-in-out infinite;
}

.hud__status[data-tone="danger"] {
  color: #fff;
  background: var(--danger);
}

.hud__arrow {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: -4px 0 -4px -4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  transition: transform 0.4s var(--ease);
}

.hud__status:has(.hud__arrow:not([hidden]))::before {
  display: none;
}

.hud__status-text {
  flex: 1;
  min-width: 0;
}

.hud__net {
  display: none;
  opacity: 0.75;
}

.is-offline .hud__net {
  display: inline-grid;
}

.hud__acc {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

.hud__acc.is-poor {
  opacity: 1;
}

.navbar {
  position: absolute;
  z-index: 700;
  left: 10px;
  right: 10px;
  bottom: calc(var(--safe-b) + 10px);
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 18px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-2);
  animation: rise 0.3s var(--ease-out);
}

.navbar__stats {
  flex: 1;
  display: flex;
  gap: 18px;
  min-width: 0;
}

.navbar__stats div {
  display: flex;
  flex-direction: column;
}

.navbar__stats b {
  font-size: 20px;
  font-weight: 720;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.navbar__stats span {
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
}

.navbar .fab {
  box-shadow: none;
  background: var(--surface-2);
}

.navbar .fab[aria-pressed="true"] {
  background: var(--you);
  color: #fff;
}

.fab--lg {
  width: 52px;
  height: 52px;
}

.btn--stop {
  min-height: 52px;
  padding: 0 18px;
  border-radius: 18px;
  background: var(--ink);
  color: var(--bg);
}

/* --- Карта: Leaflet --------------------------------------------------------------- */

.leaflet-container {
  font-family: var(--font);
  background: var(--surface-2);
  outline: 0;
}

.leaflet-control-attribution {
  font-size: 10px;
  line-height: 1.5;
  background: color-mix(in srgb, var(--surface) 80%, transparent) !important;
  color: var(--ink-3) !important;
  border-radius: 8px 0 0 0;
  padding: 0 6px !important;
}

.leaflet-control-attribution a {
  color: inherit !important;
}

.route-view .leaflet-bottom {
  bottom: 0;
}

.route-view .leaflet-control-attribution {
  position: fixed;
  top: calc(var(--safe-t) + 2px);
  right: 0;
  bottom: auto;
  margin: 0 !important;
  border-radius: 0 0 0 8px;
  opacity: 0.8;
}

.is-navigating .leaflet-control-attribution {
  top: auto;
  bottom: calc(var(--safe-b) + 96px);
  border-radius: 0 8px 8px 0;
  right: auto;
  left: 0;
}

.leaflet-bar {
  border: 0 !important;
  box-shadow: var(--shadow-2) !important;
  border-radius: 14px !important;
  overflow: hidden;
}

.leaflet-bar a {
  width: 40px !important;
  height: 40px !important;
  line-height: 40px !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}

.leaflet-popup-content-wrapper {
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-2);
}

.leaflet-popup-tip {
  background: var(--surface);
}

.leaflet-popup-content {
  margin: 12px 14px;
  font-size: 14.5px;
  line-height: 1.4;
}

.leaflet-popup-content p {
  margin: 6px 0 0;
  color: var(--ink-2);
  font-size: 13.5px;
}

/* Ночная карта — общая настройка (авто по теме телефона, день, ночь), см. js/ui/screen.js */
.map-night .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.88) saturate(0.55);
}

/* --- Экран: затемнение и настройки ------------------------------------------------ */

.dimmer {
  position: absolute;
  inset: 0;
  z-index: 900;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.is-navigating .dimmer {
  opacity: var(--dim, 0);
}

.screen-pop {
  position: absolute;
  z-index: 950;
  bottom: calc(var(--navbar-top, 90px) + 12px + 46px + 10px);
  right: max(10px, calc((100% - 520px) / 2));
  width: min(340px, calc(100% - 24px));
  display: grid;
  gap: 16px;
  padding: 14px 16px 16px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-2);
  animation: pop 0.2s var(--ease-out);
  transform-origin: bottom right;
}

.screen-pop__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -4px -8px -8px 0;
  font-size: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field__label {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink-2);
}

.field__value {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.field__hint {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-3);
}

.seg--text {
  box-shadow: none;
}

.seg--text button {
  flex: 1;
  width: auto;
  font-size: 14.5px;
  font-weight: 600;
}

.seg--text button[aria-checked="true"] {
  background: var(--ink);
  color: var(--bg);
}

.range {
  width: 100%;
  height: 28px;
  margin: 0;
  accent-color: var(--accent);
}

.switch {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.switch input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.switch__text {
  display: grid;
  gap: 2px;
}

.switch__text b {
  font-size: 15px;
  font-weight: 650;
}

.switch__text small {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-3);
}

/* Старт / финиш */
.map-flag__pin {
  display: block;
  width: 22px;
  height: 22px;
  margin: 2px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.map-flag__pin--start {
  background: #12804b;
}

.map-flag__pin--finish {
  background: conic-gradient(#111 0 25%, #fff 0 50%, #111 0 75%, #fff 0) 0 0 / 8px 8px;
}

.map-flag__pin--loop {
  background: linear-gradient(135deg, #12804b 50%, #111 50%);
}

/* Моё положение */
.you {
  pointer-events: none;
}

.you:not(.is-live) {
  visibility: hidden;
}

.you__dot,
.you__pulse,
.you__heading {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
}

.you__dot {
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  background: var(--you);
  border: 3px solid #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

.you__pulse {
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  background: color-mix(in srgb, var(--you) 20%, transparent);
}

.you__heading {
  width: 80px;
  height: 80px;
  margin: -40px 0 0 -40px;
  background: conic-gradient(
    from -32deg,
    color-mix(in srgb, var(--you) 55%, transparent),
    color-mix(in srgb, var(--you) 0%, transparent) 64deg,
    transparent 64deg
  );
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 70%);
  mask: radial-gradient(circle, #000 18%, transparent 70%);
  transition: transform 0.25s linear;
}

/* ==========================================================================
   Панели, диалоги, тосты
   ========================================================================== */

dialog {
  color: var(--ink);
}

.panel {
  width: 100%;
  max-width: 100%;
  max-height: 100dvh;
  margin: auto 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.panel::backdrop,
.dialog::backdrop {
  background: rgba(8, 12, 10, 0.45);
  animation: fade 0.25s ease;
}

.panel__card:focus {
  outline: none;
}

.panel__card {
  max-height: calc(100dvh - var(--safe-t) - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 20px calc(20px + var(--safe-b));
  border-radius: 28px 28px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-3);
  animation: sheet-up 0.38s var(--ease-out);
}

.panel.is-closing .panel__card {
  transform: translateY(100%);
  transition: transform 0.2s ease-in;
}

@media (min-width: 720px) {
  .panel {
    width: min(520px, calc(100% - 48px));
    margin: auto;
  }
  .panel__card {
    border-radius: 28px;
    padding-bottom: 24px;
  }
  .panel.is-closing .panel__card {
    transform: scale(0.97);
    opacity: 0;
  }
}

@keyframes sheet-up {
  from {
    transform: translateY(40%);
    opacity: 0;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.panel__head {
  position: sticky;
  top: -8px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -8px -8px 4px 0;
  padding: 14px 0 8px;
  background: var(--surface);
}

.panel__title {
  font-size: 24px;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.panel__lead {
  margin-bottom: 8px;
  color: var(--ink-2);
}

.panel__lead b {
  color: var(--ink);
}

.panel__links {
  margin-top: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.dl-list {
  list-style: none;
  margin: 0 -8px 16px;
  padding: 0;
}

.dl {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dl__main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 14px;
  text-decoration: none;
}

.dl__main:active {
  background: var(--surface-2);
}

.dl__thumb {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--tone, var(--ink-3)) 10%, var(--surface-2));
  color: var(--ink-3);
}

.dl__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dl__text b {
  font-size: 15.5px;
  font-weight: 620;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dl__text span {
  font-size: 13px;
  color: var(--ink-3);
}

.meter {
  height: 8px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: var(--ink-2);
  transform-origin: left;
}

.meter + .muted {
  margin-top: 6px;
}

.note {
  display: flex;
  gap: 10px;
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 14px;
}

.note .i {
  margin-top: 1px;
}

.note--ok {
  background: var(--ok-bg);
  color: color-mix(in srgb, var(--ok) 70%, var(--ink));
}

/* Знакомство */
.onboard {
  padding-top: 12px;
}

.onboard__art {
  height: 150px;
  margin: 0 -8px 18px;
  border-radius: 20px;
  overflow: hidden;
  background: color-mix(in srgb, var(--tone-green) 8%, var(--surface-2));
}

.onboard__art svg {
  width: 100%;
  height: 100%;
  display: block;
}

.onboard__grid {
  stroke: color-mix(in srgb, var(--ink) 7%, transparent);
  stroke-width: 1;
}

.onboard__water {
  fill: none;
  stroke: color-mix(in srgb, var(--tone-sky) 35%, transparent);
  stroke-width: 10;
  stroke-linecap: round;
}

.onboard__route-casing,
.onboard__route {
  fill: none;
  stroke-linecap: round;
}

.onboard__route-casing {
  stroke: var(--surface);
  stroke-width: 9;
}

.onboard__route {
  stroke: var(--route);
  stroke-width: 5;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 1.6s var(--ease) 0.25s forwards;
}

.onboard__start {
  fill: var(--ok);
  stroke: var(--surface);
  stroke-width: 3;
}

.onboard__post rect {
  fill: var(--surface);
  stroke: var(--ink);
  stroke-width: 1.5;
}

.onboard__post path {
  stroke: var(--ink);
  stroke-width: 3.5;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

.onboard__title {
  font-size: 26px;
  line-height: 1.12;
  font-weight: 780;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.steps {
  list-style: none;
  margin: 18px 0 20px;
  padding: 0;
  display: grid;
  gap: 14px;
}

.steps li {
  display: flex;
  gap: 14px;
}

.steps__n {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  font-size: 15px;
}

.steps li > div > b {
  display: block;
  font-size: 16.5px;
  font-weight: 680;
}

.steps li > div > span {
  display: block;
  margin-top: 1px;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.45;
}

.install {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-2);
}

.install__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  color: var(--ink-2);
}

.install__text b {
  color: var(--ink);
  font-size: 15.5px;
}

.install .btn {
  min-height: 44px;
  padding: 0 14px;
}

/* Подтверждение */
.dialog {
  width: min(360px, calc(100% - 40px));
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-2);
  animation: pop 0.22s var(--ease-out);
}

@keyframes pop {
  from {
    transform: scale(0.94);
    opacity: 0;
  }
}

.dialog__card {
  padding: 22px 20px 18px;
}

.dialog__title {
  font-size: 19px;
  font-weight: 720;
  letter-spacing: -0.015em;
}

.dialog__text {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 15px;
}

.dialog__actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.dialog__actions .btn {
  flex: 1;
  min-height: 48px;
  padding: 0 12px;
}

/* Тост */
.toast {
  position: fixed;
  z-index: 2000;
  left: 50%;
  bottom: calc(var(--safe-b) + 18px);
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 12px 12px 18px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-2);
  font-size: 15px;
  font-weight: 550;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.22s, transform 0.3s var(--ease-out);
}

.toast.is-in {
  opacity: 1;
  transform: translate(-50%, 0);
}

.route-open .toast {
  bottom: auto;
  top: calc(var(--safe-t) + 70px);
  transform: translate(-50%, -12px);
}

.route-open .toast.is-in {
  transform: translate(-50%, 0);
}

/* В поездке тост не должен закрывать HUD */
.nav-active .toast {
  top: calc(var(--hud-bottom, 140px) + 10px);
}

.toast--ok {
  background: var(--ok);
  color: #fff;
}

.toast--danger {
  background: var(--danger);
  color: #fff;
}

.toast__text {
  padding-right: 6px;
}

.toast__action {
  flex: none;
  height: 36px;
  padding: 0 14px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--bg) 16%, transparent);
  font-weight: 700;
}

/* --- Меньше движения --------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .onboard__route {
    stroke-dashoffset: 0;
  }
}
