/*
 * Прототип гостевого приложения агрегатора.
 *
 * Палитра чёрно-белая, один акцент — цитрон. Правило то же, что и в
 * дизайн-системе ядра: второй цвет немедленно начинает значить
 * что-то своё, поэтому цвет здесь ровно один и означает «здесь твоё
 * действие»: главная кнопка, выбранный вариант, своя точка на карте.
 * Всё остальное — бумага, тушь и линии.
 *
 * Шрифты подобраны из того же семейства характеров, что и у кофейни, но
 * другие. Geologica — плотный технический гротеск на заголовки и числа,
 * Golos Text — спокойный текстовый. Оба SIL OFL, лежат рядом файлами.
 */

@font-face {
  font-family: 'Manrope';
  src: url('./fonts/manrope-cyrillic.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  src: url('./fonts/manrope-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191,
    U+2193, U+2212, U+2215;
}
/* Inter Black — только для вордмарка «МИМО ПРОХОДИЛ»: самый плотный
   гротеск с кириллицей, ближе всего к начертанию лого. Лежит локально. */
@font-face {
  font-family: 'Inter Black';
  src: url('./fonts/inter-black-cyr.woff2') format('woff2');
  font-weight: 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter Black';
  src: url('./fonts/inter-black-lat.woff2') format('woff2');
  font-weight: 900;
  font-display: swap;
}

:root {
  /* Палитра брендбука «Мимо проходил», раздел 09 — HEX как в книге. */
  --ink: #20221d; /* графит — главный тёмный */
  --ink-2: #4b4e45;
  --ink-3: #73786a; /* оливковый — служебный */
  --paper: #f4f0e7; /* молочный — основной фон */
  --card: #fffdf7;
  --sunken: #e9e4d6;
  --line: #ddd7c7;

  /* Лайм #D5E044 — акцент и деталь. Текст на лайме — графит. */
  --accent: #d5e044;
  --accent-soft: #f1f4d0;
  --on-accent: #20221d;
  --espresso: #9a7356; /* тёплый акцент */

  --danger: #b4332a;

  --display: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --text: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --r-s: 10px;
  --r-m: 16px;
  --r-l: 24px;

  --fast: 160ms;
  --base: 280ms;
  --ease: cubic-bezier(0.2, 0, 0.1, 1);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

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

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}

.phone {
  max-width: 460px;
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  position: relative;
  overflow: hidden;
}

/* ── Шапка внутренних экранов ───────────────────────────────────────── */

.top {
  display: grid;
  grid-template-columns: 2.5rem 1fr 2.5rem;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 10px;
  flex: 0 0 auto;
}

.top h1 {
  font-size: 1.0625rem;
  text-align: center;
}

.icon-btn {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 1.25rem;
}

.icon-btn:active {
  background: var(--sunken);
}

/* ── Прокручиваемая часть внутренних экранов ────────────────────────── */

.body {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 24px;
}

.muted {
  color: var(--ink-3);
}

.section-title {
  margin: 20px 0 10px;
  font-family: var(--display);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.note {
  color: var(--ink-3);
  font-size: 0.875rem;
}

/* ── Карта: верхняя половина главного экрана ────────────────────────── */

.map-stage {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  /* Жест по карте — перемещение холста, а не прокрутка страницы. */
  touch-action: none;
  cursor: grab;
}

.map-canvas {
  position: absolute;
  width: 200%;
  height: 200%;
  will-change: transform;
}

.map-canvas svg {
  width: 100%;
  height: 100%;
  display: block;
}

.pin {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--card);
  font-family: var(--display);
  font-size: 0.8125rem;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(16, 16, 16, 0.08);
}

/* Мини-логотип кофейни на булавке: узнавание раньше чтения. */
.pin-logo {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-weight: 600;
}

.pin[aria-pressed='true'] .pin-logo {
  background: var(--on-accent);
  color: var(--accent);
}

/* Ножка булавки. */
.pin::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 8px;
  height: 8px;
  transform: translateX(-50%) rotate(45deg);
  background: inherit;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.pin[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  z-index: 2;
}

.pin[aria-pressed='true']::after {
  border-color: var(--accent);
}

.me {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--ink);
  border: 3px solid var(--card);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 8px rgba(16, 16, 16, 0.06);
}

.float-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 2px 8px rgba(16, 16, 16, 0.08);
  z-index: 3;
}

.float-btn svg {
  width: 20px;
  height: 20px;
}

.float-btn.locate {
  top: auto;
  bottom: 14px;
}

.float-btn.back {
  right: auto;
  left: 14px;
}

.map-note.shifted {
  left: 66px;
}

.map-note {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-size: 0.8125rem;
  z-index: 3;
}

/* ── Нижняя половина главного экрана ────────────────────────────────── */

.under {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 24px;
}

/* ── Карточка кофейни (по нажатию на булавку) ───────────────────────── */

.shop {
  display: grid;
  gap: 10px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--card);
  animation: pop var(--base) var(--ease);
}

@keyframes pop {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

.shop-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
}

.shop-title {
  min-width: 0;
  flex: 1;
}

.shop-title b {
  display: block;
  font-family: var(--display);
  font-size: 1.0625rem;
}

.shop-title span {
  color: var(--ink-3);
  font-size: 0.8125rem;
}

.shop-about {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.shop-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  color: var(--ink-3);
  font-size: 0.875rem;
}

.shop-facts b {
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
}

.shop .ghost {
  margin-top: 2px;
}

.shop .note {
  margin: 0;
}

/* ── Каталог ────────────────────────────────────────────────────────── */

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

.tile {
  position: relative;
  display: grid;
  gap: 2px;
  /* Сверху — место под глиф: длинная подпись не налезает на него. */
  padding: 48px 14px 14px;
  min-height: 104px;
  align-content: end;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--card);
  text-align: left;
  transition: transform var(--fast) var(--ease);
}

.tile:active {
  transform: scale(0.98);
}

.tile b {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.0625rem;
}

.tile span {
  color: var(--ink-3);
  font-size: 0.8125rem;
}

.tile .glyph {
  position: absolute;
  top: 10px;
  left: 12px;
  width: 32px;
  height: 32px;
  opacity: 0.85;
}

.tile.in-cart {
  border-color: var(--ink);
}

.tile .count {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--display);
  font-size: 12px;
  line-height: 22px;
  text-align: center;
}

/* ── Нижняя панель ──────────────────────────────────────────────────── */

.dock {
  flex: 0 0 auto;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 72%, transparent);
}

.primary {
  font-weight: 700;
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-m);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--display);
  font-size: 1.0625rem;
  font-weight: 600;
  transition: transform var(--fast) var(--ease);
}

.primary:active {
  transform: scale(0.99);
}

.primary:disabled {
  background: var(--sunken);
  color: var(--ink-3);
}

.primary .right {
  margin-left: auto;
}

.primary .left {
  margin-right: auto;
}

.ghost {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--card);
  font-family: var(--display);
  font-size: 0.9375rem;
}

.linkish {
  border: 0;
  background: none;
  padding: 10px 0;
  color: var(--ink-3);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 0.9375rem;
}

/* Подсказка «заказ собран — выберите кофейню на карте». */
.cart-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--r-m);
  background: var(--ink);
  color: var(--paper);
}

.cart-hint b {
  display: block;
  font-family: var(--display);
  font-weight: 600;
}

.cart-hint span {
  opacity: 0.7;
  font-size: 0.875rem;
}

.cart-hint button {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid rgba(245, 243, 239, 0.35);
  border-radius: 999px;
  background: none;
  color: var(--paper);
  font-size: 0.875rem;
}

/* ── Шторка выбора напитка ──────────────────────────────────────────── */

.sheet-back {
  position: fixed;
  inset: 0;
  background: rgba(16, 16, 16, 0.32);
  animation: fade var(--base) var(--ease);
}

.sheet {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(460px, 100%);
  bottom: 0;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-l) var(--r-l) 0 0;
  background: var(--paper);
  animation: rise var(--base) var(--ease);
}

@keyframes rise {
  from {
    transform: translateX(-50%) translateY(12%);
    opacity: 0.6;
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.sheet .body {
  padding-top: 4px;
}

.grabber {
  width: 40px;
  height: 4px;
  margin: 8px auto 2px;
  border-radius: 999px;
  background: var(--line);
}

.opt-title {
  margin: 18px 0 8px;
  font-family: var(--display);
  font-size: 0.9375rem;
}

.opts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.opt {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.9375rem;
  transition:
    border-color var(--fast) var(--ease),
    background var(--fast) var(--ease);
}

.opt small {
  color: var(--ink-3);
  margin-left: 6px;
}

/* Активный чип — как в ките: цитроновая заливка, графитовый текст. */
.opt[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.opt[aria-pressed='true'] small {
  color: var(--ink-2);
}

.opt[disabled] {
  opacity: 0.45;
}

.qty {
  display: flex;
  align-items: center;
  gap: 14px;
}

.qty button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 1.25rem;
}

.qty b {
  font-family: var(--display);
  font-size: 1.125rem;
  min-width: 1.5rem;
  text-align: center;
}

/* ── Карточки и строки ──────────────────────────────────────────────── */

.card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--card);
  margin-bottom: 12px;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.row:last-child {
  border-bottom: 0;
}

.row .what b {
  font-weight: 600;
}

.row .what span {
  display: block;
  color: var(--ink-3);
  font-size: 0.875rem;
}

.row .sum {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--display);
  white-space: nowrap;
}

.row .sum .icon-btn {
  width: 2rem;
  height: 2rem;
  color: var(--ink-3);
  font-size: 1rem;
}

.total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 12px;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Метки — в строку: .row .what span делает дочерние блоками. */
.row .what .tags {
  display: flex;
}

.tag {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.75rem;
}

/* ── Пусто: состав не собрать ───────────────────────────────────────── */

.empty {
  padding: 22px 18px;
  margin-bottom: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--r-m);
  background: var(--card);
  text-align: center;
}

.empty h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
}

.fix {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  background: var(--paper);
  text-align: left;
  font-size: 0.9375rem;
}

/* ── Статус заказа ──────────────────────────────────────────────────── */

.status {
  text-align: center;
  padding: 18px 0 8px;
}

.status .num {
  font-family: var(--display);
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.status .state {
  margin-top: 6px;
  font-family: var(--display);
  font-size: 1.125rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 18px 0 6px;
}

.steps i {
  height: 4px;
  border-radius: 999px;
  background: var(--sunken);
}

.steps i.on {
  background: var(--accent);
}

.steps-labels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  color: var(--ink-3);
  font-size: 0.75rem;
}

.spot {
  margin-top: 16px;
  padding: 20px;
  border-radius: var(--r-m);
  background: var(--ink);
  color: var(--paper);
  text-align: center;
}

.spot b {
  display: block;
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.spot.ready {
  background: var(--accent);
  color: var(--on-accent);
}

.spot span {
  opacity: 0.75;
  font-size: 0.875rem;
}

/* ── История и активный заказ ───────────────────────────────────────── */

.hist {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--card);
  text-align: left;
}

.hist b {
  font-weight: 600;
}

.hist span {
  color: var(--ink-3);
  font-size: 0.875rem;
}

/* ── Старт: два пути ────────────────────────────────────────────────── */

.start {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  padding: 24px 20px calc(28px + env(safe-area-inset-bottom));
}

.start-brand {
  text-align: center;
  margin-bottom: 8px;
}

/* Вордмарк — настоящий, вырезанный из макета лого целиком (оба
   слова одной картинкой, как и знак): шрифт в точности авторский. */
/* МИМО — размером со знак: оба образуют один вертикальный лок-ап. */
.start-brand .wordmark {
  display: block;
  width: 128px;
  max-width: 50%;
  height: auto;
  margin: 14px auto 0;
}

.start-brand p {
  margin: 12px 0 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.875rem;
  color: var(--ink-3);
}

.start-actions {
  display: grid;
  gap: 10px;
}

.primary.tall,
.ghost.tall {
  min-height: 64px;
  font-size: 1.125rem;
  border-radius: var(--r-l);
}

/* ── Вкладки «Заказы | Кофейни» ─────────────────────────────────────── */

.tabs {
  display: flex;
  gap: 18px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.tabs button {
  padding: 8px 0 12px;
  border: 0;
  background: none;
  font-family: var(--display);
  font-size: 1rem;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tabs button[aria-pressed='true'] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ── Прошлые заказы ─────────────────────────────────────────────────── */

.past {
  display: grid;
  gap: 12px;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--card);
}

.past-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.past-what {
  flex: 1;
  min-width: 0;
}

.past-what b {
  display: block;
  font-weight: 600;
}

.past-what span {
  color: var(--ink-3);
  font-size: 0.875rem;
}

.primary.slim {
  min-height: 46px;
  font-size: 1rem;
}

.logo.sm {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1rem;
}

/* ── Строки кофеен и сердечко ───────────────────────────────────────── */

.shop-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--card);
  text-align: left;
}

.shop-row-t {
  flex: 1;
  min-width: 0;
}

.shop-row-t b {
  display: block;
  font-family: var(--display);
  font-weight: 600;
}

.shop-row-t span {
  color: var(--ink-3);
  font-size: 0.8125rem;
}

/* Сердечко — единственное место, где акцент значит «моё», а не
   «действие»: любимая кофейня — это тоже про себя. */
.heart {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--ink-3);
  font-size: 1.25rem;
}

.heart.on {
  color: var(--accent);
}

.heart.big {
  font-size: 1.5rem;
}

/* ── Квиз «Создать заказ» ───────────────────────────────────────────── */

.quiz-progress {
  display: flex;
  gap: 6px;
  padding: 0 16px 12px;
  flex: 0 0 auto;
}

.quiz-progress i {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--sunken);
}

.quiz-progress i.on {
  background: var(--accent);
}

.hero {
  padding: 6px 0 16px;
}

.hero h2 {
  font-size: 1.75rem;
  line-height: 1.1;
}

.hero p {
  margin: 8px 0 0;
  color: var(--ink-3);
}

/* Плитка категории без глифа — текст по центру высоты. */
.tile.quiz {
  min-height: 96px;
  align-content: center;
}

/* Крупный вариант ответа: одна строка — одно решение. */
.choice {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--card);
  text-align: left;
  transition: transform var(--fast) var(--ease);
}

.choice:active {
  transform: scale(0.99);
}

.choice[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent);
}

.choice-letter {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--sunken);
  font-family: var(--display);
  font-size: 1.125rem;
  font-weight: 600;
}

.choice-t b {
  display: block;
  font-family: var(--display);
  font-size: 1.0625rem;
}

.choice-t span {
  color: var(--ink-3);
  font-size: 0.875rem;
}

/* Предупреждение об аллергенах: заметно, но не сирена. */
.warn {
  margin: 6px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--danger);
  border-radius: var(--r-s);
  background: var(--card);
  color: var(--ink-2);
  font-size: 0.875rem;
}

/* Ввод адреса. */
.addr {
  display: grid;
  gap: 8px;
  margin: -4px 0 12px;
}

.addr input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  background: var(--card);
  font: inherit;
}

/* Подпись точки отсчёта на карте: «м. Лубянка» или адрес. */
.origin-tag {
  position: absolute;
  transform: translate(-50%, 10px);
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-size: 0.6875rem;
  white-space: nowrap;
}

/* ── Строка еды: в предложке корзины и во вкладке «Еда» ─────────────── */

.upsell {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--card);
  text-align: left;
  transition: transform var(--fast) var(--ease);
}

.upsell:active {
  transform: scale(0.99);
}

.upsell .glyph {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  color: var(--ink-2);
}

.upsell-t {
  flex: 1;
  min-width: 0;
}

.upsell-t b {
  display: block;
  font-weight: 600;
}

.upsell-t span {
  color: var(--ink-3);
  font-size: 0.8125rem;
}

.upsell-price {
  flex: 0 0 auto;
  font-family: var(--display);
  font-weight: 600;
  white-space: nowrap;
}

/* ── Любимые кофейни: карточка, а не строчка ────────────────────────── */

.shop-row.fav {
  padding: 16px;
  border-color: var(--ink);
}

.shop-row.fav .shop-row-t b {
  font-size: 1.1875rem;
}

.shop-row.fav .shop-row-t > span {
  font-size: 0.875rem;
}

/* ── Комментарий для бариста ────────────────────────────────────────── */

.comment {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  background: var(--paper);
  font: inherit;
  color: inherit;
  resize: none;
}

.comment:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

/* ── Код из SMS ─────────────────────────────────────────────────────── */

.login-code {
  font-size: 1.5rem;
  letter-spacing: 0.4em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.login-code-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.linkish:disabled {
  text-decoration: none;
  opacity: 0.7;
}

/* ── Карта во весь экран: баннер и нижний слой ──────────────────────── */

.map-banner {
  position: absolute;
  top: 72px;
  left: 14px;
  right: 14px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--r-m);
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 6px 18px rgba(16, 16, 16, 0.18);
}

.map-banner b {
  display: block;
  font-family: var(--display);
  font-size: 1.0625rem;
  line-height: 1.25;
}

.map-banner button {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid rgba(245, 243, 239, 0.35);
  border-radius: 999px;
  background: none;
  color: var(--paper);
  font-size: 0.875rem;
}

.map-sheet {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 4;
  /* Карта — главное: карточке достаётся не больше половины экрана. */
  max-height: 50dvh;
  overflow-y: auto;
  max-width: calc(460px - 28px);
  margin: 0 auto;
}

.map-sheet .shop,
.map-sheet .empty {
  margin-bottom: 0;
  box-shadow: 0 10px 28px rgba(16, 16, 16, 0.16);
}

/* ── Кофейни дальше 3 км: списком в шторке, а не булавками по краю ─── */

.near-list {
  padding: 8px 16px 16px;
  border-radius: var(--r-m);
  background: var(--paper);
  box-shadow: 0 10px 28px rgba(16, 16, 16, 0.16);
}

.near-list .section-title {
  margin: 4px 0 2px;
}

.near-list .near b { display: block; }
.near-list .near span { display: block; opacity: .75; font-size: 13px; }
.near-list .near[aria-pressed="true"] { outline: 2px solid var(--accent, #d5e044); }
.near-list .near {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  text-align: left;
}

.near-list + .shop,
.near-list + .primary {
  margin-top: 10px;
}

/* «Определили примерно» — строкой над картой. */
.geo-note {
  margin: 0;
  padding: 8px 16px;
}

/* ── Активный заказ на старте ───────────────────────────────────────── */

.hist.active-order {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(244, 88, 28, 0.12);
}

/* ── Видео на старте ────────────────────────────────────────────────── */

.start.with-video {
  position: relative;
  overflow: hidden;
  background: var(--ink) url('/media/hero-poster.webp') center / cover no-repeat;
  color: var(--paper);
}

.start-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Затемнение снизу вверх: текст и кнопки должны читаться на любом
   кадре, а не только на удачном. */
.start-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(16, 16, 16, 0.82) 0%,
    rgba(16, 16, 16, 0.45) 45%,
    rgba(16, 16, 16, 0.35) 100%
  );
}

.start.with-video > *:not(.start-video):not(.start-shade) {
  position: relative;
  z-index: 2;
}

.start.with-video .start-brand p,
.start.with-video .note {
  color: rgba(245, 243, 239, 0.75);
}

.start.with-video .ghost {
  background: rgba(245, 243, 239, 0.12);
  border-color: rgba(245, 243, 239, 0.4);
  color: var(--paper);
}

.start.with-video .hist {
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
}

.start.with-video .hist span {
  color: var(--ink-3);
}

@media (prefers-reduced-motion: reduce) {
  .start-video {
    display: none;
  }
}

/* ── Поиск станции метро ────────────────────────────────────────────── */

.metro-box {
  display: grid;
  gap: 8px;
  margin: -4px 0 12px;
}

.metro-box input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  background: var(--card);
  font: inherit;
}

.metro-box input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.metro-box .fix {
  margin-top: 0;
  background: var(--card);
}

/* ── Где точка стоит: улица, дом, ТЦ с этажом ───────────────────────── */

.shop-place {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.shop-place svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--ink-3);
}

/* ── «Как пройти» на экране заказа ──────────────────────────────────── */

.route-text {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* ── «Мимо»: режим, машина, голос, гео-пуш ──────────────────────────── */

.mode-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(16, 16, 16, 0.55);
  backdrop-filter: blur(4px);
  width: min(360px, 96%);
  margin: 0 auto;
}

.mode-seg button {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(245, 243, 239, 0.8);
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.8125rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mode-seg button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.mode-seg button[aria-pressed='true'] {
  background: var(--accent);
  color: var(--on-accent);
}

.voice-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
}

.voice-btn svg {
  width: 18px;
  height: 18px;
}

.be-partner {
  display: block;
  text-align: center;
  color: rgba(245, 243, 239, 0.75);
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.geo-push {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-m);
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 10px 28px rgba(16, 16, 16, 0.25);
  animation: rise-in var(--base) var(--ease);
}

@keyframes rise-in {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
}

.geo-push-t {
  flex: 1;
  min-width: 0;
}

.geo-push-t b {
  display: block;
  font-family: var(--display);
  font-size: 0.9375rem;
}

.geo-push-t span {
  color: var(--ink-3);
  font-size: 0.8125rem;
}

.geo-push .primary.slim {
  width: auto;
  min-height: 40px;
  padding: 0 16px;
}

.car-card {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--card);
}

.car-card svg {
  width: 180px;
  height: auto;
}

.plate {
  padding: 4px 14px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.12em;
}

.car-colors {
  display: flex;
  gap: 10px;
  margin: 4px 0 14px;
}

.car-color {
  width: 36px;
  height: 36px;
  border: 2px solid var(--line);
  border-radius: 999px;
}

.car-color[aria-pressed='true'] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.car-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.car-line svg {
  width: 72px;
  flex: 0 0 auto;
}

.car-line .what b {
  display: block;
  color: var(--ink);
}

.car-line .what span {
  color: var(--ink-3);
  font-size: 0.8125rem;
}

.voice-pulse {
  width: 84px;
  height: 84px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}

.voice-pulse svg {
  width: 34px;
  height: 34px;
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 16px rgba(244, 88, 28, 0.08);
  }
}

.voice-text {
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: 1.25rem;
}

/* ── Поля формы (экран машины) ──────────────────────────────────────── */

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.field > span {
  font-size: 0.875rem;
  color: var(--ink-2);
}

.field input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  background: var(--card);
  font: inherit;
  color: inherit;
}

/* ── Маршрут «Мимо проезжал» ────────────────────────────────────────── */

.route-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.route-line polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 0.55;
  stroke-dasharray: 1.3 1.1;
  stroke-linecap: round;
  opacity: 0.8;
}

.me.dest-dot {
  background: var(--accent);
}

/* ── Знак «Мимо» ────────────────────────────────────────────────────── */

.mimo-mark {
  display: block;
  margin: 0 auto 10px;
  width: 128px;
  height: auto;
}

/* Ссылка партнёру: просто строка в правом верхнем углу, без плашки. */
.join-link {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: 18px;
  color: var(--ink-2);
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.8125rem;
  text-decoration: none;
}

.join-top {
  display: block;
  width: fit-content;
  margin: 0 auto;
  padding: 8px 16px;
  border: 1px solid rgba(213, 224, 68, 0.75);
  border-radius: 999px;
  color: var(--accent);
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.8125rem;
  text-decoration: none;
  background: var(--ink);
}

.start.with-video .start-brand .wordmark {
  /* На тёмном видео вордмарк-картинку пришлось бы инвертировать;
     сейчас видео выключено, фон светлый — картинка чёрная как есть. */
  filter: invert(1) hue-rotate(180deg);
}

/* ── Состав заказа — главный блок корзины ───────────────────────────── */

.order-card {
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* ── Мини-степпер еды в меню кофейни ────────────────────────────────── */

.upsell.picked {
  border-color: var(--accent);
}

.qty-mini {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-mini button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 1.125rem;
  line-height: 1;
}

.qty-mini b {
  font-family: var(--display);
  min-width: 1.1rem;
  text-align: center;
}

/* ── Барабан времени, как будильник ─────────────────────────────────── */

.wheel-box {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 8px;
  height: 132px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--card);
  overflow: hidden;
}

.wheel {
  width: 72px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  text-align: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.375rem;
}

.wheel::-webkit-scrollbar {
  display: none;
}

.wheel::before,
.wheel::after {
  content: '';
  display: block;
  height: 44px;
}

.wheel > div {
  height: 44px;
  line-height: 44px;
  scroll-snap-align: center;
}

.wheel-sep {
  align-self: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.375rem;
}

/* Окно выбора: центральная строка подчёркнута, края гаснут. */
.wheel-win {
  position: absolute;
  left: 18%;
  right: 18%;
  top: 44px;
  height: 44px;
  border-top: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  pointer-events: none;
}

.wheel-box::before,
.wheel-box::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 40px;
  pointer-events: none;
  z-index: 1;
}

.wheel-box::before {
  top: 0;
  background: linear-gradient(var(--card), transparent);
}

.wheel-box::after {
  bottom: 0;
  background: linear-gradient(transparent, var(--card));
}

/* ── Поле адреса с микрофоном ───────────────────────────────────────── */

.dest-line {
  display: flex;
  gap: 8px;
}

.dest-line input {
  flex: 1;
}

.mic-btn {
  flex: 0 0 auto;
  width: 46px;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  background: var(--card);
  display: grid;
  place-items: center;
  color: var(--ink-2);
}

.mic-btn svg {
  width: 20px;
  height: 20px;
}

/* ── Ссылка-кнопка на внешние карты ─────────────────────────────────── */

a.ghost.route-ext {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  text-decoration: none;
  color: inherit;
}

/* ── Крупный крестик удаления ───────────────────────────────────────── */

.icon-btn.big-x {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.5rem;
  color: var(--ink);
}

/* ── Оценка на Яндекс.Картах ────────────────────────────────────────── */

.ya-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--display);
  font-weight: 700;
}

.ya-badge i {
  font-style: normal;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: #fc3f1d;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

/* ── Проверка оплаты после возврата со страницы ЮKassa ─────────────── */

.pay-check {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 18px;
  text-align: center;
}

.pay-check .fix {
  margin-top: 4px;
}

.pay-check-place {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--ink-2);
}

.pay-check-place span {
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--ink);
}

.pay-check-spin {
  width: 40px;
  height: 40px;
  margin-bottom: 6px;
  border: 3px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: pay-check-spin 0.9s linear infinite;
}

@keyframes pay-check-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pay-check-spin {
    animation: none;
    border-top-color: var(--ink-3);
  }
}
