/* ==========================================================================
   Стили сайта проката. Акцентный цвет приходит из config.js
   (company.colors.accent / onAccent) через CSS-переменные.
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter-semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --accent: #c2410c;
  --on-accent: #ffffff;
  --accent-strong: color-mix(in srgb, var(--accent) 80%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 8%, #fff);
  --accent-line: color-mix(in srgb, var(--accent) 35%, #fff);
  /* Цвет акцента для текста и ссылок: в тёмной теме — светлее, чтобы читался. */
  --accent-text: var(--accent-strong);

  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-muted: #f3f4f6;
  --surface-raised: #ffffff;
  --section-alt: #eceff3;
  --header-bg: rgb(255 255 255 / 0.9);
  --media-bg: #e9ecf0;
  --text: #1d2329;
  --text-muted: #56606b;
  --border: #dde1e6;
  --border-strong: #c3cad2;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --danger-line: #f4b8b2;
  --success: #067647;
  --warn-text: #5a3e00;
  --warn-soft: #fff4d6;
  --warn-line: #efd08a;
  --badge-demo-bg: #5a3e00;
  --badge-demo-text: #ffffff;
  --free: #1f9d55;
  --free-soft: #dff5e7;
  --free-text: #11663a;
  --busy: #9aa3ad;
  --busy-soft: #e6e9ed;
  --overlay: rgb(16 24 40 / 0.55);

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgb(16 24 40 / 0.05), 0 6px 20px rgb(16 24 40 / 0.06);
  --shadow-lift: 0 2px 4px rgb(16 24 40 / 0.06), 0 12px 28px rgb(16 24 40 / 0.1);
  --header-h: 60px;
  --tabbar-h: 0px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --fast: 140ms;
  --medium: 200ms;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Тёмная тема: по выбору посетителя (data-theme="dark") или как в системе.
   Фирменный цвет остаётся тем же; для текста — его светлый вариант. */
:root[data-theme='dark'] {
  color-scheme: dark;
  --accent-strong: color-mix(in srgb, var(--accent) 82%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 22%, #171b20);
  --accent-line: color-mix(in srgb, var(--accent) 60%, #171b20);
  --accent-text: color-mix(in srgb, var(--accent) 45%, #fff);
  --bg: #0e1114;
  --surface: #171b20;
  --surface-muted: #1f242a;
  --surface-raised: #1c2127;
  --section-alt: #12161a;
  --header-bg: rgb(17 20 23 / 0.9);
  --media-bg: #232a31;
  --text: #e8ebef;
  --text-muted: #a5aeb8;
  --border: #2a3038;
  --border-strong: #3d4651;
  --danger: #ff9b8f;
  --danger-soft: #3a1714;
  --danger-line: #6b2a24;
  --success: #5ad18b;
  --warn-text: #f3d48a;
  --warn-soft: #2a2212;
  --warn-line: #574622;
  --badge-demo-bg: #f3d48a;
  --badge-demo-text: #2a2212;
  --free: #3fbf72;
  --free-soft: #173826;
  --free-text: #8fe0ad;
  --busy: #5d6670;
  --busy-soft: #262c33;
  --overlay: rgb(0 0 0 / 0.65);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 6px 20px rgb(0 0 0 / 0.25);
  --shadow-lift: 0 2px 4px rgb(0 0 0 / 0.45), 0 12px 28px rgb(0 0 0 / 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --accent-strong: color-mix(in srgb, var(--accent) 82%, #000);
    --accent-soft: color-mix(in srgb, var(--accent) 22%, #171b20);
    --accent-line: color-mix(in srgb, var(--accent) 60%, #171b20);
    --accent-text: color-mix(in srgb, var(--accent) 45%, #fff);
    --bg: #0e1114;
    --surface: #171b20;
    --surface-muted: #1f242a;
    --surface-raised: #1c2127;
    --section-alt: #12161a;
    --header-bg: rgb(17 20 23 / 0.9);
    --media-bg: #232a31;
    --text: #e8ebef;
    --text-muted: #a5aeb8;
    --border: #2a3038;
    --border-strong: #3d4651;
    --danger: #ff9b8f;
    --danger-soft: #3a1714;
    --danger-line: #6b2a24;
    --success: #5ad18b;
    --warn-text: #f3d48a;
    --warn-soft: #2a2212;
    --warn-line: #574622;
    --badge-demo-bg: #f3d48a;
    --badge-demo-text: #2a2212;
    --free: #3fbf72;
    --free-soft: #173826;
    --free-text: #8fe0ad;
    --busy: #5d6670;
    --busy-soft: #262c33;
    --overlay: rgb(0 0 0 / 0.65);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 6px 20px rgb(0 0 0 / 0.25);
    --shadow-lift: 0 2px 4px rgb(0 0 0 / 0.45), 0 12px 28px rgb(0 0 0 / 0.4);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overflow-wrap: break-word;
  font-feature-settings: 'cv11', 'ss01';
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

p {
  margin: 0;
}

a {
  color: var(--accent-text);
  text-underline-offset: 3px;
}

/* Двойное касание не увеличивает страницу при нажатии на кнопки (масштаб жестом не запрещён). */
a,
button,
input,
select,
textarea,
label,
summary {
  touch-action: manipulation;
}

:focus-visible {
  outline: 3px solid var(--accent-text);
  outline-offset: 2px;
  border-radius: 4px;
}

[hidden] {
  display: none !important;
}

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

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.container--narrow {
  max-width: 860px;
}

@media (min-width: 768px) {
  .container {
    padding: 0 24px;
  }
}

/* ---------- Служебные блоки ---------- */

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.skip-link:focus {
  top: 12px;
}

.demo-banner {
  background: var(--warn-soft);
  border-bottom: 1px solid var(--warn-line);
  color: var(--warn-text);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
}

.demo-banner__inner {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.demo-banner__badge {
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--badge-demo-bg);
  color: var(--badge-demo-text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.demo-banner__toggle {
  display: inline-flex;
  align-items: center;
  /* Высота касания 44px без роста полосы: лишнее уходит в отрицательные поля. */
  min-height: 44px;
  margin: -12px 0;
  padding: 0 2px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.config-error {
  padding: 16px 0;
  background: var(--danger-soft);
  border-bottom: 1px solid var(--danger-line);
  color: var(--danger);
}

.config-error__title {
  font-weight: 600;
  margin-bottom: 8px;
}

.noscript {
  padding: 16px;
  background: var(--warn-soft);
  color: var(--warn-text);
  text-align: center;
}

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--fast) ease,
    border-color var(--fast) ease,
    color var(--fast) ease,
    transform var(--fast) var(--ease);
}

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

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn--primary:hover {
  background: var(--accent-strong);
}

.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn--secondary:hover {
  background: var(--surface-muted);
  border-color: var(--text-muted);
}

.btn--ghost {
  background: transparent;
  color: var(--accent-text);
}

.btn--ghost:hover {
  background: var(--accent-soft);
}

.btn--link {
  min-height: 44px;
  padding: 0 4px;
  background: none;
  color: var(--accent-text);
  text-decoration: underline;
  font-weight: 600;
}

.btn--block {
  width: 100%;
}

.btn--demo {
  border-style: dashed;
  color: var(--text-muted);
}

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

@supports (backdrop-filter: blur(8px)) {
  .site-header {
    background: var(--header-bg);
    backdrop-filter: saturate(1.4) blur(10px);
  }
}

.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
}

.brand__logo,
.brand__mark {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
}

.brand__mark {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-size: 18px;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand__name {
  font-weight: 700;
  font-size: 17px;
}

.brand__city {
  font-size: 13px;
  color: var(--text-muted);
}

/* На телефоне разделы — в нижней панели; в шапке — логотип и тема. */
.site-nav {
  display: none;
}

.site-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--fast) ease, color var(--fast) ease;
}

.site-nav a:hover {
  background: var(--surface-muted);
}

.site-nav a[aria-current] {
  color: var(--accent-text);
  background: var(--accent-soft);
}

/* С 769px нижней панели нет — разделы в шапке. */
@media (min-width: 769px) {
  .site-nav {
    display: flex;
    gap: 2px;
    margin-left: auto;
  }
}

@media (min-width: 769px) and (max-width: 1023px) {
  .site-nav a {
    padding: 0 9px;
  }

  .theme-toggle {
    padding: 0 11px;
  }

  .theme-toggle__label {
    display: none;
  }
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--fast) ease, transform var(--fast) var(--ease);
}

.theme-toggle:hover {
  background: var(--surface-muted);
}

.theme-toggle:active {
  transform: scale(0.96);
}

.theme-toggle__icon {
  display: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle[data-mode='system'] .theme-toggle__icon--system,
.theme-toggle[data-mode='light'] .theme-toggle__icon--light,
.theme-toggle[data-mode='dark'] .theme-toggle__icon--dark,
.theme-toggle:not([data-mode]) .theme-toggle__icon--system {
  display: block;
}

@media (max-width: 359px) {
  .theme-toggle__label {
    display: none;
  }
}

/* ---------- Первый экран: короткий заголовок и даты аренды ---------- */

.hero {
  background:
    radial-gradient(120% 80% at 100% 0%, var(--accent-soft), transparent 60%),
    var(--surface);
  border-bottom: 1px solid var(--border);
}

.hero__inner {
  display: grid;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 20px;
}

.hero__eyebrow {
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 600;
}

/* На телефоне название и город уже в шапке — не повторяем. */
@media (max-width: 639px) {
  .hero__eyebrow {
    display: none;
  }
}

.hero__title {
  margin-top: 4px;
  font-size: clamp(1.45rem, 1.1rem + 1.9vw, 2.6rem);
  font-weight: 700;
  max-width: 22ch;
  text-wrap: balance;
}

.hero__title--long {
  font-size: clamp(1.3rem, 1rem + 1.5vw, 2.2rem);
}

.hero__lead {
  margin-top: 8px;
  max-width: 52ch;
  color: var(--text-muted);
  font-size: 15px;
}

.search {
  padding: 14px;
}

.search__all {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* До запуска скрипта поля недоступны и приглушены; при ошибке настроек поиска нет. */
.search__all:disabled {
  opacity: 0.6;
}

html[data-app='error'] .search {
  display: none;
}

.search__group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.search__legend {
  padding: 0;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

.search__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 7.5rem);
  gap: 8px;
}

.search__error,
.search__hours {
  margin: -4px 0 0;
}

/* Узкий телефон (320–399px): заголовок компактнее, даты и кнопка — на первом экране. */
/* Время с пометкой «вне часов работы» в поле не помещается — в списке короткая
   пометка «*», пояснение под полями. */
.search__time {
  padding-right: 30px;
  background-position: right 10px center;
}

@media (max-width: 399px) {
  .search__row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 7rem);
  }

  .hero__title--long {
    font-size: 1.25rem;
  }

  .hero__lead {
    display: none;
  }
}

.search__summary {
  min-height: 1.4em;
  margin-top: -4px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

.search__summary:empty {
  display: none;
}

@media (min-width: 640px) {
  .search {
    padding: 18px;
  }

  .search__all {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search__error,
  .search__hours,
  .search__go,
  .search__summary {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    align-items: center;
    gap: 40px;
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .hero__lead {
    font-size: 17px;
  }
}

/* ---------- Разделы ---------- */

.section {
  padding: 32px 0;
}

.section--alt {
  background: var(--section-alt);
}

.section__head {
  margin-bottom: 20px;
}

.section__title {
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  font-weight: 700;
}

.section__title:focus {
  outline: none;
}

.section__lead {
  margin-top: 8px;
  max-width: 70ch;
  color: var(--text-muted);
}

.subsection-title {
  margin: 28px 0 14px;
  font-size: 1.25rem;
  font-weight: 700;
}

@media (min-width: 900px) {
  .section {
    padding: 56px 0;
  }

  .section__head {
    margin-bottom: 28px;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.note {
  font-size: 14px;
  color: var(--text-muted);
}

.notice {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
}

.notice--demo {
  background: var(--warn-soft);
  border: 1px solid var(--warn-line);
  color: var(--warn-text);
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.92);
  border: 1px solid rgb(16 24 40 / 0.08);
  color: #1d2329;
  font-size: 12px;
  font-weight: 600;
}

.badge--demo {
  background: var(--badge-demo-bg);
  border-color: var(--badge-demo-bg);
  color: var(--badge-demo-text);
}

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

.period-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  margin: -6px 0 16px;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
}

.period-bar__text {
  font-size: 14px;
  font-weight: 600;
}

.period-bar__edit {
  min-height: 44px;
  padding: 0 10px;
  font-size: 14px;
}

.catalog {
  display: grid;
  gap: 16px;
}

@media (min-width: 640px) {
  .catalog {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .catalog {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
}

.car-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition:
    border-color var(--medium) ease,
    box-shadow var(--medium) ease,
    transform var(--medium) var(--ease);
}

@media (hover: hover) {
  .car-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lift);
  }
}

.car-card--selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), var(--shadow);
}

.car-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  /* overflow: hidden — рамка держит пропорцию, фото любой формы не растягивает карточку. */
  overflow: hidden;
  background: var(--media-bg);
  cursor: pointer;
}

.car-card__media > img,
.car-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.car-card__photos {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgb(16 24 40 / 0.6);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

/* Фото не загрузилось: на его месте — спокойная заглушка того же размера. */
.photo-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  background:
    repeating-linear-gradient(135deg, transparent 0 12px, rgb(127 127 127 / 0.06) 12px 24px),
    var(--media-bg);
}

.car-media__badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: calc(100% - 90px);
}

/* Галерея ракурсов: лента с прокруткой по кадрам (пальцем, кнопками, стрелками). */
.car-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--media-bg);
}

.car-gallery {
  display: flex;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.car-gallery::-webkit-scrollbar {
  display: none;
}

/* Рамка фокуса внутри ленты: снаружи её обрезает рамка фото (overflow: hidden). */
.car-gallery:focus-visible {
  outline-offset: -4px;
  border-radius: 0;
}

.car-gallery__slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: start;
}

.car-gallery__credit {
  position: absolute;
  right: 0;
  bottom: 0;
  max-width: 100%;
  padding: 3px 8px;
  border-top-left-radius: var(--radius-sm);
  background: rgb(16 24 40 / 0.55);
  color: #fff;
  font-size: 11px;
  line-height: 1.3;
}

.car-gallery__credit a {
  color: inherit;
}

.car-gallery__count {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgb(16 24 40 / 0.6);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.car-gallery__nav {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.92);
  color: #1d2329;
  font: inherit;
  font-size: 26px;
  line-height: 1;
  box-shadow: 0 2px 10px rgb(16 24 40 / 0.2);
  cursor: pointer;
  transition: opacity var(--fast) ease, transform var(--fast) var(--ease);
}

.car-gallery__nav:active {
  transform: scale(0.94);
}

.car-gallery__nav:disabled {
  opacity: 0;
  pointer-events: none;
}

.car-gallery__nav--prev {
  left: 10px;
}

.car-gallery__nav--next {
  right: 10px;
}

.car-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 16px;
}

.car-card__class {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.car-card__title {
  margin-top: -6px;
  font-size: 1.2rem;
  font-weight: 700;
}

.car-card__model {
  margin-top: -6px;
  color: var(--text-muted);
  font-size: 14px;
}

.car-card__meta {
  color: var(--text-muted);
  font-size: 14px;
}

.car-card__price {
  margin-top: 2px;
}

.car-card__deposit {
  font-size: 14px;
  color: var(--text-muted);
}

.car-card__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}

.car-card__actions .btn {
  min-height: 46px;
  padding-left: 10px;
  padding-right: 10px;
}

/* Выбранная машина: галочка у подписи «Выбран» (только оформление). */
.car-card--selected .car-card__select::before {
  content: '✓' / '';
}

/* Цена: за выбранный срок или за сутки на минимальный срок. */
.price-box__main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 6px;
}

.price-box__label {
  font-weight: 600;
}

.price-box__value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.price-box__unit {
  color: var(--text-muted);
  font-weight: 500;
}

.price-box__note,
.price-box__extra {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-muted);
}

.price-box__extra {
  font-weight: 600;
  color: var(--text);
}

.price-box--manager .price-box__label,
.price-box--warn .price-box__label {
  font-size: 1.05rem;
  font-weight: 700;
}

.price-box--warn .price-box__label {
  color: var(--warn-text);
}

.price-box--large .price-box__value {
  font-size: 1.9rem;
}

.price-box.is-updated {
  animation: price-in var(--medium) var(--ease);
}

@keyframes price-in {
  from {
    opacity: 0.35;
    transform: translateY(3px);
  }
}

.rates {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.rates__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
}

.rates__row:nth-child(odd) {
  background: var(--surface-muted);
}

.rates__row--current {
  outline: 1px solid var(--accent-line);
  background: var(--accent-soft) !important;
  font-weight: 600;
}

.rates__price {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rule summary,
.accordion__title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--accent-text);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.accordion__title {
  color: var(--text);
  padding: 4px 16px;
  min-height: 52px;
}

.rule summary::-webkit-details-marker,
.accordion__title::-webkit-details-marker,
.faq__question::-webkit-details-marker {
  display: none;
}

.rule summary::after,
.accordion__title::after,
.faq__question::after {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--medium) var(--ease);
}

.rule[open] summary::after,
.accordion__item[open] .accordion__title::after,
.faq__item[open] .faq__question::after {
  transform: rotate(-135deg) translateY(-2px);
}

.facts {
  margin: 4px 0 0;
}

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

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

.facts dt {
  color: var(--text-muted);
}

.facts dd {
  margin: 0;
  text-align: right;
  font-weight: 500;
}

/* ---------- Калькулятор ---------- */

.calc {
  display: grid;
  gap: 20px;
  align-items: start;
}

@media (min-width: 960px) {
  .calc {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 24px;
  }

  .calc__result {
    position: sticky;
    top: calc(var(--header-h) + 16px);
  }
}

.calc__form,
.calc__result,
.request {
  padding: 18px;
}

@media (min-width: 768px) {
  .calc__form,
  .calc__result,
  .request {
    padding: 24px;
  }
}

.calc__form {
  display: grid;
  gap: 20px;
}

.fieldset {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.fieldset legend {
  padding: 0;
  margin-bottom: 12px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.field__label {
  font-weight: 600;
  font-size: 16px;
}

.field__sublabel {
  font-size: 14px;
  font-weight: 500;
}

.field__hint {
  font-size: 14px;
  color: var(--text-muted);
}

.field__error {
  display: flex;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--danger);
}

.field__error::before {
  content: '!';
  flex: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background-color: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

select.input {
  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.5l5 5 5-5' fill='none' stroke='%2356606b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  text-overflow: ellipsis;
}

:root[data-theme='dark'] select.input {
  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.5l5 5 5-5' fill='none' stroke='%23a5aeb8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) select.input {
    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.5l5 5 5-5' fill='none' stroke='%23a5aeb8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}

input[type='date'].input {
  -webkit-appearance: none;
  appearance: none;
  line-height: 26px;
}

input[type='date'].input::-webkit-date-and-time-value {
  text-align: left;
}

.input:hover {
  border-color: var(--text-muted);
}

.input[aria-invalid='true'] {
  border-color: var(--danger);
  background-color: var(--danger-soft);
}

/* Фокус заметен и у поля с ошибкой: отдельная рамка, а не только цвет границы. */
.input:focus {
  outline: 3px solid var(--accent-text);
  outline-offset: 2px;
  border-color: var(--accent);
}

.input[aria-invalid='true']:focus {
  border-color: var(--danger);
}

.extras {
  display: grid;
  gap: 8px;
}

.check {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.check:has(.check__input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.check:has(.check__input:focus-visible) {
  outline: 3px solid var(--accent-text);
  outline-offset: 2px;
}

.check__input {
  position: relative;
  z-index: 1;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.check__input:focus-visible {
  outline: none;
}

.check__label {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  cursor: pointer;
}

/* Вся карточка услуги кликабельна */
.check__label::after {
  content: '';
  position: absolute;
  inset: 0;
}

.check__name {
  font-weight: 600;
}

.check__price {
  margin-left: auto;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.check__desc {
  flex-basis: 100%;
  font-size: 14px;
  color: var(--text-muted);
}

.calc__submit {
  margin-top: -4px;
}

.rule {
  border-top: 1px solid var(--border);
  padding-top: 4px;
}

.rule__body {
  display: grid;
  gap: 8px;
  padding-bottom: 4px;
  font-size: 14px;
  color: var(--text-muted);
}

/* ---------- Результат ---------- */

.result__title {
  margin-bottom: 14px;
  font-size: 1.25rem;
  font-weight: 700;
}

.result__title:focus {
  outline: none;
}

#result-body {
  display: grid;
  gap: 14px;
}

.result__car {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.result__car-img {
  width: 96px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--media-bg);
}

.result__car-name {
  font-weight: 700;
}

.result__car-meta {
  font-size: 14px;
  color: var(--text-muted);
}

.result__empty {
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-align: center;
}

.result__rows {
  margin: 0;
}

.result__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.result__row dt {
  color: var(--text-muted);
}

.result__row dd {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin: 0;
  text-align: right;
}

.result__value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.result__sub {
  font-size: 13px;
  color: var(--text-muted);
}

.result__total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}

.result__total-label {
  font-weight: 600;
}

.result__total-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.result__total--manager {
  background: var(--warn-soft);
  border-color: var(--warn-line);
  color: var(--warn-text);
}

.result__total--manager .result__total-value {
  font-size: 1.2rem;
}

.result__reasons {
  flex-basis: 100%;
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 14px;
}

.result__hint {
  flex-basis: 100%;
  font-size: 14px;
}

.result__deposit {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 16px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.result__deposit-label {
  font-weight: 600;
}

.result__deposit-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.result__deposit-note {
  flex-basis: 100%;
  font-size: 13px;
  color: var(--text-muted);
}

.result__note {
  font-size: 14px;
  color: var(--text-muted);
}

.result__warnings {
  margin: 0;
  padding: 10px 14px 10px 30px;
  border-radius: var(--radius-md);
  background: var(--warn-soft);
  color: var(--warn-text);
  font-size: 14px;
}

.result__disclaimer {
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  background: var(--surface-muted);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px;
  font-weight: 500;
}

/* ---------- Заявка менеджеру ---------- */

.request {
  margin-top: 20px;
}

.request__title {
  font-size: 1.25rem;
  font-weight: 700;
}

.request__title:focus {
  outline: none;
}

.request__intro {
  margin-top: 6px;
  color: var(--text-muted);
}

.request__placeholder,
.request__summary {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
}

.request__placeholder {
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
  text-align: center;
}

.request__summary {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  font-weight: 600;
}

.request__buttons {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

@media (min-width: 640px) {
  .request__buttons {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

/* Кнопки отправки — цвета мессенджеров (затемнены для контраста белого текста). */
.btn--send {
  min-height: 52px;
  color: #fff;
}

.btn--send .btn__icon {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn--whatsapp {
  background: #075e54;
}

.btn--whatsapp:hover {
  background: #064c44;
}

.btn--telegram {
  background: #1a73a8;
}

.btn--telegram:hover {
  background: #155f8b;
}

.btn--email {
  background: var(--text);
  color: var(--bg);
}

/* Пока данных для заявки нет — кнопка видна, но неактивна (без ссылки). */
.btn--send[aria-disabled='true'] {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
}

.request__demo {
  margin-top: 12px;
}

/* Пока скрипт не подготовил калькулятор (или JavaScript выключен), форма
   не показывается, чтобы не изображать неработающий расчёт. */
.app-pending .calc,
.app-pending #request {
  display: none;
}

/* ---------- Условия, FAQ, контакты ---------- */

.grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .grid--2,
  .grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.terms-card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 18px;
}

@media (min-width: 768px) {
  .terms-card {
    padding: 22px;
  }
}

.terms-card__title {
  font-size: 1.1rem;
  font-weight: 700;
}

.list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.list--plain {
  padding: 0;
  list-style: none;
  gap: 0;
}

.list--small {
  font-size: 14px;
  color: var(--text-muted);
}

.place {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

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

.place__name {
  font-weight: 600;
}

.place__fees {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.place__note {
  flex-basis: 100%;
  font-size: 13px;
  color: var(--text-muted);
}

.plan {
  margin-top: 4px;
}

.plan__title {
  font-size: 14px;
  font-weight: 600;
}

.terms__disclaimer {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.faq {
  display: grid;
  gap: 10px;
}

.faq__item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.faq__question {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 12px 18px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq__answer {
  padding: 0 18px 16px;
  color: var(--text-muted);
}

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

.contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 12px;
  min-height: 48px;
  border-bottom: 1px solid var(--border);
}

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

.contact__label {
  color: var(--text-muted);
}

.contact__value {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.contact__value--demo {
  font-weight: 500;
  color: var(--text-muted);
}

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

.site-footer {
  padding: 32px 0 40px;
  background: #1d2329;
  color: #cfd5dc;
  font-size: 14px;
}

.site-footer a {
  color: #fff;
}

.footer__grid {
  display: grid;
  gap: 16px;
}

.footer__grid > div {
  display: grid;
  gap: 6px;
  align-content: start;
}

.footer__name {
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}

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

.footer__demo {
  color: #f5d48a;
}

@media (min-width: 768px) {
  .footer__grid {
    grid-template-columns: 1fr 2fr;
    gap: 32px;
  }
}

/* ---------- Приложение на телефоне ---------- */

/* viewport-fit=cover: в альбомной ориентации контент не заходит под вырез экрана. */
body {
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.offline-note {
  padding: 8px 0;
  background: var(--warn-soft);
  border-bottom: 1px solid var(--warn-line);
  color: var(--warn-text);
  font-size: 14px;
  font-weight: 500;
}

.app-card-slot:not(:empty) {
  margin-top: 16px;
}

.app-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
}

.app-card__icon {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.app-card__text {
  display: grid;
  justify-items: start;
  gap: 10px;
}

.app-card__title {
  font-size: 18px;
}

.install-bar {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    'icon text close'
    'go go go';
  align-items: center;
  gap: 10px 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 32px rgb(16 24 40 / 0.2);
}

.install-bar__icon {
  grid-area: icon;
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.install-bar__text {
  grid-area: text;
  min-width: 0;
}

.install-bar__title {
  font-size: 15px;
  font-weight: 700;
}

.install-bar__lead {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-muted);
}

.install-bar__go {
  grid-area: go;
  min-height: 44px;
}

.install-bar__close {
  grid-area: close;
  align-self: start;
  width: 44px;
  height: 44px;
  margin: -6px -6px 0 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.install-bar__close:hover {
  background: var(--surface-muted);
}

html.has-install-bar body {
  padding-bottom: 160px;
}

@media (min-width: 520px) {
  .install-bar {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: 'icon text go close';
  }

  .install-bar__close {
    align-self: center;
    margin: 0;
  }

  html.has-install-bar body {
    padding-bottom: 100px;
  }
}

.install-help {
  width: min(100% - 32px, 440px);
  max-height: calc(100% - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 16px 48px rgb(16 24 40 / 0.3);
}

.install-help::backdrop {
  background: rgb(16 24 40 / 0.55);
}

.install-help__inner {
  display: grid;
  gap: 16px;
  padding: 24px 20px 20px;
}

.install-help__title {
  font-size: 20px;
}

.install-help__steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
}

/* Нижняя панель разделов — на телефоне (и в браузере, и в установленном приложении):
   плавающая панель с иконками «Авто · Расчёт · Условия · Контакты». */
.app-tabbar {
  display: none;
}

.app-tabbar a {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  min-height: 52px;
  padding: 4px 2px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--fast) ease, background-color var(--fast) ease;
}

.app-tabbar svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-tabbar a[aria-current] {
  color: var(--text);
  font-weight: 700;
}

.app-tabbar a[aria-current] svg {
  stroke-width: 2.1;
}

.app-tabbar a:active {
  background: var(--surface-muted);
}

@media (max-width: 768px) {
  :root {
    --tabbar-h: calc(84px + env(safe-area-inset-bottom, 0px));
  }

  .app-tabbar {
    position: fixed;
    left: max(10px, env(safe-area-inset-left, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 55;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    max-width: 520px;
    margin: 0 auto;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 8px 28px rgb(16 24 40 / 0.14);
    transition: transform var(--medium) var(--ease);
  }

  @supports (backdrop-filter: blur(8px)) {
    .app-tabbar {
      background: var(--header-bg);
      backdrop-filter: saturate(1.4) blur(12px);
    }
  }

  body {
    padding-bottom: var(--tabbar-h);
  }

  /* Экранная клавиатура открыта — панель уезжает и не закрывает поле. */
  html.is-typing .app-tabbar {
    transform: translateY(140%);
  }

  /* Предложение установить и сообщения — над панелью. */
  .install-bar {
    bottom: calc(var(--tabbar-h) + 4px);
  }

  html.has-install-bar body {
    padding-bottom: calc(var(--tabbar-h) + 160px);
  }

  html.is-standalone body {
    padding-bottom: var(--tabbar-h);
  }
}

/* ---------- Подробная карточка автомобиля ---------- */

html.has-sheet {
  overflow: hidden;
}

.sheet {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
}

.sheet[open] {
  animation: sheet-up var(--medium) var(--ease);
}

.sheet::backdrop {
  background: var(--overlay);
  animation: fade-in var(--medium) ease;
}

@keyframes sheet-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

@keyframes sheet-side {
  from {
    opacity: 0;
    transform: translateX(32px);
  }
}

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

.sheet__panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  /* Телефон боком: содержимое не уходит под вырез экрана. */
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.sheet__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(6px + env(safe-area-inset-top, 0px)) 12px 6px 6px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.sheet__close {
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--fast) ease;
}

.sheet__close:hover {
  background: var(--surface-muted);
}

.sheet__title {
  min-width: 0;
  font-size: 1.15rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Одна прокрутка — у тела карточки; шапка и кнопка внизу на месте. */
.sheet__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.sheet__section {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

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

.sheet__intro {
  gap: 6px;
}

.sheet__class {
  color: var(--text-muted);
  font-size: 14px;
}

.sheet__meta {
  font-weight: 500;
}

.sheet__dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 8px;
  color: var(--text-muted);
  font-size: 14px;
}

.sheet__subtitle {
  font-size: 1.05rem;
  font-weight: 700;
}

.sheet__footer {
  display: grid;
  gap: 6px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.sheet__total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
}

.sheet__total strong {
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.sheet .car-media {
  aspect-ratio: 4 / 3;
}

@media (min-width: 769px) {
  /* На компьютере и планшете — панель справа, страница видна за ней. */
  .sheet {
    width: min(520px, 100%);
    margin-left: auto;
    border-left: 1px solid var(--border);
    box-shadow: -16px 0 48px rgb(0 0 0 / 0.18);
  }

  .sheet[open] {
    animation-name: sheet-side;
  }

  .sheet .car-media {
    aspect-ratio: 16 / 10;
  }

  .sheet__section {
    padding: 18px 22px;
  }

  .sheet__panel {
    padding-left: 0;
  }

  .sheet__footer {
    padding: 14px 22px calc(14px + env(safe-area-inset-bottom, 0px));
  }
}

/* ---------- Условия: свёрнутые пункты ---------- */

.terms-layout {
  display: grid;
  gap: 16px;
  align-items: start;
}

@media (min-width: 900px) {
  .terms-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }
}

.accordion {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.accordion__item + .accordion__item {
  border-top: 1px solid var(--border);
}

.accordion__title:hover {
  background: var(--surface-muted);
}

.accordion__body {
  display: grid;
  gap: 10px;
  padding: 0 16px 16px;
}

.accordion__item[open] .accordion__body {
  animation: fade-in var(--medium) ease;
}

.price-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.price-list__row {
  display: grid;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.price-list__row:last-child {
  border-bottom: 0;
}

.price-list__name {
  font-weight: 700;
}

.price-list__rates {
  font-variant-numeric: tabular-nums;
}

.price-list__terms {
  font-size: 14px;
  color: var(--text-muted);
}

/* ---------- Короткие сообщения ---------- */

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  /* Над нижней панелью и над предложением установить приложение (если оно показано). */
  bottom: calc(var(--tabbar-h) + var(--install-bar-h, 0px) + 16px);
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 4px 12px;
  width: fit-content;
  max-width: min(560px, 100% - 32px);
  margin: 0 auto;
  padding: 4px 8px 4px 16px;
  min-height: 48px;
  border-radius: var(--radius-lg);
  background: #1d2329;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.25);
  animation: toast-in var(--medium) var(--ease);
}

.toast__text {
  padding: 8px 0;
}

.toast.is-leaving {
  opacity: 0;
  transition: opacity var(--medium) ease;
}

.toast__action {
  flex: none;
  color: #fff;
}

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

.footer__about {
  margin-top: 6px;
  max-width: 48ch;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .btn:active,
  .car-card:hover {
    transform: none;
  }
}

/* ---------- Занятость по календарю сайта ---------- */

.car-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.car-status__dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--free);
}

.car-status--free .car-status__text {
  color: var(--free-text);
}

.car-status--busy .car-status__dot {
  background: var(--busy);
}

.car-status--busy .car-status__text {
  color: var(--text-muted);
}

/* «Календарь» — ссылка-кнопка; высота касания 44px без роста строки. */
.car-status__calendar {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: -12px 0 -12px auto;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.sheet__description {
  white-space: pre-line;
}

.cal-legend {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.cal-legend__item::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  vertical-align: -1px;
  border-radius: 4px;
}

.cal-legend__item--free::before {
  background: var(--free-soft);
  box-shadow: inset 0 0 0 1px var(--free);
}

.cal-legend__item--busy::before {
  background: var(--busy-soft);
  box-shadow: inset 0 0 0 1px var(--busy);
}

.cal {
  display: grid;
  gap: 10px;
}

.cal__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cal__title {
  font-weight: 700;
  text-align: center;
}

.cal__arrow {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.cal__arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.cal__months {
  display: grid;
  gap: 18px;
}

@media (min-width: 700px) {
  .cal__months--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cal__month-title {
  margin-bottom: 6px;
  font-weight: 600;
  text-align: center;
}

.cal__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.cal__grid--head {
  margin-bottom: 4px;
}

.cal__weekday {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

.cal__day {
  display: grid;
  place-items: center;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) ease;
}

button.cal__day {
  cursor: pointer;
}

button.cal__day:active {
  transform: scale(0.94);
}

/* Зелёные — свободные дни, серые — занятые. */
.cal__day--free {
  background: var(--free-soft);
  color: var(--free-text);
}

.cal__day--busy {
  background: var(--busy-soft);
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.cal__day--past {
  color: var(--border-strong);
  background: transparent;
}

.cal__day--today {
  box-shadow: inset 0 0 0 2px var(--text-muted);
}

.cal__day--selected {
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
}

.cal__day--selected.cal__day--busy {
  background: color-mix(in srgb, var(--accent) 55%, var(--busy));
}

.cal-hint {
  min-height: 1.5em;
}
