/* Главная, поиск, история и профиль (задача 2): классы .home- .search- .hist- .prof- и карточка «Моя машина» главной
   телефона .car-card (строка выбора машины без машины — .car-entry в car.css).
   Размеры и цвета — из макетов: phone-01/02/03/25/26/30/31, desktop-01/05/21; подсветка — переменные --glow- из
   tokens.css. Где в макете высота строки не задана (normal), она записана числом: у Onest normal ≈ 1.275 размера
   шрифта, а у страницы по умолчанию 1.4. Цвета #C4CAD1 (текст на тёмной карточке) и #A0A7B0 (стрелки) взяты из
   макетов. */

/* ---------- Главная телефона: шапка и разделы (phone-01) ---------- */
.home-top { display: flex; align-items: center; gap: 10px; padding: 4px 16px 6px; }
.home-city {
  position: relative;
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 40px;
  margin-left: auto;
  padding: 0 12px;
  border-radius: var(--r-20);
  background: var(--c-surface);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
/* Чип 40 px, как в макете, а нажимается полоса 44 px */
.home-city::after { content: ''; position: absolute; inset: -2px 0; }
/* Длинное название города («Санкт-Петербург») сокращается, а не раздвигает шапку */
.home-city-name { overflow: hidden; text-overflow: ellipsis; }

/* Разделы прокручиваются вбок. Поля 8 px сверху и снизу вмещают полосу нажатия 44 px и свечение текущей вкладки:
   прокрутка обрезает всё, что выходит за полосу разделов */
.home-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--c-border);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.home-tabs::-webkit-scrollbar { display: none; }
/* Вкладка — «пилюля», как вкладки шапки компьютера (.hdr-tab, shell.css); прозрачная рамка держит размер вкладки
   одинаковым с подсветкой и без неё */
.home-tab {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: 15px;
  color: var(--c-muted-3);
  transition: color .18s, background-color .18s, border-color .18s;
}
.home-tab-active {
  border-color: var(--glow-pill-border);
  background: var(--glow-pill);
  box-shadow: var(--glow-pill-shadow);
  font-weight: 700;
  color: var(--c-primary-ink);
}
.home-tab-active .soon { background: #fff; }
/* Вкладки — ссылки. «Пилюля» 34 px, а нажимается полосой 44 px: от края полей внутри рамки (32 px) — на 6 px вверх
   и вниз. Кольцо фокуса внутри, иначе его срежет прокрутка разделов */
.home-tab::after { content: ''; position: absolute; inset: -6px 0; }
.home-tab:focus-visible { outline-offset: -2px; }

/* ---------- Главная телефона: поиск, тёмная карточка, последняя проверка или шаги ---------- */
.home-body { display: flex; flex-direction: column; gap: 16px; padding: 14px 16px 0; }
.home-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 14px;
  border-radius: var(--r-16);
  background: var(--c-surface);
  color: var(--c-text-2);
  font-size: 15px;
}

.home-hero { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.home-hero-title { font-size: 23px; font-weight: 700; line-height: 28px; }
.home-hero-text { margin-top: 6px; font-size: 14px; line-height: 20px; color: #C4CAD1; }
.home-free { margin-top: -4px; font-size: 12px; line-height: 16px; color: var(--c-muted-2); text-align: center; }

/* «Моя машина» под тёмной карточкой — светлая карточка-акцент, кнопка каталога машин (views/car.mjs). Строки внутри
   кнопки — span, в столбик. Длинное название («Mercedes-Benz GLE Coupe AMG 53 4MATIC+») сокращается многоточием */
.car-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px 12px 12px;
  border: 1px solid var(--glow-border);
  border-radius: var(--r-20);
  background: var(--glow-card);
  box-shadow: var(--glow-shadow);
  transition: border-color .18s;
}
.car-card-tile {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--glow-tile-border);
  border-radius: var(--r-16);
  background: #fff;
  color: var(--c-primary);
}
.car-card-text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.car-card-label { font-size: 12px; font-weight: 600; line-height: 16px; color: var(--c-primary-ink); }
.car-card-name { overflow: hidden; font-size: 17px; font-weight: 700; line-height: 22px; white-space: nowrap; text-overflow: ellipsis; }
.car-card-sub { font-size: 13px; line-height: 18px; color: var(--c-text-2); }
.car-card > .ic { flex: none; color: var(--c-primary); }

.home-h2 { font-size: 20px; font-weight: 700; line-height: 25px; }
.home-last { display: flex; flex-direction: column; gap: 8px; }
.home-last-head { display: flex; align-items: center; gap: 12px; }
/* Короткое «Все» нажимается полем 44 × 44, текст остаётся у правого края */
.home-all { min-width: 44px; margin-left: auto; padding: 12px 0 12px 12px; font-size: 14px; font-weight: 600; line-height: 20px; text-align: right; color: var(--c-primary); }

.home-how { display: flex; flex-direction: column; gap: 10px; }
.home-steps { padding: 0 16px; border-radius: var(--r-24); background: var(--c-surface); }
.home-step { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0; font-size: 15px; line-height: 20px; }
.home-step + .home-step { border-top: 1px solid var(--c-border-2); }
.home-step-num {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
}
.home-rules-row {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 54px;
  margin-top: 6px;
  padding: 0 16px;
  border-radius: var(--r-18);
  background: var(--c-surface);
  font-size: 15px;
  font-weight: 600;
}
.home-rules-row .ic { margin-left: auto; color: #A0A7B0; }

/* ---------- Главная компьютера: справа машина и последняя проверка или шаги и правила (desktop-01, desktop-21) ---------- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; align-items: start; padding: 32px 0 40px; }
.home-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.home-side > .home-h2:not(:first-child), .home-side > .home-last:not(:first-child) { margin-top: 10px; }
/* «Последняя проверка» стоит, как в desktop-01: строка заголовка 28 px и 16 px до карточки.
   «Все» нажимается полем 44 px, а строку не раздвигает */
.home-side > .home-last { gap: 16px; }
.home-side .home-all { margin-block: -8px; }
/* Карточка-акцент, как «Моя машина» телефона (.car-card): тот же фон, рамка и свечение */
.home-mycar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--glow-border);
  border-radius: var(--r-24);
  background: var(--glow-card);
  box-shadow: var(--glow-shadow);
  transition: border-color .18s;
}
.home-mycar-icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--glow-tile-border);
  border-radius: var(--r-18);
  background: #fff;
}
.home-mycar-text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.home-mycar-label { font-size: 13px; line-height: 17px; color: var(--c-text-2); }
.home-mycar-name { font-size: 20px; font-weight: 700; line-height: 25px; }
.home-mycar-city { font-size: 14px; line-height: 18px; color: var(--c-text-2); }
.home-rules { padding: 4px 20px; border-radius: var(--r-24); font-size: 14px; line-height: 20px; }

@media (min-width: 1024px) {
  .home-h2 { font-size: 22px; line-height: 28px; }
  .home-steps { padding: 0 20px; }
  .home-step { gap: 14px; min-height: 60px; }
  .home-step-num { width: 32px; height: 32px; }
}

/* ---------- Подвал главной: ссылки на документы (страницы /privacy, /consent, /terms) ---------- */
/* Телефон: строка «© 2026 Не переплати» и под ней ссылки столбиком, у каждой полоса нажатия 44 px. Точки между
   ссылками — только в строке компьютера: в столбике они повисали бы на краях строк */
.home-foot { display: flex; flex-direction: column; align-items: flex-start; padding: 28px 16px 0; font-size: 13px; line-height: 18px; color: var(--c-text-2); }
.home-foot-copy { padding: 6px 0; }
.home-foot-link { display: inline-flex; align-items: center; min-height: 44px; }
.home-foot-dot { display: none; }
@media (min-width: 1024px) {
  .home-foot { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 8px; padding: 8px 0 24px; border-top: 1px solid var(--c-border); }
  .home-foot-dot { display: inline; }
}

/* ---------- Карточка проверки: «Последняя проверка» на главной и строки истории ---------- */
.hist-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--r-24); background: var(--c-surface); transition: background-color .15s; }
.hist-card-top { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 17px; color: var(--c-text-2); }
.hist-card-top .ic { margin-left: auto; color: #A0A7B0; }
.hist-card-total { font-size: 28px; font-weight: 700; line-height: 32px; letter-spacing: -.02em; }
.hist-card-save {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--c-ok-bg);
  color: var(--c-ok-text);
  font-size: 13px;
  font-weight: 600;
}
@media (min-width: 1024px) {
  .hist-card { gap: 12px; padding: 22px; }
  .hist-card-top { font-size: 14px; line-height: 18px; }
  .hist-card-total { font-size: 34px; line-height: 38px; }
  .hist-card-bar { --bar3-h: 10px; }
  .hist-card-save { height: 32px; font-size: 14px; }
}

/* ---------- История (phone-25, phone-31; компьютер — колонка до 720 px, заголовок 32 px) ---------- */
/* Профиль — тоже пункт нижнего меню: заголовок страницы у него такой же */
.hist-title, .prof-title { padding: 8px 20px 12px; font-size: 30px; font-weight: 700; line-height: 38px; letter-spacing: -.02em; }
.hist-list { display: flex; flex-direction: column; gap: 10px; padding: 0 16px; }
.hist-group { display: flex; flex-direction: column; gap: 10px; }
.hist-group + .hist-group { margin-top: 10px; }
.hist-month { padding: 4px 4px 0; font-size: 13px; font-weight: 600; line-height: 17px; color: var(--c-text-2); }
.hist-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 560px;
  /* В макете блок стоит внутри полей списка: 16 + 24 px */
  padding: 0 40px;
  text-align: center;
}
.hist-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: var(--r-24);
  background: var(--c-surface);
  color: var(--c-text-2);
}
.hist-empty-title { margin-top: 6px; font-size: 21px; font-weight: 700; line-height: 26px; }
.hist-empty-text { font-size: 15px; line-height: 21px; color: var(--c-text-2); }
.hist-empty-btn { margin-top: 10px; padding: 0 28px; }

/* ---------- Профиль (phone-26 без шапки с «Назад»: профиль — пункт меню; компьютер — колонка до 720 px) ---------- */
.prof-list { margin: 8px 16px 0; padding: 0 16px; border-radius: var(--r-24); background: var(--c-surface); }
.prof-list > li + li { border-top: 1px solid var(--c-border-2); }
.prof-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 58px; padding: 8px 0; font-size: 15px; line-height: 20px; }
.prof-row-label { flex: 1; }
.prof-row-value { color: var(--c-text-2); text-align: right; }
.prof-row .ic { color: #A0A7B0; }
/* «Документы» — details: строка-заголовок как остальные строки (без маркера браузера), стрелка смотрит вниз, пока
   список открыт. Ссылки — по 44 px, отступом под подписью строки */
.prof-docs > summary { list-style: none; cursor: pointer; }
.prof-docs > summary::-webkit-details-marker { display: none; }
.prof-docs > summary .ic { transition: transform .18s var(--ease); }
.prof-docs[open] > summary .ic { transform: rotate(90deg); }
.prof-docs-list { padding: 0 0 8px 12px; }
.prof-doc { display: flex; align-items: center; min-height: 44px; font-size: 15px; line-height: 20px; color: var(--c-primary); }

@media (min-width: 1024px) {
  .hist, .prof { max-width: 720px; padding: 32px 0 40px; }
  .hist-title, .prof-title { margin-bottom: 20px; padding: 0; font-size: 32px; }
  .hist-list { padding: 0; }
  .hist-month { font-size: 14px; line-height: 18px; }
  .hist-empty { min-height: 420px; padding: 0 24px; }
  .prof-list { margin: 0; }
}

/* ---------- Шторки «Город» (phone-02) и «Согласия и данные» ---------- */
.prof-sheet { display: flex; flex-direction: column; gap: 14px; }
/* Справа место под крестик оболочки */
.prof-sheet-title { padding-right: 40px; font-size: 24px; font-weight: 700; line-height: 30px; letter-spacing: -.02em; }
.prof-find {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 14px;
  border-radius: var(--r-14);
  background: var(--c-surface);
  color: var(--c-text-2);
  cursor: text;
}
.prof-find:focus-within { box-shadow: inset 0 0 0 2px var(--c-dark); }
/* 16 px, а не 15 px макета: с меньшим шрифтом iPhone увеличивает страницу при вводе */
.prof-find-input { flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; font-size: 16px; color: var(--c-text); appearance: none; }
.prof-find-input:focus-visible { outline: none; }
/* В макете «Найти город» цвета лупы (#5E6670), а не бледная подсказка обычных полей из tokens.css */
.prof-find-input::placeholder { color: var(--c-text-2); }
.prof-find-input::-webkit-search-cancel-button { appearance: none; }
.prof-cities { padding: 0 16px; border-radius: var(--r-22); background: var(--c-surface); }
.prof-cities > li + li { border-top: 1px solid var(--c-border-2); }
.prof-city { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; font-size: 16px; }
.prof-city[aria-current] { font-weight: 600; }
.prof-city-name { flex: 1; }
.prof-city .ic { color: var(--c-ok); }
.prof-facts { padding: 4px 16px; border-radius: var(--r-20); background: var(--c-surface); font-size: 15px; line-height: 21px; }
.prof-facts > p { padding: 12px 0; }
.prof-facts > p + p { border-top: 1px solid var(--c-border-2); }

/* ---------- Поиск телефона (phone-03) ---------- */
.search-top { display: flex; flex-direction: column; gap: 10px; padding: 2px 12px 12px; border-bottom: 1px solid var(--c-border); }
.search-bar { display: flex; align-items: center; gap: 6px; }
.search-back { display: flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; }
.search-field {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  height: 48px;
  padding: 0 2px 0 12px;
  border-radius: var(--r-14);
  background: var(--c-surface);
  color: var(--c-text-2);
}
/* Как поле шапки компьютера: рамка поля и есть знак фокуса */
.search-field:focus-within { box-shadow: inset 0 0 0 2px var(--c-dark); }
.search-field-in { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; height: 100%; cursor: text; }
.search-input { flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; font-size: 16px; color: var(--c-text); appearance: none; }
.search-input:focus-visible { outline: none; }
.search-input::-webkit-search-cancel-button { appearance: none; }
.search-clear { display: flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--r-12); color: var(--c-text-2); }
/* Чипы прокручиваются вбок; поля сверху и снизу оставляют чипам 36 px полосу нажатия 44 px (.chip-sm::after) */
.search-chips { display: flex; gap: 8px; margin: -4px 0; padding: 4px 0 4px 4px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.search-chips::-webkit-scrollbar { display: none; }
/* Чип не шире 60 % экрана и 240 px: длинное название машины сокращается многоточием, а чип города виден рядом.
   Самый длинный город («Екатеринбург», «Санкт-Петербург») в этот размер помещается целиком */
.search-chips .chip { flex: none; max-width: min(240px, 60vw); }
.search-chip-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.search-results { display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 40px; }
.search-section { display: flex; flex-direction: column; gap: 10px; }
.search-section + .search-section { margin-top: 8px; }
.search-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; line-height: 17px; color: var(--c-text-2); }
.search-tag { padding: 2px 7px; border-radius: var(--r-6); background: var(--c-ask-bg); color: var(--c-ask-text); font-size: 11px; font-weight: 600; line-height: 14px; }
.search-list { display: flex; flex-direction: column; gap: 10px; }
.search-row { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; border-radius: var(--r-18); background: var(--c-surface); }
.search-row-text { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.search-row-name { font-size: 15px; font-weight: 600; line-height: 20px; }
.search-row-sub { font-size: 13px; line-height: 18px; color: var(--c-text-2); }
.search-row-range { font-size: 15px; font-weight: 700; line-height: 20px; white-space: nowrap; }
.search-works .search-row-range { font-size: 14px; }
.search-row .ic { color: #A0A7B0; }
.search-hint { padding: 48px 12px; font-size: 15px; line-height: 21px; color: var(--c-text-2); text-align: center; }
/* «Пока поиск идёт по примеру…»: под полем, пока запроса нет, и под результатами */
.search-note { font-size: 13px; line-height: 18px; color: var(--c-text-2); }
.search-empty { padding: 48px 12px; text-align: center; }
.search-empty-title { font-size: 18px; font-weight: 700; line-height: 23px; }
.search-empty-text { margin-top: 6px; font-size: 14px; line-height: 20px; color: var(--c-text-2); }

/* ---------- Выпадающий список поиска в шапке компьютера (desktop-05) ---------- */
/* В макете min-height 56 px без border-box, плюс поля 6 px: строка 68 px */
.search-drop-row { display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 6px 12px; border-radius: var(--r-12); }
.search-drop-text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.search-drop-name { font-size: 15px; font-weight: 600; line-height: 20px; }
.search-drop-sub { font-size: 13px; line-height: 18px; color: var(--c-text-2); }
.search-drop-range { font-size: 14px; font-weight: 700; line-height: 18px; white-space: nowrap; }
.search-drop-empty { padding: 16px 12px; font-size: 14px; line-height: 20px; color: var(--c-text-2); }

@media (hover: hover) {
  .home-city:hover, .home-search:hover, .home-rules-row:hover, .hist-card:hover, .search-row:hover { background: var(--c-surface-hover); }
  /* Карточка-акцент при наведении — рамкой ярче, как подсветка текущей вкладки */
  .car-card:hover, .home-mycar:hover { border-color: var(--glow-pill-border); }
  /* Список шапки белый: строка подсвечивается обычной поверхностью, как в макете */
  .search-drop-row:hover { background: var(--c-surface); }
  /* Ссылки на документы — подчёркиванием */
  .home-foot-link:hover, .prof-doc:hover { text-decoration: underline; text-underline-offset: 2px; }
}
