/* Uzlādes Radars
   Тёмная основа цвета глубокой ночи (navy) и один яркий акцент: электрик-бирюза → зелёный, цвет «зарядки».
   Цвет данных остаётся отдельным: класс мощности станции.
   AC (до 43 кВт) синий, DC (50–149 кВт) янтарный, HPC (от 150 кВт) розовый.
   Статус зарядок: зелёный «свободно», коралловый «занято»; смысл всегда продублирован текстом и формой значка. */

:root {
  --bg: #060b16;
  --surface: #0d1526;
  --surface-2: #131d33;
  --surface-3: #1c2a47;
  --tile: rgba(6, 11, 22, 0.55);
  --glass: rgba(10, 17, 32, 0.74);
  --line: rgba(140, 165, 215, 0.14);
  --line-2: rgba(140, 165, 215, 0.28);
  --text: #eef3fb;
  --text-soft: #c4cee3;
  --muted: #8f9eba;
  --accent: #1fe3b4;
  --accent-2: #35f58f;
  --accent-ink: #03140f;
  --accent-grad: linear-gradient(135deg, #1fe3b4 0%, #35f58f 100%);
  --accent-soft: rgba(31, 227, 180, 0.14);
  --accent-glow: 0 6px 22px rgba(31, 227, 180, 0.32);
  --hero-glow: rgba(31, 227, 180, 0.16);
  --ink-on-text: #060b16;
  --c-ac: #5aa9ff;
  --c-dc: #ffbe4a;
  --c-hpc: #ff5fa8;
  --c-unknown: #7f8ea8;
  --ok: #2bf0a0;
  --busy: #ff8f7c;
  --you: #ffffff;
  --shadow: 0 -18px 50px rgba(0, 0, 0, 0.55);
  --shadow-card: 0 12px 30px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.4);
  --sheet-top-edge: rgba(255, 255, 255, 0.08);
  --scrim: rgba(6, 11, 22, 0.9);
  --header-h: 58px;
  --filters-h: 52px;
  --sheet-peek: calc(44dvh - 36px);
  --nav-h: calc(66px + env(safe-area-inset-bottom));
  --sheet-mini: 30px;
  --sheet-full: calc(84dvh - var(--nav-h));
  --map-top: calc(var(--header-h) + var(--filters-h) + env(safe-area-inset-top) + 6px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

/* карточка станции длинная: ей нужна панель повыше; на остальных вкладках, включая «Куда», панель ниже и карта крупнее */
:root[data-view="detail"] { --sheet-peek: calc(58dvh - 36px); }

:root[data-theme="light"] {
  --bg: #e9eff7;
  --surface: #ffffff;
  --surface-2: #f2f6fb;
  --surface-3: #e3ebf6;
  --tile: rgba(233, 239, 247, 0.8);
  --glass: rgba(255, 255, 255, 0.8);
  --line: rgba(20, 45, 90, 0.11);
  --line-2: rgba(20, 45, 90, 0.2);
  --text: #0b1730;
  --text-soft: #2b3b58;
  --muted: #56667f;
  --accent: #00a67e;
  --accent-2: #0bbf6a;
  --accent-ink: #ffffff;
  --accent-grad: linear-gradient(135deg, #00a67e 0%, #0bbf6a 100%);
  --accent-soft: rgba(0, 166, 126, 0.12);
  --accent-glow: 0 6px 18px rgba(0, 166, 126, 0.3);
  --hero-glow: rgba(0, 166, 126, 0.14);
  --ink-on-text: #ffffff;
  --c-ac: #1f6fd6;
  --c-dc: #b86e00;
  --c-hpc: #d0215a;
  --c-unknown: #66808a;
  --ok: #00935f;
  --busy: #c4352a;
  --you: #0b1730;
  --shadow: 0 -16px 44px rgba(20, 45, 90, 0.2);
  --shadow-card: 0 10px 26px rgba(20, 45, 90, 0.12);
  --shadow-sm: 0 6px 16px rgba(20, 45, 90, 0.16);
  --sheet-top-edge: rgba(255, 255, 255, 0.9);
  --scrim: rgba(233, 239, 247, 0.92);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
/* мягкая подложка под шапкой и фильтрами: подписи читаются на любой карте */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--header-h) + var(--filters-h) + env(safe-area-inset-top) + 18px);
  background: linear-gradient(to bottom, var(--scrim) 0%, color-mix(in srgb, var(--scrim) 70%, transparent) 55%, transparent 100%);
  pointer-events: none;
  z-index: 650;
}
button { font: inherit; color: inherit; cursor: pointer; }
button, .btn { transition: transform 0.16s var(--ease), background-color 0.2s, box-shadow 0.2s, color 0.2s, border-color 0.2s; }
button:active, .btn:active { transform: scale(0.97); }
button:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* верхняя строка */
.top {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 700;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.top h1 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.top h1 b { color: var(--accent); font-weight: 800; }
.logo {
  width: 36px; height: 36px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent-grad);
  color: var(--accent-ink);
  box-shadow: var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  flex: none;
}
.top-actions { display: flex; gap: 8px; align-items: center; }
.pill {
  height: 38px;
  min-width: 38px;
  padding: 0 13px;
  border-radius: 19px;
  border: 1px solid var(--line-2);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text-soft);
  box-shadow: var(--shadow-sm);
}
/* установка: на телефоне только значок со стрелкой вниз, на широком экране с подписью */
#btn-install {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  font-size: 0;
  width: 38px;
  padding: 0;
  display: grid;
  place-items: center;
}
#btn-install::before {
  content: "";
  width: 18px; height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 11l5 5 5-5M5 20h14'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 11l5 5 5-5M5 20h14'/%3E%3C/svg%3E") center / contain no-repeat;
}
#btn-install[hidden] { display: none; }
@media (min-width: 520px) {
  #btn-install { font-size: 13px; width: auto; padding: 0 14px 0 11px; display: inline-flex; gap: 7px; }
  #btn-install::before { width: 15px; height: 15px; }
}
.pill[hidden] { display: none; }

/* фильтры */
.filters {
  position: fixed;
  left: 0; right: 0;
  top: calc(var(--header-h) + env(safe-area-inset-top));
  z-index: 700;
  height: var(--filters-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 22px), transparent 100%);
  mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 22px), transparent 100%);
}
.filters::-webkit-scrollbar { display: none; }
.filters::after { content: ""; flex: none; width: 16px; }
.chip {
  flex: none;
  height: 36px;
  padding: 0 15px;
  border-radius: 18px;
  border: 1px solid var(--line-2);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  display: inline-flex;
  align-items: center;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--text-soft);
  box-shadow: var(--shadow-sm);
}
.chip[data-pwr]::before {
  content: "";
  width: 12px; height: 12px;
  margin-right: 6px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13.5 2 5 13.5h6L10 22l9-12.5h-6.2z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13.5 2 5 13.5h6L10 22l9-12.5h-6.2z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.chip[aria-pressed="true"] {
  background: var(--accent-grad);
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 800;
  box-shadow: var(--accent-glow);
}
.chip-gap { flex: none; width: 2px; }

/* карта */
main { position: fixed; inset: 0; z-index: 0; }
#map { position: absolute; inset: 0; background: var(--bg); }
.leaflet-container { font-family: inherit; background: var(--bg); }
/* запасной вариант: если плиток CARTO нет, берём стандартные OSM и затемняем их фильтром */
.dark-tiles .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.88) contrast(0.92) saturate(0.55);
}
.leaflet-control-attribution {
  font-size: 10px;
  background: color-mix(in srgb, var(--bg) 70%, transparent) !important;
  color: var(--muted) !important;
  border-radius: 8px;
  margin: 0 0 0 16px !important;
}
.leaflet-control-attribution a { color: var(--muted) !important; }
/* подпись источника карты нельзя прятать; снизу её закрывает панель, поэтому она сверху слева под фильтрами */
.leaflet-top.leaflet-left { top: var(--map-top); }
.leaflet-top.leaflet-right { top: var(--map-top); }
.leaflet-touch .leaflet-control-zoom {
  margin-right: 14px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  overflow: hidden;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: var(--shadow-sm);
}
.leaflet-touch .leaflet-control-zoom a {
  width: 40px; height: 40px; line-height: 38px;
  background: transparent;
  color: var(--text);
  border: 0;
  font-size: 20px;
  font-weight: 500;
}
.leaflet-touch .leaflet-control-zoom a + a { border-top: 1px solid var(--line); }
.leaflet-touch .leaflet-control-zoom a:hover { background: var(--accent-soft); color: var(--accent); }

.status, .toast {
  position: absolute;
  left: 16px;
  right: 70px;
  top: var(--map-top);
  z-index: 500;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-card);
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  animation: rise 0.28s var(--ease);
}
.toast { top: auto; right: 16px; bottom: calc(var(--nav-h) + var(--sheet-peek) + 14px); }
body:has(.sheet[data-size="mini"]) .toast { bottom: calc(var(--nav-h) + var(--sheet-mini) + 14px); }
.status[hidden], .toast[hidden] { display: none; }
.status button {
  flex: none;
  height: 32px;
  padding: 0 14px;
  border-radius: 10px;
  border: 0;
  background: var(--accent-grad);
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 13px;
}

/* кнопка «моё место» на карте: под кнопками масштаба */
.map-fab {
  position: absolute;
  top: calc(var(--map-top) + 94px);
  right: 14px;
  z-index: 450;
  width: 40px; height: 40px;
  padding: 0;
  display: grid; place-items: center;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  color: var(--accent);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.map-fab[aria-busy="true"] { animation: breathe 1.2s ease-in-out infinite; }
.map-fab:active { background: var(--accent-soft); }

/* нижняя панель */
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: var(--nav-h);
  z-index: 800;
  height: var(--sheet-peek);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, var(--text) 8%) 0%, var(--surface) 38px);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  box-shadow: inset 0 1px 0 var(--sheet-top-edge), var(--shadow);
  transition: height 0.34s var(--ease);
}
.sheet[data-open="true"] { height: var(--sheet-full); }
/* свёрнутая панель: видны только ручка и вкладки, карта почти на весь экран */
.sheet[data-size="mini"] { height: var(--sheet-mini); }
.sheet[data-size="mini"] .panel { overflow: hidden; visibility: hidden; }
.grab {
  flex: none;
  height: 22px;
  border: 0;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
.grab span { width: 42px; height: 5px; border-radius: 3px; background: var(--line-2); transition: width 0.2s var(--ease), background-color 0.2s; }
.grab:hover span, .grab:active span { width: 54px; background: var(--muted); }
/* нижнее меню: пять разделов с иконками, всегда на экране под панелью */
.tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 810;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 6px 8px env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 52px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}
.tab svg { width: 24px; height: 24px; flex: none; }
.tab[aria-selected="true"] {
  color: var(--accent);
  font-weight: 800;
}
.tab[aria-selected="true"] svg { filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent) 60%, transparent)); }
.panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 16px 20px;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.panel::-webkit-scrollbar { display: none; }
.panel > * { animation: rise 0.3s var(--ease) both; }

/* шкала мощности: пять столбиков, высота растёт, цвет по классу */
.gauge { --gc: var(--c-unknown); display: inline-flex; align-items: flex-end; gap: 2px; height: 20px; flex: none; }
.gauge i {
  display: block;
  width: 5px;
  border-radius: 2px;
  background: var(--line-2);
}
.gauge i:nth-child(1) { height: 6px; }
.gauge i:nth-child(2) { height: 9px; }
.gauge i:nth-child(3) { height: 12px; }
.gauge i:nth-child(4) { height: 16px; }
.gauge i:nth-child(5) { height: 20px; }
.gauge[data-cls="ac"] { --gc: var(--c-ac); }
.gauge[data-cls="dc"] { --gc: var(--c-dc); }
.gauge[data-cls="hpc"] { --gc: var(--c-hpc); }
.gauge[data-cls="unknown"] { --gc: var(--c-unknown); }
.gauge i.on { background: var(--gc); }
.gauge-lg { height: 38px; gap: 4px; }
.gauge-lg i { width: 9px; border-radius: 3px; }
.gauge-lg i.on { box-shadow: 0 0 12px color-mix(in srgb, var(--gc) 55%, transparent); }
.gauge-lg i:nth-child(1) { height: 11px; }
.gauge-lg i:nth-child(2) { height: 17px; }
.gauge-lg i:nth-child(3) { height: 23px; }
.gauge-lg i:nth-child(4) { height: 30px; }
.gauge-lg i:nth-child(5) { height: 38px; }

/* кнопки */
.btn {
  height: 46px;
  padding: 0 18px;
  border-radius: 15px;
  border: 1px solid var(--line-2);
  background: var(--surface-3);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary {
  background: var(--accent-grad);
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 800;
  box-shadow: var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-primary::before {
  content: "";
  width: 16px; height: 16px;
  flex: none;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 4.5 21l7.5-4.2 7.5 4.2z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 4.5 21l7.5-4.2 7.5 4.2z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.modal-card .btn-primary::before { display: none; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1 1 auto; min-width: 0; padding: 0 8px; font-size: 14px; white-space: nowrap; }
.btn-row .btn-primary { flex: 1.3 1 auto; gap: 6px; }
.btn-row .btn-primary::before { width: 14px; height: 14px; }

/* «Куда ехать» */
.seg { display: flex; gap: 6px; margin-bottom: 8px; }
.seg button {
  flex: 1;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
  font-size: 13.5px;
}
.seg button[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent);
  font-weight: 800;
}
.origin-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.link-btn { border: 0; background: none; padding: 4px 0; color: var(--accent); font-weight: 700; font-size: 13.5px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

.best {
  position: relative;
  border: 1px solid var(--line-2);
  border-radius: 24px;
  padding: 14px;
  background:
    radial-gradient(110% 80% at 100% 0%, var(--hero-glow), transparent 60%),
    var(--surface-2);
  box-shadow: var(--shadow-card), inset 0 1px 0 var(--sheet-top-edge);
  margin-bottom: 16px;
}
/* кнопки навигации всегда видны внизу панели, даже когда карточка не помещается и прокручивается */
.best > .btn-row {
  position: sticky; bottom: 0; z-index: 2;
  margin: 0 -14px -14px; padding: 18px 14px 14px;
  border-radius: 0 0 24px 24px;
  background: linear-gradient(180deg, transparent, var(--surface-2) 42%);
}
.best-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.best h2 { margin: 0; font-size: 21px; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; }
.best .sub { color: var(--muted); font-size: 13px; margin-top: 3px; line-height: 1.35; }
.best .facts { display: grid; grid-template-columns: 1fr 1.35fr; gap: 8px; margin: 10px 0; }
.best .facts > div {
  padding: 9px 12px;
  border-radius: 14px;
  background: var(--tile);
  border: 1px solid var(--line);
  min-width: 0;
}
.best .facts b { display: block; font-size: 15.5px; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.best .facts span { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }

.rows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
  text-align: left;
}
.row:hover { border-color: var(--line-2); }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .side { text-align: right; flex: none; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.row .side small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.sect { margin: 0 0 8px; font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

.list-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
select {
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}
.count { color: var(--muted); font-size: 13px; margin-left: auto; font-weight: 600; }

/* цены */
.note { color: var(--muted); font-size: 12.5px; margin: 0 0 12px; }
.price-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.price-table th { text-align: left; font-weight: 700; font-size: 12px; color: var(--muted); padding: 10px 10px; border-bottom: 1px solid var(--line); background: var(--tile); }
.price-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.price-table tbody tr:last-child td { border-bottom: 0; }
.price-table td:first-child { font-weight: 700; }
.price-table .sub { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

/* карточка станции */
.back { margin-bottom: 8px; display: inline-flex; align-items: center; gap: 4px; }
.back::before { content: "‹"; font-size: 22px; line-height: 1; margin-top: -2px; }
.detail h2 { margin: 0 0 2px; font-size: 22px; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; }
.detail .sub { color: var(--muted); font-size: 13.5px; }
.detail dl {
  margin: 14px 0;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 0;
  padding: 2px 14px;
  font-size: 14.5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.detail dt, .detail dd { padding: 11px 0; border-bottom: 1px solid var(--line); }
.detail dl > dt:last-of-type, .detail dl > dd:last-of-type { border-bottom: 0; }
.detail dt { color: var(--muted); font-size: 13.5px; padding-right: 12px; }
.detail dd { margin: 0; font-weight: 600; }
.empty { color: var(--muted); padding: 28px 4px; text-align: center; }

@media (min-width: 760px) {
  .sheet { left: 16px; right: auto; width: 424px; top: var(--map-top); bottom: calc(16px + var(--nav-h)); height: auto; border-radius: 28px 28px 0 0; box-shadow: var(--shadow-card), 0 0 0 1px var(--line-2); }
  .sheet[data-open="true"], .sheet[data-size="mini"] { height: auto; }
  .sheet[data-size="mini"] .panel { overflow-y: auto; visibility: visible; }
  body:has(.sheet[data-size="mini"]) .toast { bottom: 16px; }
  .grab { display: none; }
  .tabs { left: 16px; right: auto; width: 424px; bottom: 16px; border-radius: 0 0 28px 28px; box-shadow: var(--shadow-card), 0 0 0 1px var(--line-2); }
  .toast { bottom: 16px; left: 460px; }
  .status { left: 460px; }
  :root, :root[data-view] { --sheet-peek: 0px; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet, button, .btn, .grab span { transition: none; }
  .panel > *, .status, .toast { animation: none; }
  .map-fab[aria-busy="true"], .live-free i { animation: none; }
}

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent), 0 0 8px var(--ok); }
  70% { box-shadow: 0 0 0 7px transparent, 0 0 8px var(--ok); }
  100% { box-shadow: 0 0 0 0 transparent, 0 0 8px var(--ok); }
}

/* ---------- статус свободных зарядок ---------- */
.live {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 800; line-height: 1.2; letter-spacing: 0.005em;
  padding: 4px 11px 4px 9px; border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, currentColor 12%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 38%, transparent);
}
.live i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.live-free { color: var(--ok); }
.live-free i { animation: pulse 2.4s ease-out infinite; }
.live-busy { color: var(--busy); }
.live-busy i { background: transparent; box-shadow: inset 0 0 0 2px currentColor; }
.live-out i { border-radius: 2px; background: transparent; box-shadow: inset 0 0 0 2px currentColor; }
.live-unknown i { background: transparent; box-shadow: inset 0 0 0 2px currentColor; opacity: 0.6; }
.live-line { margin-top: 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; }
.row .live-line { margin-top: 5px; }
.row .live { font-size: 11.5px; padding: 2px 9px 2px 7px; }
.live-note { font-size: 12px; color: var(--muted); margin: -4px 0 10px; }

.pts { list-style: none; margin: 4px 0 10px; padding: 2px 14px; font-size: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 20px; }
.pts li {
  display: grid; grid-template-columns: 14px 1fr auto auto; align-items: center; gap: 4px 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.pts li:last-child { border-bottom: 0; }
.pt-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.pt-free { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.pt-busy { background: transparent; box-shadow: inset 0 0 0 2px var(--busy); }
.pt-out { border-radius: 2px; background: transparent; box-shadow: inset 0 0 0 2px var(--muted); }
.pt-unk { background: transparent; box-shadow: inset 0 0 0 2px var(--muted); opacity: 0.6; }
.pt-name { font-weight: 700; }
.pt-state { color: var(--muted); font-size: 13px; }
.pt-price { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 78px; text-align: right; font-size: 13px; }

/* окно с инструкцией по установке */
.modal {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(3, 7, 16, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
.modal[hidden] { display: none; }
.modal-card {
  width: 100%; max-width: 420px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 28px;
  padding: 22px 22px 20px; box-shadow: var(--shadow);
  animation: rise 0.3s var(--ease);
}
.modal-card h2 { margin: 0 0 6px; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.modal-card p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.modal-card ol { margin: 0 0 18px; padding-left: 22px; }
.modal-card li { margin: 8px 0; font-size: 15px; }
.modal-card .btn { width: 100%; }
@media (min-width: 760px) { .modal { align-items: center; } }

/* способы оплаты */
.pay { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.pay-label { color: var(--muted); font-size: 12.5px; margin-right: 2px; font-weight: 600; }
.chip-pay {
  font-size: 12px; font-weight: 700; line-height: 1.2;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--tile); color: var(--text-soft);
}
.detail dd .pay { margin: 0; }

/* когда обычно занято */
.usual { margin: 14px 0 12px; padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 20px; }
.usual-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 14.5px; margin-bottom: 10px; }
.usual-head span { color: var(--muted); font-size: 12.5px; }
.bars { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; height: 56px; align-items: end; }
.bars i { display: block; border-radius: 3px 3px 1px 1px; background: var(--muted); min-height: 3px; transition: height 0.4s var(--ease); }
.bars i.lo { background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
.bars i.mid { background: var(--c-dc); }
.bars i.hi { background: var(--busy); }
.bars i.na { background: var(--line-2); }
.bars i.cur { outline: 2px solid var(--text); outline-offset: 1px; }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 5px; }
.usual .note { margin: 8px 0 0; }
.usual-line { font-size: 12.5px; color: var(--muted); margin: -2px 0 10px; }

.live-time { font-size: 12px; color: var(--muted); margin-left: 0; }

/* ---------- профиль машины, избранное, поиск, маршрут ---------- */
input[type="text"], input[type="search"], input[type="number"] {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* меньше 16 px: iPhone увеличивает страницу при вводе */
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
}
input::placeholder { color: var(--muted); font-weight: 500; opacity: 0.85; }
input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.pill-icon { padding: 0; display: grid; place-items: center; }
.pill-icon.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.chip svg { width: 16px; height: 16px; margin-right: 6px; flex: none; }

/* вкладки: пять штук, подписи короче; число сохранённых станций значком над иконкой */
.tab { min-width: 0; white-space: nowrap; position: relative; }
.tab em { position: absolute; top: 2px; left: calc(50% + 7px); font-style: normal; font-size: 10.5px; line-height: 14px; min-width: 16px; text-align: center; font-weight: 800; padding: 1px 4px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); }

.icon-btn {
  width: 34px; height: 34px; padding: 0; flex: none;
  display: inline-grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--tile);
  color: var(--muted);
}
.icon-btn[aria-pressed="true"] { color: var(--c-dc); border-color: color-mix(in srgb, var(--c-dc) 55%, transparent); background: color-mix(in srgb, var(--c-dc) 14%, transparent); }
.best-head .best-title { flex: 1; min-width: 0; }
.best-side { display: flex; align-items: center; gap: 10px; flex: none; }
.fav-mark { color: var(--c-dc); }
.warn { color: var(--c-dc); font-size: 13px; }

.car-line {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; margin: 0 0 8px;
  border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text-soft);
  font-size: 12.5px; text-align: left; line-height: 1.3;
}
.car-line svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.car-line span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.car-line b { color: var(--text); font-weight: 700; }

/* поиск по списку */
.search { position: relative; margin-bottom: 8px; }
.search > svg { position: absolute; left: 13px; top: 12px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 40px; padding-right: 40px; }
.search-x {
  position: absolute; right: 5px; top: 5px; width: 34px; height: 34px;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted);
  display: grid; place-items: center;
}
.search-x[hidden] { display: none; }
.search-x svg { width: 16px; height: 16px; }

/* что ещё известно о станции */
.insights { display: grid; gap: 6px; margin: 0 0 12px; }
.insight {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 12px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 13.5px; line-height: 1.35;
}
.insight i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-top: 6px; flex: none; }
.insight small { color: var(--muted); font-size: 12px; }
.rel-good i { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.rel-mid i { background: var(--c-dc); }
.rel-bad i, .px-up i { background: var(--busy); }
.px-down i { background: var(--ok); }

.est {
  margin: 0 0 12px; padding: 12px 14px; border-radius: 18px;
  background: linear-gradient(180deg, var(--accent-soft), transparent 120%), var(--surface-2);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.est-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.est-head svg { width: 18px; height: 18px; color: var(--accent); }
.est-head span { margin-left: auto; color: var(--muted); font-size: 12px; text-align: right; }
.est p { margin: 2px 0; font-size: 14px; }
.est small { display: block; margin-top: 6px; color: var(--muted); font-size: 11.5px; }
.est-none { border-color: var(--line); background: var(--surface-2); }
.est-none svg { color: var(--muted); }

.cmp { margin: 0 0 12px; padding: 12px 14px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.cmp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.cmp-head small { color: var(--muted); font-size: 11.5px; text-align: right; }
.cmp-grid { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.cmp-cell { padding: 8px 10px; border-radius: 12px; background: var(--tile); border: 1px solid var(--line); }
.cmp-cell span { display: block; font-size: 11.5px; color: var(--muted); }
.cmp-cell b { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cmp-cell.is-ev b { color: var(--accent); }
.cmp-cell.is-petrol b { color: var(--busy); }
.cmp p { margin: 8px 0 0; font-size: 13.5px; font-weight: 600; }

.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 0; }
.tool {
  height: 40px; padding: 0 6px; border-radius: 13px;
  border: 1px solid var(--line-2); background: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; color: var(--text-soft); white-space: nowrap;
}
.tool svg { width: 16px; height: 16px; flex: none; }
.tool[aria-pressed="true"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: var(--accent-soft); }
.tool[data-fav][aria-pressed="true"] { color: var(--c-dc); border-color: color-mix(in srgb, var(--c-dc) 50%, transparent); background: color-mix(in srgb, var(--c-dc) 12%, transparent); }
.tool[aria-disabled="true"] { opacity: 0.5; }

/* маршрут */
.route-form { display: grid; gap: 8px; margin-bottom: 12px; }
.route-form label { display: grid; gap: 4px; }
.route-form label > span { font-size: 12px; font-weight: 700; color: var(--muted); }
.route-form .btn { width: 100%; margin-top: 2px; }
/* после построения маршрута форма сворачивается, итог и остановки сразу под картой */
.route-edit { margin: 0 0 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.route-edit > summary { list-style: none; cursor: pointer; padding: 12px 14px; min-height: 44px; font-size: 14px; font-weight: 700; color: var(--accent); display: flex; align-items: center; justify-content: space-between; }
.route-edit > summary::-webkit-details-marker { display: none; }
.route-edit > summary::after { content: '▾'; font-size: 12px; transition: transform 0.2s var(--ease); }
.route-edit[open] > summary::after { transform: rotate(180deg); }
.route-edit-body { padding: 0 14px 12px; }
.route-edit-body .origin-line { margin-top: 0; }
.route-sum { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 2px 0 10px; font-size: 14px; font-weight: 700; }
.route-ok, .route-warn { margin: 0 0 12px; padding: 11px 14px; border-radius: 16px; font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.route-ok { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); color: var(--text); }
.route-warn { background: color-mix(in srgb, var(--busy) 12%, transparent); border: 1px solid color-mix(in srgb, var(--busy) 40%, transparent); }
.pin span {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font: 800 13px/1 "Manrope", system-ui, sans-serif;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.pin-stop span { background: var(--accent-grad); color: var(--accent-ink); border: 2px solid var(--bg); }
.pin-end span { background: var(--text); color: var(--bg); border: 2px solid var(--accent); }
.leaflet-marker-icon.pin { background: none; border: 0; }

/* окно «Моя машина» */
.car-card { max-height: calc(100dvh - 32px); overflow-y: auto; scrollbar-width: none; }
.car-card::-webkit-scrollbar { display: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.modal-head h2 { margin: 0; }
.fld { display: grid; gap: 5px; margin: 0 0 10px; min-width: 0; }
.fld > span { font-size: 12px; font-weight: 700; color: var(--muted); }
.fld select { width: 100%; height: 44px; font-size: 15px; }
.fld-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.check.wide { display: flex; margin: 0 0 12px; }
.modal-actions { margin-top: 6px; }
.modal-actions .btn[hidden] { display: none; }
@media (max-width: 380px) { .fld-grid { grid-template-columns: 1fr; } }

/* низкие экраны (iPhone SE/mini и т.п.): плотнее, чтобы кнопки маршрута были видны без прокрутки */
@media (max-height: 820px) {
  .seg { margin-bottom: 4px; }
  .seg button { height: 32px; }
  .origin-line { margin-bottom: 4px; }
  .best { padding: 12px; }
  .best .facts { margin: 8px 0; }
  .live-line { margin-top: 6px; }
}
.car-card .modal-actions { position: sticky; bottom: -20px; margin: 6px -22px -20px; padding: 12px 22px 20px; background: linear-gradient(180deg, transparent, var(--surface) 28%); }

/* журнал зарядок и удобства рядом */
.btn-block { width: 100%; }
.charge-sect { margin-top: 22px; }
.charge-form { margin: 10px 0 4px; padding: 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.charge-form .fld input { width: 100%; height: 44px; font-size: 15px; }
.charge-err { margin: 0 0 10px; color: var(--busy); font-size: 13px; font-weight: 600; }
.charge-sum { display: grid; gap: 2px; margin: 12px 0 4px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--line); font-size: 14px; }
.charge-sum span { color: var(--text-soft); font-size: 12.5px; }
.charge-prev { margin: 0 0 8px; padding: 0 4px; color: var(--muted); font-size: 12.5px; }
.charge-list { list-style: none; margin: 6px 0 0; padding: 0; }
.charge-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 44px; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.charge-list .ch-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.charge-list .ch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.charge-list .ch-val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ch-del { min-width: 44px; height: 44px; border: 0; background: none; color: var(--muted); font-size: 18px; border-radius: 12px; }
.ch-del.armed { color: var(--busy); font-size: 12.5px; font-weight: 700; }
.charge-note { margin-top: 10px; }
.amen { margin: 14px 0 6px; }
.amen[hidden] { display: none; }

/* ---------- метки с мощностью (как в Chargemap): «выноска» с кВт сверху и свободно/всего снизу ---------- */
.leaflet-marker-icon.ppill { background: none; border: 0; }
.ppill .pl {
  --pl-bg: #565b69; --pl-chip: #bfe6ff; --pl-chip-ink: #0d2f52; --pl-count: #ffffff;
  position: absolute; left: 0; top: 0; transform: translate(-50%, calc(-100% - 7px));
  display: flex; flex-direction: column; align-items: stretch; text-align: center; white-space: nowrap; width: max-content;
  padding: 3px; border-radius: 15px; background: var(--pl-bg);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
  font: 700 12px/1 "Manrope", system-ui, sans-serif;
}
.ppill .pl::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
  border: 7px solid transparent; border-bottom: 0; border-top-color: var(--pl-bg);
}
.ppill .pl .pw {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 5px 7px 5px 9px; border-radius: 12px; background: var(--pl-chip); color: var(--pl-chip-ink);
}
.ppill .pl .pw b { font-size: 15px; font-weight: 800; }
.ppill .pl .pw em { font-style: normal; font-weight: 600; font-size: 12.5px; }
.ppill .pl .pw svg { width: 15px; height: 15px; flex: none; }
.ppill .pl .pc { padding: 5px 4px 3px; font-size: 13px; font-weight: 700; color: var(--pl-count); }
.ppill .pl .pc b { font-weight: 800; }
.ppill .lv-free .pc b { color: #7dffc4; }
.ppill .lv-busy .pc b { color: #ffb9ac; }
.ppill .lv-out { --pl-bg: #3a3e4a; --pl-chip: #5a5f6d; --pl-chip-ink: #c5cad6; --pl-count: #9aa1b2; opacity: 0.8; }
.ppill .lv-unknown .pw { padding-bottom: 5px; }
.ppill .sel { --pl-bg: #1f6fd6; z-index: 2; box-shadow: 0 0 0 2px #fff, 0 4px 14px rgba(0, 0, 0, 0.5); }
.ppill .sel::after { filter: drop-shadow(0 1px 0 #fff); }

/* самая низкая цена среди станций на экране: переливающийся зелёный ободок (градиентная рамка вокруг выноски) */
.ppill .pl.cheap {
  border: 3px solid transparent; padding: 0;
  background: linear-gradient(var(--pl-bg), var(--pl-bg)) padding-box,
    linear-gradient(110deg, #19d6a4 0%, #c9ffe9 25%, #35f58f 50%, #c9ffe9 75%, #19d6a4 100%) border-box;
  background-size: 100% 100%, 250% 100%;
  animation: plshine 2.4s linear infinite;
  box-shadow: 0 0 12px rgba(53, 245, 143, 0.55);
}
.ppill .pl.cheap::after { bottom: -10px; border-top-color: #2bf0a0; }
@keyframes plshine { from { background-position: 0 0, 0% 0; } to { background-position: 0 0, -250% 0; } }
@media (prefers-reduced-motion: reduce) { .ppill .pl.cheap { animation: none; } }

/* самая низкая цена среди станций на экране: ярлык с неоновой зелёной рамкой и мигающим свечением, где кВт и цена сменяют друг друга.
   Все точки заняты: тот же ярлык, но красный, с надписью «Все заняты» */
.leaflet-marker-icon.cdot { background: none; border: 0; }
.cd {
  --cd-glow: 0, 230, 118;
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  display: grid; place-items: center; width: max-content; min-width: 72px; height: 30px; box-sizing: border-box;
  padding: 0 10px; border-radius: 999px; border: 2px solid rgb(var(--cd-glow));
  background: #07101a; color: rgb(var(--cd-glow));
  box-shadow: 0 0 0 4px rgba(var(--cd-glow), 0.16), 0 0 20px 3px rgba(var(--cd-glow), 0.6);
  animation: cdGlow 1.6s ease-in-out infinite;
  font: 800 13px/1 "Manrope", system-ui, sans-serif; white-space: nowrap;
}
.cd i { grid-area: 1 / 1; font-style: normal; }
.cd .cd-a { animation: cdA 4s ease-in-out infinite; }
.cd .cd-b { animation: cdB 4s ease-in-out infinite; opacity: 0; }
@keyframes cdA { 0%, 42% { opacity: 1; } 50%, 92% { opacity: 0; } 100% { opacity: 1; } }
@keyframes cdB { 0%, 42% { opacity: 0; } 50%, 92% { opacity: 1; } 100% { opacity: 0; } }
@keyframes cdGlow {
  0%, 100% { box-shadow: 0 0 0 4px rgba(var(--cd-glow), 0.16), 0 0 20px 3px rgba(var(--cd-glow), 0.6); }
  50% { box-shadow: 0 0 0 8px rgba(var(--cd-glow), 0.05), 0 0 34px 9px rgba(var(--cd-glow), 0.9); }
}
.cd.bz { --cd-glow: 255, 82, 82; background: #1a0b0f; color: #ff8a80; }
.cd.sel { outline: 2px solid var(--text); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .cd, .cd .cd-a { animation: none; } .cd .cd-b { display: none; } }

/* обычные метки: светящееся кольцо с молнией и ценой сверху; цвет по доступности: свободно зелёный, все заняты красный, нет данных оранжевый, не работает серый */
.leaflet-marker-icon.gdot { background: none; border: 0; }
.gd { --gd-c: 0, 230, 118; position: absolute; left: 0; top: 0; width: 0; height: 0; }
.gd-busy { --gd-c: 255, 82, 82; }
.gd-unknown { --gd-c: 255, 167, 38; }
.gd-out { --gd-c: 127, 142, 168; opacity: 0.75; }
.gd-dot {
  position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; box-sizing: border-box;
  display: grid; place-items: center; border-radius: 50%;
  background: #07101a; border: 2px solid rgb(var(--gd-c)); color: rgb(var(--gd-c));
  box-shadow: 0 0 0 5px rgba(var(--gd-c), 0.14), 0 0 18px 3px rgba(var(--gd-c), 0.5);
}
.gd-dot svg { width: 11px; height: 11px; fill: currentColor; }
.gd-tag {
  position: absolute; left: 0; bottom: 18px; transform: translateX(-50%);
  padding: 4px 7px; border-radius: 9px; background: rgba(10, 16, 30, 0.9); border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5); color: #ffffff; white-space: nowrap;
  font: 700 12px/1 "Manrope", system-ui, sans-serif;
}
.gd.sel .gd-dot { left: -17px; top: -17px; width: 34px; height: 34px; border-width: 3px; box-shadow: 0 0 0 7px rgba(var(--gd-c), 0.18), 0 0 30px 7px rgba(var(--gd-c), 0.65); }
.gd.sel .gd-dot svg { width: 16px; height: 16px; }
.gd.sel .gd-tag { bottom: 28px; padding: 5px 10px; font-size: 15px; font-weight: 800; color: rgb(var(--gd-c)); border-color: rgba(var(--gd-c), 0.7); }

/* ---------- скидки сетей ---------- */
.disc { margin: 14px 0 6px; }
.disc-list { margin: 0 0 8px; padding: 0; list-style: none; display: grid; gap: 8px; }
.disc-list li { font-size: 13.5px; line-height: 1.45; padding: 10px 12px; border-radius: 14px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.disc-list a { color: var(--muted); font-size: 12px; margin-left: 4px; }
.disc-op { margin: 14px 0 6px; font-size: 14px; }

/* ---------- баннер «Доступна новая версия» ---------- */
.upd {
  position: fixed; z-index: 3000; left: 12px; right: 12px; top: calc(env(safe-area-inset-top, 0px) + 66px);
  max-width: 460px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 16px; border-radius: 16px; background: var(--tile); border: 1px solid var(--line-2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); font-weight: 700; font-size: 14px;
}
.upd .btn { white-space: nowrap; }
.note.ver { margin-top: 14px; text-align: center; opacity: 0.7; }

.eta-line { color: var(--busy); font-weight: 700; }

.mine { margin: 4px 0 14px; }
.mine-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tou-line { margin: 0 0 8px; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--c-dc) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c-dc) 40%, transparent); font-size: 13.5px; font-weight: 700; }

.garage { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.route-acts { display: flex; gap: 8px; margin: 0 0 12px; }
.saved-routes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.saved-route { display: inline-flex; gap: 4px; }
.chip-x { padding-left: 10px; padding-right: 10px; }

/* когда ехать, таймер, сводка */
.inl { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.timer { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.timer small { color: var(--muted); font-size: 12px; }
.timer-btns { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; margin-top: 4px; }
.chip-btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chip-btn:active { background: var(--surface-2); }
.digest-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 12px; padding: 11px 14px; font: inherit; cursor: pointer; }
.digest-btn span { display: inline-flex; align-items: center; gap: 8px; }
.digest-btn svg { width: 18px; height: 18px; color: var(--accent); }
.digest-btn[aria-pressed="true"] { border-color: var(--accent); }
.digest-btn[aria-pressed="true"] b { color: var(--accent); }
.digest-note { margin: 6px 2px 14px; }

/* экономия против бензина */
.sav { margin: 12px 0 4px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.sav-head { margin-bottom: 8px; }
.sav-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.sav-cell { display: grid; gap: 1px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.sav-cell span { color: var(--muted); font-size: 12px; }
.sav-cell b { font-size: 19px; }
.sav-cell small { color: var(--muted); font-size: 11.5px; }
.sav-cell.pos b { color: var(--accent); }
.sav-cell.neg b { color: #ff8a73; }
.sav-line { margin: 8px 0 4px; font-size: 13.5px; }
.sav > small { display: block; color: var(--muted); font-size: 11.5px; }
