/* ===========================================================================
   «Где залить» — интерфейс в стиле Apple.

   Опорные величины взяты из Apple HIG, а не подобраны на глаз:
   системные цвета iOS, шкала San Francisco, толщина материалов, кривая
   пружины листа. Шрифт не грузим ниоткуда: на технике Apple -apple-system
   даёт настоящий SF, на остальных — родной системный. Это и быстрее
   (нет блокирующего запроса), и честнее, чем подделка SF веб-шрифтом.
   =========================================================================== */

:root {
  color-scheme: light dark;

  /* --- системные цвета iOS (светлая тема) ------------------------------- */
  --blue:   #007AFF;
  --green:  #34C759;
  --orange: #FF9500;
  --red:    #FF3B30;
  --gray:   #8E8E93;

  /* --- фоны -------------------------------------------------------------- */
  --bg:           #FFFFFF;
  --bg-secondary: #F2F2F7;
  --bg-elevated:  #FFFFFF;

  /* Материал: в iOS это не «полупрозрачный белый», а размытие + подъём
     насыщенности. Без saturate под стеклом выцветает карта. */
  --material:     rgba(249, 249, 249, 0.80);
  --material-thin: rgba(255, 255, 255, 0.72);
  --blur: saturate(180%) blur(24px);

  /* --- метки ------------------------------------------------------------- */
  --label:   #000000;
  --label-2: rgba(60, 60, 67, 0.60);
  --label-3: rgba(60, 60, 67, 0.30);

  --separator: rgba(60, 60, 67, 0.20);

  /* --- заливки (сегмент-контрол, нажатия) -------------------------------- */
  --fill-2: rgba(120, 120, 128, 0.16);
  --fill-3: rgba(120, 120, 128, 0.12);
  --fill-4: rgba(120, 120, 128, 0.08);

  --thumb: #FFFFFF;
  --thumb-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04);
  --float-shadow: 0 1px 1px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.12);
  --sheet-shadow: 0 -1px 0 var(--separator), 0 -8px 40px rgba(0,0,0,.16);

  /* Радиус листа и карточек. В iOS 26 углы крупнее прежних 10pt. */
  --r-sheet: 14px;
  --r-card:  12px;
  --r-seg:   9px;

  /* Пружина листов UIKit. Не ease-out: у неё нет этого «доезда». */
  --spring: cubic-bezier(.32, .72, 0, 1);

  --sheet-peek: 176px;
  --sheet-visible: 176px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --blue:   #0A84FF;
    --green:  #30D158;
    --orange: #FF9F0A;
    --red:    #FF453A;
    --gray:   #98989D;

    --bg:           #000000;
    --bg-secondary: #1C1C1E;
    --bg-elevated:  #1C1C1E;

    --material:      rgba(30, 30, 30, 0.78);
    --material-thin: rgba(40, 40, 42, 0.72);

    --label:   #FFFFFF;
    --label-2: rgba(235, 235, 245, 0.60);
    --label-3: rgba(235, 235, 245, 0.30);

    --separator: rgba(84, 84, 88, 0.65);

    --fill-2: rgba(120, 120, 128, 0.32);
    --fill-3: rgba(120, 120, 128, 0.24);
    --fill-4: rgba(120, 120, 128, 0.18);

    --thumb: #636366;
    --thumb-shadow: 0 3px 8px rgba(0,0,0,.30);
    --float-shadow: 0 4px 16px rgba(0,0,0,.50);
    --sheet-shadow: 0 -1px 0 var(--separator), 0 -8px 40px rgba(0,0,0,.60);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overscroll-behavior: none;
  background: var(--bg-secondary);
  color: var(--label);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
               system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;              /* iOS Body */
  line-height: 1.29;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }

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

/* 100dvh, а не inset:0: на iOS фиксированный слой растягивается на «большой»
   вьюпорт — тот, что без панелей браузера, — и низ листа вместе с кнопкой
   «Маршрут» уезжает под плавающую панель Safari. */
.shell { position: fixed; top: 0; left: 0; right: 0; height: 100dvh; }

/* --- карта ---------------------------------------------------------------- */

#map { position: absolute; inset: 0; }
#map:focus { outline: none; }

.maplibregl-ctrl-attrib {
  font-size: 10px;
  border-radius: 8px 0 0 0;
  background: var(--material-thin) !important;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}
.maplibregl-ctrl-attrib a { color: var(--label-2); }
.maplibregl-ctrl-bottom-right { bottom: calc(var(--sheet-visible) - 4px); transition: bottom .4s var(--spring); }
.maplibregl-ctrl-bottom-left  { display: none; }

/* Своя кнопка геолокации уже есть — родная от MapLibre только дублирует её. */
.maplibregl-ctrl-top-right { display: none; }

/* Атрибуция должна лежать свёрнутой до нажатия, иначе строка на пол-экрана
   налезает на кнопку «где я». */
.maplibregl-ctrl-attrib.maplibregl-compact:not(.maplibregl-compact-show)
  .maplibregl-ctrl-attrib-inner { display: none !important; }
.maplibregl-ctrl-attrib.maplibregl-compact { min-height: 24px; }

/* --- верхняя панель ------------------------------------------------------- */

.top {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.top > * { pointer-events: auto; }

.brand {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px 7px 10px;
  border-radius: 999px;
  background: var(--material);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--float-shadow);
}
.brand h1 {
  margin: 0;
  font-size: 15px;              /* iOS Subheadline */
  font-weight: 600;
  letter-spacing: -.01em;
}
.brand__drop { width: 18px; height: 18px; color: var(--green); flex: 0 0 auto; }

/* --- сегмент-контрол ------------------------------------------------------ */

.seg {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 2px;
  border-radius: var(--r-seg);
  background: var(--material);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--float-shadow);
  isolation: isolate;
}

/* Бегунок — один элемент, который едет. Так и в UIKit: подсветка не
   перекрашивается по сегментам, а физически переезжает. */
.seg__thumb {
  position: absolute;
  z-index: 0;
  top: 2px;
  bottom: 2px;
  left: 2px;
  border-radius: 7px;
  background: var(--thumb);
  box-shadow: var(--thumb-shadow);
  transition: transform .32s var(--spring), width .32s var(--spring);
  will-change: transform;
}

.seg__item {
  position: relative;
  z-index: 1;
  /* Выше мишень: 31 пиксель — на пределе даже для строки. */
  padding: 9px 4px;
  font-size: 13px;              /* iOS Footnote, как в UISegmentedControl */
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--label);
  text-align: center;
  transition: font-weight .2s, opacity .2s, transform .15s var(--spring);
}
.seg__item[aria-checked="true"] { font-weight: 600; }
.seg__item:active { transform: scale(.94); }

/* Разделители между невыбранными сегментами — гаснут рядом с бегунком. */
.seg__item + .seg__item::before {
  content: "";
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 1px;
  background: var(--separator);
  transition: opacity .2s;
}
.seg__item[aria-checked="true"]::before,
.seg__item[aria-checked="true"] + .seg__item::before { opacity: 0; }

/* --- круглые плавающие кнопки --------------------------------------------- */

.fab {
  position: absolute;
  right: max(12px, env(safe-area-inset-right));
  z-index: 5;
  width: 44px;                  /* минимальная зона нажатия по HIG */
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--material);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--float-shadow);
  color: var(--blue);
  transition: transform .2s var(--spring), bottom .4s var(--spring);
}
.fab:active { transform: scale(.92); }
.fab--locate { bottom: calc(var(--sheet-visible) + 34px); }
.fab.is-on { color: #fff; background: var(--blue); }

/* --- лист ----------------------------------------------------------------- */

.sheet {
  position: absolute;
  left: 0; right: 0;
  top: 0;
  height: 100%;
  z-index: 6;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--material);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--sheet-shadow);
  transform: translate3d(0, calc(100% - var(--sheet-peek)), 0);
  transition: transform .42s var(--spring);
  will-change: transform;
}
.sheet.is-dragging { transition: none; }

.grabber {
  flex: 0 0 auto;
  touch-action: none;
  width: 100%;
  /* Полоска рисуется тонкой, но мишень должна быть в палец шириной:
     по рекомендациям Apple — не меньше 44 точек. */
  padding: 12px 0 8px;
  display: grid;
  place-items: center;
}
.grabber span {
  width: 36px; height: 5px;     /* размер грабера в UIKit */
  border-radius: 3px;
  background: var(--label-3);
}

/* --- разделы листа ---------------------------------------------------------

   Подчёркнутые вкладки, а не «пилюли»: пилюля наверху — это ФИЛЬТР марки,
   и если сделать разделы такими же, два одинаковых элемента станут
   означать разное. Подчёркивание читается как навигация. */
.tabs {
  display: flex;
  gap: 18px;
  padding-bottom: 10px;
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0 7px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--label-2);
  transition: color .18s;
}
.tab.is-on { color: var(--label); }
.tab.is-on::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2.5px;
  border-radius: 2px;
  background: var(--blue);
}

.sheet__head {
  flex: 0 0 auto;
  padding: 2px 16px 14px;
  touch-action: none;
  cursor: grab;
}
.sheet__head:active { cursor: grabbing; }
.tally {
  margin: 0;
  font-size: 22px;              /* iOS Title 3 */
  font-weight: 700;
  letter-spacing: -.02em;
}
/* --- порядок и фильтр ------------------------------------------------------ */

.sorts {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.sorts::-webkit-scrollbar { display: none; }

.sort {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 9px;
  background: var(--fill-4);
  color: var(--label-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
  transition: background-color .15s, color .15s, transform .15s var(--spring);
}
.sort:active { transform: scale(.95); }
.sort.is-on { background: var(--blue); color: #fff; }

/* Отбивка: слева — порядок, справа — фильтр. Без неё три одинаковые
   плашки читаются как один список взаимоисключающих вариантов. */
.sort--sep { margin-left: 6px; position: relative; }
.sort--sep::before {
  content: "";
  position: absolute;
  left: -7px; top: 6px; bottom: 6px;
  width: 1px;
  background: var(--separator);
}

/* --- строки-подсказки в конце списка ---------------------------------------- */

.more, .hintrow {
  list-style: none;
  padding: 14px 12px 6px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--label-3);
}
.hintrow { padding-bottom: 14px; }
.hintrow__btn {
  width: 100%;
  min-height: 44px;
  border-radius: var(--r-card);
  background: var(--fill-4);
  color: var(--blue);
  font-size: 15px;
  font-weight: 600;
}
.hintrow__btn:active { opacity: .6; }

.freshness {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--label-2);
  font-variant-numeric: tabular-nums;
}

.sheet__body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  /* Запас снизу: панель Safari плавает поверх страницы и в safe-area
     не отражается, поэтому одного инсета мало. */
  padding-bottom: calc(env(safe-area-inset-bottom) + 40px);
}
.sheet:not(.is-open) .sheet__body { overflow: hidden; }

/* --- список ---------------------------------------------------------------- */

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

.card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  width: 100%;
  padding: 11px 12px;
  text-align: left;
  border-radius: var(--r-card);
  transition: background-color .15s;
}
.card:active, .card.is-active { background: var(--fill-4); }

/* Разделитель с отступом слева — как в UITableView: линия начинается
   от текста, а не от края экрана. */
.list li + li .card::before {
  content: "";
  position: absolute;
  left: 12px; right: 0; top: -1px;
  height: 1px;
  background: var(--separator);
  transform: scaleY(.5);
}
.list li + li .card.is-active::before,
.list li:has(+ li .card.is-active) .card::before { opacity: 0; }

.card__name {
  font-size: 17px;              /* iOS Body/Headline */
  font-weight: 600;
  letter-spacing: -.02em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card__dist {
  font-size: 15px;
  color: var(--label-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  align-self: start;
  padding-top: 1px;
}
.card__addr {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--label-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card__pylon { grid-column: 1 / -1; margin-top: 8px; }

/* --- марки топлива ------------------------------------------------------- */

/* Статус несёт вся плашка — заливка, цвет и знак. По одному цветному
   кружку «какой бензин есть» не прочитывается. */
.pylon { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px 3px 7px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
  background: var(--fill-4);
  color: var(--label-2);
}
.chip__mark { font-size: 11px; line-height: 1; opacity: .9; }

.chip.is-yes   { background: rgba(52,199,89,.18);  color: #1D7A35; }
.chip.is-maybe { background: rgba(255,149,0,.20);  color: #9A5B00; }
.chip.is-no    { background: rgba(255,59,48,.14);  color: #B3281F; }
.chip.is-unk   { background: var(--fill-4);        color: var(--label-2); }

@media (prefers-color-scheme: dark) {
  .chip.is-yes   { background: rgba(48,209,88,.22); color: #4FE07A; }
  .chip.is-maybe { background: rgba(255,159,10,.22); color: #FFC14D; }
  .chip.is-no    { background: rgba(255,69,58,.20);  color: #FF8177; }
}

/* Список марок в карточке места: статус словом, без расшифровки цвета. */
.fuels { list-style: none; margin: 14px 0 0; padding: 0; }
.fuel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  font-size: 16px;
}
.fuel + .fuel { border-top: 1px solid var(--separator); }
.fuel__main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fuel__name { font-weight: 500; }
/* Цена и источник — под названием марки: вопрос «откуда это» возникает
   ровно здесь, у конкретной марки, а не в подписи ко всей карточке.
   Бледной сноской быть не может: на тёмном фоне её просто не видно. */
.fuel__meta { display: flex; align-items: center; gap: 7px; margin-top: 3px; }

.fuel__price {
  font-size: 13px;
  font-weight: 500;
  color: var(--label-2);
  font-variant-numeric: tabular-nums;
}

/* Заливка серая, а не «чёрная с прозрачностью»: серый одинаково виден
   и на светлом, и на тёмном фоне, каким бы его ни отдал клиент Telegram. */
.fuel__src {
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(120, 120, 128, .22);
  box-shadow: inset 0 0 0 1px rgba(120, 120, 128, .18);
  color: var(--label);
  opacity: .75;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
}
.fuel__state { display: inline-flex; align-items: center; gap: 7px; color: var(--label-2); }
.fuel__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gray); }
.fuel.is-yes   .fuel__state { color: var(--green);  font-weight: 600; }
.fuel.is-yes   .fuel__dot   { background: var(--green); }
.fuel.is-maybe .fuel__state { color: var(--orange); font-weight: 600; }
.fuel.is-maybe .fuel__dot   { background: var(--orange); }
.fuel.is-no    .fuel__dot   { background: var(--red); }

/* --- пусто / ошибка --------------------------------------------------------- */

.empty {
  padding: 36px 24px 44px;
  text-align: center;
  color: var(--label-2);
  font-size: 15px;
}

/* --- карточка АЗС (place card) ----------------------------------------------- */

.place { position: relative; padding: 0 16px 8px; }

.place__title { padding-right: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.place__sub { margin: 3px 0 0; font-size: 15px; color: var(--label-2); }
.place__pylon { margin-top: 14px; }

/* --- заметные признаки: очередь, лимит, наличные ------------------------- */

.flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.flag {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
  background: var(--fill-4);
  color: var(--label-2);
}
.flag--queue { background: rgba(255,149,0,.20); color: #9A5B00; }
.flag--limit { background: rgba(255,59,48,.14); color: #B3281F; }

@media (prefers-color-scheme: dark) {
  .flag--queue { background: rgba(255,159,10,.22); color: #FFC14D; }
  .flag--limit { background: rgba(255,69,58,.20);  color: #FF8177; }
}

/* Заголовок группы, как в сгруппированных списках iOS. */
.place__srchead {
  margin: 18px 0 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--label-2);
}
.place__srchead + .fuels { margin-top: 4px; }
.place__actions { display: flex; gap: 10px; margin-top: 10px; }

.place__navhead {
  margin: 18px 0 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--label-2);
}

/* Навигаторы — в ряд, выбранный в прошлый раз выделен. Списком выбора
   делать не стал: лишний тап ради того, что человек и так каждый раз
   выбирает один и тот же. */
.navs { display: flex; flex-wrap: wrap; gap: 8px; }

/* Три в один ряд: перенос «2ГИС» на отдельную строку во всю ширину
   выглядел как отдельное, более важное действие. */
.nav {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: 0 10px;
  border-radius: var(--r-card);
  background: var(--fill-3);
  color: var(--label);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform .15s var(--spring), background-color .15s;
}
.nav:active { transform: scale(.97); }
.nav.is-pref { background: var(--blue); color: #fff; }

.btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--r-card);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.02em;
  background: var(--fill-3);
  color: var(--blue);
  text-decoration: none;
  transition: transform .15s var(--spring), opacity .15s;
}
.btn--filled { background: var(--blue); color: #fff; }
.btn:active { transform: scale(.97); opacity: .85; }

.place__meta {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--separator);
  font-size: 13px;
  color: var(--label-2);
}

/* --- подвал ------------------------------------------------------------------ */

/* В карточке места подвал только отнимает высоту у кнопки действия. */
.sheet.has-place .credit { display: none; }

.credit {
  padding: 22px 16px 8px;
  font-size: 12px;
  line-height: 1.42;
  color: var(--label-3);
}
.credit a { color: var(--label-2); }

/* --- десктоп: боковая панель, как в Картах на Mac ----------------------------- */

@media (min-width: 900px) {
  .sheet {
    top: 12px;
    bottom: 12px;
    left: 12px;
    right: auto;
    height: auto;
    width: 384px;
    border-radius: var(--r-sheet);
    transform: none !important;
    transition: none;
  }
  .grabber { display: none; }
  .sheet__head { padding-top: 16px; }
  .sheet__body { overflow-y: auto !important; }
  .top { left: 420px; }
  .brand { display: none; }
  .seg { max-width: 420px; }
  .fab--locate { bottom: max(56px, env(safe-area-inset-bottom)); }
  .maplibregl-ctrl-bottom-right { bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}


/* --- первый вход ----------------------------------------------------------- */

/* Появление разнесено по времени: капля, заголовок, текст, кнопки. Всё сразу
   читается как рывок, поочерёдно — как движение. */
/* Своё display перебивает браузерное [hidden]{display:none} — без этой
   строки экран приветствия не скрывался вообще никогда. */
.hello[hidden] { display: none; }

.hello {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--material);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  animation: hello-in .3s ease both;
}
.hello.is-leaving { animation: hello-out .42s var(--spring) both; }

.hello__card {
  width: min(340px, 100%);
  text-align: center;
}

.hello__drop {
  display: inline-grid;
  place-items: center;
  width: 76px; height: 76px;
  border-radius: 24px;
  background: var(--bg-elevated);
  color: var(--green);
  box-shadow: var(--float-shadow);
  animation: drop-in .62s var(--spring) both;
}

.hello__title {
  margin: 18px 0 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.03em;
  animation: rise .5s var(--spring) .1s both;
}

.hello__text {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.38;
  color: var(--label-2);
  animation: rise .5s var(--spring) .17s both;
}

.hello__go {
  display: block;
  width: 100%;
  min-height: 50px;
  margin-top: 26px;
  border-radius: var(--r-card);
  background: var(--blue);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.02em;
  box-shadow: 0 6px 18px rgba(0, 122, 255, .30);
  animation: rise .5s var(--spring) .24s both;
  transition: transform .15s var(--spring);
}
.hello__go:active { transform: scale(.97); }

.hello__skip {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  font-size: 16px;
  color: var(--label-2);
  animation: rise .5s var(--spring) .3s both;
}

@keyframes hello-in  { from { opacity: 0 } to { opacity: 1 } }
@keyframes hello-out {
  to { opacity: 0; transform: scale(1.06); }
}
@keyframes drop-in {
  from { opacity: 0; transform: scale(.4) translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* Появление листа и панели после приветствия. */
.shell.is-entering .sheet { animation: sheet-up .55s var(--spring) both; }
.shell.is-entering .top   { animation: rise .45s var(--spring) .08s both; }
@keyframes sheet-up { from { transform: translate3d(0, 100%, 0); } }


/* --- сравнение источников --------------------------------------------------- */

.cmp__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 14px;
  padding: 11px 0;
  border-top: 1px solid var(--separator);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--blue);
}
.cmp__toggle:active { opacity: .6; }

.cmp { overflow-x: auto; }
.cmp__wait { padding: 10px 0; font-size: 14px; color: var(--label-2); }

/* Марки — колонками: сравнивают их сверху вниз, глазу нужен столбец. */
.cmp__grid {
  display: grid;
  grid-template-columns: minmax(84px, auto) repeat(var(--cols), minmax(34px, 1fr));
  align-items: center;
  row-gap: 2px;
  min-width: min-content;
}

.cmp__cell { display: flex; align-items: center; justify-content: center; padding: 7px 2px; }

.cmp__col {
  font-size: 12px;
  font-weight: 600;
  color: var(--label-2);
}

.cmp__src {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  padding-right: 8px;
}
.cmp__srcname { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.cmp__when { font-size: 11px; color: var(--label-3); white-space: nowrap; }

.cmp__dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--gray);
  flex: 0 0 auto;
}
.cmp__dot.is-yes   { background: var(--green); }
.cmp__dot.is-maybe { background: var(--orange); }
.cmp__dot.is-no    { background: var(--red); }
.cmp__dot.is-unk   { background: var(--gray); opacity: .45; }

/* Обводка — у того ответа, который в итоге показан в карточке. */
.cmp__dot.is-used { box-shadow: 0 0 0 2px var(--bg-elevated), 0 0 0 3.5px var(--blue); }

.cmp__dash { color: var(--label-3); font-weight: 700; }

.cmp__legend {
  display: flex; align-items: center; flex-wrap: wrap; gap: 5px 10px;
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--label-2);
}
.cmp__legend .cmp__dot { margin-right: -4px; }

.cmp__note { margin: 8px 0 0; font-size: 12px; line-height: 1.4; color: var(--label-3); }


/* --- круговые индикаторы ----------------------------------------------------- */

.dials {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.dial {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 2px;
  /* Запас снизу под двухстрочную подпись: без него вторая строка
     обрезалась краем плашки. */
  padding: 12px 6px 14px;
  border-radius: var(--r-card);
  background: var(--bg-elevated);
}

.dial__ring { display: block; }

/* Число — в центре кольца, поэтому кольцо и подпись остаются в потоке,
   а значение накладывается абсолютно. */
.dial__val {
  position: absolute;
  top: 12px;
  height: 64px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.dial__cap {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  color: var(--label-2);
}
.dial__cap span { color: var(--label-2); }


/* «Все» — не марка, а сброс фильтра. Отделяем, чтобы это читалось. */
.seg__item--all { font-weight: 500; }
.seg__item--all::before { opacity: .5 !important; }


/* --- лист: режим списка против режима карточки ------------------------------

   При выбранной заправке элементы управления СПИСКОМ уходят: вкладки,
   сводка по области и сортировка не имеют отношения к одному месту, а
   занимают верх экрана и путают. Шапка становится заголовком карточки. */
.sheet.has-place .tabs,
.sheet.has-place .sorts { display: none; }

.sheet__head { position: relative; }

.head__acts {
  display: none;
  position: absolute;
  top: 0; right: 16px;
  gap: 8px;
}
.sheet.has-place .head__acts { display: flex; }

.head__act {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--fill-3);
  color: var(--label-2);
  transition: transform .15s var(--spring), color .2s, background-color .2s;
}
.head__act:active { transform: scale(.88); }
.head__act--fav.is-on { color: var(--orange); background: rgba(255,149,0,.18); }

/* Название заправки в шапке — длинное, поэтому уводим от кнопок. */
.sheet.has-place .tally {
  padding-right: 84px;
  font-size: 24px;
}
.sheet.has-place .freshness { padding-right: 84px; }


/* ===========================================================================
   Тема в Telegram задаётся КЛИЕНТОМ, а не системой.

   Медиазапрос prefers-color-scheme отражает настройку ОС, и на Telegram
   Desktop она расходится с темой клиента: система светлая, клиент тёмный.
   Из-за этого бегунок переключателя марок брал белый цвет из медиазапроса,
   а цвет текста — белый из палитры Telegram, и выбранная марка становилась
   белой на белом.

   Поэтому все тёмные значения продублированы селектором по атрибуту, который
   ставит tg-early.js из tg.colorScheme. Источник правды один — клиент.
   =========================================================================== */
:root[data-tg-scheme="dark"] {
    --blue:   #0A84FF;
    --green:  #30D158;
    --orange: #FF9F0A;
    --red:    #FF453A;
    --gray:   #98989D;

    --bg:           #000000;
    --bg-secondary: #1C1C1E;
    --bg-elevated:  #1C1C1E;

    --material:      rgba(30, 30, 30, 0.78);
    --material-thin: rgba(40, 40, 42, 0.72);

    --label:   #FFFFFF;
    --label-2: rgba(235, 235, 245, 0.60);
    --label-3: rgba(235, 235, 245, 0.30);

    --separator: rgba(84, 84, 88, 0.65);

    --fill-2: rgba(120, 120, 128, 0.32);
    --fill-3: rgba(120, 120, 128, 0.24);
    --fill-4: rgba(120, 120, 128, 0.18);

    --thumb: #636366;
    --thumb-shadow: 0 3px 8px rgba(0,0,0,.30);
    --float-shadow: 0 4px 16px rgba(0,0,0,.50);
    --sheet-shadow: 0 -1px 0 var(--separator), 0 -8px 40px rgba(0,0,0,.60);
  }

[data-tg-scheme="dark"] .chip.is-yes { background: rgba(48,209,88,.22); color: #4FE07A; }
  [data-tg-scheme="dark"] .chip.is-maybe { background: rgba(255,159,10,.22); color: #FFC14D; }
  [data-tg-scheme="dark"] .chip.is-no { background: rgba(255,69,58,.20);  color: #FF8177; }

[data-tg-scheme="dark"] .flag--queue { background: rgba(255,159,10,.22); color: #FFC14D; }
  [data-tg-scheme="dark"] .flag--limit { background: rgba(255,69,58,.20);  color: #FF8177; }


/* --- «цены справочно» и история ------------------------------------------ */

.legal {
  margin: 6px 2px 0;
  font-size: 11px;
  letter-spacing: .01em;
  /* label-2, не label-3: на чёрном третий уровень уже не читается,
     а эта строка — юридическая, ей положено быть видимой. */
  color: var(--label-2);
}

.hist { padding-bottom: 4px; }
.hist__cap {
  margin: 12px 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--label);
}
.hist__cap span { font-weight: 400; color: var(--label-2); }
.hist__tl { display: block; width: 100%; height: 46px; }
.hist__tick { font: 500 11px -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif; fill: var(--label-2); }
.hist__price { display: block; width: 100%; height: 90px; border-radius: 10px; background: var(--fill-3); }
.hist__range { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11px; color: var(--label-3); font-variant-numeric: tabular-nums; }
.hist__act { display: block; width: 100%; height: 44px; border-radius: 8px; background: var(--fill-3); }
.flag--closed { background: rgba(255,59,48,.14); color: #B3281F; }


/* --- объяснение, завозы, умный подбор ----------------------------------- */
.explain {
  margin: 10px 0 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--bg-elevated);
  font-size: 13px;
  line-height: 1.4;
  color: var(--label-2);
}
.delivery { margin: 10px 0 0; font-size: 13px; line-height: 1.4; color: var(--label-2); }
.delivery > span { display: block; }
.delivery__next { font-weight: 600; color: var(--label); }
.delivery__note { font-size: 12px; color: var(--label-3); }
.sort--go { background: var(--blue); color: #fff; }
.sort--go.is-on { background: var(--blue); }
.card--pick .card__why { grid-column: 1 / -1; font-size: 12px; color: var(--label-2); }
.pick__foot { list-style: none; text-align: center; padding: 8px 0; }
.linkbtn { border: 0; background: none; color: var(--blue); font: inherit; font-size: 14px; font-weight: 600; }
.cmp__acc { font-size: 11px; color: var(--blue); white-space: nowrap; }

/* Ряд сортировок переносится: с кнопкой «Куда ехать» он перестал влезать
   в одну строку, и последняя кнопка обрезалась краем. */
.sorts { flex-wrap: wrap; }

.flag--tx { background: rgba(52,199,89,.16); color: #1B7F3B; }


/* Брендовый знак: буква сети в фирменном цвете. Свой единый значок вместо
   чужих логотипов — одинаковой формы и без вопросов к товарным знакам. */
.glyph {
  display: inline-grid; place-items: center;
  vertical-align: -5px; margin-right: 7px;
  border-radius: 50%;
  background: var(--bg); color: #fff;
  font-weight: 700; letter-spacing: -.02em;
  flex: 0 0 auto;
}
.card__name { display: flex; align-items: center; min-width: 0; }
.card__name .glyph { vertical-align: 0; }
.tally .glyph { vertical-align: -4px; }


/* --- онбординг ------------------------------------------------------------ */
.onb {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center; padding: 24px;
  background: rgba(0,0,0,.42); backdrop-filter: blur(6px);
  animation: onb-in .3s ease both;
}
.onb.is-leaving { animation: onb-out .32s ease both; }
@keyframes onb-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes onb-out { to { opacity: 0; } }
.onb__card {
  position: relative;
  width: min(360px, 100%);
  padding: 26px 22px 20px;
  border-radius: 22px;
  background: var(--bg-elevated);
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
  text-align: center;
  animation: onb-rise .4s var(--spring) both;
}
@keyframes onb-rise { from { transform: translateY(14px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.onb__skip {
  position: absolute; top: 12px; right: 14px;
  border: 0; background: none; color: var(--label-2);
  font: inherit; font-size: 14px; font-weight: 500;
}
.onb__body { min-height: 190px; }
.onb__mark {
  display: inline-grid; place-items: center;
  width: 62px; height: 62px; margin-top: 8px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--c) 16%, transparent);
  color: var(--c);
}
.onb__title { margin: 16px 0 0; font-size: 21px; font-weight: 700; letter-spacing: -.03em; }
.onb__text { margin: 9px 0 0; font-size: 15px; line-height: 1.45; color: var(--label-2); }
.onb__dots { display: flex; justify-content: center; gap: 6px; margin: 18px 0 14px; }
.onb__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fill-3); transition: width .2s, background .2s; }
.onb__dot.is-on { width: 18px; border-radius: 3px; background: var(--blue); }
.onb__next {
  width: 100%; min-height: 50px;
  border: 0; border-radius: 14px;
  background: var(--blue); color: #fff;
  font: inherit; font-size: 16px; font-weight: 600;
  transition: transform .15s var(--spring);
}
.onb__next:active { transform: scale(.98); }
