:root {
  color-scheme: dark;
  --ink: #effff5;
  --muted: #83a291;
  --line: rgba(99, 255, 149, 0.15);
  /* Интерфейсные поверхности подняты ровно на 15% к белому относительно
     прежней палитры. Картографический canvas сохраняет цвета провайдера. */
  --panel: rgba(45, 51, 47, 0.92);
  --panel-soft: rgba(49, 61, 53, 0.9);
  --bg: #282a29;
  --shell: #2b2d2b;
  --deep: #0dff74;
  --deep-ink: #021008;
  --accent: #ccff00;
  --good: #39ff88;
  --warn: #dfff5a;
  --bad: #ff4f83;
  --blue: #70ffd6;
  --control-bg: rgba(44, 50, 46, 0.92);
  --control-border: rgba(99, 255, 149, 0.18);
  /* Роли верхнего слоя: +20% для основной подложки, +25% для навигации,
     +35% для компактного контрола масштаба (смешение к белому). */
  --topbar-surface: transparent;
  --nav-surface: rgba(147, 149, 148, 0.62);
  --zoom-surface: rgba(125, 128, 126, 0.58);
  --topbar-control-visual-h: 35px;
  --shadow: rgba(0, 0, 0, 0.48);
  /* Gray scale */
  --gray-1: #9ab0a6;
  --gray-2: #62786e;
  --gray-3: #2e3e38;
  --gray-4: #1c2923;
  --gray-5: #111917;
  --surface-0: #2d3330;
  --surface-1: #303834;
  --surface-2: #353e39;
  --surface-3: #3b453c;
  /* Доступность топлива (цветовая карта) */
  --avail-available: #2fe07f;
  /* Спокойный янтарный вместо резкого жёлтого: лучше читается на карте и
     не конкурирует с красным предупреждением. */
  /* Мягкий лаймовый для ограниченного наличия: заметный, но без неоновой
     резкости на подложке карты. */
  --avail-limited: #d8ee4a;
  --avail-empty: #ff5d6c;
  --avail-unknown: #8fa6a0;
  --avail-disputed: #d27bff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* Полноэкранная карта: шапка/вкладки/дисклеймер плавают поверх карты как
     фиксированные слои — переменные ниже задают их высоту/отступы, чтобы
     остальные экраны (Список/+АЗС) могли отступить от них. */
  /* Высота строки учитывает доступные для касания контролы 44px. */
  --topbar-h: calc(env(safe-area-inset-top, 0px) + 52px);
  --tabs-h: 44px;
  --gap-sm: 10px;
  /* Высота дисклеймера зависит от того, в сколько строк переносится длинный
     юридический текст — она разная по брейкпоинтам (замерено эмпирически). */
  --disclaimer-h: 155px;
}

@media (min-width: 680px) {
  :root {
    --topbar-h: calc(env(safe-area-inset-top, 0px) + 52px);
    --disclaimer-h: 90px;
  }
}

@media (min-width: 1080px) {
  :root { --disclaimer-h: 56px; }
}


* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 3000;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--deep);
  color: var(--deep-ink);
  font-size: 13px;
  font-weight: 800;
  transform: translateY(-150%);
  transition: transform 140ms ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--deep);
  outline-offset: 3px;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: transparent;
  color: var(--ink);
  transition: color 180ms ease;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.65;
  background:
    radial-gradient(ellipse at 8% 12%, rgba(13, 255, 116, 0.35) 0%, transparent 42%),
    radial-gradient(ellipse at 88% 6%, rgba(120, 0, 255, 0.28) 0%, transparent 40%),
    radial-gradient(ellipse at 55% 88%, rgba(255, 0, 140, 0.22) 0%, transparent 48%),
    radial-gradient(ellipse at 92% 72%, rgba(0, 200, 255, 0.26) 0%, transparent 38%),
    radial-gradient(ellipse at 6% 92%, rgba(255, 210, 0, 0.18) 0%, transparent 36%),
    radial-gradient(ellipse at 48% 42%, rgba(80, 0, 255, 0.12) 0%, transparent 55%),
    conic-gradient(from 200deg at 70% 30%, transparent 0deg, rgba(255, 80, 0, 0.06) 60deg, transparent 120deg, rgba(0, 255, 200, 0.08) 200deg, transparent 280deg);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  overflow: hidden;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 50% -12%, rgba(13, 255, 116, 0.12), transparent 32%),
    rgba(5, 8, 6, 0.45);
}


.app-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg width='220' height='220' viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23333a36' stroke-width='1.45' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg opacity='.82' transform='translate(24 23)'%3E%3Cpath d='M10 37V8.8c0-1.5 1.1-2.6 2.6-2.6h10.9c1.5 0 2.6 1.1 2.6 2.6V37'/%3E%3Cpath d='M8.2 37h20'/%3E%3Cpath d='M14.2 13.4h8.2'/%3E%3Cpath d='M26.1 13.8h3.2l5.1 5.7v13.2c0 2.2 1.2 3.6 2.9 3.6s2.9-1.4 2.9-3.6v-8.3'/%3E%3C/g%3E%3Cg opacity='.74' transform='translate(139 31) rotate(9 28 25)'%3E%3Cpath d='M15.6 15.6h22.8l7.1 6.8v26.2c0 2.4-1.8 4.2-4.2 4.2H12.7c-2.4 0-4.2-1.8-4.2-4.2V22.7c0-2.4 1.8-4.2 4.2-4.2h2.9Z'/%3E%3Cpath d='M17.8 15.6v-5h15.4l4 5'/%3E%3Cpath d='M17 29h14.3'/%3E%3Cpath d='M37.8 21h4.4l6.3 7.8v18.4'/%3E%3C/g%3E%3Cg opacity='.62' transform='translate(50 144) rotate(-12 26 26)'%3E%3Cpath d='M12 34c0-9.2 6-17.3 14-28.5C34 16.7 40 24.8 40 34'/%3E%3Cpath d='M15.3 34a10.7 10.7 0 0 0 21.4 0'/%3E%3Cpath d='M26 27v18'/%3E%3C/g%3E%3Cg opacity='.5' transform='translate(146 142)'%3E%3Ccircle cx='26' cy='26' r='7.5'/%3E%3Cpath d='M26 7.8v7M26 37.2v7M7.8 26h7M37.2 26h7M13.1 13.1l5 5M33.9 33.9l5 5M38.9 13.1l-5 5M18.1 33.9l-5 5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  background-size: 220px 220px;
  background-position: 14px 18px;
  mix-blend-mode: screen;
}


main {
  position: relative;
  z-index: 1;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0 10px;
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  padding: max(1px, env(safe-area-inset-top)) 12px 1px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 0;
  color: var(--ink);
}


.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  margin-left: auto;
}

/* Выбор города — комбобокс с поиском */
.city-picker {
  position: static;
}

.city-picker__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  min-height: 44px;
  max-width: 46vw;
  padding: 0 12px 0 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: background 140ms ease, border-color 140ms ease;
}

/* Локальная контрастная подложка вместо общей серой шапки: элементы остаются
   читаемыми поверх любой карты, но не образуют прямоугольный фон. */
.topbar-actions .city-picker__btn,
.topbar-actions .icon-button {
  background: var(--nav-surface);
  border-color: rgba(255, 255, 255, 0.08);
}

.city-picker__btn:hover { background: var(--nav-surface); border-color: rgba(255, 255, 255, 0.08); }
.city-picker__btn[aria-expanded="true"] { border-color: var(--deep); background: rgba(255, 255, 255, 0.16); }

.city-picker .city-select-icon {
  position: absolute;
  left: 9px;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--deep);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.city-picker__btn span {
  max-width: 34vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-picker__chev { width: 11px; height: 11px; color: var(--muted); flex-shrink: 0; transition: transform 160ms ease; }
.city-picker__btn[aria-expanded="true"] .city-picker__chev { transform: rotate(180deg); }

.city-picker__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 2000;
  width: min(280px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--ink) 8%, var(--shell));
}

.city-picker__search {
  width: 100%;
  height: 38px;
  margin-bottom: 6px;
  padding: 0 12px;
  border: 1px solid var(--control-border);
  border-radius: 9px;
  background: var(--control-bg);
  color: var(--ink);
  font-size: 14px;
  outline: none;
}
.city-picker__search:focus { border-color: var(--deep); }

.city-picker__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.city-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.city-opt:hover { background: color-mix(in srgb, var(--deep) 12%, transparent); }
.city-opt.is-active { color: var(--deep); }
.city-opt svg { color: var(--deep); flex-shrink: 0; }
.city-opt-empty { padding: 14px 11px; color: var(--muted); font-size: 13px; text-align: center; }

/* Скелетоны загрузки */
@keyframes skel-shimmer {
  0% { background-position: -160px 0; }
  100% { background-position: 240px 0; }
}
.skel-card {
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
}
.skel-card--selected { margin-bottom: 0; }
.skel-line, .skel-fuels span {
  background: linear-gradient(90deg, var(--panel-soft) 0%, color-mix(in srgb, var(--ink) 12%, var(--panel-soft)) 40%, var(--panel-soft) 80%);
  background-size: 320px 100%;
  animation: skel-shimmer 1.2s ease-in-out infinite;
  border-radius: 6px;
}
.skel-line { height: 13px; margin-bottom: 9px; }
.skel-line--title { width: 55%; height: 16px; }
.skel-line--sub { width: 38%; }
.skel-fuels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.skel-fuels span { display: block; height: 46px; border-radius: 8px; }
.map-shell.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ink) 8%, transparent), transparent);
  background-size: 240px 100%;
  animation: skel-shimmer 1.2s ease-in-out infinite;
  pointer-events: none;
  border-radius: inherit;
}

.eyebrow {
  margin: 0 0 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font-size: 23px;
  font-weight: 800;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: background 140ms ease, border-color 140ms ease;
}

.icon-button:hover {
  background: var(--nav-surface);
  border-color: rgba(255, 255, 255, 0.08);
}


main {
  /* Отступы под плавающие фиксированные шапку/вкладки/дисклеймер — актуально
     для «Список»/«+АЗС» (обычный поток); карта сама fixed и эти паддинги
     на неё не влияют. */
  padding:
    calc(var(--topbar-h) + var(--gap-sm))
    14px
    calc(var(--disclaimer-h) + var(--gap-sm) + env(safe-area-inset-bottom, 0px));
}

.filters,
.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filters {
  margin-bottom: 10px;
}

.map-filters {
  flex-wrap: wrap;
  overflow: visible;
  margin: 10px 0 0;
  align-items: flex-end;
}

.avail-dot--available { --dot-color: var(--avail-available); background: var(--avail-available); }
.avail-dot--limited { --dot-color: var(--avail-limited); background: var(--avail-limited); }
.avail-dot--empty { --dot-color: var(--avail-empty); background: var(--avail-empty); }
.avail-dot--unknown { --dot-color: var(--avail-unknown); background: var(--avail-unknown); }

label span,
legend {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  background: var(--control-bg);
  color: var(--ink);
  outline: none;
}

select,
input {
  height: 42px;
  padding: 0 11px;
}

select option {
  background: #f5f8f6;
  color: #111a17;
}

textarea {
  resize: vertical;
  padding: 10px 11px;
}

.filters label:first-child {
  min-width: 132px;
}

.toggle {
  display: inline-flex;
  align-items: end;
  min-width: max-content;
}

.toggle input,
.check input {
  width: auto;
  height: auto;
  margin-right: 7px;
  accent-color: var(--deep);
}

.toggle span {
  display: inline-flex;
  align-items: center;
  height: 42px;
  margin: 18px 0 0;
  padding: 0 12px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  background: var(--control-bg);
  color: var(--ink);
  font-size: 14px;
}

/* Переключатель разделов теперь занимает прежнее место логотипа в шапке. */
.tabs {
  position: relative;
  z-index: auto;
  display: inline-flex;
  width: auto;
  margin: 0;
  padding: 0;
  gap: 2px;
  overflow: visible;
  border-radius: 999px;
  height: 44px;
  align-items: center;
  isolation: isolate;
  background: transparent;
  border: 0;
}

.tabs::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset-inline: 0;
  top: 50%;
  height: var(--topbar-control-visual-h);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: var(--nav-surface);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  transform: translateY(-50%);
  pointer-events: none;
}

@media (max-width: 679px) {
  /* На телефоне все навигационные элементы находятся в одной строке. */
  .topbar { flex-wrap: nowrap; gap: 6px; }
  .topbar-actions { order: 0; width: auto; gap: 4px; margin-left: 0; flex-shrink: 0; }
  .topbar .tabs {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    overflow: hidden;
  }
  .topbar .tab { flex: 1 1 0; min-width: 0; white-space: nowrap; padding-left: 2px; padding-right: 2px; font-size: 10px; }
  .topbar .tab-help { flex: 0 0 44px; width: 44px; min-width: 44px; }
  .topbar .city-picker__btn { max-width: 28vw; padding-left: 25px; padding-right: 7px; font-size: 11px; }

}

/* На самых узких Android-экранах одна строка физически не вмещает четыре
   навигационные кнопки и выбор города без уменьшения зон касания. */
@media (max-width: 340px) {
  .app-shell { --topbar-h: calc(env(safe-area-inset-top, 0px) + 102px); }
  .topbar {
    flex-wrap: wrap;
    align-content: start;
    gap: 6px;
    padding-block-end: 6px;
  }
  .topbar .tabs {
    flex: 0 0 100%;
    width: 100%;
  }
  .topbar-actions {
    display: flex;
    flex: 0 0 100%;
    justify-content: flex-end;
  }
  .topbar .city-picker__btn { max-width: min(72vw, 230px); }
}

.tab {
  position: relative;
  z-index: 1;
  isolation: isolate;
  flex: none;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--deep);
  font-size: 12.5px;
  font-weight: 700;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.tab.active {
  background: transparent;
  color: var(--deep-ink);
}

.tab::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset-inline: 0;
  top: 50%;
  height: var(--topbar-control-visual-h);
  border-radius: 999px;
  background: transparent;
  transform: translateY(-50%);
  transition: background 140ms ease, box-shadow 140ms ease;
  pointer-events: none;
}

.tab.active::before { background: var(--deep); }

.tab-help {
  width: 44px;
  min-width: 44px;
  padding: 0;
  border: 0;
  color: var(--deep);
  font-size: 14px;
  font-weight: 800;
  background: transparent;
}
.tab-help::before { border: 1px solid color-mix(in srgb, var(--deep) 30%, transparent); }
.tab-help:hover,
.tab-help:focus-visible {
  background: transparent;
  color: var(--deep);
}
.tab-help.active {
  background: transparent;
  color: var(--deep-ink);
}

/* Видимые GPS/город — 35px, но фактическая зона касания остаётся 44px. */
.topbar-actions .city-picker__btn,
.topbar-actions .icon-button {
  position: relative;
  isolation: isolate;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.topbar-actions .city-picker__btn::before,
.topbar-actions .icon-button::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset-inline: 0;
  top: 50%;
  height: var(--topbar-control-visual-h);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: inherit;
  background: var(--nav-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translateY(-50%);
  transition: background 140ms ease, border-color 140ms ease;
  pointer-events: none;
}

.topbar-actions .city-picker__btn:hover,
.topbar-actions .city-picker__btn[aria-expanded="true"],
.topbar-actions .icon-button:hover {
  background: transparent;
  border-color: transparent;
}

.topbar-actions .city-picker__btn:hover::before,
.topbar-actions .icon-button:hover::before {
  background: color-mix(in srgb, var(--nav-surface) 88%, white);
}

.topbar-actions .city-picker__btn[aria-expanded="true"]::before {
  border-color: var(--deep);
  background: color-mix(in srgb, var(--nav-surface) 84%, white);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

/* Карта — во весь экран (фиксированный слой позади всех плавающих элементов).
   Остальные .view (Список/+АЗС) остаются обычным потоком внутри main. */
#mapView.active {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  overflow: hidden;
}

/* Полноэкранная карта: #mapView (при активной вкладке) фиксируется на весь
   вьюпорт, .map-shell/.map-panel просто заполняют его на 100% — без полей,
   рамки и декоративных фильтров. Остальные элементы (шапка, вкладки,
   карточка АЗС, дисклеймер) — плавающие слои поверх, см. секцию ниже. */
.map-shell {
  position: relative;
  height: 100%;
}

.map-panel {
  position: relative;
  z-index: 0;
  /* z-index:0 здесь обязателен: создаёт свой стекинг-контекст, изолируя
     внутренние слои MapLibre (canvas/marker/control, z-index 1-2) — иначе
     они сравнивались бы напрямую с плавающей .selected-card на уровне
     #mapView и перекрывали бы её. */
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #2c3731;
}

.maplibregl-map {
  font: inherit;
}

/* Зум-контрол MapLibre (NavigationControl, showCompass:false — только +/-):
   стеклянный вид под тёмную тему, белые иконки (у MapLibre сами svg-иконки
   тёмно-серые #333, см. vendor/maplibre/maplibre-gl.css — инвертируем). */
body[data-theme="dark"] .maplibregl-ctrl-group button {
  background: var(--zoom-surface);
  transition: background 140ms ease;
}
body[data-theme="dark"] .maplibregl-ctrl-group button:hover {
  background: rgba(150, 153, 151, 0.76);
}
body[data-theme="dark"] .maplibregl-ctrl-icon {
  filter: invert(1);
}

/* Стеклянный контейнер зум-контрола: сглаженные углы вместо квадратных
   (дефолт MapLibre 4px), overflow:hidden аккуратно обрезает кнопки внутри. */
.map-panel .maplibregl-ctrl-group {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  overflow: hidden;
  /* MapLibre по умолчанию добавляет внешнюю 2px тень. На прозрачной карте
     она читается как лишняя обводка вокруг всей площадки + / −. */
  box-shadow: none;
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}

/* Вендорный :focus рисует яркую синюю рамку даже после мышиного клика в
   браузерах с неполной поддержкой :focus-visible. У мыши её быть не должно;
   у клавиатуры оставляем компактный, доступный индикатор внутри кнопки. */
.map-panel .maplibregl-ctrl-group button:focus {
  outline: none;
  box-shadow: none;
}
.map-panel .maplibregl-ctrl-group button:focus-visible {
  outline: 2px solid var(--deep);
  outline-offset: -2px;
  box-shadow: none;
}

/* Фолбэк, если стиль OpenFreeMap не поднялся за разумное время (см.
   watchMapAvailability в app.js) — карта могла не отрисоваться, но список/
   карточки АЗС по-прежнему работают, сообщаем об этом прямо на месте карты. */
.map-unavailable {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  background: #2c3731;
  z-index: 1;
}

/* Утончённые компактные маркеры — небольшие круглые точки, чтобы не
   перекрывать карту. Цвет = доступность топлива.
   .pin — КОРНЕВОЙ элемент MapLibre-маркера: его transform двигает сама
   библиотека на каждом кадре пана/зума (позиционирование по координатам).
   Поэтому на .pin НЕЛЬЗЯ вешать ни transition:transform, ни :hover{transform},
   — CSS-transition на том же свойстве, которое ежекадрово перезаписывает
   MapLibre, заставлял бы точку "доезжать" до новой позиции 130мс вместо
   мгновенного скачка — визуально точки "плавали"/отставали от карты при
   перетаскивании. Вместо этого .pin — крупная НЕВИДИМАЯ область попадания
   пальцем (проще нажать на мобильном), а видимый кружок — ::before, к нему
   transform/анимации применяются свободно, MapLibre его не трогает. */
.pin {
  --pin-color: var(--avail-available);
  box-sizing: border-box;
  /* Корневой элемент создаётся MapLibre и позиционируется его transform.
     Relative здесь ломает расчёт координат при zoom/pan и даёт эффект
     «уплывающих» иконок. Внутренний визуальный круг остаётся на ::before. */
  position: absolute;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pin::before {
  content: "";
  box-sizing: border-box;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, color-mix(in srgb, var(--pin-color) 45%, #ffffff), var(--pin-color) 78%);
  box-shadow:
    0 0 0 1.4px rgba(255, 255, 255, 0.9),
    0 0 9px 1px color-mix(in srgb, var(--pin-color) 62%, transparent);
  transition: transform 130ms ease, box-shadow 130ms ease;
}

.pin.available { --pin-color: var(--avail-available); }

.pin:hover::before {
  transform: scale(1.35);
}
.pin:hover { z-index: 2; }

/* Жалоба / спорные данные — фиолетовый акцент-кольцо */
.pin.disputed::before {
  box-shadow:
    0 0 0 1.5px rgba(255, 255, 255, 0.92),
    0 0 0 3px color-mix(in srgb, var(--avail-disputed) 65%, transparent);
}


/* Выбранная АЗС — чуть крупнее + мягкое двойное свечение */
.pin.selected::before {
  width: 17px;
  height: 17px;
  box-shadow:
    0 0 0 2px #ffffff,
    0 0 0 4px color-mix(in srgb, var(--pin-color) 55%, transparent);
  animation: pin-pulse 2.4s ease-out infinite;
}
.pin.selected { z-index: 3; }

@keyframes pin-pulse {
  0%   { box-shadow: 0 0 0 2px #fff, 0 0 0 4px color-mix(in srgb, var(--pin-color) 55%, transparent), 0 0 16px 3px color-mix(in srgb, var(--pin-color) 70%, transparent); }
  70%  { box-shadow: 0 0 0 2px #fff, 0 0 0 12px color-mix(in srgb, var(--pin-color) 0%, transparent), 0 0 22px 5px color-mix(in srgb, var(--pin-color) 0%, transparent); }
  100% { box-shadow: 0 0 0 2px #fff, 0 0 0 4px color-mix(in srgb, var(--pin-color) 55%, transparent), 0 0 16px 3px color-mix(in srgb, var(--pin-color) 70%, transparent); }
}

.pin.limited { --pin-color: var(--avail-limited); }
.pin.empty {
  --pin-color: var(--avail-empty);
  /* An explicit absence must remain unmistakably red even when its
     observation is old. Freshness is shown separately in the station card;
     dimming the marker made the only red station look grey/green on the map. */
  opacity: 1;
  filter: none;
  z-index: 2;
}
.pin.empty::before {
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--avail-empty) 88%, transparent),
    0 0 13px 3px color-mix(in srgb, var(--avail-empty) 72%, transparent);
}
.pin.unknown { --pin-color: var(--avail-unknown); }
.pin.freshness-stale { opacity: .58; filter: saturate(.58); }
.pin.freshness-unknown { opacity: .48; }

/* Жалоба / спорные данные — фиолетово-розовый контур-акцент */
/* Цвет выбранного маркера по доступности выбранного топлива */
.pin.selected.limited { --pin-color: var(--avail-limited); }
.pin.selected.empty { --pin-color: var(--avail-empty); }
.pin.selected.unknown { --pin-color: var(--avail-unknown); }

/* Компактная атрибуция MapLibre (CARTO/OSM, ODbL требует показывать источник)
   — маленькая "i", разворачивается по клику; полностью скрыть нельзя —
   условие лицензий (см. handoff.md). Прозрачность 50% в состоянии покоя —
   меньше отвлекает на карте; при наведении/фокусе/раскрытии возвращаем
   полную непрозрачность, чтобы текст атрибуции по клику читался нормально. */
.maplibregl-ctrl-attrib {
  font-size: 11px;
  background: rgba(7, 14, 9, 0.7) !important;
  color: var(--muted) !important;
  opacity: 0.5;
  transition: opacity 140ms ease;
}
.maplibregl-ctrl-attrib:hover,
.maplibregl-ctrl-attrib:focus-within,
.maplibregl-ctrl-attrib[open] {
  opacity: 1;
}
.maplibregl-ctrl-attrib a {
  color: var(--muted) !important;
}

.referrer-row__url small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.station-card,
.form-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.form-error {
  margin: 5px 0 0;
  color: var(--bad);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.form-error--general {
  margin: 12px 0 0;
}

#updateForm input[aria-invalid="true"] {
  border-color: var(--bad);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--bad) 20%, transparent);
}

/* Профиль АЗС — единое компактное окно по правому центру на всех экранах.
   Станция и ближайшие маркеры остаются видимыми слева от карточки, а карта
   вне её площади сохраняет клики без предварительного закрытия профиля. */
.selected-card {
  position: fixed;
  top: 50%;
  right: max(12px, env(safe-area-inset-right, 0px));
  left: auto;
  bottom: auto;
  z-index: 110;
  width: min(430px, calc(100vw - 24px));
  margin: 0;
  max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(-50%);
}

.selected-card:empty {
  display: none;
}

.selected-station-overlay {
  position: absolute;
  z-index: 4;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  background: color-mix(in srgb, var(--selected-station-color, #8fa6a0) 18%, transparent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--selected-station-color, #8fa6a0) 24%, transparent), 0 0 18px color-mix(in srgb, var(--selected-station-color, #8fa6a0) 68%, transparent);
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: selected-station-pulse 1.8s ease-in-out infinite;
}

.selected-station-overlay[hidden] { display: none; }

@keyframes selected-station-pulse {
  0%, 100% { opacity: 0.72; transform: translate(-50%, -50%) scale(0.92); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}

.station-card,
.form-panel {
  padding: 14px;
}

.selected-card .station-card {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(13, 255, 116, 0.08), rgba(0, 0, 0, 0)),
    rgba(46, 54, 49, 0.72);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.station-card + .station-card {
  margin-top: 10px;
}

#listView .station-list {
  display: grid;
  gap: 44px;
}

.list-heading {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.list-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 18px;
}

.list-controls label {
  min-height: 46px;
  padding: 7px 8px;
  border: 1px solid rgba(126, 168, 142, 0.12);
  border-radius: 8px;
  background: rgba(45, 51, 47, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.list-controls label span {
  color: color-mix(in srgb, var(--muted) 82%, var(--ink));
  font-size: 10px;
  font-weight: 720;
}

.list-controls select {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--ink) 90%, var(--muted));
  font-size: 13px;
  font-weight: 780;
}

.list-controls select:focus-visible {
  outline: 1px solid rgba(99, 255, 149, 0.35);
  outline-offset: 4px;
}


#listView .station-card {
  margin-top: 0;
  padding: 20px;
  border-color: rgba(126, 168, 142, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
    rgba(45, 51, 47, 0.9);
}


#listView .station-card + .station-card {
  margin-top: 0;
}

#listView .station-card--list {
  gap: 0;
}

.station-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.station-head--list {
  align-items: flex-start;
}

.station-name {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 17px;
  font-weight: 850;
}

/* Адрес в профиле — отдельная строка вместо длинной цепочки мета-плашек. */
.station-address {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  max-width: 100%;
  margin-top: 6px;
  color: color-mix(in srgb, var(--ink) 78%, var(--muted));
  font-size: 12px;
  font-weight: 620;
  line-height: 1.35;
}

.station-address .ui-icon {
  width: 14px;
  height: 14px;
  margin-top: 1px;
  color: var(--deep);
}

.station-address span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  text-overflow: ellipsis;
}

.selected-card .station-card {
  padding: 18px;
}

.selected-card .station-name {
  max-width: 260px;
  line-height: 1.18;
}

.selected-card .station-tools {
  margin-top: 9px;
}

.station-kicker {
  color: var(--deep);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.station-list-meta,
.station-list-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.station-list-meta {
  margin-top: 8px;
}

.station-list-meta span,
.station-list-foot span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
}

.station-list-meta span:first-child {
  max-width: 32ch;
}

.station-list-warning {
  color: color-mix(in srgb, var(--warn) 60%, var(--muted));
}

.station-list-foot {
  flex-wrap: wrap;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(126, 168, 142, 0.1);
}

.list-updated {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 170px;
  max-width: 100%;
  color: color-mix(in srgb, var(--muted) 82%, var(--ink));
  font-size: 12px;
  font-weight: 620;
  line-height: 1.25;
}

.list-updated .ui-icon {
  width: 13px;
  height: 13px;
  color: color-mix(in srgb, var(--deep) 62%, var(--muted));
}

.list-updated .status-dot {
  width: 7px;
  height: 7px;
}

.station-list-actions {
  display: flex;
  gap: 8px;
}

.station-icon-action {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(126, 168, 142, 0.14);
  border-radius: 8px;
  background: rgba(13, 27, 17, 0.56);
  color: color-mix(in srgb, var(--ink) 78%, var(--muted));
}

.station-icon-action .ui-icon {
  width: 19px;
  height: 19px;
  stroke-width: 2;
}

.station-icon-action--route {
  color: #73ffd2;
  background: rgba(64, 189, 156, 0.11);
}

.station-icon-action--map {
  color: #bfff62;
  background: rgba(191, 255, 98, 0.09);
}

.station-icon-action--update {
  color: #9fb9ff;
  background: rgba(119, 149, 255, 0.1);
}


.station-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-top: 7px;
}

.station-tool {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.station-tool--warn {
  color: var(--accent);
}

.ui-icon {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  background: rgba(13, 255, 116, 0.12);
  color: var(--good);
  font-size: 12px;
  font-weight: 800;
}

.badge.limited {
  background: rgba(201, 132, 22, 0.13);
  color: var(--warn);
}

.badge.empty {
  background: rgba(188, 55, 55, 0.12);
  color: var(--bad);
}

/* ── Бейдж доступности в карточке ────────────────────────────── */
.avail-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ab-color, var(--avail-unknown)) 45%, transparent);
  background: color-mix(in srgb, var(--ab-color, var(--avail-unknown)) 15%, transparent);
  color: color-mix(in srgb, var(--ab-color, var(--avail-unknown)) 72%, var(--ink));
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.avail-badge small {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.7;
  text-transform: uppercase;
}

.avail-badge--available { --ab-color: var(--avail-available); }
.avail-badge--limited { --ab-color: var(--avail-limited); }
.avail-badge--empty { --ab-color: var(--avail-empty); }
.avail-badge--unknown { --ab-color: var(--avail-unknown); }

.avail-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--avail-unknown);
  vertical-align: middle;
  margin-right: 6px;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--dot-color, var(--avail-unknown)) 22%, transparent);
}

/* Ячейка топлива, которого нет — приглушаем и подкрашиваем рамку */
.fuel-cell--avail-empty {
  border-color: color-mix(in srgb, var(--avail-empty) 35%, transparent);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--avail-empty) 10%, transparent), transparent 60%),
    var(--panel-soft);
}

.fuel-cell--avail-limited {
  border-color: color-mix(in srgb, var(--avail-limited) 32%, transparent);
}

.fuel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.fuel-cell {
  position: relative;
  overflow: hidden;
  padding: 11px;
  border-radius: 8px;
  background: var(--panel-soft);
  border: 1px solid rgba(126, 168, 142, 0.11);
}

.fuel-cell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.07), transparent 46%);
  opacity: 0.65;
}

.fuel-cell > * {
  position: relative;
  z-index: 1;
}

.fuel-cell--ai92 {
  border-color: rgba(91, 190, 132, 0.18);
  background:
    linear-gradient(145deg, rgba(91, 190, 132, 0.13), rgba(91, 190, 132, 0.028)),
    var(--panel-soft);
}

.fuel-cell--ai95 {
  border-color: rgba(185, 196, 110, 0.18);
  background:
    linear-gradient(145deg, rgba(185, 196, 110, 0.12), rgba(185, 196, 110, 0.024)),
    var(--panel-soft);
}

.fuel-cell--ai98 {
  border-color: rgba(168, 142, 214, 0.2);
  background:
    linear-gradient(145deg, rgba(133, 102, 190, 0.14), rgba(133, 102, 190, 0.028)),
    var(--panel-soft);
}

.fuel-cell--ai100 {
  border-color: rgba(211, 133, 154, 0.2);
  background:
    linear-gradient(145deg, rgba(183, 88, 117, 0.13), rgba(183, 88, 117, 0.026)),
    var(--panel-soft);
}

.fuel-cell--diesel {
  border-color: rgba(128, 188, 216, 0.18);
  background:
    linear-gradient(145deg, rgba(92, 150, 184, 0.14), rgba(92, 150, 184, 0.028)),
    var(--panel-soft);
}

.fuel-cell--gas {
  border-color: rgba(102, 210, 166, 0.17);
  background:
    linear-gradient(145deg, rgba(65, 178, 139, 0.13), rgba(65, 178, 139, 0.026)),
    var(--panel-soft);
}

#listView .fuel-grid {
  gap: 14px;
  margin: 22px 0 0;
}

#listView .fuel-cell {
  display: grid;
  min-height: 96px;
  align-content: space-between;
  border-color: rgba(126, 168, 142, 0.12);
  background: rgba(49, 61, 53, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

#listView .fuel-cell::before {
  opacity: 0.28;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 52%);
}

#listView .fuel-cell--ai92 {
  background: linear-gradient(145deg, rgba(87, 166, 119, 0.12), rgba(87, 166, 119, 0.018)), rgba(49, 61, 53, 0.78);
}

#listView .fuel-cell--ai95 {
  background: linear-gradient(145deg, rgba(175, 180, 102, 0.105), rgba(175, 180, 102, 0.016)), rgba(49, 61, 53, 0.78);
}

#listView .fuel-cell--ai98 {
  background: linear-gradient(145deg, rgba(131, 99, 183, 0.11), rgba(131, 99, 183, 0.016)), rgba(49, 61, 53, 0.78);
}

#listView .fuel-cell--ai100 {
  background: linear-gradient(145deg, rgba(176, 84, 112, 0.105), rgba(176, 84, 112, 0.016)), rgba(49, 61, 53, 0.78);
}

#listView .fuel-cell--diesel {
  background: linear-gradient(145deg, rgba(86, 132, 164, 0.11), rgba(86, 132, 164, 0.016)), rgba(49, 61, 53, 0.78);
}

#listView .fuel-cell--gas {
  background: linear-gradient(145deg, rgba(62, 154, 127, 0.105), rgba(62, 154, 127, 0.016)), rgba(49, 61, 53, 0.78);
}


#listView .fuel-cell b {
  justify-content: space-between;
  margin-bottom: 14px;
  color: color-mix(in srgb, var(--deep) 72%, var(--muted));
  font-size: 18px;
  font-weight: 920;
}

#listView .fuel-cell b .ui-icon {
  width: 13px;
  height: 13px;
  color: color-mix(in srgb, var(--deep) 74%, var(--muted));
}

#listView .fuel-cell span {
  color: color-mix(in srgb, var(--ink) 94%, white);
  font-size: 25px;
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

#listView .fuel-cell .price-currency {
  font-size: 0.54em;
}

.fuel-cell b {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: color-mix(in srgb, var(--deep) 78%, var(--muted));
  font-size: 15px;
  font-weight: 920;
  line-height: 1;
  letter-spacing: 0;
}

.fuel-cell b .ui-icon {
  width: 17px;
  height: 17px;
  color: var(--deep);
  stroke-width: 2;
}

.fuel-cell__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

#listView .fuel-cell__title {
  margin-bottom: 14px;
}

.fuel-cell__title b,
.selected-card .fuel-cell__title b,
#listView .fuel-cell__title b {
  min-width: 0;
  margin-bottom: 0;
}

.fuel-cell .fuel-eco,
#listView .fuel-cell .fuel-eco {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding-inline: 7px;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--deep) 30%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--deep) 10%, transparent);
  color: color-mix(in srgb, var(--ink) 86%, var(--muted));
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: .02em;
  text-shadow: none;
  white-space: nowrap;
}

.fuel-cell__value {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 5px;
  min-width: 0;
}

.selected-card .fuel-cell .fuel-eco {
  min-height: 18px;
  padding-inline: 5px;
  font-size: 9px;
}

.fuel-cell span {
  display: block;
  color: color-mix(in srgb, var(--ink) 92%, white);
  font-size: 17px;
  font-weight: 850;
  line-height: 1.15;
}

.price-currency {
  display: inline;
  margin-left: 2px;
  color: color-mix(in srgb, currentColor 54%, var(--muted));
  font-size: 0.62em;
  font-weight: 420;
  line-height: 1;
  text-shadow: none;
}

/* Минимальные состояния ячейки топлива */
.fuel-state--empty {
  color: color-mix(in srgb, var(--avail-empty) 82%, var(--ink));
}

.fuel-cell span.fuel-state--unknown {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.fuel-cell span.fuel-note--limited,
#listView .fuel-cell span.fuel-note--limited {
  display: inline-block;
  margin: 6px 0 0;
  color: color-mix(in srgb, var(--avail-limited) 80%, var(--ink));
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

/* Единая строка состояния станции */
.station-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 12px 0 2px;
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--sd-color, var(--avail-available));
}

.status-dot--fresh { --sd-color: var(--avail-available); }
.status-dot--check { --sd-color: var(--avail-limited); }
.status-dot--stale { --sd-color: var(--avail-unknown); }
.status-dot--unknown { --sd-color: var(--avail-unknown); }
.status-dot--disputed { --sd-color: var(--avail-disputed); }

.status-time {
  color: var(--muted);
}

.status-tag {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--st-color, var(--muted));
  background: color-mix(in srgb, var(--st-color, var(--muted)) 13%, transparent);
}

.status-tag--check { --st-color: var(--avail-limited); }
.status-tag--stale { --st-color: var(--avail-unknown); }
.status-tag--unknown { --st-color: var(--avail-unknown); }
.status-confidence { color: var(--muted); font-size: .78rem; }
.status-tag--disputed { --st-color: var(--avail-disputed); }

#listView .badge {
  background: rgba(126, 168, 142, 0.12);
  color: color-mix(in srgb, var(--good) 72%, var(--muted));
}

#listView .badge.limited {
  background: rgba(170, 183, 83, 0.11);
  color: color-mix(in srgb, var(--warn) 70%, var(--muted));
}

#listView .badge.empty {
  background: rgba(188, 90, 90, 0.1);
  color: color-mix(in srgb, var(--bad) 68%, var(--muted));
}

#listView .station-tool {
  color: color-mix(in srgb, var(--muted) 88%, var(--ink));
}

#listView .station-tool--warn {
  color: color-mix(in srgb, var(--warn) 68%, var(--muted));
}

.restriction {
  color: var(--accent);
  font-weight: 750;
}

.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.station-share {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 11px;
  border-top: 1px solid rgba(126, 168, 142, 0.16);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.station-share a {
  color: var(--deep);
  font-weight: 780;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--deep) 55%, transparent);
  text-underline-offset: 3px;
  white-space: nowrap;
}

.station-share a:hover,
.station-share a:focus-visible {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

@media (max-width: 420px) {
  .station-share {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

#listView .actions {
  gap: 14px;
  margin-top: 18px;
}

.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  border-radius: 8px;
  font-weight: 800;
}

.primary {
  border: 0;
  background: var(--deep);
  color: var(--deep-ink);
}

.action-update {
  border: 1px solid rgba(99, 255, 149, 0.16);
  background: rgba(32, 73, 48, 0.58);
  color: color-mix(in srgb, var(--ink) 86%, var(--muted));
  box-shadow: none;
}

#listView .action-update {
  border-color: rgba(126, 168, 142, 0.14);
  background: rgba(24, 50, 33, 0.62);
  color: color-mix(in srgb, var(--ink) 78%, var(--muted));
}


.secondary {
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: var(--ink);
}

.form-panel,
.dialog-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Honeypot анти-бот поле (см. server.py bot_signal) — не display:none:
   некоторые примитивные боты специально пропускают скрытые через display,
   но всё равно слепо заполняют все input/textarea формы. Прячем визуально
   через позиционирование за пределы экрана, поле остаётся в DOM/tab-order
   исключено через tabindex=-1 + aria-hidden на обёртке. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

fieldset {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.check {
  font-size: 14px;
}

dialog {
  width: min(calc(100vw - 24px), 520px);
  border: 0;
  border-radius: 18px;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(2, 8, 5, 0.78);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.dialog-panel {
  position: relative;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(99, 255, 149, 0.08), transparent 38%),
    var(--panel);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-head .eyebrow {
  margin-bottom: 5px;
  color: var(--deep);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.dialog-head h2 {
  max-width: 320px;
  font-size: clamp(20px, 5vw, 24px);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.dialog-subtitle {
  max-width: 300px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.dialog-main-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(110px, 0.92fr);
  gap: 10px;
}

.dialog-detail-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.dialog-panel label span {
  margin-bottom: 8px;
  font-size: 13px;
}

.dialog-panel select,
.dialog-panel input:not([type="hidden"]) {
  height: 50px;
  padding-inline: 14px;
  border-radius: 11px;
  font-size: 16px;
}

.dialog-price-field input {
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  font-weight: 800;
}

.dialog-submit {
  width: 100%;
  height: 48px;
  margin-top: 2px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(13, 255, 116, 0.14);
}

@media (max-width: 420px) {
  .dialog-panel { padding: 18px; }
  .dialog-main-fields { grid-template-columns: 1fr; gap: 12px; }
  .dialog-detail-fields { grid-template-columns: 1fr; gap: 12px; }
}

@media (max-width: 340px) {
  .selected-card .fuel-cell__value { gap: 3px; }
}

.dialog-head .icon-button {
  border-color: var(--line);
  background: var(--control-bg);
  color: var(--ink);
}

.empty-state {
  padding: 28px 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

/* Список: порционная подгрузка по 20 карточек, без случайной «простыни» DOM. */
.list-load-more {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.list-load-more__button {
  min-height: 44px;
  padding-inline: 18px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}

.list-load-more__button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: color-mix(in srgb, var(--deep) 35%, rgba(255, 255, 255, 0.14));
}


/* ── Форма добавления АЗС ── */

.add-station-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-block: 16px;
}

.add-station-head {
  margin-bottom: 4px;
}

.add-station-head h2 {
  margin: 4px 0 6px;
  font-size: 1.15rem;
}

.add-station-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

.add-fuels-fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0;
}

.add-fuels-fieldset legend {
  font-size: 0.8rem;
  color: var(--muted);
  padding-inline: 4px;
}

.add-fuels-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.add-fuel-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.add-fuel-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.add-station-submit {
  margin-top: 4px;
}

/* ════════════════════════════════════════════════════════════════
   АДАПТИВ — полноэкранная вёрстка на всю ширину
   Мобайл-фёрст: базовые стили = смартфон; ниже расширяем под
   планшет и десктоп, чтобы было строго и ровно на любом экране.
   ════════════════════════════════════════════════════════════════ */

/* Планшет и шире */
@media (min-width: 680px) {
  main {
    padding:
      calc(var(--topbar-h) + var(--gap-sm))
      clamp(18px, 3vw, 40px)
      calc(var(--disclaimer-h) + var(--gap-sm) + env(safe-area-inset-bottom, 0px));
  }
  .map-filters {
    gap: 12px;
  }
  .map-filters label { flex: 0 1 auto; min-width: 150px; }
  /* Список — карточки в резиновую сетку */
  .station-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
    align-items: start;
  }
  /* Карточки держат единый минимальный ритм, но растут по содержимому:
     фиксированная высота накладывала футер на третий вид топлива. */
  #listView .station-card--list {
    display: flex;
    flex-direction: column;
    min-height: 360px;
    box-sizing: border-box;
  }
  #listView .station-card--list .station-head--list {
    min-height: 52px;
  }
  #listView .station-card--list .fuel-grid--list {
    align-content: start;
    min-height: 96px;
  }
  #listView .station-card--list .station-list-foot {
    margin-top: auto;
  }
  /* Подсказки действий мини-профиля видны только на устройствах с
     наведением: на сенсорных экранах они не создают лишних слоёв и тапов. */
  #listView .station-icon-action {
    position: relative;
    cursor: pointer;
  }
  #listView .station-icon-action::after {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    z-index: 20;
    padding: 5px 8px;
    border: 1px solid rgba(126, 168, 142, 0.22);
    border-radius: 6px;
    background: rgba(20, 29, 23, 0.96);
    color: var(--ink);
    content: attr(aria-label);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, 4px);
    transition: opacity 120ms ease, transform 120ms ease;
  }
  #listView .station-icon-action:hover::after,
  #listView .station-icon-action:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  .list-controls { flex-wrap: wrap; }
}

/* Десктоп / ноутбук — двухколоночная карта + боковая карточка АЗС */
@media (min-width: 1080px) {
  main {
    padding:
      calc(var(--topbar-h) + var(--gap-sm))
      clamp(28px, 3vw, 56px)
      calc(var(--disclaimer-h) + var(--gap-sm) + env(safe-area-inset-bottom, 0px));
  }
  #mapView.active {
    display: block;
  }
  /* Список шире — 3+ колонки */
  .station-list {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 14px;
  }
  /* Форма добавления — по центру, не на всю ширину */
  .add-station-form {
    max-width: 640px;
    margin-inline: auto;
  }
}

/* Широкие мониторы — карта ещё крупнее, список плотнее */
@media (min-width: 1600px) {
  .station-list {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  }
}

@media (max-width: 390px) {
  main {
    padding-inline: 10px;
  }

  .fuel-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
}


/* Кластеры маркеров на карте.
   .map-cluster-hit — корневой элемент MapLibre-маркера (позиционируется
   самой библиотекой, transform на нём не трогаем — см. комментарий к .pin
   выше о том же баге с "плаванием"). Крупная невидимая область попадания
   пальцем. .map-cluster — видимый кружок с числом внутри, transform/hover
   свободно применяются к нему, MapLibre его не двигает. */
.map-cluster-hit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.map-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #06130d;
  font-weight: 700;
  font-size: 10px;
  line-height: 1;
  letter-spacing: -0.02em;
  border: 1.5px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 14px 2px var(--cl-glow, transparent);
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.25);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.map-cluster-hit:hover .map-cluster { transform: scale(1.2); }
.map-cluster-hit:hover { z-index: 2; }
.map-cluster--available { background: var(--avail-available); --cl-glow: color-mix(in srgb, var(--avail-available) 70%, transparent); }
.map-cluster--limited   { background: var(--avail-limited);   --cl-glow: color-mix(in srgb, var(--avail-limited) 70%, transparent); }
.map-cluster--empty     { background: var(--avail-empty); color: #2a0006; --cl-glow: color-mix(in srgb, var(--avail-empty) 72%, transparent); }
.map-cluster--unknown   { background: var(--avail-unknown); --cl-glow: color-mix(in srgb, var(--avail-unknown) 65%, transparent); }
.map-cluster--freshness-stale { opacity: .58; filter: saturate(.58); }
.map-cluster--freshness-unknown { opacity: .48; }

/* ── Геолокация: кнопка в шапке (top-right), промпт, расстояние, маркер, тост ── */
.geo-btn--topbar .geo-icon { width: 18px; height: 18px; }
.geo-btn--topbar:hover { color: var(--deep); }
.geo-btn--topbar[aria-pressed="true"] {
  border-color: var(--deep);
  color: var(--deep);
  box-shadow: 0 0 0 1px var(--deep) inset;
}
.geo-btn--topbar.is-busy { opacity: 0.6; cursor: progress; }
.geo-btn--topbar.is-busy .geo-icon { animation: geo-spin 0.9s linear infinite; }
@keyframes geo-spin { to { transform: rotate(360deg); } }

.geo-prompt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 14px 0;
  padding: 12px 40px 12px 14px;
  border: 1px solid var(--control-border);
  border-radius: 12px;
  background: var(--panel-soft);
}

.geo-prompt__close {
  display: grid;
  place-items: center;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.geo-prompt__close svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.4;
}

.geo-prompt__close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--ink);
}
/* [hidden] сам по себе перебивается display:flex выше — нужен явный сброс,
   иначе кнопка «Не сейчас» (geoPrompt.hidden=true) не скрывает плашку */
.geo-prompt[hidden] { display: none; }

/* Фильтры карты оставлены в DOM для общей логики и списка, но на карте
   намеренно не показываются: главный экран должен оставаться чистым. */
.map-filters { display: none; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
.geo-prompt__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  background: color-mix(in srgb, var(--deep) 16%, transparent);
  color: var(--deep);
}
.geo-prompt__icon svg { width: 20px; height: 20px; }
.geo-prompt__text { flex: 1 1 200px; font-size: 14px; color: var(--ink); }
.geo-prompt__actions { display: flex; gap: 8px; flex: none; }
.geo-prompt__actions .primary { height: 38px; padding: 0 16px; font-size: 14px; }
.geo-prompt .ghost {
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}
.geo-prompt .ghost:hover { color: var(--ink); }

.dist-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--deep) 14%, transparent);
  color: var(--deep);
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
}
.dist-chip .ui-icon { width: 13px; height: 13px; }
.station-list-meta .dist-chip { padding: 1px 7px 1px 5px; font-size: 11px; }

.user-marker { background: none; border: 0; }
.user-marker__dot {
  display: block;
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2f9bff;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px rgba(47, 155, 255, 0.4);
}
.user-marker__dot::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(47, 155, 255, 0.5);
  animation: user-pulse 1.8s ease-out infinite;
}
@keyframes user-pulse {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.8); opacity: 0; }
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(12px);
  max-width: min(92vw, 420px);
  padding: 11px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--control-border);
  font-size: 14px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 2000;
}
.app-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.app-toast[hidden] { display: none; }
.app-toast[data-persistent="true"] { pointer-events: auto; }
.app-toast__close {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 0;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 22px;
}
.app-toast[data-persistent="true"] .app-toast__close { display: grid; }

.dialog-close { flex: 0 0 44px; }

@media (min-width: 680px) and (max-width: 900px) {
  .station-list-foot { align-items: flex-start; }
  .list-updated { flex-basis: 100%; }
  .station-list-actions { margin-inline-start: auto; }
}

/* ── Неоновая полировка: карточка АЗС, шапка, вкладки ───────────── */
/* Тень у шапки убрана по требованию — .topbar нигде не использует box-shadow. */

/* Активная вкладка — неоновое свечение */
.tab.active {
  box-shadow: none;
}
.tab.active::before {
  box-shadow:
    0 0 20px -2px color-mix(in srgb, var(--deep) 60%, transparent),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

/* Карточка выбранной АЗС — неоновая рамка (без свечения сверху/снизу) */
.selected-card .station-card {
  position: relative;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--deep) 30%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--deep) 16%, transparent);
}

/* Топливные ячейки с ценой — зелёное свечение и подсветка цены */
.fuel-cell--avail-available {
  border-color: color-mix(in srgb, var(--avail-available) 35%, transparent);
  box-shadow: inset 0 0 16px -9px var(--avail-available);
}
.fuel-cell .fuel-price {
  text-shadow: 0 0 12px color-mix(in srgb, var(--deep) 45%, transparent);
}

/* ── Полноэкранная карта: плавающие слои поверх ── */

@media (min-width: 1080px) {
  #mapView .map-shell {
    min-width: 0;
    min-height: 0;
    height: 100%;
  }
}

/* Гео-промпт — плавающий баннер под пилюлей вкладок, стеклянный вид */
.geo-prompt {
  position: fixed;
  top: calc(var(--topbar-h) + var(--gap-sm));
  left: 14px;
  right: 14px;
  z-index: 95;
  margin: 0;
  background: rgba(49, 61, 53, 0.72);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

@media (min-width: 680px) {
  .geo-prompt {
    left: 14px;
    right: auto;
    width: min(520px, calc(100vw - 28px));
  }
}

/* Дисклеймер — тонкая стеклянная плашка внизу экрана, с крестиком-закрытием
   (закрывается один раз и навсегда, см. setupDisclaimer в app.js). */
.data-disclaimer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)) 16px;
  border-radius: 0;
  background: rgba(47, 52, 48, 0.74);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.data-disclaimer[hidden] {
  display: none;
}

.data-disclaimer p {
  flex: 1 1 auto;
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.data-disclaimer__short,
.data-disclaimer__details {
  display: none;
}

.data-disclaimer__details p {
  margin-top: 8px;
}

.data-disclaimer__details summary {
  cursor: pointer;
  color: var(--deep);
  font-size: 11px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.data-disclaimer__close {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-top: 1px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.data-disclaimer__close svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.4;
}

.data-disclaimer__close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--ink);
}

/* Зум-контрол MapLibre — прижимаем вправо и опускаем ниже плавающей шапки
   (стеклянный вид — см. .map-panel .maplibregl-ctrl-group выше). */
.map-panel .maplibregl-ctrl-top-right {
  top: calc(var(--topbar-h) + 12px);
  right: 8px;
}

.map-panel .maplibregl-ctrl-top-right > .maplibregl-ctrl {
  margin-top: 0;
}

/* ── Производительность карты (особенно Safari): backdrop-filter поверх
   постоянно движущегося контента карты заставляет браузер пересчитывать
   блюр КАЖДЫЙ кадр пана/зума — это и есть источник ощутимых лагов, а не
   нехватка CPU/сети. На время активного жеста (см. cityMap movestart/
   zoomstart в app.js) убираем блюр у плавающих поверх карты элементов и
   компенсируем непрозрачностью фона, чтобы текст/иконки не терялись —
   после жеста (moveend/zoomend + небольшая задержка) блюр возвращается. ── */
body.is-map-interacting .topbar {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.is-map-interacting .tabs {
  /* У вкладок уже есть собственная компактная подложка. Дополнительный фон
     появлялся только во время zoom как ложная рамка вокруг Карта/Список/Радар. */
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.is-map-interacting .map-panel .maplibregl-ctrl-group {
  /* Не рисуем отдельную площадку поверх + / − во время жеста: убираем лишь
     дорогой blur, а визуальная подложка остаётся у самих кнопок. */
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.is-map-interacting .map-panel .maplibregl-ctrl-group button {
  background: var(--zoom-surface);
}

/* Во время pinch-zoom/панорамирования убираем дорогие эффекты и у самих
   маркеров. MapLibre теперь рисует их в WebGL, поэтому достаточно отключить
   только тени/анимации поверх слоя — кадры не тратятся на лишний композитинг. */
body.is-map-interacting .map-panel,
body.is-map-interacting .map-panel * {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.is-map-interacting .map-panel .maplibregl-canvas-container,
body.is-map-interacting .map-panel .maplibregl-canvas {
  will-change: transform;
}

/* Дисклеймер закрыт насовсем — освобождаем зарезервированное под него место
   (main padding-bottom, отступы карточки АЗС и локатора от низа экрана). */
body.disclaimer-dismissed {
  --disclaimer-h: 0px;
}

/* Карточка выбранной АЗС — заголовок: бейдж наличия + крестик закрытия рядом */
.station-head__right {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: none;
}

.station-card__close {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.station-card__close svg { width: 18px; height: 18px; stroke-width: 2.5; }
.station-card__close:hover { background: rgba(255, 255, 255, 0.12); color: var(--ink); }

@media (max-width: 679px) {
  .geo-prompt {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 8px 10px;
    padding: 10px 42px 10px 12px;
  }

  .geo-prompt__icon {
    width: 30px;
    height: 30px;
  }

  .geo-prompt__icon svg {
    width: 18px;
    height: 18px;
  }

  .geo-prompt__text {
    min-width: 0;
    font-size: 13px;
    line-height: 1.25;
  }

  .geo-prompt__actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .geo-prompt__actions .primary {
    height: 36px;
    padding-inline: 14px;
    font-size: 13px;
  }

  .geo-prompt .ghost {
    display: none;
  }

  .data-disclaimer {
    align-items: center;
    min-height: 56px;
    padding: 8px 12px 8px 14px;
  }

  .data-disclaimer__long {
    display: none;
  }

  .data-disclaimer__short,
  .data-disclaimer__details {
    display: block;
  }

  .data-disclaimer__short {
    font-size: 11px;
    line-height: 1.3;
  }

  .data-disclaimer__details[open] {
    align-self: flex-start;
  }

  .data-disclaimer:has(.data-disclaimer__details[open]) .data-disclaimer__short {
    display: none;
  }

  .data-disclaimer__details[open] p {
    font-size: 11px;
    line-height: 1.35;
  }

  .data-disclaimer__close {
    width: 44px;
    height: 44px;
  }

}

/* На узком смартфоне топливо остаётся в две колонки: профиль помещается
   целиком и не превращается в длинную прокручиваемую половину экрана. */
.selected-card .fuel-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 340px) {
  .selected-card {
    width: calc(100vw - 20px);
    right: max(10px, env(safe-area-inset-right, 0px));
    max-height: calc(100dvh - 20px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }
  .selected-card .station-card { padding: 13px; }
  .selected-card .station-head { gap: 7px; }
  .selected-card .station-name { max-width: none; font-size: 16px; }
  .selected-card .station-address { margin-top: 4px; }
  .selected-card .station-tools { margin-top: 5px; }
  .selected-card .station-head__right { gap: 4px; }
  .selected-card .avail-badge { padding-inline: 8px; font-size: 11px; }
  .selected-card .station-card__close { width: 44px; height: 44px; }
  .selected-card .fuel-grid { margin-block: 8px; gap: 7px; }
  .selected-card .fuel-cell { padding: 8px; }
  .selected-card .fuel-cell b { margin-bottom: 4px; font-size: 14px; }
  .selected-card .station-status { margin-block: 8px 0; }
  .selected-card .actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 8px;
  }
  .selected-card .actions button { padding-inline: 7px; font-size: 14px; }
  .selected-card .station-share { margin-top: 8px; padding-top: 8px; }
  .selected-card .station-share span { display: none; }
}

/* Список АЗС — чередование мягких цветовых гамм карточек по кругу (3 тона)
   для лёгкой читабельности длинного списка: без этого все карточки одного
   нейтрального цвета сливаются друг с другом. Оттенки едва заметны (низкая
   насыщенность/прозрачность), чтобы не мешать восприятию цен и наличия. */
#stationList .station-card--list {
  border-left: 2px solid transparent;
}
#stationList .station-card--list:nth-of-type(3n+1) {
  background: linear-gradient(135deg, color-mix(in srgb, var(--deep) 6%, transparent), transparent 60%), var(--panel);
  border-left-color: color-mix(in srgb, var(--deep) 45%, transparent);
}
#stationList .station-card--list:nth-of-type(3n+2) {
  background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 6%, transparent), transparent 60%), var(--panel);
  border-left-color: color-mix(in srgb, var(--blue) 45%, transparent);
}
#stationList .station-card--list:nth-of-type(3n+3) {
  background: linear-gradient(135deg, color-mix(in srgb, var(--avail-disputed) 6%, transparent), transparent 60%), var(--panel);
  border-left-color: color-mix(in srgb, var(--avail-disputed) 45%, transparent);
}

/* ── Информеры: футуристичная аналитическая сводка по городу ──────────
   Дизайн-язык: стеклянные панели на тёмном фоне, тонкие неоновые контуры,
   светящиеся акценты на ключевых цифрах, фирменные цвета по видам топлива
   (переиспользуют оттенки из .fuel-cell--*), без ярких/кричащих эффектов —
   сдержанный «HUD»-стиль, а не аляповатая подсветка. */

.informers-grid {
  --ai92: var(--deep);
  --ai95: var(--warn);
  --diesel: var(--blue);
  --gas: var(--avail-disputed);
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 4px;
  padding: 2px 2px 16px;
}

.legend-view { overflow: auto; }
.legend-page { max-width: 920px; margin: 0 auto; padding: 28px 24px 64px; color: var(--ink); }
.legend-hero { padding: 28px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(135deg, color-mix(in srgb, var(--panel) 92%, var(--avail-available)), var(--panel)); }
.legend-hero h1 { margin: 6px 0 10px; font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.08; }
.legend-hero p:last-child { max-width: 680px; margin: 0; color: var(--muted); line-height: 1.55; }
.legend-section { margin-top: 24px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); }
.legend-section h2 { margin: 0 0 16px; font-size: 1.15rem; }
.legend-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.legend-item { display: flex; gap: 13px; align-items: flex-start; padding: 15px; border-radius: 15px; background: color-mix(in srgb, var(--panel) 82%, var(--line)); }
.legend-item strong { display: block; }
.legend-item p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.4; }
.legend-swatch { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 2px; border-radius: 50%; background: var(--avail-unknown); box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 12%, transparent); }
.legend-swatch--available { background: var(--avail-available); color: var(--avail-available); }
.legend-swatch--limited { background: var(--avail-limited); color: var(--avail-limited); }
.legend-swatch--empty { background: var(--avail-empty); color: var(--avail-empty); }
.legend-swatch--unknown { background: var(--avail-unknown); color: var(--avail-unknown); }
.legend-freshness { display: grid; gap: 10px; }
.legend-freshness__row { display: grid; grid-template-columns: 14px 155px 1fr; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.legend-freshness__row:last-child { border-bottom: 0; }
.legend-freshness__row span:last-child { color: var(--muted); font-size: .9rem; }
.legend-note { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--avail-limited) 10%, var(--panel)); color: var(--muted); font-size: .9rem; line-height: 1.45; }
.legend-confidence { display: flex; flex-wrap: wrap; gap: 8px; }
.legend-confidence span { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .84rem; }
.legend-section--tip li { margin: 8px 0; color: var(--muted); }
@media (max-width: 640px) {
  .legend-page { padding: 16px 14px 40px; }
  .legend-hero, .legend-section { padding: 18px; border-radius: 16px; }
  .legend-grid { grid-template-columns: 1fr; }
  .legend-freshness__row { grid-template-columns: 14px 1fr; }
  .legend-freshness__row span:last-child { grid-column: 2; }
}

/* Editorial legend: compact, high-contrast reading rhythm. */
.legend-view { background: #eef2f1; }
.legend-page { width: min(100%, 1180px); max-width: none; padding: 24px 28px 48px; }
.legend-hero { display: flex; gap: 18px; align-items: center; padding: 22px 26px; border: 0; border-radius: 18px; color: #f5fbf8; background: linear-gradient(135deg, #173d36, #285c50 58%, #337665); box-shadow: 0 12px 28px rgba(25, 67, 56, .14); }
.legend-hero__copy { display: flex; gap: 18px; align-items: flex-start; min-width: 0; }
.legend-hero__mark { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border: 1px solid rgba(255,255,255,.36); border-radius: 50%; font: 700 1.2rem/1 Georgia, serif; }
.legend-hero .eyebrow { margin: 0 0 8px; color: #b9ded1; }
.legend-hero h1 { max-width: 560px; margin: 0 0 8px; font: 700 clamp(1.8rem, 4vw, 2.8rem)/1.03 Georgia, serif; letter-spacing: -.025em; }
.legend-hero p:last-child { color: #d9eee7; font-size: 1rem; }
.legend-map-demo { position: relative; width: 190px; height: 116px; flex: 0 0 190px; overflow: hidden; border: 1px solid rgba(255,255,255,.18); border-radius: 16px; background: linear-gradient(145deg, rgba(7,26,21,.2), rgba(9,42,32,.55)); }
.legend-map-demo::before, .legend-map-demo::after { content: ""; position: absolute; width: 160%; height: 16px; left: -28px; border-top: 2px solid rgba(205,238,225,.17); transform: rotate(-25deg); }
.legend-map-demo::before { top: 34px; } .legend-map-demo::after { top: 76px; transform: rotate(18deg); }
.legend-map-demo__road { position: absolute; width: 240px; height: 30px; top: 45px; left: -20px; border-top: 2px solid rgba(255,255,255,.22); border-bottom: 2px solid rgba(255,255,255,.1); transform: rotate(-12deg); }
.legend-demo-pin { position: absolute; display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid rgba(255,255,255,.86); border-radius: 50%; color: #fff; font: 800 12px/1 system-ui,sans-serif; font-style: normal; box-shadow: 0 4px 12px rgba(0,0,0,.22); }
.legend-demo-pin--green { top: 19px; left: 35px; background: #2ca96d; } .legend-demo-pin--amber { top: 65px; left: 83px; background: var(--avail-limited); } .legend-demo-pin--red { top: 28px; right: 28px; background: #d94e62; } .legend-demo-pin--gray { bottom: 12px; left: 35px; background: #879b95; }
.legend-map-demo__label { position: absolute; right: 10px; bottom: 9px; color: rgba(231,247,240,.68); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.legend-rule { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 12px; align-items: center; margin-top: 10px; padding: 12px 16px; border: 1px solid #d7e4de; border-radius: 14px; background: #f7fbf9; color: #38574c; }
.legend-rule__icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #fff; background: #327b68; font: 700 .7rem/1 system-ui,sans-serif; }
.legend-rule strong, .legend-rule span { display: block; } .legend-rule strong { font-size: .86rem; } .legend-rule div span { margin-top: 3px; color: #73857e; font-size: .75rem; line-height: 1.3; }
.legend-rule__arrow { color: #9ab0a7; font-size: 1.25rem; }
.legend-section { margin-top: 14px; padding: 20px 22px; border: 1px solid #d9e2de; border-radius: 16px; background: rgba(255,255,255,.9); box-shadow: 0 6px 18px rgba(38, 64, 55, .045); }
.legend-section, .legend-section * { color: #20372f !important; }
.legend-section .legend-pin, .legend-section .legend-actions b { color: #fff !important; }
.legend-section .legend-step { color: #1d5b4e !important; }
.legend-section__head { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 12px; }
.legend-section__head h2 { margin: 0; color: #142b22 !important; font: 700 1.35rem/1.1 Georgia, serif; letter-spacing: -.01em; }
.legend-section__head p { margin: 4px 0 0; color: #52675e !important; font-size: .88rem; }
.legend-step { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; color: #1d5b4e; background: #dcefe8; font: 700 .72rem/1 system-ui, sans-serif; }
.legend-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.legend-item { min-height: 68px; align-items: center; border: 1px solid #e0e8e4; background: #f8fbfa; }
.legend-item strong { color: #142b22 !important; font-size: .97rem; }
.legend-item p { margin: 4px 0 0; color: #52675e !important; font-size: .84rem; line-height: 1.4; }
.legend-pin { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; color: #fff; font-weight: 800; box-shadow: 0 5px 10px rgba(30,50,43,.15); }
.legend-pin--available { background: #2ca96d; }
.legend-pin--limited { background: var(--avail-limited); }
.legend-pin--empty { background: #d94e62; }
.legend-pin--unknown { background: #879b95; }
.legend-freshness__row { grid-template-columns: 14px 150px 1fr; padding: 12px 0; }
.legend-freshness__row strong { color: #142b22 !important; }
.legend-freshness__row em { color: #52675e !important; font-size: .85rem; font-style: normal; }
.legend-confidence span { padding: 8px 12px; color: #315448; background: #f2f7f5; border-color: #dce7e2; font-size: .82rem; }
.legend-note { color: #52675e !important; background: #f3f7f5; border-left: 3px solid #73b99c; }
.legend-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.legend-actions span { display: flex; align-items: center; gap: 9px; padding: 12px; border-radius: 12px; color: #29483c !important; background: #f4f8f6; font-size: .87rem; }
.legend-actions b { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; color: #fff; background: #327b68; font-size: .75rem; }
@media (max-width: 640px) {
  .legend-view { background: #eef2f1; }
  .legend-page { padding: 16px 12px 42px; }
  .legend-hero { padding: 22px 20px; }
  .legend-hero, .legend-hero__copy { flex-direction: column; }
  .legend-hero__copy { gap: 12px; }
  .legend-map-demo { width: 100%; height: 92px; flex-basis: 92px; }
  .legend-rule { grid-template-columns: auto 1fr; gap: 10px; }
  .legend-rule__arrow { display: none; }
  .legend-section { padding: 20px 16px; }
  .legend-actions { grid-template-columns: 1fr; }
}

/* Широкая журнальная раскладка легенды на больших экранах. */
@media (min-width: 900px) {
  .legend-page {
    width: min(100%, 1440px);
    padding: 34px 42px 64px;
  }

  .legend-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
    gap: 34px;
    min-height: 218px;
    padding: 30px 36px;
    border-radius: 24px;
  }

  .legend-map-demo {
    width: 100%;
    height: 158px;
  }

  .legend-rule {
    grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
    padding: 16px 20px;
  }

  .legend-section {
    padding: 28px 30px;
    border-radius: 20px;
  }

  .legend-section--colors {
    padding-bottom: 30px;
  }

  .legend-section--freshness,
  .legend-section--actions {
    display: block;
    width: 100%;
  }

  .legend-section--freshness {
    margin-right: 0;
  }

  .legend-section--actions {
    margin-left: 0;
  }

  .legend-section__head {
    margin-bottom: 18px;
  }

  .legend-section__head h2 {
    font-size: 1.5rem;
  }

  .legend-item {
    min-height: 82px;
    padding: 17px 18px;
  }

  .legend-item p {
    max-width: 27ch;
  }

  .legend-actions {
    grid-template-columns: 1fr;
  }

  .legend-actions span {
    min-height: 48px;
  }
}

@media (min-width: 680px) {
  .informers-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .informer-card--hero,
  .informer-card--savings {
    grid-column: 1 / -1;
  }
}

.informer-card {
  position: relative;
  border: 1px solid rgba(148, 255, 189, 0.12);
  border-radius: 16px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(13, 255, 116, 0.07), transparent 55%),
    linear-gradient(180deg, rgba(50, 59, 54, 0.94), rgba(44, 49, 46, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  padding: 18px 20px;
  overflow: hidden;
  transition: border-color 220ms ease, box-shadow 220ms ease;
}

/* ── Легенда карты: компактная кроссбраузерная версия ──
   Намеренно использует обычные цвета и flex/grid без color-mix, фильтров и
   декоративного blur — одинаково читается в Safari, Chrome и Firefox. */
.legend-view {
  overflow: auto;
  background: #eef2f1;
  color: #20372f;
}
.legend-page {
  width: min(100% - 32px, 1120px);
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 0 44px;
}
.legend-hero {
  display: block;
  margin: 0;
  padding: 24px 28px;
  border: 0;
  border-radius: 16px;
  color: #f7fffb;
  background: #205346;
  box-shadow: 0 8px 20px rgba(32, 83, 70, .14);
}
.legend-hero__copy { display: flex; gap: 14px; align-items: flex-start; }
.legend-hero__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
  color: #fff;
  font: 700 18px/1 Georgia, serif;
}
.legend-hero .eyebrow { margin: 0 0 7px; color: #c4e5d9; }
.legend-hero h1 { margin: 0 0 8px; color: #fff; font: 700 clamp(1.55rem, 3vw, 2.25rem)/1.1 Georgia, serif; }
.legend-hero p:last-child { max-width: 660px; margin: 0; color: #d9eee6; font-size: .96rem; line-height: 1.45; }
.legend-section {
  margin-top: 12px;
  padding: 18px 20px;
  border: 1px solid #d8e3de;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(32,55,47,.05);
}
.legend-section, .legend-section * { color: #20372f !important; }
.legend-section .legend-pin, .legend-section .legend-actions b { color: #fff !important; }
.legend-section__head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.legend-step {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 8px;
  color: #205346 !important;
  background: #dcefe8;
  font: 700 13px/1 system-ui, sans-serif;
}
.legend-section__head h2 { margin: 0; color: #152b23 !important; font: 700 1.2rem/1.15 Georgia, serif; }
.legend-section__head p { margin: 3px 0 0; color: #52675e !important; font-size: .85rem; line-height: 1.35; }
.legend-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; }
.legend-item {
  display: flex;
  min-height: 76px;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid #e0e9e4;
  border-radius: 11px;
  background: #f7faf8;
}
.legend-item strong { display: block; color: #152b23 !important; font-size: .9rem; line-height: 1.2; }
.legend-item p { margin: 4px 0 0; color: #52675e !important; font-size: .78rem; line-height: 1.35; }
.legend-pin { display: grid; place-items: center; width: 31px; height: 31px; flex: 0 0 31px; border-radius: 50%; color: #fff; font: 800 14px/1 system-ui, sans-serif; box-shadow: none; }
.legend-pin--available { background: #2fe07f; }
.legend-pin--limited { background: var(--avail-limited); }
.legend-pin--empty { background: #ff5d6c; }
.legend-pin--unknown { background: #8fa6a0; }
.legend-freshness { display: grid; gap: 0; }
.legend-freshness__row { display: grid; grid-template-columns: 12px 150px 1fr; gap: 9px; align-items: center; padding: 9px 0; border-bottom: 1px solid #e4ebe7; }
.legend-freshness__row:last-child { border-bottom: 0; }
.legend-freshness__row strong { color: #152b23 !important; font-size: .88rem; }
.legend-freshness__row em { color: #52675e !important; font-size: .82rem; font-style: normal; }
.legend-note { margin: 12px 0 0; padding: 10px 12px; border-left: 3px solid #70ad93; border-radius: 0 8px 8px 0; color: #52675e !important; background: #f1f6f3; font-size: .8rem; line-height: 1.4; }
.legend-actions { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.legend-actions > span { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 9px 10px; border-radius: 9px; color: #29483c !important; background: #f2f7f4; font-size: .82rem; line-height: 1.25; }
.legend-actions b { display: grid; place-items: center; width: 23px; height: 23px; flex: 0 0 23px; border-radius: 50%; color: #fff !important; background: #327b68; font: 700 12px/1 system-ui, sans-serif; }
.legend-actions > span > span { color: #29483c !important; }
@media (max-width: 760px) {
  .legend-page { width: min(100% - 20px, 560px); padding: 12px 0 28px; }
  .legend-hero { padding: 20px; }
  .legend-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .legend-section { padding: 16px; }
}
@media (max-width: 480px) {
  .legend-page { width: calc(100% - 16px); }
  .legend-hero h1 { font-size: 1.45rem; }
  .legend-grid, .legend-actions { grid-template-columns: 1fr; }
  .legend-item { min-height: 0; }
  .legend-freshness__row { grid-template-columns: 12px 1fr; }
  .legend-freshness__row em { grid-column: 2; }
}

.informer-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(13, 255, 116, 0.45), transparent);
  opacity: 0.7;
}

.informer-card.is-loading,
.informers-grid.is-loading .informer-card {
  opacity: 0.5;
}

.informer-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}

.informer-card__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 9px;
  border: 1px solid rgba(13, 255, 116, 0.22);
  background: radial-gradient(circle at 30% 25%, rgba(13, 255, 116, 0.22), rgba(13, 255, 116, 0.04));
  color: var(--deep);
}

.informer-card__icon .ui-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.informer-card__title {
  margin: 0;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.informer-empty {
  color: var(--muted);
  font-size: 13px;
}

/* ── Топливная ситуация (карточка-герой) ── */
.informer-fuel-list {
  display: grid;
  gap: 8px;
}

@media (min-width: 860px) {
  .informer-card--hero .informer-fuel-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.informer-fuel-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid var(--row-accent, var(--deep));
  background: rgba(255, 255, 255, 0.02);
}

.informer-fuel-row--ai92 { --row-accent: var(--ai92); }
.informer-fuel-row--ai95 { --row-accent: var(--ai95); }
.informer-fuel-row--diesel { --row-accent: var(--diesel); }
.informer-fuel-row--gas { --row-accent: var(--gas); }

.informer-fuel-row--empty {
  opacity: 0.55;
}

.informer-fuel-row__tag {
  font-size: 12px;
  font-weight: 800;
  color: var(--row-accent, var(--ink));
  min-width: 44px;
}

.informer-fuel-row__prices {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex: 1;
  min-width: 130px;
}

.informer-min {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  text-shadow: 0 0 14px rgba(13, 255, 116, 0.3);
}

.informer-min small {
  margin-left: 3px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-shadow: none;
}

.informer-row__muted {
  color: var(--muted);
  font-size: 11.5px;
}

/* ── Общий ряд (используется в списках) ── */
.informer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 255, 189, 0.1);
  border-radius: 12px;
  background: linear-gradient(105deg, rgba(24, 45, 32, 0.88), rgba(10, 22, 15, 0.78));
  font-size: 13px;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.informer-row--button {
  width: 100%;
  border: 1px solid rgba(148, 255, 189, 0.1);
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}

.informer-row--button:hover { border-color: rgba(13, 255, 116, 0.34); background: linear-gradient(105deg, rgba(30, 65, 44, 0.94), rgba(12, 28, 19, 0.88)); }
.informer-row--button:active { transform: scale(.99); }
.informer-row--button:focus-visible { outline: 2px solid var(--deep); outline-offset: -2px; }
.informer-widget-summary { margin: -2px 0 8px; color: var(--muted); font-size: 12px; }
.informer-inline-action { margin-top: 10px; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--deep) 35%, var(--line)); border-radius: 10px; color: var(--deep); background: transparent; cursor: pointer; font: inherit; font-size: 12px; }
.informer-inline-action:hover { background: color-mix(in srgb, var(--deep) 10%, transparent); }
.informer-price--good { color: var(--avail-available); }

.informer-row:first-of-type {
  margin-top: 0;
}

.informer-row--rank {
  align-items: center;
}

.informer-row--rank-first {
  border-color: rgba(13, 255, 116, 0.28);
  background: linear-gradient(105deg, rgba(21, 64, 39, 0.95), rgba(10, 28, 17, 0.86));
}

.informer-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--deep) 16%, transparent);
  color: var(--deep);
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}

.informer-row--rank-first .informer-rank {
  background: var(--deep);
  color: var(--deep-ink);
  box-shadow: 0 0 16px rgba(13, 255, 116, 0.45);
}

.informer-row__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.informer-row__body b {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.informer-row__end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.informer-price {
  display: inline-flex;
  align-items: baseline;
  padding: 4px 7px;
  border-radius: 8px;
  font-weight: 800;
  color: var(--ink);
  font-size: 16px;
  background: rgba(13, 255, 116, 0.08);
  text-shadow: 0 0 14px rgba(13, 255, 116, 0.28);
}

.informer-price small {
  margin-left: 2px;
  font-size: 10px;
  color: var(--muted);
  text-shadow: none;
}

/* ── Чипы (недельная динамика внутри карточки «Топливная ситуация») ── */
.informer-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.informer-chip--up {
  background: color-mix(in srgb, var(--bad) 16%, transparent);
  color: var(--bad);
}

.informer-chip--down {
  background: color-mix(in srgb, var(--good) 16%, transparent);
  color: var(--good);
}

.informer-chip--stable {
  background: color-mix(in srgb, var(--muted) 20%, transparent);
  color: var(--muted);
}

.informer-chip--muted {
  color: var(--muted);
}

/* ── Радар наличия топлива ── */
.informer-overall {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 14px;
  border: 1px solid transparent;
}

.informer-overall__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.informer-overall--calm {
  background: color-mix(in srgb, var(--good) 14%, transparent);
  border-color: color-mix(in srgb, var(--good) 30%, transparent);
  color: var(--good);
}

.informer-overall--possible_disruptions {
  background: color-mix(in srgb, var(--warn) 16%, transparent);
  border-color: color-mix(in srgb, var(--warn) 32%, transparent);
  color: var(--warn);
}

.informer-overall--deficit {
  background: color-mix(in srgb, var(--bad) 14%, transparent);
  border-color: color-mix(in srgb, var(--bad) 30%, transparent);
  color: var(--bad);
}

.informer-overall--low_data {
  background: color-mix(in srgb, var(--muted) 18%, transparent);
  border-color: color-mix(in srgb, var(--muted) 30%, transparent);
  color: var(--muted);
}

.informer-radar-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.informer-radar-row__tag {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--muted);
}

.informer-radar-bar {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.informer-radar-seg {
  height: 100%;
  transition: width 320ms ease;
}

.informer-radar-seg--available { background: var(--avail-available); }
.informer-radar-seg--limited { background: var(--avail-limited); }
.informer-radar-seg--empty { background: var(--avail-empty); }
.informer-radar-seg--unknown { background: var(--avail-unknown); }

.informer-radar-row__counts {
  grid-column: 2 / 3;
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-size: 10.5px;
  font-weight: 700;
}

.informer-radar-count::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 4px;
  background: currentColor;
}

.informer-radar-count--available { color: var(--avail-available); }
.informer-radar-count--limited { color: var(--avail-limited); }
.informer-radar-count--empty { color: var(--avail-empty); }
.informer-radar-count--unknown { color: var(--avail-unknown); }

/* ── Изменение цен за 7 дней ── */
.informer-trend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.informer-trend-row:first-of-type {
  border-top: none;
}

.informer-trend-row__tag {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  min-width: 44px;
}

.informer-trend-row__change {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.informer-trend-row__glyph {
  font-size: 9px;
}

.informer-trend-row__change--up {
  background: color-mix(in srgb, var(--bad) 15%, transparent);
  color: var(--bad);
}

.informer-trend-row__change--down {
  background: color-mix(in srgb, var(--good) 15%, transparent);
  color: var(--good);
}

.informer-trend-row__change--stable {
  background: color-mix(in srgb, var(--muted) 18%, transparent);
  color: var(--muted);
}

/* ── Свежесть данных ── */
.informer-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.informer-stat {
  padding: 14px 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
}

.informer-stat--warn {
  border-color: color-mix(in srgb, var(--warn) 24%, transparent);
  background: color-mix(in srgb, var(--warn) 6%, transparent);
}

.informer-stat__value {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  text-shadow: 0 0 14px rgba(13, 255, 116, 0.22);
}

.informer-stat--warn .informer-stat__value {
  color: var(--warn);
  text-shadow: 0 0 14px rgba(223, 255, 90, 0.24);
}

.informer-stat__label {
  display: block;
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--muted);
}

/* ── Экономия на полном баке ── */
.informer-savings__controls {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.informer-inline-label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.informer-inline-select {
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid rgba(13, 255, 116, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
}

.informer-savings__hero {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 0 4px;
}

.informer-savings__value {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  color: var(--deep);
  text-shadow: 0 0 26px rgba(13, 255, 116, 0.4);
}

.informer-savings__value small {
  margin-left: 4px;
  font-size: 20px;
  opacity: 0.75;
  text-shadow: none;
}

.informer-savings__label {
  font-size: 12.5px;
  color: var(--muted);
}

.informer-savings__sub {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: var(--muted);
}

/* Compact selected station profile: keep the map visible and reduce vertical noise. */
.selected-card {
  width: min(368px, calc(100vw - 20px));
  max-height: calc(100dvh - 20px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
}
.selected-card .station-card { padding: 12px; }
.selected-card .station-head { gap: 8px; }
.selected-card .station-name { max-width: 225px; font-size: 16px; }
.selected-card .station-address { margin-top: 4px; font-size: 11px; }
.selected-card .station-tools { gap: 2px 8px; margin-top: 5px; }
.selected-card .station-tool { min-height: 18px; font-size: 11px; }
.selected-card .fuel-grid { gap: 6px; margin: 8px 0; }
.selected-card .fuel-cell { padding: 8px; }
.selected-card .fuel-cell b { margin-bottom: 4px; font-size: 13px; }
.selected-card .fuel-cell__value { font-size: 18px; }
.selected-card .fuel-cell .fuel-eco { min-height: 19px; padding-inline: 5px; font-size: 10px; }
.selected-card .station-status { margin: 8px 0 0; font-size: 11px; }
.selected-card .actions { gap: 6px; margin-top: 8px; }
.selected-card .actions button { min-height: 36px; padding: 7px 8px; font-size: 13px; }
.selected-card .station-share { margin-top: 8px; padding-top: 7px; }
.selected-card .station-card__close { width: 34px; height: 34px; }

@media (max-width: 679px) {
  .selected-card { width: calc(100vw - 16px); right: max(8px, env(safe-area-inset-right, 0px)); }
  .selected-card .station-card { padding: 11px; }
  .selected-card .station-name { max-width: none; font-size: 15px; }
}

/* Final density pass: less chrome, same essential information and actions. */
.selected-card { width: min(340px, calc(100vw - 20px)); }
.selected-card .station-card { padding: 9px; }
.selected-card .station-head { gap: 6px; }
.selected-card .station-name { max-width: 205px; font-size: 15px; }
.selected-card .station-address { margin-top: 3px; line-height: 1.25; }
.selected-card .station-tools { gap: 1px 6px; margin-top: 3px; }
.selected-card .station-tool { min-height: 16px; font-size: 10px; }
.selected-card .fuel-grid { gap: 5px; margin: 6px 0; }
.selected-card .fuel-cell { padding: 7px; }
.selected-card .fuel-cell b { margin-bottom: 3px; font-size: 12px; }
.selected-card .fuel-cell__value { font-size: 16px; }
.selected-card .fuel-cell .fuel-eco { min-height: 17px; padding-inline: 4px; font-size: 9px; }
.selected-card .station-status { margin-top: 6px; font-size: 10px; }
.selected-card .actions { gap: 5px; margin-top: 6px; }
.selected-card .actions button { min-height: 32px; padding: 5px 6px; font-size: 12px; }
.selected-card .station-share { margin-top: 6px; padding-top: 5px; font-size: 10px; }
.selected-card .station-card__close { width: 31px; height: 31px; }

@media (max-width: 679px) {
  .selected-card { width: calc(100vw - 12px); right: max(6px, env(safe-area-inset-right, 0px)); }
  .selected-card .station-card { padding: 8px; }
  .selected-card .station-name { max-width: none; font-size: 14px; }
  .selected-card .station-card__close { width: 30px; height: 30px; }
}

/* The selected profile is anchored by app.js to the chosen map icon. */
.selected-card {
  top: 0;
  right: auto;
  bottom: auto;
  left: 0;
  transform: none;
  transition: left 120ms ease-out, top 120ms ease-out;
}
.selected-card .station-head { cursor: grab; touch-action: none; }
.selected-card.is-dragging,
.selected-card.is-dragging .station-head { cursor: grabbing; }
.selected-card.is-dragging { user-select: none; transition: none; }
@media (prefers-reduced-motion: reduce) {
  .selected-card { transition: none; }
}

/* Легенда — компактный круг вместо крупной выделенной кнопки. */
.topbar .tab-help {
  width: 44px;
  min-width: 44px;
  flex: 0 0 44px;
  font-size: 12px;
}
.topbar .tab-help::before {
  inset-inline: auto;
  left: 50%;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* Мобильный профиль остаётся в безопасной центральной зоне. На desktop его
   позицию задаёт app.js: справа-сверху от выбранной иконки АЗС. */
.selected-card {
  top: 50%;
  right: max(12px, env(safe-area-inset-right, 0px));
  left: auto;
  bottom: auto;
  transform: translateY(-50%);
}
@media (min-width: 680px) {
  .selected-card {
    top: 0;
    right: auto;
    bottom: auto;
    left: 0;
    transform: none;
  }
}

@media (max-width: 340px) {
  .selected-card { right: max(10px, env(safe-area-inset-right, 0px)); }
}
.selected-card[aria-hidden="true"] {
  pointer-events: none;
}
.selected-card.is-user-positioned {
  right: auto;
  transform: none;
}
.selected-card.is-marker-positioned {
  right: auto;
  transform: none;
}
@media (max-width: 679px) {
  .selected-card {
    width: calc(100vw - 24px);
    right: max(12px, env(safe-area-inset-right, 0px));
  }
}
@media (max-width: 340px) {
  .selected-card {
    width: calc(100vw - 20px);
    right: max(10px, env(safe-area-inset-right, 0px));
  }
}

/* Compact legend: one clear reading path, without decorative overload. */
.legend-view { background: #eef2f1; }
.legend-page { width: min(100% - 32px, 960px); padding: 18px 0 36px; }
.legend-hero { min-height: 0; padding: 20px 24px; border-radius: 16px; box-shadow: 0 8px 20px rgba(25, 67, 56, .1); }
.legend-hero__copy { gap: 14px; }
.legend-hero__mark { width: 34px; height: 34px; flex-basis: 34px; font-size: 1rem; }
.legend-hero h1 { margin-bottom: 6px; font-size: clamp(1.55rem, 3vw, 2.2rem); }
.legend-hero p:last-child { font-size: .9rem; }
.legend-section { margin-top: 10px; padding: 16px 18px; border-radius: 14px; box-shadow: 0 4px 14px rgba(38, 64, 55, .04); }
.legend-section__head { gap: 9px; margin-bottom: 10px; }
.legend-section__head h2 { font-size: 1.1rem; }
.legend-section__head p { margin-top: 3px; font-size: .82rem; }
.legend-step { width: 26px; height: 26px; flex-basis: 26px; border-radius: 8px; }
.legend-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.legend-item { min-height: 0; gap: 9px; padding: 11px 10px; border-radius: 11px; }
.legend-pin { width: 28px; height: 28px; flex-basis: 28px; font-size: .82rem; }
.legend-item strong { font-size: .85rem; line-height: 1.15; }
.legend-item p { margin-top: 3px; font-size: .76rem; line-height: 1.25; }
.legend-freshness { gap: 0; }
.legend-freshness__row { grid-template-columns: 12px 130px 1fr; gap: 8px; padding: 8px 0; }
.legend-freshness__row em { font-size: .78rem; }
.legend-note { margin-top: 10px; padding: 9px 11px; font-size: .78rem; line-height: 1.3; }
.legend-actions { gap: 7px; }
.legend-actions span { padding: 9px 10px; border-radius: 10px; font-size: .8rem; }
.legend-actions b { width: 21px; height: 21px; flex-basis: 21px; font-size: .68rem; }
@media (min-width: 900px) {
  .legend-page { width: min(100% - 48px, 960px); padding: 22px 0 42px; }
  .legend-hero { display: block; min-height: 0; padding: 22px 26px; }
  .legend-section { padding: 18px 20px; }
  .legend-section__head { margin-bottom: 11px; }
  .legend-section__head h2 { font-size: 1.2rem; }
  .legend-item { min-height: 0; padding: 12px; }
  .legend-item p { max-width: none; }
  .legend-actions { grid-template-columns: repeat(3, 1fr); }
  .legend-actions span { min-height: 42px; }
}
@media (max-width: 640px) {
  .legend-page { width: min(100% - 24px, 520px); padding: 12px 0 28px; }
  .legend-hero { padding: 16px; }
  .legend-hero__copy { gap: 10px; }
  .legend-section { padding: 14px; }
  .legend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legend-freshness__row { grid-template-columns: 12px 1fr; }
  .legend-freshness__row em { grid-column: 2; }
}
