:root {
  --green: #1b8a3a;
  --green-dk: #136d2d;
  --green-soft: #e6f4ea;
  --warn: #e0a800;
  --warn-soft: #fdf3d6;
  --red: #d83b3b;
  --red-soft: #fbe4e4;
  --none: #9aa0a6;
  --cond: #2f7fe0;
  --bg: #f4f5f7;
  --card: #ffffff;
  --surface: #ffffff;
  --field: #ffffff;
  --field-2: #eef0f3;
  --text: #1c2430;
  --muted: #6b7280;
  --border: #e4e7eb;
  --shadow: 0 8px 30px rgba(15, 22, 34, 0.16);
  --radius: 14px;
}

/* Ночная тема — спокойные тёмные поверхности, статусы остаются яркими */
body.theme-dark {
  --green: #2fae54;
  --green-dk: #7fe0a0;
  --green-soft: #16331f;
  --warn: #f0bf3a;
  --warn-soft: #36300f;
  --red: #ef5757;
  --red-soft: #3a1c1c;
  --none: #8a93a3;
  --cond: #5b9bf0;
  --bg: #0f1622;
  --card: #182233;
  --surface: #182233;
  --field: #202c40;
  --field-2: #243149;
  --text: #e7ecf3;
  --muted: #9aa6b8;
  --border: #2a3850;
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}

body { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }

button { font-family: inherit; }

/* ---------- Шапка ---------- */
.topbar {
  flex: 0 0 auto;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: env(safe-area-inset-top) 10px 8px;
  z-index: 1000;
}
.topbar-row { display: flex; align-items: center; gap: 8px; padding-top: 8px; }
.brand { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.brand-logo { font-size: 24px; }
.brand-text strong { font-size: 16px; display: block; line-height: 1.05; }
.brand-text small { color: var(--muted); font-size: 11px; }

.city-search { flex: 1 1 auto; display: flex; min-width: 0; }
.city-search input {
  flex: 1 1 auto; min-width: 0;
  border: 1.5px solid var(--border); border-right: none;
  border-radius: 10px 0 0 10px;
  padding: 9px 11px; font-size: 14px; outline: none;
  background: var(--field); color: var(--text);
}
.city-search input::placeholder { color: var(--muted); }
.city-search input:focus { border-color: var(--green); }
.city-search button {
  flex: 0 0 auto;
  border: 1.5px solid var(--border); border-left: none;
  background: var(--field); border-radius: 0 10px 10px 0;
  padding: 0 12px; font-size: 16px; cursor: pointer; color: var(--text);
}
.icon-btn {
  flex: 0 0 auto;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--field);
  font-size: 17px; cursor: pointer; color: var(--green-dk);
  transition: transform .12s, background .15s;
}
.icon-btn:active { transform: scale(.92); }
/* Кнопка «Расскажи» — плавающая в нижнем левом углу */
.share-fab {
  position: fixed; left: 14px;
  bottom: calc(74px + env(safe-area-inset-bottom));
  z-index: 900;
  display: inline-flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 15px; border: none; border-radius: 22px;
  background: var(--green); color: #fff; font-size: 14px; font-weight: 700;
  box-shadow: 0 4px 14px rgba(27,138,58,.42); cursor: pointer;
  animation: nudge 2.8s ease-in-out 1.4s 3;
}
.share-fab:active { transform: scale(.96); }
@keyframes nudge { 0%,86%,100%{ transform: rotate(0); } 90%{ transform: rotate(-9deg); } 94%{ transform: rotate(9deg); } 97%{ transform: rotate(-4deg); } }

/* Лист «Расскажите друзьям» */
.share-actions { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.share-qr { display: flex; align-items: center; gap: 14px; margin: 14px 0; padding: 12px;
  background: var(--field-2); border-radius: 14px; }
.share-qr img { width: 116px; height: 116px; flex: 0 0 auto; border-radius: 10px; background: #fff; padding: 6px; }
.share-qr-cap b { display: block; font-size: 14px; }
.share-qr-cap span { display: block; margin-top: 4px; font-size: 13px; color: var(--green-dk); font-weight: 700; }
.share-msg-label { font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
.share-msg { white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.5;
  background: var(--field-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; margin: 0 0 8px; font-family: inherit; color: var(--text); }
.share-sheet a.btn { display: block; text-align: center; text-decoration: none; }

.chips-row {
  display: flex; align-items: center; gap: 6px;
  margin-top: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
}
.chips-row::-webkit-scrollbar { display: none; }
.chips-label { font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--border); background: var(--field); color: var(--text);
  border-radius: 999px; padding: 6px 13px; font-size: 13px; cursor: pointer;
  transition: all .12s; white-space: nowrap;
}
.chip:active { transform: scale(.95); }
.chip.active { background: var(--green); border-color: var(--green); color: #fff; }
.chip.city-chip.active { background: var(--green-dk); border-color: var(--green-dk); }

/* ---------- Карта ---------- */
#map { flex: 1 1 auto; width: 100%; z-index: 1; }

/* Маркеры */
.marker-pin {
  width: 100%; height: 100%; border-radius: 50%;
  border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4);
  display: grid; place-items: center;
  color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
}
.m-yes  { background: var(--green); }
.m-cond { background: var(--cond); }
.m-warn { background: var(--warn); }
.m-no   { background: var(--red); }
.m-none { background: var(--none); }
.marker-pin.confident { box-shadow: 0 0 0 3px rgba(27,138,58,.35), 0 1px 4px rgba(0,0,0,.4); }
.marker-pin.contested { opacity: .85; }

.marker-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; }

/* Круглый бренд-значок (моно-логотип, фирменный цвет) — виден на близком зуме
   вместо точки. Компактный, как точка: лаг DOM-маркера на нём незаметен. */
.brand-badge {
  display: none; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; overflow: hidden;
  font-size: 12px; font-weight: 800; line-height: 1; letter-spacing: -.3px;
  white-space: nowrap; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.45);
}
body.show-fuels .marker-pin { display: none; }
body.show-fuels .brand-badge { display: inline-flex; }
/* Во время ЛЮБОГО движения (пан/зум) прячем DOM-маркеры целиком — их заменяют
   нативные GL-кружки (move-points/move-clusters), которые не «плавают». */
body.moving .maplibregl-marker { visibility: hidden; }
/* Во время зума: только компактные точки, без «плавающих» бейджей и подписей. */
body.zooming .brand-badge { display: none !important; }
body.zooming .marker-pin { display: grid !important; }
.brand-badge-logo { background: #fff !important; }
.badge-logo-img { width: 26px; height: 26px; display: block; object-fit: contain; }
.brand-badge.bk-yes  { box-shadow: 0 0 0 2.5px var(--green), 0 1px 4px rgba(0,0,0,.45); }
.brand-badge.bk-cond { box-shadow: 0 0 0 2.5px var(--cond),  0 1px 4px rgba(0,0,0,.45); }
.brand-badge.bk-warn { box-shadow: 0 0 0 2.5px var(--warn),  0 1px 4px rgba(0,0,0,.45); }
.brand-badge.bk-no   { box-shadow: 0 0 0 2.5px var(--red),   0 1px 4px rgba(0,0,0,.45); }
.brand-badge.bk-none { box-shadow: 0 0 0 2.5px var(--none),  0 1px 4px rgba(0,0,0,.45); }

/* Подпись «какое топливо есть» у маркера — видна на близком зуме (body.show-fuels) */
.marker-fuels {
  position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  display: none; gap: 2px; white-space: nowrap; pointer-events: none;
}
body.show-fuels .marker-fuels { display: flex; }
body.zooming .marker-fuels { display: none !important; }
body.zooming .cheap-flag { display: none !important; }
.mf {
  font-size: 10px; font-weight: 800; line-height: 1; padding: 2px 4px;
  border-radius: 5px; color: #fff; border: 1px solid rgba(255,255,255,.65);
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.mf-yes  { background: var(--green); }
.mf-cond { background: var(--cond); }
.mf-warn { background: var(--warn); color: #5a4700; }

/* Кластеры */
.cl { border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 700; border: 3px solid rgba(255,255,255,.85);
  box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.cl-yes { background: rgba(27,138,58,.92); }
.cl-cond { background: rgba(47,127,224,.92); }
.cl-warn { background: rgba(224,168,0,.92); }
.cl-no { background: rgba(216,59,59,.92); }
.cl-none { background: rgba(122,128,134,.92); }

/* ---------- Плавающие элементы ---------- */
.fab-group {
  position: fixed; right: 14px;
  bottom: calc(74px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px; z-index: 900;
}
.fab {
  width: 48px; height: 48px; border-radius: 50%; border: none;
  background: var(--card); box-shadow: var(--shadow); font-size: 21px;
  cursor: pointer; display: grid; place-items: center;
}

.refuel-bar {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  height: 54px; border: none; border-radius: 14px;
  background: var(--green); color: #fff;
  font-size: 17px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 20px rgba(27,138,58,.45);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  z-index: 900;
}
.refuel-bar:active { transform: scale(.99); }
.refuel-ic { font-size: 20px; }

.legend {
  /* Разнесли: «Расскажи» — внизу слева, легенда — внизу справа над кнопками 📋📍.
     Правое выравнивание, чтобы раскрытая панель не уходила за край экрана. */
  position: fixed; right: 14px; left: auto;
  bottom: calc(190px + env(safe-area-inset-bottom));
  z-index: 900;
  display: flex; flex-direction: column; align-items: flex-end;
}
.legend-toggle {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
  font-size: 15px; cursor: pointer; display: none;
}
.legend-body {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 7px 10px;
  font-size: 11.5px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px;
}
.legend.collapsed .legend-body { display: none; }
.legend.collapsed .legend-toggle { display: grid; place-items: center; }
.legend span { display: flex; align-items: center; gap: 6px; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot-yes { background: var(--green); }
.dot-cond { background: var(--cond); }
.dot-warn { background: var(--warn); }
.dot-no { background: var(--red); }
.dot-none { background: var(--none); }

/* ---------- Сворачивание шапки и легенды (с запоминанием) ---------- */
.topbar.collapsed .chips-row { display: none; }
.topbar.collapsed { padding-bottom: 4px; }
#btn-hdr { transition: transform .15s; }
.topbar.collapsed #btn-hdr { transform: rotate(-90deg); }

.legend-body { position: relative; padding-top: 18px; }
.legend-x {
  position: absolute; top: 3px; right: 5px;
  width: 18px; height: 18px; padding: 0; border: none; background: transparent;
  color: var(--muted); font-size: 12px; line-height: 1; cursor: pointer;
}

/* ---------- Плашка безопасности ---------- */
.safety {
  position: fixed; left: 12px; right: 12px;
  top: calc(env(safe-area-inset-top) + 8px);
  background: #1c2430; color: #fff; border-radius: 10px;
  padding: 9px 34px 9px 12px; font-size: 13px; z-index: 1700;
  box-shadow: var(--shadow);
}
.safety button {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; color: #fff; font-size: 14px; cursor: pointer;
}

/* ---------- Нижний лист ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1500; animation: fadeIn .18s ease; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--card); color: var(--text);
  border-radius: 20px 20px 0 0; box-shadow: var(--shadow);
  z-index: 1600; max-height: 88dvh; overflow-y: auto;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  animation: slideUp .26s cubic-bezier(.22,1,.36,1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet-handle { width: 40px; height: 4px; background: #d4d7dc; border-radius: 3px; margin: 6px auto 4px; }
.sheet-close {
  position: absolute; top: 10px; right: 12px; border: none; background: var(--field-2);
  width: 32px; height: 32px; border-radius: 50%; font-size: 14px; cursor: pointer; color: var(--muted);
}
.sheet-body { padding-top: 4px; }

/* ---------- Лайтбокс фото (фото табло) ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 2500;
  background: rgba(0,0,0,.9);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; animation: fadeIn .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.lightbox-inner {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  max-width: 100%; max-height: 100%;
}
.lightbox-img {
  max-width: 100%; max-height: 80dvh; object-fit: contain;
  border-radius: 10px; box-shadow: 0 8px 40px rgba(0,0,0,.6); background: #fff;
}
.lightbox-cap { color: #fff; font-size: 14px; text-align: center; opacity: .95; }
.lightbox-hint { color: rgba(255,255,255,.6); font-size: 12px; text-align: center; }
.lightbox-err { color: #fff; padding: 40px; font-size: 15px; text-align: center; }
.lightbox-close {
  position: fixed; top: max(14px, env(safe-area-inset-top)); right: 16px; z-index: 2600;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.16); color: #fff; border: none;
  font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }

/* ---------- Карточка АЗС ---------- */
.st-name { font-size: 19px; font-weight: 700; margin: 2px 0; padding-right: 28px; }
.st-brand { color: var(--muted); font-size: 13px; }
.st-addr { color: var(--muted); font-size: 13px; margin-top: 4px; }

.freshline { font-size: 12px; color: var(--muted); margin: 4px 0 8px; }
.freshline .stale { color: #b06a00; }
.st-meta { font-size: 13px; color: var(--muted); margin: 6px 0; line-height: 1.5; }

/* Статус ПО КАЖДОМУ топливу (информация, не кнопки) */
.fuel-state { margin: 10px 0 6px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.fs-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-bottom: 1px solid var(--border);
}
.fs-row:last-child { border-bottom: none; }
.fs-name { font-weight: 700; font-size: 14px; }
.fs-val { font-size: 13px; font-weight: 600; text-align: right; }
.fs-yes { color: var(--green-dk); }
.fs-warn { color: var(--warn); }
.fs-no { color: var(--red); }
.fs-stale, .fs-none { color: var(--muted); }

/* ===== Цены ===== */
.price-title { display: flex; align-items: center; justify-content: space-between; }
.price-add-link {
  border: none; background: transparent; color: var(--green-dk); font-weight: 700;
  font-size: 13px; cursor: pointer; padding: 0;
}
.price-block { margin: 6px 0 8px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.price-row {
  display: grid; grid-template-columns: 1fr auto auto; align-items: baseline; gap: 10px;
  padding: 9px 12px; border-bottom: 1px solid var(--border);
}
.price-row:last-child { border-bottom: none; }
.price-fuel { font-weight: 700; font-size: 14px; }
.price-val { font-size: 17px; font-weight: 800; color: var(--green-dk); white-space: nowrap; }
.price-age { font-size: 11.5px; color: var(--muted); white-space: nowrap; min-width: 64px; text-align: right; }
.price-row.price-old .price-val { color: var(--muted); }
.price-empty {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; font-size: 13.5px; color: var(--muted);
}

/* форма ввода цен */
.price-form { margin: 8px 0 4px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.price-input-row {
  display: grid; grid-template-columns: 1fr 110px auto; align-items: center; gap: 10px;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.price-input-row:last-child { border-bottom: none; }
.price-input-label { font-weight: 700; font-size: 14px; }
.price-input {
  width: 100%; padding: 9px 10px; font-size: 16px; font-weight: 700; text-align: right;
  border: 1.5px solid var(--border); border-radius: 9px; background: var(--field);
  color: var(--text); -moz-appearance: textfield;
}
.price-input:focus { outline: none; border-color: var(--green); }
.price-unit { font-size: 13px; color: var(--muted); }
.price-disclaimer { font-size: 11.5px; line-height: 1.4; color: var(--muted); margin: 4px 2px 8px; }
.price-photo-status { font-size: 12.5px; color: var(--green-dk); margin: 6px 2px; line-height: 1.4; }
.price-photo-thumb { width: 100%; max-height: 200px; object-fit: contain; border-radius: 10px;
  border: 1px solid var(--border); margin: 4px 0 8px; background: var(--field-2); }
.price-photo-link { display: inline-block; font-size: 12.5px; color: var(--green-dk);
  font-weight: 600; margin: 2px 2px 6px; }
.queue-badge {
  margin: 8px 0; padding: 9px 12px; border-radius: 10px;
  background: var(--warn-soft); border: 1px solid var(--warn);
  font-size: 13.5px; font-weight: 600; color: var(--text);
}
.queue-badge.q-ok { background: var(--green-soft); border-color: var(--green); color: var(--green-dk); }

/* Условия продажи: заметный бейдж на карточке + индикатор на маркере/в списке */
.cond-badge {
  margin: 8px 0; padding: 9px 12px; border-radius: 10px;
  background: var(--warn-soft); border: 1px solid var(--warn);
  font-size: 13px; line-height: 1.4; color: var(--text);
}
.cond-badge b { color: var(--warn); }
.cond-tag { font-size: 12px; }

/* Прокручиваемая лента всех комментариев */
.comments-list {
  max-height: 62vh; overflow-y: auto; margin: 8px 0 12px;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.cmt { padding: 9px 12px; background: var(--field-2); border-radius: 12px; margin-bottom: 8px; }
.cmt-text { font-size: 14px; line-height: 1.45; color: var(--text); word-break: break-word; }
.cmt-time { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* Подсветка слова, заменённого фильтром мата на смешной эвфемизм */
.censored-word {
  font-style: italic; color: var(--green-dk);
  background: var(--green-soft); border-radius: 6px; padding: 0 5px;
  text-decoration: underline dotted; cursor: help;
}

/* Быстрый выбор топлива на карточке + чипы очереди/ожидания */
.fuel-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 8px 0 4px; }
.pick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.fp-chip, .pick-row .chip { flex: 0 0 auto; }
.fp-chip { padding: 9px 15px; font-size: 14px; font-weight: 600; }

/* Быстрые кнопки «в один тап» */
.quick-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 12px 0 6px; }
.quick-btn {
  border: none; border-radius: 12px; padding: 14px 6px; font-size: 15px; font-weight: 700;
  cursor: pointer; color: #fff;
}
.q-yes { background: var(--green); }
.q-warn { background: var(--warn); color: #5a4700; }
.q-no { background: var(--red); }
.quick-btn { transition: transform .1s; }
.quick-btn:active { transform: scale(.96); }

/* Подтвердить / оспорить */
.vote-row { display: flex; gap: 8px; margin: 8px 0; }
.vote-btn {
  flex: 1 1 0; border-radius: 11px; padding: 12px; font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--field); color: var(--text);
  transition: transform .1s;
}
.vote-btn:active { transform: scale(.97); }
.vote-yes { color: var(--green-dk); background: var(--green-soft); border-color: transparent; }
.vote-no { color: var(--red); background: var(--red-soft); border-color: transparent; }
.vote-btn b { font-weight: 800; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; border: none; border-radius: 12px; padding: 13px;
  font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 8px;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-secondary { background: var(--field-2); color: var(--text); }
.btn-ghost { background: transparent; color: var(--green-dk); border: 1px solid var(--green); }
.btn:active { transform: scale(.99); }
.btn:disabled { opacity: .55; cursor: default; }

.route-row { display: flex; gap: 8px; }
.section-title { font-weight: 700; font-size: 15px; margin: 16px 0 8px; }
.collapse-link {
  display: inline-block; margin-top: 8px; color: var(--green-dk);
  font-size: 14px; font-weight: 600; cursor: pointer; background: none; border: none;
}
.extra-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }

/* ---------- Форма уточнения ---------- */
.form-group { margin: 14px 0; }
.form-group > label.lbl { font-size: 13px; color: var(--muted); display: block; margin-bottom: 7px; }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt {
  border: 1.5px solid var(--border); border-radius: 10px; padding: 11px;
  text-align: center; cursor: pointer; font-size: 14px; font-weight: 600; user-select: none;
  background: var(--field); color: var(--text); transition: all .12s;
}
.opt input { display: none; }
.opt.sel-fuel { border-color: var(--green); background: var(--green-soft); color: var(--green-dk); }
input[type="number"], textarea {
  width: 100%; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 11px; font-size: 15px; font-family: inherit; resize: vertical;
  background: var(--field); color: var(--text);
}
input[type="number"]::placeholder, textarea::placeholder { color: var(--muted); }
input[type="number"]:focus, textarea:focus { outline: none; border-color: var(--green); }
textarea { min-height: 56px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.4; }

/* ---------- Список «рядом» ---------- */
.near-sort {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 8px 0 6px; padding-bottom: 2px;
}
.near-sort::-webkit-scrollbar { display: none; }
.sort-chip { flex: 0 0 auto; }
.near-item {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 4px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.near-item:last-child { border-bottom: none; }
.near-dot { width: 13px; height: 13px; border-radius: 50%; flex: 0 0 auto; }
.near-info { flex: 1 1 auto; min-width: 0; }
.near-info .n { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.near-info .s { font-size: 12px; color: var(--muted); }
.near-info .near-addr {
  font-size: 11.5px; color: var(--muted); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.near-fav {
  flex: 0 0 auto; background: none; border: none; font-size: 18px;
  cursor: pointer; color: var(--none); padding: 2px 4px; line-height: 1;
}
.near-fav.on { color: var(--warn); }
.near-dist { font-size: 13px; color: var(--muted); white-space: nowrap; }
.rf-badge { flex: 0 0 auto; width: 22px; text-align: center; font-size: 15px; }
.near-info .s.rf-yes { color: var(--green-dk); font-weight: 600; }
.near-info .s.rf-warn { color: var(--warn); font-weight: 600; }
.refuel-list { margin-top: 4px; }
.near-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: 0 0 auto; }
.near-price { font-size: 15px; font-weight: 800; color: var(--green-dk); white-space: nowrap; }
.near-price-sm { font-size: 12.5px; font-weight: 700; }
.near-price-none { color: var(--muted); font-weight: 600; font-size: 12px; }
.near-pricefuel {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 0 8px;
}
.near-pricefuel::-webkit-scrollbar { display: none; }
.pf-chip { flex: 0 0 auto; }

/* Самая выгодная АЗС на карте — золотой флажок + золотое кольцо */
.cheap-flag {
  position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%);
  background: linear-gradient(180deg, #ffd34d, #f5a623); color: #4a2e00;
  font-size: 11px; font-weight: 800; line-height: 1; white-space: nowrap;
  padding: 3px 7px; border-radius: 8px; border: 1.5px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.4); pointer-events: none; z-index: 2;
}
.marker-wrap.cheapest .brand-badge { box-shadow: 0 0 0 3px #f5a623, 0 1px 5px rgba(0,0,0,.5); }
.marker-wrap.cheapest .marker-pin { box-shadow: 0 0 0 3px #f5a623, 0 1px 4px rgba(0,0,0,.45); }

/* Строка «в избранное» на карточке */
.fav-line {
  display: inline-block; background: none; border: none; cursor: pointer;
  color: var(--green-dk); font-size: 14px; font-weight: 600; padding: 4px 0; margin: 2px 0 4px;
}

/* Тумблер «по талонам» в форме (использует стиль .opt) */
.vouchers-toggle { display: block; }

/* Бейдж-геймификация в «О сервисе» */
.contrib-line { font-size: 14px; font-weight: 700; color: var(--green-dk); margin: 8px 0; }

/* Антимошенническое предупреждение */
.antifraud {
  background: var(--warn-soft); border: 1px solid var(--warn);
  border-radius: 12px; padding: 11px 13px; margin: 12px 0;
}
.antifraud > b { display: block; color: var(--warn); font-size: 15px; margin-bottom: 4px; }
.antifraud p { font-size: 13px; line-height: 1.5; margin: 6px 0 0; color: var(--text); }
.antifraud p b { color: var(--red); }

/* ---------- О сервисе / футер ---------- */
.about h2 { font-size: 19px; margin: 6px 0 10px; }
.about p { font-size: 14px; line-height: 1.55; color: var(--text); margin: 10px 0; }
.about .muted { color: var(--muted); font-size: 13px; }
.about a { color: var(--green-dk); font-weight: 600; }
.about .contacts { font-size: 14px; margin: 10px 0; }
.about .about-note { font-size: 12.5px; line-height: 1.45; color: var(--muted);
  background: var(--field-2); border-radius: 10px; padding: 9px 11px; margin: 10px 0; }
.about .about-sign { font-size: 14px; margin: 14px 0 6px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); }
.footer-credit {
  border-top: 1px solid var(--border); margin-top: 16px; padding-top: 12px;
  font-size: 12.5px; line-height: 1.5; color: var(--muted);
}
.footer-credit a { color: var(--green-dk); font-weight: 600; }

/* ---------- Тост ---------- */
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%);
  background: #1c2430; color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 14px; z-index: 2000; box-shadow: var(--shadow); max-width: 90%; text-align: center;
}

@media (min-width: 720px) {
  .sheet { left: auto; right: 16px; bottom: 16px; width: 400px; border-radius: 18px; max-height: 84dvh; }
  .refuel-bar { left: auto; right: 80px; width: 320px; }
}

/* ---------- MapLibre: маркеры-указатели и точка пользователя ---------- */
.maplibregl-marker { cursor: pointer; }
.user-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: #1a73e8; border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(26,115,232,.25);
}

/* ---------- Тёмная тема: контролы MapLibre ---------- */
body.theme-dark .maplibregl-ctrl-group { background: var(--surface); }
body.theme-dark .maplibregl-ctrl-group button { background: var(--surface); }
body.theme-dark .maplibregl-ctrl-group button + button { border-top-color: var(--border); }
body.theme-dark .maplibregl-ctrl-group button .maplibregl-ctrl-icon {
  filter: invert(1) hue-rotate(180deg) brightness(1.1);
}
body.theme-dark .maplibregl-ctrl-attrib {
  background: rgba(24,34,51,.8); color: var(--muted);
}
body.theme-dark .maplibregl-ctrl-attrib a { color: var(--green-dk); }

/* Аккуратное «всплытие» маркеров */
.marker-pin { animation: pop .18s ease; }
@keyframes pop { from { transform: scale(.4); opacity: .2; } to { transform: scale(1); opacity: 1; } }

/* Уважение к настройке «меньше движения» */
@media (prefers-reduced-motion: reduce) {
  .sheet, .overlay, .marker-pin { animation: none !important; }
}

/* ===== Слежение за областью (колокольчик + лист уведомлений) ===== */
#btn-watch { position: relative; }
#btn-watch.watch-active { background: var(--green); color: #fff; border-color: var(--green); }
.watch-badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px;
  padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--card);
}

.watch-sheet { display: flex; flex-direction: column; gap: 14px; }
.watch-status { background: var(--field-2); border-radius: 12px; padding: 13px 14px; }
.watch-status b { display: block; font-size: 15px; margin-bottom: 4px; }
.watch-status .muted { font-size: 13px; line-height: 1.4; margin: 0; }
.watch-status.on { background: var(--green-soft); }
.watch-actions { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }

.watch-sheet .btn-primary,
.watch-sheet .btn-sec {
  border: none; border-radius: 11px; padding: 11px 14px; font-size: 14px;
  font-weight: 600; cursor: pointer;
}
.watch-sheet .btn-primary { background: var(--green); color: #fff; width: 100%; margin-top: 11px; }
.watch-sheet .btn-sec { background: var(--field); color: var(--text); border: 1px solid var(--border); flex: 1; }
.watch-sheet .btn-sec.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, var(--border)); }

.watch-toggles { display: flex; flex-direction: column; gap: 2px; }
.wt-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 4px; border-bottom: 1px solid var(--border); font-size: 14px;
}
.wt-row input { width: 20px; height: 20px; accent-color: var(--green); }
.watch-toggles .wt-test { margin-top: 10px; width: 100%; }

.watch-listhead { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.watch-listhead b { font-size: 15px; }
.watch-clear { background: none; border: none; color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: underline; }
.watch-list { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; overscroll-behavior: contain; }
.watch-empty { font-size: 13px; line-height: 1.45; padding: 6px 2px; }

.watch-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  background: var(--field-2); border: none; border-radius: 12px; padding: 11px 13px;
  cursor: pointer; color: var(--text);
}
.watch-item:active { transform: scale(.99); }
.wi-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.wi-dot.yes { background: var(--green); }
.wi-dot.warn { background: var(--warn); }
.wi-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.wi-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wi-sub { font-size: 12.5px; color: var(--muted); }
.wi-time { font-size: 11.5px; color: var(--muted); }
.wi-go { color: var(--green); font-size: 20px; font-weight: 700; flex: none; }

/* ===== Слежение v71: разметка области + всплывающие уведомления ===== */
.watch-sheet .btn-link {
  display: block; width: 100%; margin-top: 9px; background: none; border: none;
  color: var(--muted); font-size: 13px; text-decoration: underline; cursor: pointer;
}

/* Режим обводки района: убираем лишнее, метки не перехватывают жест */
body.watch-selecting .maplibregl-marker { pointer-events: none !important; }
body.watch-selecting .refuel-bar,
body.watch-selecting .share-fab,
body.watch-selecting .fab-group,
body.watch-selecting .legend { display: none !important; }
body.watch-selecting #map { cursor: crosshair; }

.watch-selectbar {
  position: fixed; left: 10px; right: 10px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 1400; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 11px 13px; border-radius: 14px;
  background: var(--card); color: var(--text); box-shadow: var(--shadow);
  border: 2px solid var(--green);
}
.wsb-hint { flex: 1; min-width: 120px; font-size: 13.5px; font-weight: 600; }
.wsb-actions { display: flex; gap: 8px; }
.wsb-btn { border: none; border-radius: 10px; padding: 9px 13px; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.wsb-btn.ok { background: var(--green); color: #fff; }
.wsb-btn.again { background: var(--field-2); color: var(--text); }
.wsb-btn.cancel { background: none; color: var(--muted); padding: 9px 6px; text-decoration: underline; font-weight: 600; }

/* Баннеры «вылетают сверху» */
.watch-banners {
  position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 0; right: 0;
  z-index: 1800; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0 10px; pointer-events: none;
}
.watch-pop {
  pointer-events: auto; width: 100%; max-width: 460px;
  display: flex; align-items: center; gap: 11px;
  padding: 12px 13px; border-radius: 15px; cursor: pointer;
  background: linear-gradient(180deg, var(--green) 0%, var(--green-dk) 130%); color: #fff;
  box-shadow: 0 10px 30px rgba(27,138,58,.5);
  transform: translateY(-140%); opacity: 0; transition: transform .32s cubic-bezier(.2,.9,.3,1.2), opacity .25s;
}
.watch-pop.in { transform: translateY(0); opacity: 1; }
.watch-pop.out { transform: translateY(-140%); opacity: 0; }
.wp-ic { font-size: 26px; flex: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.wp-body { flex: 1; min-width: 0; }
.wp-title { font-size: 12px; font-weight: 700; opacity: .92; text-transform: uppercase; letter-spacing: .3px; }
.wp-name { font-size: 15.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.wp-go { flex: none; background: rgba(255,255,255,.22); color: #fff; border: none; border-radius: 10px; padding: 8px 12px; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.wp-go:active { transform: scale(.95); }
.wp-x { flex: none; background: none; border: none; color: rgba(255,255,255,.85); font-size: 17px; cursor: pointer; padding: 2px 4px; }
@media (prefers-reduced-motion: reduce) {
  .watch-pop { transition: opacity .2s; transform: none; }
  .watch-pop.in { transform: none; } .watch-pop.out { transform: none; }
}

/* Тихий час — поля времени */
.wt-row small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.wt-times { display: flex; gap: 14px; padding: 8px 4px 10px; border-bottom: 1px solid var(--border); }
.wt-times label { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.wt-times input[type="time"] {
  border: 1.5px solid var(--border); background: var(--field); color: var(--text);
  border-radius: 9px; padding: 7px 9px; font-size: 14px;
}

/* Шапка: на узких экранах прячем подпись бренда, чтобы 🔔🌙ⓘ▾ не наезжали */
@media (max-width: 400px) {
  .brand-text small { display: none; }
  .icon-btn { width: 36px; height: 36px; font-size: 16px; }
  .topbar-row { gap: 6px; }
}
@media (max-width: 340px) {
  .brand-text { display: none; }
}

/* Фоновые push — подсказка и кнопки теста */
.wt-bg-hint:not(:empty) {
  font-size: 12px; line-height: 1.4; color: var(--muted);
  background: var(--field-2); border-radius: 10px; padding: 9px 11px; margin: 8px 0 2px;
}
.wt-testrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.wt-testrow .btn-sec { flex: 1; min-width: 140px; }

/* Баннер: строка с топливом под названием/улицей */
.wp-place { font-size: 12.5px; font-weight: 600; opacity: .9; margin-top: 1px; }
