/* ============================================================
   Топливный радар — ночной приборный HUD для поиска топлива в ЛНР
   Мобайл-фёрст. Тёмная тактическая карта, статусы-блипы.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* ---- Поверхности: глубокий приборный сине-зелёный ---- */
  --bg:        oklch(0.17 0.018 220);
  --bg-deep:   oklch(0.13 0.018 220);
  --surface:   oklch(0.22 0.020 222);
  --surface-2: oklch(0.27 0.022 222);
  --surface-3: oklch(0.32 0.024 222);
  --hairline:  oklch(0.40 0.020 222 / 0.5);
  --hairline-strong: oklch(0.55 0.030 222 / 0.6);

  /* ---- Текст ---- */
  --ink:       oklch(0.97 0.006 220);
  --ink-soft:  oklch(0.86 0.010 220);
  --muted:     oklch(0.74 0.018 222);   /* ≥4.5:1 на --surface */
  --faint:     oklch(0.62 0.018 222);

  /* ---- Акцент интерфейса (НЕ статус): фирменный топливный жёлтый ---- */
  --accent:        oklch(0.87 0.128 96);
  --accent-strong: oklch(0.81 0.135 95);
  --accent-ink:    oklch(0.22 0.04 80);
  --accent-glow:   oklch(0.87 0.128 96 / 0.34);

  /* ---- Семантика статусов (зарезервированы под смысл) ---- */
  /* «возможно» — янтарь/оранжевый, чтобы не сливаться с фирменным жёлтым */
  --green:  oklch(0.82 0.17 152);
  --green-d:oklch(0.50 0.10 152);
  --yellow: oklch(0.78 0.15 62);
  --yellow-d:oklch(0.52 0.12 55);
  --red:    oklch(0.66 0.20 27);
  --red-d:  oklch(0.45 0.14 27);
  --gray:   oklch(0.64 0.012 222);
  --gray-d: oklch(0.42 0.012 222);

  /* ---- Радиусы / тени ---- */
  --r-sm: 8px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px; --r-pill: 999px;
  --shadow-sheet: 0 -8px 40px oklch(0.08 0.02 220 / 0.6);
  --shadow-pop:   0 8px 30px oklch(0.08 0.02 220 / 0.5);
  --shadow-fab:   0 6px 22px oklch(0.08 0.02 220 / 0.55), 0 0 0 1px var(--hairline);

  /* ---- Z-шкала (семантическая) ---- */
  --z-map: 0;
  --z-overlay: 5;
  --z-chrome: 20;
  --z-fab: 30;
  --z-backdrop: 40;
  --z-sheet: 50;
  --z-toast: 70;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);          /* ease-out-quint */
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

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

html, body {
  margin: 0; height: 100%;
  overscroll-behavior: none;
}
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-deep);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
button { font-family: inherit; color: inherit; cursor: pointer; border: none; background: none; }
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ============================================================
   Каркас
   ============================================================ */
.app { position: fixed; inset: 0; overflow: hidden; }

/* ---- Карта ---- */
#map { position: absolute; inset: 0; z-index: var(--z-map); background: var(--bg-deep); }

/* Тактический дуотон: красим ТОЛЬКО подложку (тайлы),
   блипы-маркеры остаются настоящего цвета. */
ymaps [class*='-ground-pane'] {
  filter: invert(0.92) hue-rotate(176deg) saturate(0.55) brightness(0.96) contrast(0.92) sepia(0.22) hue-rotate(150deg) saturate(1.35);
}
/* Прячем стандартный балун/хинт яндекса — у нас своя карточка */
ymaps [class*='-balloon'], ymaps [class*='-hint'] { display: none !important; }
ymaps [class*='-copyright'] { filter: invert(0.9) hue-rotate(180deg); opacity: 0.5; }

/* Оверлеи поверх карты: виньетка + сетка-«радар». Не ловят клики. */
.map-fx {
  position: absolute; inset: 0; z-index: var(--z-overlay); pointer-events: none;
}
.map-fx::before { /* виньетка */
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(125% 95% at 50% 42%, transparent 55%, oklch(0.10 0.02 220 / 0.55) 100%);
}
.map-fx::after { /* тонкая координатная сетка */
  content: ''; position: absolute; inset: 0; opacity: 0.09;
  background-image:
    linear-gradient(oklch(0.82 0.09 96 / 0.55) 1px, transparent 1px),
    linear-gradient(90deg, oklch(0.82 0.09 96 / 0.55) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(120% 90% at 50% 45%, black 30%, transparent 80%);
}

/* ============================================================
   Маркеры-блипы
   ============================================================ */
.blip {
  position: relative; width: 0; height: 0;
  /* якорь маркера ставится в (0,0); рисуем от центра вверх */
}
.blip__dot {
  position: absolute; left: 50%; top: 50%;
  width: 22px; height: 22px; transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid oklch(0.18 0.02 220 / 0.85);
  box-shadow: 0 2px 6px oklch(0.08 0.02 220 / 0.7);
  display: grid; place-items: center;
  transition: transform 0.18s var(--ease);
}
.blip__ring {
  position: absolute; left: 50%; top: 50%;
  width: 22px; height: 22px; transform: translate(-50%, -50%);
  border-radius: 50%;
}
.blip__label {
  position: absolute; left: 50%; bottom: calc(50% + 16px);
  transform: translateX(-50%);
  font: 600 10px/1 'IBM Plex Mono', monospace;
  letter-spacing: 0.02em;
  padding: 2px 6px; border-radius: var(--r-pill);
  background: oklch(0.16 0.02 220 / 0.92);
  color: var(--ink-soft);
  border: 1px solid var(--hairline);
  white-space: nowrap; backdrop-filter: blur(4px);
}
.blip__plus {
  position: absolute; left: calc(50% + 9px); top: calc(50% - 16px);
  font: 700 9px/1 'IBM Plex Mono', monospace;
  color: var(--accent); background: oklch(0.16 0.02 220 / 0.95);
  border-radius: var(--r-pill); padding: 1px 4px; border: 1px solid var(--hairline);
}
.blip__warn {
  position: absolute; left: calc(50% + 7px); top: calc(50% + 4px);
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--yellow); color: oklch(0.25 0.05 80);
  font: 800 10px/14px 'Inter'; text-align: center;
  border: 1.5px solid oklch(0.16 0.02 220);
}

/* Тоны */
.t-green  .blip__dot { background: var(--green);  }
.t-yellow .blip__dot { background: var(--yellow); }
.t-red    .blip__dot { background: var(--red);    }
.t-gray   .blip__dot { background: var(--gray);   }
.t-green  .blip__ring { box-shadow: 0 0 0 0 var(--green); }
.t-yellow .blip__ring { box-shadow: 0 0 0 0 var(--yellow); }
.t-red    .blip__ring { box-shadow: 0 0 0 0 var(--red); }

/* Пульс «живых» данных: чем свежее, тем заметнее (через --pulse). */
@keyframes radar {
  0%   { box-shadow: 0 0 0 0 currentColor; opacity: var(--pulse, 0.5); }
  70%  { box-shadow: 0 0 0 16px transparent; opacity: 0; }
  100% { box-shadow: 0 0 0 16px transparent; opacity: 0; }
}
.blip.is-live .blip__ring {
  animation: radar 2.4s var(--ease-soft) infinite;
}
.t-green  .blip.is-live .blip__ring,
.blip.is-live.t-green  .blip__ring { color: var(--green); }
.blip.is-live.t-yellow .blip__ring { color: var(--yellow); }
.blip.is-live.t-red    .blip__ring { color: var(--red); }

/* Нет данных: мельче, тише, на фоне — не отвлекает от «живых» точек */
.blip.is-nodata .blip__dot { width: 13px; height: 13px; opacity: 0.62; border-width: 1.5px; }
.blip.is-nodata { z-index: 1 !important; }

.blip.is-active .blip__dot { transform: translate(-50%, -50%) scale(1.35); }
.blip.is-active .blip__dot { box-shadow: 0 0 0 4px var(--accent-glow), 0 2px 8px oklch(0.08 0.02 220 / 0.8); }
.blip.is-closed .blip__dot { opacity: 0.55; border-style: dashed; }

/* ============================================================
   Верхняя панель: бренд + фильтр топлива
   ============================================================ */
.chrome-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: var(--z-chrome);
  padding: calc(var(--safe-t) + 10px) 12px 8px;
  background: linear-gradient(180deg, oklch(0.13 0.02 220 / 0.92) 0%, oklch(0.13 0.02 220 / 0.55) 70%, transparent 100%);
  pointer-events: none;
}
.chrome-top > * { pointer-events: auto; }

.brand {
  display: flex; align-items: center; gap: 9px; margin-bottom: 10px;
  padding: 0 2px;
}
.brand__mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: radial-gradient(circle at 35% 30%, var(--accent), var(--accent-strong));
  display: grid; place-items: center;
  box-shadow: 0 0 16px var(--accent-glow), inset 0 0 0 1px oklch(1 0 0 / 0.15);
}
.brand__mark svg { width: 18px; height: 18px; display: block; }
.brand__name { font-weight: 800; font-size: 16px; letter-spacing: 0.01em; }
.brand__name b { color: var(--accent); font-weight: 800; }
.brand__sub { font-size: 11px; color: var(--muted); margin-top: -2px; }
.brand__live {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
  font: 600 10px/1 'IBM Plex Mono', monospace; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.brand__live .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 8px var(--green); animation: blink 2s var(--ease-soft) infinite;
}
@keyframes blink { 50% { opacity: 0.35; } }

/* Фильтр-чипы */
.filters {
  display: flex; gap: 7px; overflow-x: auto; padding: 2px 2px 4px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 13px; border-radius: var(--r-pill);
  background: oklch(0.24 0.02 222 / 0.8); backdrop-filter: blur(10px);
  border: 1px solid var(--hairline);
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
  white-space: nowrap; transition: background 0.16s, border-color 0.16s, color 0.16s, transform 0.1s;
}
.chip:active { transform: scale(0.95); }
.chip[aria-pressed='true'] {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}
.chip .cnt {
  font: 600 11px/1 'IBM Plex Mono', monospace;
  padding: 2px 5px; border-radius: var(--r-pill);
  background: oklch(0.16 0.02 220 / 0.4);
}
.chip[aria-pressed='true'] .cnt { background: oklch(0.18 0.03 220 / 0.25); color: var(--accent-ink); }

/* Карточки городов — быстрый переход по карте */
.cities {
  display: flex; gap: 7px; overflow-x: auto; padding: 7px 2px 2px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.cities::-webkit-scrollbar { display: none; }
.city-chip {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 12px; border-radius: var(--r-pill);
  background: oklch(0.2 0.02 222 / 0.66); backdrop-filter: blur(10px);
  border: 1px solid var(--hairline); color: var(--ink-soft);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  transition: border-color 0.16s, color 0.16s, background 0.16s, transform 0.1s;
}
.city-chip svg { width: 13px; height: 13px; opacity: 0.7; }
.city-chip:active { transform: scale(0.94); }
.city-chip[aria-pressed='true'] { border-color: var(--accent); color: var(--accent); background: oklch(0.24 0.03 90 / 0.4); }
.city-chip .n { font: 600 10px/1 'IBM Plex Mono', monospace; opacity: 0.65; }

/* ============================================================
   Правые круглые кнопки + легенда
   ============================================================ */
.map-tools {
  position: absolute; right: 12px; z-index: var(--z-chrome);
  bottom: calc(var(--safe-b) + 96px);
  display: flex; flex-direction: column; gap: 10px;
}
.tool {
  width: 46px; height: 46px; border-radius: 14px;
  background: oklch(0.26 0.024 222 / 0.92); backdrop-filter: blur(10px);
  border: 1px solid var(--hairline-strong); color: var(--ink);
  display: grid; place-items: center; box-shadow: var(--shadow-pop);
  transition: transform 0.1s, background 0.16s, color 0.16s;
}
.tool:active { transform: scale(0.92); }
.tool svg { width: 22px; height: 22px; }
.tool.is-on { color: var(--accent); border-color: var(--accent); }
.tool.is-locating svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Легенда статусов */
.legend {
  position: absolute; left: 12px; z-index: var(--z-chrome);
  bottom: calc(var(--safe-b) + 96px);
  background: oklch(0.20 0.02 222 / 0.86); backdrop-filter: blur(12px);
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  padding: 9px 11px; box-shadow: var(--shadow-pop);
  max-width: 46vw;
}
.legend h4 { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 7px; font-weight: 700; }
.legend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.legend li { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-soft); }
.legend .sw { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.legend .sw.green { background: var(--green); }
.legend .sw.yellow { background: var(--yellow); }
.legend .sw.red { background: var(--red); }
.legend .sw.gray { background: var(--gray); }

/* ============================================================
   Список АЗС (правая панель / мобильный ящик)
   ============================================================ */
.stations {
  position: fixed; top: 0; right: 0; z-index: var(--z-sheet);
  width: min(87vw, 360px); height: 100dvh;
  display: flex; flex-direction: column;
  background: oklch(0.19 0.02 222 / 0.94); backdrop-filter: blur(16px);
  border-left: 1px solid var(--hairline-strong);
  box-shadow: -12px 0 40px oklch(0.08 0.02 220 / 0.5);
  transform: translateX(100%); transition: transform 0.36s var(--ease);
  padding-top: var(--safe-t);
}
.stations.is-open { transform: none; }
.stations__head { padding: 14px 14px 10px; border-bottom: 1px solid var(--hairline); flex: none; }
.stations__title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.stations__title .mono { font-size: 12px; color: var(--muted); font-weight: 500; }
.st-add {
  display: none; /* добавлять АЗС может только админ (?admin=1) */
  margin-left: auto; height: 28px; padding: 0 11px; border-radius: var(--r-pill);
  background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700;
  white-space: nowrap;
}
.is-admin .st-add { display: inline-block; }
.st-add:active { transform: scale(0.95); }
.stations__close { margin-left: 8px; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
body:not(.is-admin) .stations__close { margin-left: auto; }
.stations__close svg { width: 17px; height: 17px; }
.stations__search {
  width: 100%; height: 38px; padding: 0 12px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--hairline); color: var(--ink);
  font-family: inherit; font-size: 13px;
}
.stations__search::placeholder { color: var(--faint); }
.stations__search:focus { border-color: var(--accent); outline: none; }
.stations__list { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.stations__list::-webkit-scrollbar { width: 6px; }
.stations__list::-webkit-scrollbar-thumb { background: var(--hairline-strong); border-radius: 6px; }
.stations__empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; }

.st-item {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  width: 100%; text-align: left; padding: 9px 10px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid transparent;
  transition: background 0.14s, border-color 0.14s, transform 0.08s;
}
.st-item:hover { background: var(--surface-3); }
.st-item:active { transform: scale(0.99); }
.st-item.is-active { border-color: var(--accent); background: oklch(0.27 0.03 200 / 0.6); }
.st-item__dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.st-item__dot.t-green { background: var(--green); box-shadow: 0 0 8px var(--green); }
.st-item__dot.t-yellow { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.st-item__dot.t-red { background: var(--red); }
.st-item__dot.t-gray { background: var(--gray); }
.st-item__main { min-width: 0; }
.st-item__name { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-item__area { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 5px; }
.st-item__fuels { display: flex; gap: 4px; }
.ff {
  font: 600 9.5px/1 'IBM Plex Mono', monospace; font-style: normal;
  padding: 3px 5px; border-radius: 5px; border: 1px solid var(--hairline);
  color: var(--faint); background: oklch(0.16 0.02 220 / 0.5);
}
.ff.s-green { color: var(--green); border-color: var(--green-d); background: oklch(0.45 0.1 152 / 0.18); }
.ff.s-yellow { color: var(--yellow); border-color: var(--yellow-d); background: oklch(0.5 0.1 90 / 0.16); }
.ff.s-red { color: var(--red); border-color: var(--red-d); }
.ff.s-gray { opacity: 0.55; }
.st-item__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.st-item__meta .age { font: 500 10.5px/1 'IBM Plex Mono', monospace; color: var(--muted); white-space: nowrap; }
.st-item__meta .age.stale { color: var(--faint); }
.st-item__meta .qd { font: 600 9px/1 'Inter'; text-transform: uppercase; letter-spacing: 0.03em; padding: 2px 5px; border-radius: var(--r-pill); }
.qd.q-large { color: oklch(0.25 0.05 80); background: var(--yellow); }
.qd.q-medium { color: var(--yellow); border: 1px solid var(--yellow-d); }
.qd.q-none { color: var(--green); border: 1px solid var(--green-d); }

.tool.tool--list { position: relative; }
.tool .tool__badge {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink);
  font: 700 10px/18px 'IBM Plex Mono', monospace; text-align: center; border: 2px solid var(--bg-deep);
}

/* ============================================================
   FAB — сообщить о топливе
   ============================================================ */
.fab {
  position: absolute; left: 12px; right: 12px; z-index: var(--z-fab);
  bottom: calc(var(--safe-b) + 14px);
  height: 54px; border-radius: var(--r-pill);
  background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center; gap: 9px;
  font-size: 15.5px; font-weight: 700; letter-spacing: 0.01em;
  box-shadow: 0 8px 28px var(--accent-glow), var(--shadow-fab);
  transition: transform 0.12s var(--ease);
}
.fab:active { transform: translateY(2px) scale(0.99); }
.fab svg { width: 21px; height: 21px; }

/* ============================================================
   Нижний лист (карточка АЗС / форма)
   ============================================================ */
.backdrop {
  position: fixed; inset: 0; z-index: var(--z-backdrop);
  background: oklch(0.08 0.02 220 / 0.55); backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden; transition: opacity 0.25s var(--ease), visibility 0.25s;
}
.backdrop.is-open { opacity: 1; visibility: visible; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sheet);
  background: var(--surface); color: var(--ink);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-sheet);
  border-top: 1px solid var(--hairline-strong);
  transform: translateY(110%);
  transition: transform 0.4s var(--ease);
  max-height: 88dvh; display: flex; flex-direction: column;
  padding-bottom: var(--safe-b);
  touch-action: none;
}
.sheet.is-open { transform: translateY(0); }
.sheet__grip { padding: 9px 0 4px; display: grid; place-items: center; flex: none; cursor: grab; }
.sheet__grip i { width: 38px; height: 4px; border-radius: 4px; background: var(--hairline-strong); display: block; }
.sheet__scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 18px 22px; }
.sheet__scroll::-webkit-scrollbar { width: 0; }

/* ---- Шапка карточки ---- */
.card-head { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 14px; }
.card-head__pin {
  width: 44px; height: 44px; border-radius: 13px; flex: none;
  display: grid; place-items: center; position: relative;
  border: 1px solid var(--hairline);
}
.card-head__pin .core { width: 16px; height: 16px; border-radius: 50%; }
.card-head .name { font-size: 19px; font-weight: 700; line-height: 1.15; }
.card-head .area { font-size: 13px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 5px; }
.card-head .closed-tag {
  display: inline-block; margin-top: 7px; font-size: 11px; font-weight: 600;
  color: var(--red); border: 1px solid var(--red-d); border-radius: var(--r-pill); padding: 2px 9px;
}
.card-head .x {
  margin-left: auto; flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface-2); display: grid; place-items: center; color: var(--muted);
}
.card-head .x svg { width: 18px; height: 18px; }

/* ---- Полоса предупреждения о доверии ---- */
.trust-note {
  display: flex; gap: 9px; align-items: flex-start;
  background: oklch(0.27 0.03 80 / 0.35); border: 1px solid var(--yellow-d);
  border-radius: var(--r-md); padding: 10px 12px; margin-bottom: 14px;
  font-size: 12px; line-height: 1.4; color: var(--ink-soft);
}
.trust-note svg { width: 16px; height: 16px; flex: none; color: var(--yellow); margin-top: 1px; }

/* ---- Очередь как отдельный бейдж риска ---- */
.queue-badge {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
  padding: 11px 13px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--hairline);
}
.queue-badge .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.queue-badge .ico svg { width: 17px; height: 17px; }
.queue-badge .txt b { display: block; font-size: 13.5px; font-weight: 700; }
.queue-badge .txt span { font-size: 11.5px; color: var(--muted); }
.queue-badge.q-none   .ico { background: var(--green-d); color: var(--green); }
.queue-badge.q-medium .ico { background: var(--yellow-d); color: var(--yellow); }
.queue-badge.q-large  .ico { background: var(--red-d); color: var(--red); }
.queue-badge.q-unknown .ico { background: var(--gray-d); color: var(--ink-soft); }

/* ---- Список топлива ---- */
.fuel-list { display: grid; gap: 9px; }
.fuel-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 12px 13px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--hairline);
}
.fuel-row.is-dim { opacity: 0.5; }
.fuel-row__name { font-weight: 700; font-size: 14px; min-width: 44px; }
.fuel-row__name .price { display: block; font: 500 11px/1.2 'IBM Plex Mono', monospace; color: var(--accent); margin-top: 3px; }
.fuel-row__mid { min-width: 0; }
.fuel-row__status { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; }
.fuel-row__status .pill { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.fuel-row__meta { font-size: 11px; color: var(--muted); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 9px; }
.fuel-row__meta .conf b { color: var(--ink-soft); font-weight: 600; }
.fuel-row.s-green  .fuel-row__status { color: var(--green); }  .fuel-row.s-green  .pill { background: var(--green); box-shadow: 0 0 8px var(--green); }
.fuel-row.s-yellow .fuel-row__status { color: var(--yellow); } .fuel-row.s-yellow .pill { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.fuel-row.s-red    .fuel-row__status { color: var(--red); }    .fuel-row.s-red    .pill { background: var(--red); }
.fuel-row.s-gray   .fuel-row__status { color: var(--faint); }  .fuel-row.s-gray   .pill { background: var(--gray); }
.fuel-row.warn-q .fuel-row__status::after {
  content: 'очередь'; font: 700 9px/1 'Inter'; text-transform: uppercase; letter-spacing: 0.05em;
  color: oklch(0.25 0.05 80); background: var(--yellow); padding: 3px 6px; border-radius: var(--r-pill);
}

/* Шкала свежести (как топливный датчик) */
.gauge { width: 52px; height: 6px; border-radius: 3px; background: oklch(0.16 0.02 220 / 0.8); overflow: hidden; position: relative; }
.gauge i { display: block; height: 100%; border-radius: 3px; }
.gauge.g-green i  { background: linear-gradient(90deg, var(--green-d), var(--green)); }
.gauge.g-yellow i { background: linear-gradient(90deg, var(--yellow-d), var(--yellow)); }
.gauge.g-red i    { background: linear-gradient(90deg, var(--red-d), var(--red)); }
.gauge.g-gray i   { background: var(--gray-d); }

/* ---- Комментарии ---- */
.section-h { font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 700; margin: 20px 0 10px; }
.comments { display: grid; gap: 8px; }
.comment {
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: var(--r-md); padding: 10px 12px;
}
.comment p { margin: 0 0 6px; font-size: 13px; line-height: 1.4; color: var(--ink-soft); }
.comment .meta { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--muted); }
.src-tag {
  font: 600 9.5px/1 'Inter'; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 2px 6px; border-radius: var(--r-pill); border: 1px solid var(--hairline);
}
.src-personal  { color: var(--green); border-color: var(--green-d); }
.src-telegram, .src-max { color: var(--accent); border-color: var(--accent-strong); }
.src-other { color: var(--muted); }
.comment .report-link { margin-left: auto; color: var(--faint); font-size: 10.5px; }

/* ---- Кнопка «сообщить обновление» в карточке ---- */
.card-cta {
  margin-top: 20px; width: 100%; height: 50px; border-radius: var(--r-md);
  background: var(--accent); color: var(--accent-ink); font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 18px var(--accent-glow);
}
.card-cta:active { transform: scale(0.99); }
.card-cta svg { width: 19px; height: 19px; }

/* ============================================================
   Форма сообщения
   ============================================================ */
.form-title { font-size: 18px; font-weight: 800; padding-bottom: 4px; }
.form-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.field { margin-bottom: 18px; }
.field > label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 9px; }
.field .req { color: var(--accent); }
.field .opt { color: var(--faint); font-weight: 500; }

/* Сегменты / выбор */
.seg { display: flex; flex-wrap: wrap; gap: 7px; }
.seg button, .multi button {
  flex: 1 1 auto; min-width: fit-content; min-height: 42px; padding: 0 14px;
  border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--hairline);
  font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
  transition: background 0.14s, border-color 0.14s, color 0.14s, transform 0.1s;
}
.seg button:active, .multi button:active { transform: scale(0.97); }
.seg button[aria-pressed='true'] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.seg.tone-green  button[aria-pressed='true'] { background: var(--green);  color: oklch(0.2 0.05 152); border-color: var(--green); }
.seg.tone-red    button[aria-pressed='true'] { background: var(--red);    color: oklch(0.98 0.02 27); border-color: var(--red); }
.seg.tone-gray   button[aria-pressed='true'] { background: var(--gray);   color: oklch(0.2 0 0); border-color: var(--gray); }
.multi button[aria-pressed='true'] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* select станции */
.station-select {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--hairline); color: var(--ink);
  font-size: 14px; font-weight: 600; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%237aa' stroke-width='2'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}

input.text, textarea.text {
  width: 100%; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--hairline); color: var(--ink);
  font-family: inherit; font-size: 14px; resize: none;
}
input.text::placeholder, textarea.text::placeholder { color: var(--faint); }
input.text:focus, textarea.text:focus, .station-select:focus { border-color: var(--accent); outline: none; }
.char-count { text-align: right; font: 500 11px/1 'IBM Plex Mono', monospace; color: var(--faint); margin-top: 6px; }
.char-count.over { color: var(--red); }
.price-wrap { position: relative; }
.price-wrap .cur { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }

.form-foot {
  position: sticky; bottom: 0; margin-top: 14px;
  padding: 14px 0 calc(4px + var(--safe-b));
  background: linear-gradient(180deg, transparent 0%, var(--surface) 32%);
}
.form-submit {
  width: 100%; height: 52px; border-radius: var(--r-md);
  background: var(--accent); color: var(--accent-ink); font-size: 15.5px; font-weight: 700;
  box-shadow: 0 4px 18px var(--accent-glow);
}
.form-submit:disabled { opacity: 0.45; box-shadow: none; }
.form-submit:not(:disabled):active { transform: scale(0.99); }

/* ============================================================
   Тост
   ============================================================ */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-b) + 80px); z-index: var(--z-toast);
  transform: translate(-50%, 24px); opacity: 0; pointer-events: none;
  background: var(--green); color: oklch(0.18 0.05 152);
  font-size: 13.5px; font-weight: 700; padding: 12px 18px; border-radius: var(--r-pill);
  box-shadow: var(--shadow-pop); display: flex; align-items: center; gap: 8px;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  max-width: 90vw;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 18px; height: 18px; }

/* ============================================================
   Прелоадер
   ============================================================ */
.boot {
  position: fixed; inset: 0; z-index: 90; background: var(--bg-deep);
  display: grid; place-items: center; transition: opacity 0.5s var(--ease);
}
.boot.is-gone { opacity: 0; pointer-events: none; }
.boot__r { width: 78px; height: 78px; position: relative; }
.boot__r::before, .boot__r::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--accent); opacity: 0; animation: sweep 1.8s var(--ease-soft) infinite;
}
.boot__r::after { animation-delay: 0.9s; }
@keyframes sweep { 0% { transform: scale(0.2); opacity: 0.8; } 100% { transform: scale(1); opacity: 0; } }
.boot__dot { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 16px var(--accent); }
.boot__t { position: absolute; bottom: 28%; left: 0; right: 0; text-align: center; color: var(--muted); font: 600 12px/1 'IBM Plex Mono', monospace; letter-spacing: 0.1em; text-transform: uppercase; }

/* ============================================================
   Геолокация · прицел · добавление АЗС
   ============================================================ */
/* «Вы здесь» */
.you-blip { position: relative; width: 0; height: 0; }
.you-blip__dot { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--accent); border: 3px solid var(--bg-deep); box-shadow: 0 0 12px var(--accent); }
.you-blip__pulse { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; transform: translate(-50%, -50%); border-radius: 50%; animation: youpulse 2.2s var(--ease-soft) infinite; }
@keyframes youpulse { 0% { box-shadow: 0 0 0 0 var(--accent-glow); opacity: 0.75; } 70% { box-shadow: 0 0 0 18px transparent; opacity: 0; } 100% { opacity: 0; } }

/* Прицел постановки новой АЗС (центр карты) */
.crosshair {
  position: absolute; top: 50%; left: 50%; width: 72px; height: 72px;
  transform: translate(-50%, -50%); z-index: 8; color: var(--accent);
  pointer-events: none; opacity: 0; transition: opacity 0.2s var(--ease);
  filter: drop-shadow(0 1px 4px oklch(0.1 0.02 220 / 0.7));
}
.crosshair.is-open { opacity: 1; }
.crosshair svg { width: 100%; height: 100%; }

/* Панель добавления (карта остаётся подвижной — без бэкдропа) */
.add-bar {
  position: absolute; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 14px);
  z-index: var(--z-backdrop); background: var(--surface);
  border: 1px solid var(--hairline-strong); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sheet); padding: 14px;
  transform: translateY(150%); opacity: 0; visibility: hidden;
  transition: transform 0.35s var(--ease), opacity 0.25s;
}
.add-bar.is-open { transform: none; opacity: 1; visibility: visible; }
.add-bar__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 11px; }
.add-bar__head strong { font-size: 15px; }
.add-bar__hint { font-size: 11.5px; color: var(--muted); }
.add-bar__fields { display: flex; gap: 8px; margin-bottom: 10px; }
.add-bar__fields .text { flex: 1 1 58%; min-width: 0; }
.add-bar__fields .station-select { flex: 1 1 42%; min-width: 0; min-height: 46px; }
.add-bar__actions { display: flex; gap: 8px; }
.add-bar__cancel { flex: 0 0 auto; padding: 0 16px; height: 46px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--hairline); color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.add-bar__confirm { flex: 1 1 auto; height: 46px; border-radius: var(--r-md); background: var(--accent); color: var(--accent-ink); font-size: 14.5px; font-weight: 700; }
.add-bar__cancel:active, .add-bar__confirm:active { transform: scale(0.98); }
.adding .fab { display: none; }

/* Расстояние и метка «моя» в списке */
.st-item__meta .dist { color: var(--accent); font-size: 11px; font-weight: 600; }
.st-item__tag { font-style: normal; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent-ink); background: var(--accent); padding: 1px 5px; border-radius: var(--r-pill); margin-left: 4px; vertical-align: middle; }

/* Удалить мою АЗС */
.card-remove { display: block; width: 100%; margin-top: 10px; height: 42px; border-radius: var(--r-md); background: transparent; border: 1px solid var(--red-d); color: var(--red); font-size: 13px; font-weight: 600; }
.card-remove:active { background: oklch(0.45 0.14 27 / 0.15); }

/* ============================================================
   Планшет / десктоп
   ============================================================ */
@media (min-width: 720px) {
  .chrome-top { padding: 16px; right: 348px; }
  .filters { max-width: 560px; }
  .fab { left: auto; right: 364px; width: 280px; bottom: 16px; }
  .add-bar { left: auto; right: 364px; width: 340px; }
  .map-tools { bottom: 84px; right: 364px; }
  .legend { bottom: 16px; max-width: 220px; }
  .sheet { left: auto; right: 364px; width: 420px; transform: translateY(110%); border-radius: var(--r-xl); bottom: 16px; max-height: 84dvh; border: 1px solid var(--hairline-strong); }
  .sheet.is-open { transform: translateY(0); }
  /* Док-панель списка: всегда видна, не перекрывает карту полностью */
  .stations { transform: none; width: 332px; box-shadow: -1px 0 0 var(--hairline-strong); }
  .stations__close { display: none; }
  #listTool { display: none; }
  .backdrop.for-list { display: none; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.08s !important; }
  .blip.is-live .blip__ring { animation: none; box-shadow: 0 0 0 3px color-mix(in oklch, currentColor 35%, transparent); }
}
