/* ==========================================================================
   Прокат Авто — стили
   1. Шрифты  2. Токены  3. Темы  4. Основа  5. Кнопки и поля
   6. Шапка  7. Первый экран  8. Каталог  9. Подробности  10. Запрос
   11. Шаги, условия, вопросы  12. Подвал  13. Диалоги  14. Движение
   Цвета бренда приходят из конфигурации (--brand-*); значения ниже — запасные.
   ========================================================================== */

/* 1. Шрифты — Onest и Unbounded (SIL OFL 1.1), только нужные наборы символов */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/onest-cyrillic-wght-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/onest-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/onest-rub-wght.woff2') format('woff2');
  unicode-range: U+20BD;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('../fonts/unbounded-cyrillic-wght-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('../fonts/unbounded-punct-wght.woff2') format('woff2');
  unicode-range: U+0020-0040, U+005B-0060, U+007B-007E, U+00A0-00BF, U+00D7, U+2010-2027, U+2030-205E;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('../fonts/unbounded-rub-wght.woff2') format('woff2');
  unicode-range: U+20BD;
}

/* 2. Токены */
:root {
  --font-text: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: 'Unbounded', 'Onest', system-ui, sans-serif;

  --text-xs: 0.875rem;                                   /* 14 */
  --text-s: 0.9375rem;                                   /* 15 */
  --text-m: 1rem;                                        /* 16 */
  --text-l: clamp(1.0625rem, 1.02rem + 0.2vw, 1.1875rem);/* 17–19 */
  --text-xl: clamp(1.1875rem, 1.1rem + 0.4vw, 1.4375rem);/* 19–23 */
  --title-s: clamp(1.25rem, 1.12rem + 0.6vw, 1.625rem);  /* 20–26 */
  --title-m: clamp(1.5rem, 1.25rem + 1.2vw, 2.375rem);   /* 24–38 */
  --title-l: clamp(1.75rem, 1.3rem + 2.3vw, 3.5rem);     /* 28–56 */

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --section-y: clamp(56px, 7vw, 104px);
  --gutter: clamp(16px, 4vw, 32px);
  --container: 1200px;
  --header-h: 64px;

  --radius-xs: 6px;
  --radius-s: 10px;
  --radius-m: 14px;
  --radius-l: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --dur-fast: 160ms;
  --dur-base: 220ms;
  --dur-slow: 340ms;
  --dur-enter: 420ms;
  --ease-out: cubic-bezier(0.22, 0.8, 0.24, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --tap: 44px;
}

/* 3. Темы */
:root,
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f3f6fa;
  --surface-sunken: #eaf0f7;
  --line: #dbe2ec;
  --line-strong: #b9c5d6;
  --text: #0f1b2d;
  --text-muted: #46566c;
  --text-inverse: #ffffff;
  --accent: var(--brand-accent, #1846e8);
  --accent-text: var(--brand-accent, #1846e8);
  --accent-hover: color-mix(in oklab, var(--accent) 86%, #000);
  --accent-press: color-mix(in oklab, var(--accent) 74%, #000);
  --accent-soft: color-mix(in oklab, var(--accent) 9%, #fff);
  --accent-line: color-mix(in oklab, var(--accent) 28%, #fff);
  --on-accent: #ffffff;
  --positive: var(--brand-positive, #12805c);
  --positive-soft: color-mix(in oklab, var(--positive) 11%, #fff);
  --danger: var(--brand-danger, #c8282e);
  --danger-soft: color-mix(in oklab, var(--danger) 8%, #fff);
  --focus: color-mix(in oklab, var(--accent) 70%, #fff);
  --floor-top: #f6f9fc;
  --floor-bottom: #e3eaf4;
  --stage-top: color-mix(in oklab, var(--accent) 88%, #fff);
  --stage-bottom: color-mix(in oklab, var(--accent) 92%, #000);
  --banner-bg: #0f1b2d;
  --banner-text: #e9eef6;
  --shadow-1: 0 1px 2px rgb(15 27 45 / 0.06), 0 1px 1px rgb(15 27 45 / 0.04);
  --shadow-2: 0 10px 28px -14px rgb(15 27 45 / 0.22), 0 2px 6px rgb(15 27 45 / 0.06);
  --shadow-3: 0 28px 64px -28px rgb(15 27 45 / 0.38), 0 4px 12px rgb(15 27 45 / 0.08);
  --scrim: rgb(9 16 28 / 0.56);
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0d1420;
  --surface: #141d2c;
  --surface-alt: #111a28;
  --surface-sunken: #0b111b;
  --line: #27344a;
  --line-strong: #3a4a64;
  --text: #e8eef7;
  --text-muted: #a9b6ca;
  --text-inverse: #0f1b2d;
  --accent: var(--brand-accent-dark, #2c5bf0);
  --accent-text: var(--brand-accent-text-dark, #93b1ff);
  --accent-hover: color-mix(in oklab, var(--accent) 86%, #fff);
  --accent-press: color-mix(in oklab, var(--accent) 80%, #000);
  --accent-soft: color-mix(in oklab, var(--accent) 18%, #141d2c);
  --accent-line: color-mix(in oklab, var(--accent) 45%, #141d2c);
  --on-accent: #ffffff;
  --positive: var(--brand-positive-dark, #4cc79a);
  --positive-soft: color-mix(in oklab, var(--positive) 14%, #141d2c);
  --danger: var(--brand-danger-dark, #ff8080);
  --danger-soft: color-mix(in oklab, var(--danger) 12%, #141d2c);
  --focus: color-mix(in oklab, var(--accent-text) 85%, #fff);
  --floor-top: #1a2537;
  --floor-bottom: #111926;
  --stage-top: color-mix(in oklab, var(--accent) 62%, #0d1420);
  --stage-bottom: color-mix(in oklab, var(--accent) 34%, #0d1420);
  --banner-bg: #1b2a44;
  --banner-text: #e8eef7;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.3);
  --shadow-2: 0 12px 30px -16px rgb(0 0 0 / 0.6), 0 2px 6px rgb(0 0 0 / 0.3);
  --shadow-3: 0 28px 64px -28px rgb(0 0 0 / 0.75), 0 4px 12px rgb(0 0 0 / 0.35);
  --scrim: rgb(3 7 14 / 0.7);
}

/* 4. Основа */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  scrollbar-gutter: stable;
}
html:has(dialog[open]) { overflow: hidden; }

/* Пока скрипт строит страницу из конфигурации, содержимое скрыто, чтобы не было скачков.
   Если скрипт не загрузился, через 4 секунды страница покажется с сообщением. */
html.js:not(.is-ready) body.app { visibility: hidden; animation: boot-fallback 0s linear 4s forwards; }
@keyframes boot-fallback { to { visibility: visible; } }
.boot-fallback { display: none; }
html.js:not(.is-ready) .boot-fallback { display: block; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--text-m);
  line-height: 1.55;
  font-feature-settings: 'kern';
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
@media (max-width: 1023px) {
  body.has-mobile-bar { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}

h1, h2, h3, h4 { margin: 0; line-height: 1.2; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent-text); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-s);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: var(--space-3); }

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--alt { background: var(--surface-alt); }

.section-head {
  display: grid;
  gap: var(--space-3);
  max-width: 44rem;
  margin-bottom: clamp(var(--space-5), 4vw, var(--space-7));
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--title-m);
  font-weight: 520;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.section-title:focus { outline: none; }
.section-lead {
  color: var(--text-muted);
  font-size: var(--text-l);
  max-width: 38rem;
}

.icon { width: 20px; height: 20px; flex: none; }
.icon--s { width: 16px; height: 16px; }

.muted { color: var(--text-muted); }
.fineprint { color: var(--text-muted); font-size: var(--text-xs); line-height: 1.5; }

.demo-tag {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-s);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.4;
}

/* 5. Кнопки и поля */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-line: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap);
  padding: 10px 20px;
  border: 1.5px solid var(--btn-line);
  border-radius: var(--radius-s);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: var(--text-m);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:active { transform: scale(0.975); }
.btn--primary { --btn-bg: var(--accent); --btn-fg: var(--on-accent); box-shadow: 0 6px 16px -10px var(--accent); }
.btn--primary:hover { --btn-bg: var(--accent-hover); }
.btn--primary:active { --btn-bg: var(--accent-press); box-shadow: none; }
.btn--secondary { --btn-bg: var(--surface); --btn-fg: var(--text); --btn-line: var(--line-strong); }
.btn--secondary:hover { --btn-line: var(--accent); --btn-fg: var(--accent-text); }
.btn--secondary:active { --btn-bg: var(--accent-soft); }
.btn--ghost { --btn-fg: var(--accent-text); padding-inline: 12px; }
.btn--ghost:hover { --btn-bg: var(--accent-soft); }
.btn--block { width: 100%; }
.btn--l { min-height: 52px; padding-inline: 24px; font-size: var(--text-l); }
.btn[aria-pressed='true'] { --btn-bg: var(--positive-soft); --btn-fg: var(--positive); --btn-line: color-mix(in oklab, var(--positive) 45%, transparent); box-shadow: none; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--text);
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.icon-btn:hover { background: var(--surface-alt); }
.icon-btn:active { transform: scale(0.94); }

.field { display: grid; gap: 6px; min-width: 0; }
.field__label {
  font-size: var(--text-s);
  font-weight: 600;
  color: var(--text);
}
.field__label .muted { font-weight: 400; }
.field__hint { font-size: var(--text-xs); color: var(--text-muted); }

.input,
.select,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-m);
  line-height: 1.3;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background-color var(--dur-fast);
}
.input:hover,
.select:hover,
.textarea:hover { border-color: var(--text-muted); }
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 24%, transparent);
}
.input[aria-invalid='true'],
.select[aria-invalid='true'] {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.input[type='date'] { min-width: 0; appearance: none; -webkit-appearance: none; }
.input[type='date']::-webkit-date-and-time-value { text-align: left; }
.input[type='date']::-webkit-calendar-picker-indicator { opacity: 0.7; cursor: pointer; padding: 4px; }
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2346566c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
:root[data-theme='dark'] .select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23a9b6ca' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }

.field-error {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  color: var(--danger);
  font-size: var(--text-s);
  font-weight: 500;
  line-height: 1.4;
}
.field-error .icon { margin-top: 1px; }

.check {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-height: var(--tap);
  padding: 10px 0;
  cursor: pointer;
}
.check input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.check input::after {
  content: '';
  width: 12px;
  height: 7px;
  margin-top: -3px;
  border-left: 2.5px solid var(--on-accent);
  border-bottom: 2.5px solid var(--on-accent);
  transform: rotate(-45deg) scale(0.4);
  opacity: 0;
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast);
}
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { opacity: 1; transform: rotate(-45deg) scale(1); }
.check input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.check__text { display: grid; gap: 2px; }
.check__meta { color: var(--text-muted); font-size: var(--text-s); }

/* Чипы фильтров: настоящие радиокнопки */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-s);
  font-weight: 500;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast);
}
.chip span small { color: var(--text-muted); font-size: var(--text-xs); font-weight: 500; }
.chip input:hover + span { border-color: var(--line-strong); }
.chip input:checked + span { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip input:checked + span small { color: inherit; opacity: 0.75; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (pointer: coarse) { .chip span { min-height: var(--tap); } }

/* Плашка демонстрации */
.demo-banner {
  background: var(--banner-bg);
  color: var(--banner-text);
  font-size: var(--text-xs);
  line-height: 1.45;
}
.demo-banner__inner {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  padding-block: 10px;
}
.demo-banner .icon { color: #8fb0ff; }
@media (min-width: 768px) { .demo-banner { font-size: var(--text-s); } }

/* 6. Шапка */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in oklab, var(--bg) 94%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
@supports (backdrop-filter: blur(10px)) {
  .site-header { backdrop-filter: saturate(1.4) blur(12px); }
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-1); }
.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  color: var(--text);
  text-decoration: none;
  flex: none;
}
.brand__mark { width: 46px; height: auto; color: var(--accent-text); }
.brand__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand__logo-img { height: 36px; width: auto; }

.main-nav { margin-left: auto; }
.main-nav__list { display: flex; gap: 2px; list-style: none; }
.main-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 12px;
  border-radius: var(--radius-s);
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast);
}
.main-nav__link:hover { background: var(--surface-alt); color: var(--accent-text); }

.header-actions { display: flex; align-items: center; gap: var(--space-3); }

.theme-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 68px;
  height: var(--tap);
  padding: 0;
  border: 0;
  background: transparent;
  flex: none;
}
.theme-switch__track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  color: var(--text-muted);
}
.theme-switch__track .icon { width: 16px; height: 16px; position: relative; z-index: 1; transition: color var(--dur-base); }
.theme-switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-1), 0 0 0 1px var(--line);
  transition: transform var(--dur-base) var(--ease-out);
}
.theme-switch[aria-checked='true'] .theme-switch__thumb { transform: translateX(31px); }
.theme-switch[aria-checked='false'] .icon--sun,
.theme-switch[aria-checked='true'] .icon--moon { color: var(--accent-text); }
.theme-switch:hover .theme-switch__track { border-color: var(--text-muted); }

.menu-toggle { display: none; }
.mobile-nav { display: none; }

@media (max-width: 1023px) {
  .main-nav,
  .header-cta { display: none; }
  .header-actions { margin-left: auto; gap: var(--space-2); }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: var(--tap);
    padding: 0 14px;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius-s);
    background: var(--surface);
    font-weight: 600;
  }
  .menu-toggle:active { transform: scale(0.97); }
  .mobile-nav {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-3);
    transform-origin: top center;
  }
  .mobile-nav[hidden] { display: none !important; }
  .mobile-nav__list { list-style: none; padding-block: var(--space-2) var(--space-3); }
  .mobile-nav__link {
    display: flex;
    align-items: center;
    min-height: 52px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-size: var(--text-l);
    font-weight: 500;
    text-decoration: none;
  }
  .mobile-nav__cta { padding-bottom: var(--space-5); }
}
@media (max-width: 440px) {
  .site-header__inner { gap: var(--space-3); }
  .brand { gap: 8px; }
  .brand__name { font-size: 0.9375rem; }
  .brand__mark { width: 36px; }
  .menu-toggle { width: var(--tap); padding: 0; justify-content: center; }
  .menu-toggle__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .theme-switch { width: 62px; }
  .theme-switch[aria-checked='true'] .theme-switch__thumb { transform: translateX(25px); }
}

/* 7. Первый экран */
.hero { padding-block: clamp(20px, 4vw, 56px) clamp(40px, 6vw, 80px); }
.hero__grid {
  display: grid;
  gap: var(--space-5);
}
.hero__copy { display: grid; gap: var(--space-4); align-content: start; }
.hero__place { color: var(--text-muted); font-weight: 500; }
.hero__title {
  font-family: var(--font-display);
  font-size: var(--title-l);
  font-weight: 560;
  letter-spacing: -0.02em;
  line-height: 1.08;
  max-width: 15ch;
}
.hero__lead { font-size: var(--text-l); color: var(--text-muted); max-width: 32rem; }

.stage {
  position: relative;
  aspect-ratio: 16 / 9.5;
  border-radius: var(--radius-xl);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(120% 70% at 50% 100%, var(--stage-bottom) 0%, transparent 70%),
    linear-gradient(180deg, var(--stage-top) 0%, var(--stage-bottom) 100%);
}
/* Дорога: горизонт и разметка уходят вдаль */
.stage::before {
  content: '';
  position: absolute;
  inset: 58% 0 0;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.1), rgb(255 255 255 / 0) 30%),
    linear-gradient(180deg, rgb(4 12 40 / 0.0), rgb(4 12 40 / 0.28));
  border-top: 1px solid rgb(255 255 255 / 0.28);
  z-index: -1;
}
.stage__car {
  position: absolute;
  left: 50%;
  bottom: -3%;
  width: 92%;
  max-width: none;
  transform: translateX(-50%);
}
.stage__note {
  position: absolute;
  left: 16px;
  top: 14px;
  color: rgb(255 255 255 / 0.9);
  font-size: var(--text-xs);
  font-weight: 500;
}

/* Билет поездки: получение — маршрут — возврат */
.ticket {
  position: relative;
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-3);
}
.ticket__stub { display: grid; gap: var(--space-3); min-width: 0; }
.ticket__label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  font-size: var(--text-m);
}
.ticket__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  background: var(--surface);
  flex: none;
}
.ticket__stub--return .ticket__dot { background: var(--accent); }
.ticket__fields {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: var(--space-3);
}
.ticket__fields .field__label { font-weight: 500; color: var(--text-muted); font-size: var(--text-xs); }
.ticket__route {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-s);
  font-weight: 600;
}
.ticket__route::before,
.ticket__route::after {
  content: '';
  flex: 1;
  border-top: 2px dashed var(--line-strong);
}
.ticket__duration {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  color: var(--text-muted);
  white-space: nowrap;
  transition: background-color var(--dur-base), color var(--dur-base);
}
.ticket__duration.is-set { background: var(--accent-soft); color: var(--accent-text); }
.ticket__note { font-size: var(--text-s); color: var(--text-muted); }
.ticket__action .btn { width: 100%; }

@media (min-width: 640px) and (max-width: 1023px) {
  .stage { aspect-ratio: 21 / 9; }
  .stage__car { width: 64%; bottom: -2%; }
}

@media (min-width: 640px) and (max-width: 1179px) {
  .ticket {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: 'pickup return' 'route action' 'note note';
    column-gap: var(--space-5);
    align-items: center;
  }
  .ticket > .ticket__stub--pickup { grid-area: pickup; }
  .ticket > .ticket__stub--return { grid-area: return; }
  .ticket > .ticket__route { grid-area: route; }
  .ticket > .ticket__action { grid-area: action; }
  .ticket > .ticket__note { grid-area: note; }
}

@media (min-width: 1024px) {
  .hero__grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--space-7);
    align-items: center;
  }
  .hero__copy { padding-bottom: 72px; }
  .stage { aspect-ratio: 16 / 10.5; }
  .stage__car { width: 86%; bottom: 44px; }
  .ticket { margin-top: -64px; padding: var(--space-5) var(--space-6); }
}

@media (min-width: 1180px) {
  .ticket {
    grid-template-columns: minmax(0, 1fr) 176px minmax(0, 1fr) auto;
    grid-template-areas: 'pickup route return action' 'note note note note';
    align-items: end;
    column-gap: var(--space-5);
  }
  .ticket > .ticket__stub--pickup { grid-area: pickup; }
  .ticket > .ticket__stub--return { grid-area: return; }
  .ticket > .ticket__route { grid-area: route; height: 48px; }
  .ticket > .ticket__action { grid-area: action; }
  .ticket__action .btn { width: auto; min-height: 48px; }
  .ticket > .ticket__note { grid-area: note; }
}

/* 8. Каталог */
.catalog-toolbar {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.filter-group { display: grid; gap: var(--space-2); }
.filter-group__label { font-size: var(--text-s); font-weight: 600; color: var(--text-muted); }
.catalog-toolbar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
}
.catalog-toolbar__meta { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; min-height: var(--tap); }
.catalog-count { color: var(--text-muted); font-weight: 500; }
.sort-field { display: flex; align-items: center; gap: var(--space-3); }
.sort-field .select { width: auto; min-width: 190px; }
.catalog-note {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  margin-bottom: var(--space-5);
  color: var(--text-muted);
  font-size: var(--text-s);
}

@media (max-width: 639px) {
  .filter-group .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: calc(-1 * var(--gutter));
    padding: 6px var(--gutter);
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    scroll-padding-inline: var(--gutter);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - 40px), transparent);
  }
  .filter-group .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; scroll-snap-align: start; }
  .catalog-toolbar { gap: var(--space-3); }
  .catalog-toolbar__row { flex-wrap: nowrap; align-items: center; }
  .sort-field .field__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sort-field .select { min-width: 0; }
}

@media (min-width: 1024px) {
  .catalog-toolbar { grid-template-columns: auto 1fr; align-items: end; column-gap: var(--space-6); }
  .catalog-toolbar__row { grid-column: 1 / -1; }
}

.car-grid {
  display: grid;
  gap: var(--space-5);
  list-style: none;
}
@media (min-width: 640px) { .car-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .car-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); } }

.car-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  overflow: hidden;
  transition:
    transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out);
}
@media (hover: hover) {
  .car-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
  .car-card:hover .car-card__img { transform: translateX(-50%) scale(1.025); }
}
.car-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-2); }

.car-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(90% 55% at 50% 92%, var(--floor-bottom) 0%, transparent 70%),
    linear-gradient(180deg, var(--floor-top) 0%, var(--floor-top) 58%, var(--floor-bottom) 100%);
  overflow: hidden;
}
.car-card__media::before {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  top: 60%;
  border-top: 1px solid color-mix(in oklab, var(--line) 70%, transparent);
}
.car-card__img {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100%;
  height: auto;
  transform: translateX(-50%);
  transition: transform var(--dur-slow) var(--ease-out);
}
.car-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--positive);
  font-size: var(--text-xs);
  font-weight: 600;
  box-shadow: var(--shadow-1);
}
.car-card__body {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5) var(--space-5);
  flex: 1;
  align-content: start;
}
.car-card__class { color: var(--text-muted); font-size: var(--text-s); font-weight: 500; }
.car-card__title { font-size: var(--text-xl); font-weight: 650; letter-spacing: -0.01em; }
.specs-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  list-style: none;
  color: var(--text);
  font-size: var(--text-s);
}
.specs-inline li { display: inline-flex; align-items: center; gap: 6px; }
.specs-inline .icon { width: 18px; height: 18px; color: var(--text-muted); }

.car-card__footer {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}
.price-tag { display: grid; gap: 2px; }
.price-tag__value { font-size: var(--text-xl); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.price-tag__unit { font-size: var(--text-s); font-weight: 500; color: var(--text-muted); }
.price-tag__note { font-size: var(--text-xs); color: var(--text-muted); }
.car-card__actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.car-card__actions .btn { padding-inline: 12px; }

.empty-state {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-5);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-l);
  text-align: center;
}
.empty-state__title { font-size: var(--text-xl); font-weight: 650; }
.empty-state p { color: var(--text-muted); max-width: 30rem; }

/* 9. Подробности автомобиля */
.car-details { display: grid; gap: var(--space-5); }
.car-details__info { display: grid; gap: var(--space-5); align-content: start; }
.image-missing { display: grid; place-items: center; width: 100%; height: 100%; color: var(--text-muted); font-size: var(--text-s); }
.gallery { display: grid; gap: var(--space-3); align-content: start; }
.gallery__frame {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-m);
  overflow: hidden;
  background:
    radial-gradient(90% 55% at 50% 92%, var(--floor-bottom) 0%, transparent 70%),
    linear-gradient(180deg, var(--floor-top) 0%, var(--floor-top) 58%, var(--floor-bottom) 100%);
}
.gallery__img { position: absolute; inset: auto 0 0; width: 100%; height: auto; }
.gallery__img.is-entering { animation: fade-in var(--dur-base) var(--ease-out); }
.gallery__thumbs { display: flex; gap: var(--space-2); }
.gallery__thumb {
  width: 96px;
  aspect-ratio: 16 / 10;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: var(--radius-s);
  background: linear-gradient(180deg, var(--floor-top), var(--floor-bottom));
  overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast);
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
.gallery__thumb[aria-current='true'] { border-color: var(--accent); }
.gallery__thumb:active { transform: scale(0.96); }
.gallery__credit { font-size: var(--text-xs); color: var(--text-muted); }

.spec-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3) var(--space-4);
  margin: 0;
}
.spec-list div { display: grid; gap: 2px; padding: var(--space-3); border-radius: var(--radius-s); background: var(--surface-alt); }
.spec-list dt { color: var(--text-muted); font-size: var(--text-xs); }
.spec-list dd { margin: 0; font-weight: 600; }

.info-block { display: grid; gap: var(--space-2); }
.info-block__title { font-size: var(--text-m); font-weight: 650; }
.rate-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rate-table th,
.rate-table td { padding: 10px 0; border-bottom: 1px solid var(--line); text-align: left; font-weight: 500; }
.rate-table td { text-align: right; font-weight: 650; }
.rate-table tr:last-child th,
.rate-table tr:last-child td { border-bottom: 0; }

.callout {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-m);
  background: var(--accent-soft);
  color: var(--text);
  font-size: var(--text-s);
}
.callout .icon { color: var(--accent-text); margin-top: 1px; }

@media (min-width: 900px) {
  .car-details { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--space-6); }
}

/* 10. Запрос */
.booking__layout { display: grid; gap: var(--space-6); align-items: start; }
@media (min-width: 1024px) {
  .booking__layout { grid-template-columns: minmax(0, 1fr) 400px; gap: var(--space-7); }
  .booking__summary { position: sticky; top: calc(var(--header-h) + 20px); }
}
.booking__form { display: grid; gap: var(--space-4); }

.step {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
}
.step__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xl);
  font-weight: 650;
}
.step__num {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: var(--text-s);
  font-weight: 700;
  flex: none;
}
.trip-grid { display: grid; gap: var(--space-5); }
@media (min-width: 760px) { .trip-grid { grid-template-columns: 1fr 1fr; } }
.loc-grid { display: grid; gap: var(--space-4); }

.picked-car {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: center;
}
.picked-car__media {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-s);
  background: linear-gradient(180deg, var(--floor-top), var(--floor-bottom));
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.picked-car__name { font-size: var(--text-l); font-weight: 650; }
.picked-car__meta { color: var(--text-muted); font-size: var(--text-s); }
.picked-car__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--space-2); }
@media (min-width: 560px) {
  .picked-car { grid-template-columns: 160px minmax(0, 1fr) auto; }
  .picked-car__actions { grid-column: auto; }
}
.picked-car--empty {
  grid-template-columns: 1fr;
  padding: var(--space-4);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-m);
  justify-items: start;
  gap: var(--space-3);
}
.picked-car--empty.is-invalid { border-color: var(--danger); background: var(--danger-soft); }

.error-summary {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border: 2px solid var(--danger);
  border-radius: var(--radius-m);
  background: var(--danger-soft);
}
.error-summary:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.error-summary__title { font-weight: 700; color: var(--danger); }
.error-summary ul { display: grid; gap: 4px; padding-left: 1.1em; }
.error-summary a { color: var(--text); font-weight: 500; }

/* Сводка-маршрут */
.summary {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-2);
}
.summary__title { font-size: var(--text-xl); font-weight: 650; }
.summary__stack { display: grid; gap: var(--space-4); }
.summary__car { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--space-3); align-items: center; }
.summary__car-media { aspect-ratio: 16 / 10; border-radius: var(--radius-xs); background: linear-gradient(180deg, var(--floor-top), var(--floor-bottom)); overflow: hidden; display: flex; align-items: flex-end; }
.summary__car-name { font-weight: 650; }
.summary__muted { color: var(--text-muted); font-size: var(--text-s); }
.route { display: grid; gap: 0; list-style: none; }
.route__point {
  position: relative;
  display: grid;
  gap: 2px;
  padding-left: 28px;
}
.route__point::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  background: var(--surface);
}
.route__point--end::before { background: var(--accent); }
.route__label { color: var(--text-muted); font-size: var(--text-xs); font-weight: 600; }
.route__value { font-weight: 600; }
.route__place { color: var(--text-muted); font-size: var(--text-s); }
.route__leg {
  position: relative;
  margin: 6px 0;
  padding: 6px 0 6px 28px;
  color: var(--accent-text);
  font-size: var(--text-s);
  font-weight: 600;
}
.route__leg::before {
  content: '';
  position: absolute;
  left: 7px;
  top: -4px;
  bottom: -4px;
  border-left: 2px dashed var(--line-strong);
}
.summary__divider { border: 0; border-top: 1px solid var(--line); margin: 0; }
.cost { display: grid; gap: var(--space-2); font-variant-numeric: tabular-nums; }
.cost__row { display: flex; justify-content: space-between; gap: var(--space-4); align-items: baseline; }
.cost__row span:first-child { color: var(--text-muted); }
.cost__row span:last-child { font-weight: 600; text-align: right; }
.cost__detail { display: block; font-size: var(--text-xs); color: var(--text-muted); font-weight: 400; }
.cost__total { padding-top: var(--space-2); border-top: 1px solid var(--line); font-size: var(--text-l); }
.cost__total span:first-child { color: var(--text); font-weight: 600; }
.cost__total span:last-child { font-weight: 750; }
.cost__deposit { padding: var(--space-3); border-radius: var(--radius-s); background: var(--surface-alt); }
.cost__manager { font-weight: 600; color: var(--text); }
.summary__reasons { display: grid; gap: 4px; padding-left: 1.1em; color: var(--text-muted); font-size: var(--text-s); }
.summary__cta { display: grid; gap: var(--space-2); }

/* 11. Шаги, условия, вопросы */
.steps {
  position: relative;
  display: grid;
  gap: var(--space-5);
  list-style: none;
  counter-reset: step;
}
.steps__item { position: relative; display: grid; gap: var(--space-2); padding-left: 64px; }
.steps__num {
  position: absolute;
  left: 0;
  top: -4px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg);
  color: var(--accent-text);
  font-family: var(--font-display);
  font-weight: 600;
  z-index: 1;
}
.steps__item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 21px;
  top: 44px;
  bottom: calc(-1 * var(--space-5));
  border-left: 2px dashed var(--line-strong);
}
.steps__title { font-size: var(--text-xl); font-weight: 650; }
.steps__text { color: var(--text-muted); max-width: 30rem; }
.steps-note { margin-top: var(--space-6); }
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); }
  .steps__item { padding-left: 0; padding-top: 68px; }
  .steps__item:not(:last-child)::before {
    left: 52px;
    right: calc(-1 * var(--space-6));
    top: 21px;
    bottom: auto;
    border-left: 0;
    border-top: 2px dashed var(--line-strong);
  }
  .steps__num { top: 0; }
}

.terms__layout { display: grid; gap: var(--space-5); }
@media (min-width: 1024px) {
  .terms__layout { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: var(--space-8); align-items: start; }
  .terms__intro { position: sticky; top: calc(var(--header-h) + 24px); }
}

.accordion { display: grid; border-top: 1px solid var(--line); }
.accordion__item { border-bottom: 1px solid var(--line); }
.accordion__summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 56px;
  padding: var(--space-4) 0;
  cursor: pointer;
  list-style: none;
}
.accordion__summary::-webkit-details-marker { display: none; }
.accordion__summary:focus-visible { outline-offset: 4px; }
.accordion__heading { display: grid; gap: 4px; }
.accordion__title { font-size: var(--text-l); font-weight: 650; }
.accordion__lead { color: var(--text-muted); }
.accordion__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--text);
  transition: transform var(--dur-base) var(--ease-out), background-color var(--dur-fast);
}
.accordion__summary:hover .accordion__icon { background: var(--accent-soft); color: var(--accent-text); }
.accordion__item[open] .accordion__icon { transform: rotate(45deg); }
.accordion__content { overflow: hidden; }
.accordion__body { display: grid; gap: var(--space-2); padding: 0 48px var(--space-5) 0; color: var(--text-muted); }
.accordion__body ul { display: grid; gap: var(--space-2); padding-left: 1.1em; }
.faq { max-width: 52rem; }

/* 12. Подвал */
.site-footer {
  padding-block: var(--space-7) calc(var(--space-6) + env(safe-area-inset-bottom));
  background: var(--surface-alt);
  border-top: 1px solid var(--line);
}
.site-footer__grid { display: grid; gap: var(--space-6); }
.site-footer__about { display: grid; gap: var(--space-3); max-width: 28rem; }
.site-footer__nav ul { display: grid; gap: 2px; list-style: none; }
.site-footer__nav a { display: inline-flex; align-items: center; min-height: 40px; color: var(--text); text-decoration: none; }
.site-footer__nav a:hover { color: var(--accent-text); text-decoration: underline; }
.site-footer__heading { font-size: var(--text-s); font-weight: 650; color: var(--text-muted); margin-bottom: var(--space-2); }
.owner-note { display: grid; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); }
.site-footer__bottom { margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); justify-content: space-between; }
@media (min-width: 900px) {
  .site-footer__grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 1.2fr); }
}

/* 13. Диалоги */
.dialog {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: hidden;
}
.dialog::backdrop { background: var(--scrim); }
.dialog[open] { display: flex; align-items: flex-end; justify-content: center; }
.dialog__panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 100%;
  background: var(--surface);
  box-shadow: var(--shadow-3);
  overflow: hidden;
}
.dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-4) var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--line);
}
.dialog__eyebrow { color: var(--text-muted); font-size: var(--text-s); font-weight: 500; }
.dialog__title { font-size: var(--title-s); font-weight: 650; letter-spacing: -0.01em; }
.dialog__title:focus { outline: none; }
.dialog__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-5);
  display: grid;
  gap: var(--space-5);
  align-content: start;
}
.dialog__footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5) calc(var(--space-4) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.dialog__footer .btn { flex: 1 1 200px; }

.dialog--car .dialog__panel { height: 100%; }
@media (min-width: 760px) {
  .dialog[open] { align-items: center; padding: var(--space-6); }
  .dialog__panel { border-radius: var(--radius-l); max-height: min(860px, 100%); }
  .dialog--car .dialog__panel { max-width: 1040px; height: auto; }
  .dialog--request .dialog__panel { max-width: 640px; }
}
@media (max-width: 759px) {
  .dialog--request .dialog__panel { border-radius: var(--radius-l) var(--radius-l) 0 0; max-height: 92%; }
}

.request-text {
  width: 100%;
  min-height: 300px;
  padding: var(--space-4);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-m);
  background: var(--surface-alt);
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--text-s);
  line-height: 1.6;
  resize: vertical;
}
.request-text:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 24%, transparent); }
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  justify-self: start;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 650;
  font-size: var(--text-s);
}
.copy-status { min-height: 1.5em; font-size: var(--text-s); font-weight: 600; }
.copy-status.is-ok { color: var(--positive); }
.copy-status.is-error { color: var(--danger); }
.channel-list { display: grid; gap: var(--space-2); }

/* Нижняя панель выбранного автомобиля на телефоне и планшете */
.mobile-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--gutter) calc(var(--space-3) + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 30px -18px rgb(15 27 45 / 0.35);
  transform: translateY(0);
  transition: transform var(--dur-slow) var(--ease-out), visibility 0s linear 0s;
}
.mobile-bar.is-hidden { transform: translateY(110%); visibility: hidden; transition: transform var(--dur-base) var(--ease-in-out), visibility 0s linear var(--dur-base); }
.mobile-bar__info { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.mobile-bar__info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-bar__info span { color: var(--text-muted); font-size: var(--text-s); }
@media (min-width: 1024px) { .mobile-bar { display: none; } }

.load-error {
  max-width: 40rem;
  margin: var(--space-8) auto;
  padding: var(--space-5);
  border: 2px solid var(--danger);
  border-radius: var(--radius-m);
  background: var(--danger-soft);
}

/* 14. Движение */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes car-in { from { opacity: 0; transform: translateX(-46%); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes sheet-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(40px); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes pop-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(8px) scale(0.985); } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  /* Первый экран: один согласованный выход — текст, автомобиль, билет */
  .motion .hero__copy > * { animation: rise-in var(--dur-enter) var(--ease-out) both; }
  .motion .hero__copy > :nth-child(2) { animation-delay: 60ms; }
  .motion .hero__copy > :nth-child(3) { animation-delay: 120ms; }
  .motion .stage { animation: fade-in var(--dur-enter) var(--ease-out) both 80ms; }
  .motion .stage__car { animation: car-in 640ms var(--ease-out) both 160ms; }
  .motion .ticket { animation: rise-in var(--dur-enter) var(--ease-out) both 220ms; }

  /* Секции при прокрутке: только если наблюдатель готов (класс ставит скрипт) */
  .reveal-ready .reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--dur-enter) var(--ease-out), transform var(--dur-enter) var(--ease-out); }
  .reveal-ready .reveal.is-visible { opacity: 1; transform: none; }

  .dialog[open] .dialog__panel { animation: sheet-in var(--dur-slow) var(--ease-out); }
  .dialog[open]::backdrop { animation: backdrop-in var(--dur-base) var(--ease-out); }
  .dialog.is-closing .dialog__panel { animation: sheet-out var(--dur-base) var(--ease-in-out) forwards; }
  .dialog.is-closing::backdrop { animation: backdrop-in var(--dur-base) var(--ease-in-out) reverse forwards; }
  @media (min-width: 760px) {
    .dialog[open] .dialog__panel { animation-name: pop-in; }
    .dialog.is-closing .dialog__panel { animation-name: pop-out; }
  }

  .mobile-nav:not([hidden]) { animation: menu-in var(--dur-base) var(--ease-out); }
  .car-grid.is-updating .car-card { animation: rise-in var(--dur-slow) var(--ease-out) both; }
  .car-grid.is-updating .car-card:nth-child(2) { animation-delay: 30ms; }
  .car-grid.is-updating .car-card:nth-child(3) { animation-delay: 60ms; }
  .car-grid.is-updating .car-card:nth-child(n + 4) { animation-delay: 90ms; }
  .error-summary:not([hidden]) { animation: rise-in var(--dur-base) var(--ease-out); }
  .copy-status:not(:empty) { animation: fade-in var(--dur-fast) var(--ease-out); }

  /* Короткий переход при смене темы */
  html.theme-transition,
  html.theme-transition *,
  html.theme-transition *::before,
  html.theme-transition *::after {
    transition: background-color 240ms var(--ease-out), border-color 240ms var(--ease-out), color 240ms var(--ease-out), fill 240ms var(--ease-out) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
  .car-card:hover,
  .car-card:hover .car-card__img { transform: none; }
}

@media print {
  .site-header, .demo-banner, .mobile-bar, .stage { display: none; }
}

/* Страница источников */
.credits { display: grid; gap: var(--space-5); max-width: 52rem; }
.credits__heading { font-size: var(--text-xl); font-weight: 650; }
.credits__list { display: grid; gap: var(--space-3); padding-left: 1.2em; color: var(--text-muted); }
.credits__list strong { color: var(--text); }
