/* Hallmark · shape: showroom and service desk · genre: editorial · theme: brand · redesign: full
 * hero: Poster (/), Banner (/services/, /contacts/) · nav: edge-aligned · footer: colophon
 * signature: the X5 changing with the visitor's scroll · posture: Restrained
 * copy: verbatim except the edits recorded in .hallmark/log.json
 * axes: dark-and-light/Onest/royal-blue · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E3 S5 R4 V4 · weakest: E, mobile utility pages delayed their content; compact their introductions and put contacts before the map. */
/* МОЙКА ТЕРМИНАЛ АВТО — "showroom" design: a photo opening (a wet car in a
   dark bay), violet-black ink, one royal-blue accent for the action that matters
   (booking / route / prices), ruled service rows and restrained controls.
   Onest (variable, self-hosted, Cyrillic + Latin) for every face. Light pages
   follow the visitor's OS theme (light-dark()): light reads as white cards
   on white, dark as rimmed cards on ink. The opening, intro bands, photo band,
   header and footer are dark always (color-scheme: dark on them flips every
   token below in one place); the home page's calculator is light always
   (.section-light), and so is the admin — see .admin-body. */
@font-face {
  font-family: "Onest";
  src: url("../fonts/onest-cyrillic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Onest";
  src: url("../fonts/onest-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212;
}

:root {
  color-scheme: light dark;
  /* fixed brand colors — the same in both themes */
  --ink: #0b0918;
  --ink-2: #120f26;
  --accent: #2563eb;
  --accent-hover: #3b76ff;
  --on-accent: #fafbfe;
  /* the two theme palettes, each value defined once here */
  --l-primary: #1d4ed8;
  --d-primary: #8aa8ff;
  --l-primary-soft: #e9efff;
  --d-primary-soft: #181a40;
  --l-text: #0f1222;
  --d-text: #eceaf6;
  --l-text-muted: #5a6075;
  --d-text-muted: #a19db8;
  /* the error red, one per theme: #c62828 on the dark surface is 3.3:1,
     under WCAG AA's 4.5:1 for the booking dialog's messages */
  --l-error: #c62828;
  --d-error: #ff6b6b;
  --l-bg: #fafbfe;
  --d-bg: #0b0918;
  --l-bg-alt: #f4f6fb;
  --d-bg-alt: #100d21;
  --l-surface: #fafbfe;
  --d-surface: #131029;
  --l-border: #e3e7f0;
  --d-border: #24203f;
  /* card rim + its shadow: a soft drop on light, a blue halo on dark */
  --l-rim: #e3e7f0;
  --d-rim: #2c3a93;
  --l-glow: rgba(15, 18, 34, 0.08);
  --d-glow: rgba(47, 91, 255, 0.24);
  /* theme-aware tokens: resolved per element by its color-scheme */
  --primary: light-dark(var(--l-primary), var(--d-primary));
  --primary-soft: light-dark(var(--l-primary-soft), var(--d-primary-soft));
  --text: light-dark(var(--l-text), var(--d-text));
  --text-muted: light-dark(var(--l-text-muted), var(--d-text-muted));
  --bg: light-dark(var(--l-bg), var(--d-bg));
  --bg-alt: light-dark(var(--l-bg-alt), var(--d-bg-alt));
  --surface: light-dark(var(--l-surface), var(--d-surface));
  --border: light-dark(var(--l-border), var(--d-border));
  --rim: light-dark(var(--l-rim), var(--d-rim));
  --glow: light-dark(var(--l-glow), var(--d-glow));
  --card-shadow: 0 12px 32px var(--glow);
  --error: light-dark(var(--l-error), var(--d-error));
  --success: #2e7d32;
  --warn: #ef6c00;
  --radius: 12px;
  --radius-sm: 8px;
  --font-body: "Onest", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: var(--font-body);
  /* the full-width header bar. The opening and the inner-page intro pull
     themselves up under it by exactly this much. */
  --header-h: 68px;
  /* a section heading's size; the opening's headline is set in it too */
  --h2-size: var(--text-section);
  --shadow-sm: 0 1px 2px rgba(11, 9, 24, 0.05), 0 2px 8px rgba(11, 9, 24, 0.06);
  --shadow-md: 0 12px 32px rgba(11, 9, 24, 0.12), 0 2px 6px rgba(11, 9, 24, 0.06);
  --veil-light: rgba(255, 255, 255, 0.08);
  --rule-on-dark: rgba(255, 255, 255, 0.1);
  --mask-opaque: #000;
  --success-soft: #e8f5e9;
  --error-soft: #ffebee;
  --warn-soft: #fff3e0;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Browsers without light-dark() (Safari < 17.5, Chrome < 123) would drop
   every token above to "invalid" and paint the dark bands black-on-black.
   They get the light palette, and every surface that declares
   color-scheme: dark gets the dark one — no OS-theme following, but readable.
   Keep this selector list in step with the color-scheme: dark rules. */
@supports not (color: light-dark(#000, #fff)) {
  :root {
    --primary: var(--l-primary);
    --primary-soft: var(--l-primary-soft);
    --text: var(--l-text);
    --text-muted: var(--l-text-muted);
    --bg: var(--l-bg);
    --bg-alt: var(--l-bg-alt);
    --surface: var(--l-surface);
    --border: var(--l-border);
    --rim: var(--l-rim);
    --glow: var(--l-glow);
    --error: var(--l-error);
  }

  .section-dark,
  .drive,
  .site-header,
  .action-bar {
    --primary: var(--d-primary);
    --primary-soft: var(--d-primary-soft);
    --text: var(--d-text);
    --text-muted: var(--d-text-muted);
    --bg: var(--d-bg);
    --bg-alt: var(--d-bg-alt);
    --surface: var(--d-surface);
    --border: var(--d-border);
    --rim: var(--d-rim);
    --glow: var(--d-glow);
    --error: var(--d-error);
  }
}

/* cross-page fade (CSS only, no router); the header stays put */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.22s;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

* {
  box-sizing: border-box;
}

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

/* Not while the home page's car follows the scroll (.has-drive): a smooth
   scroll to the calculator — «Записаться», Back and Forward to it, a page
   opened at /#services — would carry the visitor through the opening's
   screens and play the clip on the way. At once instead */
html.has-drive {
  scroll-behavior: auto;
}

/* Below 980px the bottom is covered too: the calculator's total turns into
   a sticky bar (87px with its offset), and on phones the fixed action bar
   joins it (148px together; 74px alone on other pages). Without this, Tab
   scrolls a checkbox just into view behind them: 17 of 39 add-ons hidden on
   a 390px screen (WCAG 2.4.11). Each value is what covers the bottom plus
   12px, as for the header; site.js scrolls the whole focused row or card
   into view, so a tall one clears them too. Measured — keep in step with
   .action-bar and .calc-summary.
   Only while focus is keyboard focus (:focus-visible): the browser treats
   the padding as off-screen for a click or a tap too, and centred the
   tapped row — a 401px jump under the finger. */
@media (max-width: 979px) {
  html.has-calc:has(:focus-visible) {
    scroll-padding-bottom: 100px;
  }
}

@media (max-width: 760px) {
  html:has(:focus-visible) {
    scroll-padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }

  html.has-calc:has(:focus-visible) {
    scroll-padding-bottom: calc(160px + env(safe-area-inset-bottom));
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

/* the opening's glow and the cards' halo reach past the viewport edge on
   purpose; clip (unlike hidden) creates no scroll container, so the sticky
   header keeps working */
main {
  overflow-x: clip;
}

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

a {
  color: var(--primary);
}

h1,
h2,
h3 {
  text-wrap: balance;
  overflow-wrap: break-word;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.05;
  margin: 0.3em 0;
}

h2 {
  font-size: var(--h2-size);
  line-height: 1.1;
  margin: 1em 0 0.5em;
}

h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0.8em 0 0.4em;
}

code {
  background: var(--bg-alt);
  padding: 0 var(--space-4);
  border-radius: 3px;
}

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

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-20);
}

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

.section {
  padding: clamp(var(--space-64), 9vw, var(--space-112)) 0;
}

/* Section header: heading on the left, an optional link on the
   right that drops under them on narrow screens */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-20) var(--space-32);
  flex-wrap: wrap;
  margin-bottom: clamp(var(--space-28), 4vw, var(--space-48));
}

.section-head h2 {
  margin: 0;
  max-width: 18ch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-12);
  margin: 0 0 var(--space-16);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}


.section-lead {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 58ch;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  padding: var(--space-12) var(--space-20);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color 0.2s var(--ease-out);
}

.section-link:hover {
  border-color: var(--text);
}

/* Dark surface. color-scheme flips every
   light-dark() token inside, so cards/borders/text need no dark variants. */
.section-dark {
  color-scheme: dark;
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: var(--text);
}

.section-dark > .container {
  position: relative;
}

/* A band that stays white whatever the OS theme: color-scheme: light pins
   every light-dark() token inside to its light value, as .section-dark does
   the other way. The calculator's own background, so the page around it
   (body's --bg) cannot show through dark. */
.section-light {
  color-scheme: light;
  background: var(--bg);
  color: var(--text);
}

/* A section that rises over the one above it, its top corners rounded like
   the cards, instead of a straight cut from ink to white. A fade would pass
   through the grey between them. The section above shows in the corners and
   loses its bottom --sheet-radius under this one, so it must keep at least
   that much bottom padding (.drive-stage, .page-intro and .section do: 40px
   and more against at most 40px). The footer rises too, except after the
   home page's band, which is as dark as it is: the page's last section,
   not its last element, so a script or a dialog put after it changes
   nothing. Its selector sits in :is(), a forgiving list: a browser without
   :has() (Firefox before 121) skips it alone, where a plain list would drop
   the whole rule. */
.section-sheet,
:is(main:has(> section:last-of-type:not(.section-dark)) + .site-footer) {
  --sheet-radius: var(--radius-panel);
  position: relative;
  z-index: 1;
  margin-top: calc(-1 * var(--sheet-radius));
  border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
}

/* a sheet must cover what it rises over: the bands paint their own (ink,
   white), a plain section takes the page's */
.section-sheet:not(.section-dark, .section-light) {
  background: var(--bg);
}



/* Header ------------------------------------------------------------------ */
/* A full-width dark glass bar: it reads the same over the opening's photo and
   over a white section, so nothing has to switch its colors on scroll. Its
   blur stays over the opening's canvas too: scrubbing it under a 4x CPU
   throttle (Chrome, desktop and phone) dropped no more frames with the blur
   than without. */
.site-header {
  color-scheme: dark;
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  background: var(--ink);
  view-transition-name: site-header;
}

.header-bar {
  display: flex;
  align-items: center;
  gap: var(--space-24);
  height: var(--header-h);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header {
    background: var(--ink);
  }
}

.admin-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-24);
  min-height: 64px;
  flex-wrap: wrap;
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}

.logo span {
  color: var(--primary);
}

.logo small {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0;
}

.main-nav {
  display: flex;
  gap: var(--space-28);
  flex: 1;
}

.main-nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}

.main-nav a:hover {
  color: var(--primary);
}

.header-bar .main-nav {
  justify-content: flex-end;
  gap: var(--space-8);
}

.header-bar .main-nav a {
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-control);
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color 0.2s ease, background 0.2s ease;
}

.header-bar .main-nav a:hover,
.header-bar .main-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--veil-light);
}

.header-phone {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-12) var(--space-20);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.header-phone:hover {
  color: var(--primary);
}

.header-phone svg,
.action-bar svg,
.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

@media (max-width: 760px) {
  /* The fixed action bar already links to prices. Keeping a second copy
     here pushes Contacts off a 320px screen beside the wordmark. */
  .header-bar .header-prices {
    display: none;
  }

  .header-bar {
    gap: var(--space-8);
  }

  .header-bar .main-nav {
    justify-content: flex-end;
    gap: 0;
  }

  .header-bar .main-nav a {
    padding: var(--space-8) var(--space-12);
    font-size: 0.9rem;
  }

  /* the admin one carries "админка" too: at the desktop size the pair
     runs off a 320px screen */
  .header-bar .logo,
  .header-inner .logo {
    font-size: 0.92rem;
  }

  /* the bottom action bar carries the call on phones */
  .header-phone {
    display: none;
  }
}

/* Mobile action bar ----------------------------------------------------------- */
/* Thumb-reach shortcuts on phones: prices, route, call. Hidden on wider
   screens, where the header pill already shows the phone. */
.action-bar {
  display: none;
}

@media (max-width: 760px) {
  .action-bar {
    color-scheme: dark;
    position: fixed;
    z-index: 60;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    display: flex;
    gap: var(--space-8);
    padding: var(--space-8);
    border-radius: var(--radius-panel);
    border: 1px solid var(--rule-on-dark);
    background: color-mix(in oklab, var(--ink) 86%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    box-shadow: none;
  }

  .action-bar a {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
    min-height: 48px;
    border-radius: var(--radius-control);
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
  }

  .action-bar .action-call {
    flex: 1.4;
    background: var(--accent);
    color: var(--on-accent);
  }

  body:has(.action-bar) {
    padding-bottom: calc(var(--space-84) + env(safe-area-inset-bottom));
  }
}

/* Photos behind copy ---------------------------------------------------- */
/* a photo behind a section's copy (_macros.html backdrop()): the section
   isolates itself, or the photo would sink under its background */
.backdrop,
.backdrop img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

/* the shade of a page intro over its photo */
.page-intro-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(45% 55% at 72% 55%, color-mix(in oklab, var(--accent) 22%, transparent), transparent 70%),
    linear-gradient(90deg, var(--ink) 0%, color-mix(in oklab, var(--ink) 82%, transparent) 30%, transparent 62%),
    linear-gradient(180deg, color-mix(in oklab, var(--ink) 60%, transparent) 0%, transparent 28%, transparent 62%, var(--ink) 100%);
}

/* the shade where the copy sits on top and the car below it: it runs
   top-down instead. A page intro up to a tablet's width, where it
   stacks */
.page-intro-photo {
  --shade-stacked:
    radial-gradient(60% 40% at 70% 85%, color-mix(in oklab, var(--accent) 22%, transparent), transparent 70%),
    linear-gradient(180deg, var(--ink) 0%, color-mix(in oklab, var(--ink) 88%, transparent) 45%, color-mix(in oklab, var(--ink) 20%, transparent) 75%, var(--ink) 100%);
}

/* The opening: a dirty X5 becomes clean as the visitor scrolls. The
   still and canvas share the same composition. Loading reserves one screen;
   only a ready animation needs the additional scroll distance. */
.drive {
  --drive-photo-mask: linear-gradient(180deg, transparent, var(--mask-opaque) 22%, var(--mask-opaque) 78%, transparent);
  color-scheme: dark;
  position: relative;
  height: 100vh;
  margin-top: calc(-1 * var(--header-h));
  background: var(--ink);
  color: var(--text);
}

.has-drive.drive-scroll-ready .drive {
  height: calc(var(--drive-scroll, 0px) + 100vh);
}

/* overflow: clip, not hidden: hidden makes the stage a scroll container,
   and Tab to the headline's «Записаться» below its edge (a short screen)
   scrolls the stage itself — the photo, the canvas and the captions off
   by that much for the rest of the visit. hidden where clip is unknown
   (Safari before 16) */
.drive-stage {
  --drive-visible-height: 100vh;
  --drive-top: calc(var(--header-h) + clamp(32px, 6vw, 80px));
  --drive-bottom: clamp(40px, 6vw, 72px);
  --drive-scroll-space: 64px;
  position: sticky;
  top: 0;
  height: 100vh;
  isolation: isolate;
  overflow: hidden;
  overflow: clip;
  display: flex;
  align-items: flex-start;
  padding: var(--drive-top) 0 var(--drive-bottom);
}

.has-drive .drive-stage {
  --drive-scroll-space: 80px;
}

@supports (height: 100svh) {
  .drive-stage {
    --drive-visible-height: 100svh;
  }
}

/* the photo (backdrop(), _macros.html) and the canvas over it
   cover the stage alike, centred, as drive.js draws a frame */
.drive-canvas {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  display: none;
}

/* Hide the opening photo only once the canvas fully covers it. */
.has-drive .is-drawn .drive-layer {
  visibility: hidden;
}

/* The photo in the frames' shape (--drive-ratio, home.html, from
   photos.py's DRIVE), covering the stage as drive.js draws a frame: frame 0
   is the photo cut to that shape at its centre (scripts/drive_frames.py),
   and drive.js fades the canvas in over the photo. Each covering the stage in its own
   shape, the two would be scaled apart on a screen wider than both — 5 px
   at the car's tail at 1920 x 960, a double image while they mix. The
   stage is 100vh tall where the car follows the scroll. Only where
   aspect-ratio is known: the box has no height but from it, and a photo
   a few pixels off beats none */
@supports (aspect-ratio: 1) {
  @media (orientation: landscape) {
    .drive-layer {
      inset: auto;
      top: 50%;
      left: 50%;
      width: max(100%, 100vh * var(--drive-ratio));
      height: auto;
      aspect-ratio: var(--drive-ratio);
      transform: translate(-50%, -50%);
    }
  }
}

/* A portrait screen would show a quarter of a frame covering it, the car
   cut off at both ends: the frame keeps its own shape there instead, the
   screen's width (the car's tail is at the frame's right edge as it
   starts), under the copy, its top and bottom faded into the ink. drive.js
   draws on the canvas the shape it is */
@media (orientation: portrait) {
  .drive-layer,
  .drive-canvas {
    inset: auto;
    top: 62%;
    left: 0;
    width: 100%;
    height: auto;
    aspect-ratio: var(--drive-ratio);
    transform: translateY(-50%);
    -webkit-mask-image: var(--drive-photo-mask);
    mask-image: var(--drive-photo-mask);
  }
}

/* the copy stands at the top, over the bay's ceiling: the car fills the
   lower two thirds of every frame, and its roof reaches up past a third as
   the camera comes round. Ink there and at the bottom edge, where the band
   meets the page */
.drive-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, var(--ink) 0%,
    color-mix(in oklab, var(--ink) 82%, transparent) 20%,
    color-mix(in oklab, var(--ink) 50%, transparent) 34%, transparent 50%,
    transparent 86%, var(--ink) 100%);
}

.drive-copy {
  display: grid;
  width: 100%;
}

/* At a 32px default font on 320x568 the copy put the button at 816px,
   below the action bar at 493px. site.js measures the visible space and
   makes only the active, overflowing copy keyboard-scrollable. The button
   keeps its own row; the stage and the car's scroll travel stay unchanged. */
.has-drive .drive-copy {
  /* Keep the button on screen while deferred site.js is still loading.
     Six rem reserves the bottom bar at both 16px and 32px defaults; once
     ready, the controller replaces this with the measured clearance.
     The cue clearance follows its measured height when the controller
     is ready. */
  max-height: max(0px, calc(var(--drive-copy-height,
    calc(var(--drive-visible-height) - var(--drive-top) - max(var(--drive-bottom), 6rem)))
    - var(--drive-scroll-space)));
  grid-template-rows: minmax(0, 1fr) auto;
}

.has-drive .drive-intro,
.has-drive .drive-tour {
  min-height: 0;
  overflow-y: auto;
}

.drive-intro,
.drive-tour {
  max-width: 620px;
}

.drive-kicker {
  margin: 0 0 var(--space-md);
  color: var(--text-muted);
  font-size: var(--text-label);
}

/* the size of the tour's heading that takes its place as the camera moves */
.drive-intro h1 {
  font-size: var(--text-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 var(--space-lg);
}

.drive-title-accent {
  display: block;
  color: inherit;
}

.drive-sub {
  max-width: 44ch;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--text-muted);
  margin: 0;
}

.drive-cta {
  /* A separate row below the overlapping copy keeps the button still and
     reachable while the headline and the captions fade in and out. */
  grid-area: 2 / 1;
  margin: var(--space-28) 0 0;
}

.drive-scroll {
  position: absolute;
  left: 50%;
  bottom: var(--drive-bottom);
  margin: 0;
  transform: translateX(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.drive-scroll svg {
  display: block;
}

/* site.js reserves this row's measured height. The
   initial CSS clearance also leaves space before the controller loads. */
.drive-loading {
  display: none;
}

.has-drive:not(.drive-buffer-ready):not(.drive-buffer-degraded) .drive-loading {
  display: flex;
  align-items: center;
  width: min(420px, calc(100vw - 40px));
  max-width: 100%;
  padding: 10px;
  border: 1px solid #ffffff24;
  border-radius: 12px;
  background: #0c0a18e8;
  color: #fff6e8;
}

.has-drive:not(.drive-buffer-ready):not(.drive-buffer-degraded) .drive-scroll > svg {
  display: none;
}

.drive-loading progress {
  display: block;
  appearance: none;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
  height: 4px;
  margin: 0;
  background: #ffffff30;
  color: #f2b36d;
}

.drive-loading progress::-webkit-progress-bar { background: #ffffff30; }
.drive-loading progress::-webkit-progress-value { background: #f2b36d; border-radius: 8px; }
.drive-loading progress::-moz-progress-bar { background: #f2b36d; border-radius: 8px; }

.drive-scroll-wheel {
  /* Three 1.6s cycles point down on arrival, then leave the cue still
     beside the captions. The reduced-motion rule below disables them. */
  animation: scroll-wheel 1.6s ease-in-out 3;
}

@keyframes scroll-wheel {
  0%, 20%, 100% {
    opacity: 1;
    transform: translateY(0);
  }

  65%, 80% {
    opacity: 0;
    transform: translateY(6px);
  }

  81% {
    opacity: 0;
    transform: translateY(0);
  }
}

.has-drive .drive-scroll {
  bottom: calc(100vh - var(--drive-visible-height) + var(--drive-bottom));
}

.drive-cta .btn,
.drive-cta .btn:hover,
.drive-cta .btn:active {
  min-width: min(184px, 100%);
  min-height: 52px;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-control);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  border-color: transparent;
  background-color: var(--drive-button-color, var(--accent));
  background-image: none;
  box-shadow: none;
}

.drive-cta .btn:hover {
  --drive-button-color: var(--accent-hover);
  transform: none;
}

.drive-cta .btn:active {
  transform: translateY(1px);
}

/* A short screen, the car following the scroll: the
   stage is the screen's height and sticks, so copy that does not fit is
   never scrolled to — the «Записаться» last, past the edge or under the
   action bar. Tighter there, the kicker left out (the hours are in the
   footer), the headline on one line where it fits, the button the ordinary
   size. The full copy's button ends at 421px on a 320px-wide screen; the
   action bar needs another 74px below it, so a 480px cutoff left it covered
   at heights 481–495px. 31.25em gives 500px at the usual 16px font. em also
   follows the browser's default font: at 24px the button ended at 609px on
   320x568, below the bar at 494px. Without the car the section scrolls as
   any other: nothing changes. */
@media (max-height: 31.25em) {
  .has-drive .drive-stage {
    --drive-top: calc(var(--header-h) + 12px);
  }

  .has-drive .drive-kicker,
  .has-drive .drive-tour > .eyebrow,
  .has-drive .drive-tour h2 {
    display: none;
  }

  .has-drive .drive-intro h1 {
    margin-bottom: var(--space-12);
  }

  /* Use the available width before wrapping. */
  .has-drive .drive-title-accent {
    display: inline;
  }

  .has-drive .drive-cta {
    margin-top: var(--space-16);
  }

  .has-drive .drive-cta .btn {
    min-height: 60px;
    padding: var(--space-16) var(--space-24);
    font-size: 1.2rem;
  }
}

@media (orientation: landscape) and (max-height: 480px) {
  /* Beside the copy on a short landscape screen: below the tallest caption
     the button ended at 319px on 640x280, under the action bar at 206px.
     The active caption names the service; the generic heading above yields
     its space so both the description and the button fit. The smaller icon
     stays below the copy at the left, clear of the button on the right.
     Reclaim 8px above the copy while keeping the loading bar clear
     of the bottom shortcuts. */
  .has-drive .drive-stage {
    --drive-scroll-space: 72px;
    --drive-top: calc(var(--header-h) + 4px);
    --drive-bottom: 86px;
  }

  .has-drive .drive-scroll {
    max-width: calc(100vw - 40px - var(--drive-action-width, 184px) - var(--space-24));
    left: 20px;
    transform: none;
  }

  .has-drive .drive-scroll svg {
    width: auto;
    height: 32px;
  }

  .has-drive .drive-copy {
    --drive-copy-height: calc(var(--drive-visible-height) - var(--drive-top) - var(--drive-bottom));
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: minmax(0, 1fr);
    column-gap: var(--space-24);
  }

  .has-drive .drive-cta {
    grid-area: 1 / 2;
    align-self: start;
    margin-top: 0;
  }
}

/* The mobile shortcuts include the device inset. Apply their clearance
   after the landscape baseline so the notice stays above the whole bar. */
@media (max-width: 760px) {
  .has-drive .drive-stage {
    --drive-bottom: calc(86px + env(safe-area-inset-bottom));
  }
}

@media (orientation: landscape) and (max-height: 300px) {
  /* At 640x240 only 94px lies between header and shortcuts. The compact
     loading bar leaves room for the headline and booking button. */
  .has-drive .drive-stage {
    --drive-scroll-space: 56px;
  }

  .has-drive:not(.drive-buffer-ready) .drive-intro h1 {
    font-size: 20px;
  }

  /* At 300px or less the captions stand in for the intro's subline too. */
  .has-drive .drive-sub {
    display: none;
  }
}

.drive-tour h2 {
  margin: 0 0 clamp(var(--space-20), 3vw, var(--space-32));
  max-width: 18ch;
}

.drive-steps {
  display: grid;
  gap: var(--space-16);
  margin: 0;
  padding: 0;
  list-style: none;
}

.drive-step h3 {
  margin: 0 0 var(--space-8);
  color: var(--d-primary);
  font-size: clamp(1.15rem, 2vw, 1.4rem);
}

.drive-step p {
  margin: 0;
  max-width: 40ch;
  color: var(--text-muted);
}

.has-drive .drive-canvas {
  display: block;
}

/* Keep the tour out of layout and the accessibility tree until a usable
   animation buffer is ready. Slow/2G connections may never start the clip;
   their static hero still offers the headline, booking and prices below. */
.drive-tour {
  display: none;
}

.has-drive .drive.is-touring .drive-tour {
  display: block;
}

/* The headline and the ready animation's captions share one grid cell. */
.drive-intro,
.drive-tour,
.drive-step {
  grid-area: 1 / 1;
}

/* a short drift on a curve that starts slowly: 16 px on a strong ease-out
   moved the text ~5 px in its first frame at Safari's 30 frames a second
   (Low Power Mode) — the copy twitched just before it gave way */
.drive-tour,
.drive-step {
  opacity: 0;
  transform: translateY(6px);
}

.is-touring .drive-intro {
  opacity: 0;
  transform: translateY(-6px);
}

.is-touring .drive-tour,
.drive-step.is-active {
  opacity: 1;
  transform: none;
}

.has-drive .drive-intro,
.has-drive .drive-tour,
.has-drive .drive-step {
  transition: opacity 0.45s ease, transform 0.45s ease;
}

/* the other way round, the captions, transparent over the headline until
   the camera moves, are not what a click or a tap on it lands on */
.has-drive .drive:not(.is-touring) .drive-tour {
  pointer-events: none;
}

/* No scrub: a static photo, introductory headline and booking button. */
:root:not(.has-drive) .drive {
  height: auto;
}

:root:not(.has-drive) .drive-stage {
  position: relative;
  height: auto;
  min-height: min(100vh, 900px);
  /* On 844x390 the absolute icon occupied the last paragraph's final
     48px. Natural-height stages need its space in their padding too. */
  padding-bottom: calc(var(--drive-bottom) + var(--drive-scroll-space));
}

:root:not(.has-drive) .drive-intro {
  grid-area: auto;
  opacity: 1;
  transform: none;
}

/* At 800x400 the full fallback copy makes the stage over 900px tall.
   Keep its photo in the viewport-sized canvas declared by the source's
   sizes hint, rather than enlarging it to cover all that copy. Fade the
   bounded photo's edges into the ink around it. */
@media (orientation: landscape) {
  :root:not(.has-drive) .drive-layer {
    -webkit-mask-image: var(--drive-photo-mask);
    mask-image: var(--drive-photo-mask);
  }
}

/* no scrub on a portrait screen: the copy stacks, the car stands below it */
@media (orientation: portrait) {
  :root:not(.has-drive) .drive-stage {
    min-height: 0;
    padding-bottom: 64vw;
  }

  :root:not(.has-drive) .drive-layer {
    top: auto;
    bottom: 8vw;
    transform: none;
  }
}

/* Inner-page intro band ---------------------------------------------------- */
.page-intro {
  margin-top: calc(-1 * var(--header-h));
  padding: calc(var(--header-h) + clamp(var(--space-40), 6vw, var(--space-72))) 0 clamp(var(--space-40), 6vw, var(--space-72));
}

/* A page intro over a photo (services, contacts): the render's empty left
   half carries the copy, as on the home page, the car stands on the right. */
.page-intro-photo {
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(380px, 38vw, 540px);
}

.page-intro-photo > .container {
  width: 100%;
}

.page-intro-photo .backdrop img {
  object-position: 80% 50%;
}

/* beside the car the copy keeps to the photo's empty left part, or the
   lead runs across the car body. Not behind a min-width query: the stacked
   intro below undoes it, so a zoomed 1023.5 px window, which matches
   neither max-width: 1023px nor min-width: 1024px, still gets one layout */
.page-intro-photo .section-lead {
  max-width: min(58ch, 44%);
}

/* a wide screen would scale the photo past the band's height and crop the
   car: it keeps to the right, at most 1440 px wide (intro_photo()'s sizes),
   its edge faded out */
@media (min-width: 1441px) {
  .page-intro-photo .backdrop {
    left: auto;
    width: 1440px;
    -webkit-mask-image: linear-gradient(90deg, transparent, var(--mask-opaque) 30%);
    mask-image: linear-gradient(90deg, transparent, var(--mask-opaque) 30%);
  }
}

/* a phone or a tablet upright: the copy on top, the car below it (side by
   side, a 768 px screen ran the lead across the car) — the photo only as
   tall as keeps the whole car (the renders' right half) inside the screen's
   width, and capped, or a phone on its side scrolls two screens of car
   before the prices. intro_photo()'s sizes follows the 110vw and the
   1023 px: change them together */
@media (max-width: 1023px) {
  .page-intro-photo {
    align-items: flex-start;
    min-height: 0;
    padding-bottom: min(72vw, var(--space-360));
  }

  .page-intro-photo .backdrop {
    top: auto;
    height: min(110vw, 560px);
  }

  .page-intro-photo .backdrop img {
    object-position: 95% 100%;
  }

  .page-intro-photo::before {
    background: var(--shade-stacked);
  }

  /* the copy has the full width again: .section-lead's own measure */
  .page-intro-photo .section-lead {
    max-width: 58ch;
  }
}

.page-intro h1 {
  margin: 0.25em 0 0.35em;
  max-width: 20ch;
}

/* Utility pages lead with their task. At 375px the former photo opening
   delayed the first price until y=889 and the contact block until y=1056.
   Keep the same photograph as a quiet backdrop, without a second screen
   reserved for it; the price index and contact details follow immediately. */
.utility-intro.page-intro-photo {
  min-height: 320px;
  padding-block: calc(var(--header-h) + var(--space-32)) var(--space-48);
}

.utility-intro.page-intro-photo::before {
  background: linear-gradient(90deg, var(--ink),
    color-mix(in oklab, var(--ink) 85%, transparent),
    color-mix(in oklab, var(--ink) 45%, transparent));
}

.utility-intro.page-intro-photo .section-lead {
  max-width: 58ch;
}

.price-sheet,
.contact-sheet {
  padding-block: var(--space-48) var(--space-96);
}

.price-layout {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: var(--column-gap);
  align-items: start;
}

.price-layout > .chips {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: grid;
  gap: var(--space-4);
}

.price-layout .chips a {
  display: block;
  padding: var(--space-12) 0;
  border: 0;
  border-radius: 0;
}

.price-groups {
  min-width: 0;
  grid-column: 2;
}

.price-layout:not(:has(.chips)) .price-groups {
  grid-column: 1 / -1;
}

.price-groups .service-group-title {
  margin-top: 0;
  font-size: var(--text-section);
}

@media (max-width: 760px) {
  .utility-intro.page-intro-photo {
    min-height: 0;
    padding-block: calc(var(--header-h) + var(--space-24)) var(--space-40);
  }

  .utility-intro.page-intro-photo .backdrop {
    height: 100%;
    opacity: 0.35;
  }

  .utility-intro h1 {
    font-size: 2rem;
  }

  .utility-intro .section-lead {
    font-size: 1rem;
  }

  .price-sheet,
  .contact-sheet {
    padding-block: var(--space-24) var(--space-64);
  }

  .price-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-24);
  }

  .price-layout > .chips {
    position: static;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: var(--space-24);
    margin: 0;
  }

  .price-layout .chips a {
    white-space: nowrap;
  }

  .price-groups {
    grid-column: 1;
  }
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-12);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--text);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

/* Buttons ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-12);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: var(--space-12) var(--space-24);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  background: var(--bg-alt);
  color: var(--text);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: none;
}

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

.btn-primary:hover {
  box-shadow: var(--shadow-md);
}

/* the public call to action: royal blue on any background */
.btn-accent {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: none;
}

.btn-accent:hover {
  background: var(--accent-hover);
  box-shadow: none;
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--text);
}

.btn-lg {
  min-height: 52px;
  padding: var(--space-12) var(--space-24);
  font-size: 1.05rem;
  border-radius: var(--radius-control);
}

.btn-block {
  width: 100%;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  padding: var(--space-8) var(--space-12);
  font-size: 0.9rem;
  font-weight: 500;
}

.btn-danger,
.btn-ghost.btn-danger {
  color: var(--error);
  border-color: var(--error);
  background: transparent;
}

/* white on the deep red in either theme: the dark theme's lighter --error
   is for text on a dark surface, and would leave white text at 2.6:1 here */
.btn-danger:not(.btn-ghost) {
  background: var(--l-error);
  color: var(--on-accent);
}

.inline-form {
  display: inline;
}

/* Category chips ---------------------------------------------------------------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  margin: 0 0 var(--space-28);
  padding: 0;
  list-style: none;
}

.chips a {
  display: inline-block;
  padding: var(--space-8) var(--space-16);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.chips a:hover {
  border-color: var(--text);
}

/* Price calculator ------------------------------------------------------------ */
/* The home page's price list: car class, a package, add-ons, the total. The
   inputs and the total panel exist only once js/calculator.js has added .has-calc;
   until then every price reads "от <cheapest class>" and nothing is
   clickable that does nothing. */
.calc {
  display: grid;
  gap: var(--space-24);
}

/* the total column only once there is a total to show */
@media (min-width: 980px) {
  .has-calc .calc {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: var(--space-32);
    align-items: start;
  }
}

.calc-steps {
  counter-reset: calc-step;
  min-width: 0;
}

.calc-step {
  min-width: 0;
  margin: 0 0 var(--space-32);
  padding: 0;
  border: 0;
}

/* the step number, only where the steps are steps */
.has-calc .calc-steps legend::before {
  counter-increment: calc-step;
  content: counter(calc-step);
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: var(--space-12);
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.75rem;
  letter-spacing: 0;
}

.has-calc .calc-hint {
  display: block;
  margin: 0 0 var(--space-16);
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* every class's price is printed; the switch shows the visitor's */
.calc-price {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.calc-price [data-class],
.has-class-switch .calc-price-min {
  display: none;
}

.has-class-switch .calc-price .is-selected {
  display: inline;
}

/* the inputs, the panel and the "pick one" hint wait for the script */
.calc-hint,
.calc-skip,
.calc-summary,
.calc-row input,
.plan-pick input {
  display: none;
}

/* packages: plan cards, pick one */
.plan-grid {
  display: grid;
  gap: var(--space-16);
  /* Two wide columns keep the descriptions readable beside the summary.
     The former four-column layout left about 14 characters per line. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-24);
  border-radius: var(--radius);
  border: 1px solid var(--rim);
  background: var(--surface);
  box-shadow: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.plan-pick {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  align-items: baseline;
  gap: var(--space-16);
}

.has-calc .plan-pick {
  cursor: pointer;
}

/* the native radio stays focusable and announced, just not drawn */
.has-calc .plan-pick input {
  display: block;
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.plan-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.plan-card:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.plan-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.plan-card .calc-price {
  margin-top: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.plan-desc {
  grid-column: 1 / -1;
  margin-top: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

@media (max-width: 760px) {
  .plan-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.has-calc .calc-skip {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-top: var(--space-16);
  padding: var(--space-8) var(--space-16);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
}

.calc-skip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.calc-skip:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.calc-skip:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* add-ons: one collapsible card per price group */
.calc-group {
  margin-bottom: var(--space-12);
  border-radius: var(--radius-sm);
  border: 1px solid var(--rim);
  background: var(--surface);
  box-shadow: none;
}

.calc-group summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-12);
  padding: var(--space-16) var(--space-20);
  cursor: pointer;
  list-style: none;
}

.calc-group summary::-webkit-details-marker {
  display: none;
}

.calc-group summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: var(--space-4);
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease;
}

.calc-group[open] summary::after {
  transform: translateY(2px) rotate(-135deg);
}

.calc-group-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.calc-group-meta {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.calc-group-count {
  padding: 2px var(--space-12);
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
}

.calc-list {
  margin: 0;
  padding: 0 var(--space-20) var(--space-8);
  list-style: none;
}

/* in line with the rows below it */
.calc-group .group-note {
  margin: 0 var(--space-20) var(--space-12);
}

.calc-row {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  border-top: 1px solid var(--border);
}

.calc-row label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-12);
  min-width: 0;
  padding: var(--space-12) 0;
}

.has-calc .calc-row label {
  cursor: pointer;
}

.has-calc .calc-row input {
  display: block;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}

.calc-row-name {
  flex: 1;
  min-width: 0;
  font-weight: 500;
}

.calc-row-name small {
  display: block;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 400;
}

.calc-row .calc-price {
  font-weight: 600;
}

.calc-row:has(input:checked) .calc-price {
  color: var(--primary);
}

/* already in a picked package: ticked, free, not unpickable by hand */
.calc-covered {
  display: none;
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

.calc-row.is-covered .calc-price {
  display: none;
}

.calc-row.is-covered .calc-covered {
  display: inline;
}

/* needed by a pick and added by the calculator: ticked and summed */
.calc-required {
  display: none;
  padding: 1px var(--space-8);
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.calc-row.is-required .calc-required {
  display: inline;
}

/* not priced for the chosen class: shown, but not pickable */
.calc-row:has(input:disabled):not(.is-covered, .is-required) label {
  opacity: 0.5;
  cursor: not-allowed;
}

/* the total: a sticky side panel, a sticky bottom bar below 980px */
.has-calc .calc-summary {
  display: block;
  position: sticky;
  top: calc(var(--header-h) + 20px);
  padding: var(--space-24);
  border-radius: var(--radius);
  border: 1px solid var(--rim);
  background: var(--surface);
  box-shadow: none;
}

.calc-summary-car,
.calc-empty,
.calc-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.calc-lines {
  margin: var(--space-12) 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
}

/* name · price · ×; a required line has no × and its price still lines up */
.calc-lines li {
  display: grid;
  grid-template-columns: 1fr auto 28px;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-8) 0;
  border-bottom: 1px dashed var(--border);
}

.calc-lines li span:nth-child(2) {
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.calc-remove {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.calc-remove:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.calc-empty {
  margin-top: var(--space-12);
}

.calc-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-12);
  margin: var(--space-16) 0 var(--space-8);
}

.calc-total span {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
}

.calc-total output {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.calc-summary .btn {
  margin-top: var(--space-16);
}

/* focused only by script, when the last line's × goes */
.calc-summary:focus {
  outline: none;
}

@media (max-width: 979px) {
  .has-calc .calc-summary {
    top: auto;
    bottom: 12px;
    display: flex;
    align-items: center;
    gap: var(--space-16);
    padding: var(--space-12) var(--space-20);
  }

  .calc-summary-car,
  .calc-lines,
  .calc-empty,
  .calc-note {
    display: none;
  }

  .calc-total {
    flex: 1;
    margin: 0;
  }

  .calc-summary .btn {
    width: auto;
    margin: 0;
  }

  /* the bar has no room for notes, but a failed save must still show: a
     chip just above it */
  .calc-note-error:not([hidden]) {
    display: block;
    position: absolute;
    right: 12px;
    bottom: calc(100% + 6px);
    left: 12px;
    padding: var(--space-8) var(--space-12);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--card-shadow);
  }
}

/* phones: above the action bar; «Записаться» stays, compact */
@media (max-width: 760px) {
  .has-calc .calc-summary {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .calc-summary .btn {
    padding: var(--space-12) var(--space-16);
  }

  .calc-total output {
    font-size: 1.5rem;
  }

  html.has-calc.in-calculator .action-bar:not(:focus-within) {
    display: none;
  }

  html.in-calculator:not(:has(.action-bar:focus-within)) .calc-summary {
    bottom: calc(12px + env(safe-area-inset-bottom));
  }

  html.has-calc.in-calculator:not(:has(.action-bar:focus-within)):has(:focus-visible) {
    scroll-padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }
}

.calc-note-error {
  color: var(--error);
}

/* «Записаться» with nothing picked yet */
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Booking dialog ------------------------------------------------------------ */
/* «Записаться» from the calculator's total: a modal <dialog> (js/site.js) */
/* A browser without <dialog> (Safari before 15.4) knows no UA rule hiding a
   closed one: the form would sit inline under the calculator, with no
   script behind it (site.js only wires a dialog it can open). */
.booking:not([open]) {
  display: none;
}

.booking {
  width: min(440px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: var(--space-28);
  border: 1px solid var(--rim);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--card-shadow);
}

.booking::backdrop {
  background: color-mix(in oklab, var(--mask-opaque) 55%, transparent);
}

.booking h2 {
  margin: 0 0 var(--space-8);
  font-size: 1.4rem;
}

.booking-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-12);
  margin: var(--space-16) 0;
  padding: var(--space-12) 0;
  border-block: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 0.88rem;
}

.booking-total output {
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.booking-consent {
  display: flex;
  gap: var(--space-8);
  align-items: flex-start;
  font-size: 0.88rem;
  font-weight: 400 !important;
}

.booking-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-12);
  margin: var(--space-20) 0 var(--space-12);
}

.booking-actions .btn {
  flex: 1;
}

/* Car-class switcher ------------------------------------------------------------ */
.class-switch {
  display: none;
}

.has-class-switch .class-switch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr));
  gap: var(--space-8);
  margin: 0 0 var(--space-24);
  padding: 0;
  border: 0;
}

@media (max-width: 600px) {
  .has-class-switch .class-switch {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.class-switch legend,
.calc-step legend {
  padding: 0;
  margin-bottom: var(--space-12);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
}

.class-switch label {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-12) var(--space-16);
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.class-switch label:hover {
  border-color: var(--text);
}

/* the native radio stays focusable and announced, just not drawn */
.class-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.class-switch label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.class-switch label:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.class-switch-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}

.class-switch small {
  font-size: 0.8rem;
  line-height: 1.35;
}

/* Service cards --------------------------------------------------------------- */
.service-group + .service-group {
  margin-top: clamp(var(--space-40), 6vw, var(--space-64));
}

.service-group-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  margin: 0 0 var(--space-20);
}

/* a group's notes (PriceGroup.notes): /services/ and the calculator */
.group-note {
  max-width: 72ch;
  margin: 0 0 var(--space-20);
  padding: var(--space-16) var(--space-20);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  color: var(--text-muted);
  font-size: 0.92rem;
}

.group-note > :first-child {
  margin-top: 0;
}

.group-note > :last-child {
  margin-bottom: 0;
}

.group-note strong {
  color: var(--text);
}

.group-note ol,
.group-note ul {
  padding-left: 1.3em;
}

.group-note li + li {
  margin-top: var(--space-4);
}

.service-grid {
  display: grid;
  gap: 0;
  grid-template-columns: minmax(0, 1fr);
}

.service-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-8) var(--space-24);
  align-items: baseline;
  padding: var(--space-24) 0;
  border-radius: 0;
  border: 0;
  border-top: 1px solid var(--border);
  background: transparent;
  box-shadow: none;
}

.service-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.service-card .service-price {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.service-card p {
  color: var(--text-muted);
  margin: 0;
}

.service-card > p:not(.service-price) {
  grid-column: 1 / -1;
  max-width: 65ch;
}

/* pinned to the card bottom whatever the text length above */
.service-card-foot {
  grid-column: 1 / -1;
  padding-top: var(--space-8);
  font-size: 0.92rem;
}

.service-duration {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-4) var(--space-12);
  border-radius: 999px;
  background: var(--bg-alt);
  color: var(--text-muted);
}

/* CTA band --------------------------------------------------------------------- */
.cta-band-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-32);
  align-items: end;
}

@media (max-width: 760px) {
  .cta-band-inner {
    grid-template-columns: minmax(0, 1fr);
  }
}

.cta-band h2 {
  font-size: clamp(2rem, 5.5vw, 4rem);
  letter-spacing: -0.035em;
  line-height: 1;
  margin: 0 0 var(--space-16);
}

.cta-band p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.cta-band:has(> .map-embed) {
  padding-bottom: 0;
}

.cta-band > .map-embed {
  position: relative;
  margin-top: var(--space-32);
  border-inline: 0;
  border-radius: 0;
}

.cta-band > .map-embed iframe {
  height: clamp(560px, 70vh, 720px);
}

.cta-band-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-16);
}

.cta-band-phone {
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.cta-band-phone:hover {
  color: var(--primary);
}

/* Contacts ------------------------------------------------------------------------ */
.contacts-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: var(--space-24);
  align-items: start;
}

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

.contact-grid {
  display: grid;
  gap: var(--space-12);
}

.contacts-layout:not(:has(.map-embed)) .contact-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

.contacts-layout:not(:has(.map-embed)) {
  grid-template-columns: minmax(0, 1fr);
}

.contact-card {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-24) 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.contact-card h2 {
  margin: 0 0 2px;
  font-size: var(--text-label);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text-muted);
}

.contact-card p {
  margin: 0;
  font-size: var(--text-title);
  font-weight: 500;
}

.contact-card a {
  color: var(--text);
  text-decoration: none;
}

.contact-card a:hover {
  color: var(--primary);
}

.contact-icon {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--primary);
}

.contact-icon svg {
  width: 100%;
  height: 100%;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-self: center;
  gap: var(--space-12);
  margin-top: var(--space-8);
}

.map-embed {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-alt);
}

.map-embed iframe {
  display: block;
  width: 100%;
  min-height: 480px;
  border: 0;
}

.contacts-layout .map-embed {
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

@media (max-width: 900px) {
  .contacts-layout .map-embed {
    position: static;
  }

  .map-embed iframe {
    min-height: 320px;
  }
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.socials a {
  display: inline-block;
  padding: var(--space-8) var(--space-16);
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s ease;
}

.socials a:hover {
  border-color: var(--text);
}

/* Legal / error pages --------------------------------------------------------------- */
.legal h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.legal h2 {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  margin-top: 1.8em;
}

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

.error-page {
  text-align: center;
  padding: var(--space-40) 0;
}

.error-page p {
  color: var(--text-muted);
}

.error-code {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(6rem, 22vw, 11rem);
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--primary);
}

.error-page .logo {
  display: inline-block;
  margin-bottom: var(--space-24);
}

/* Footer ------------------------------------------------------------------------- */
.site-footer {
  padding: clamp(var(--space-56), 7vw, var(--space-88)) 0 var(--space-24);
  font-size: 0.95rem;
}

.site-footer a {
  color: var(--text);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--primary);
}

.footer-inner {
  display: grid;
  gap: var(--space-32);
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.footer-inner > :last-child {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8) var(--space-32);
}

@media (max-width: 760px) {
  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
  }
}

.footer-inner p {
  margin: 0 0 var(--space-8);
  color: var(--text-muted);
}

.footer-heading {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text) !important;
  margin-bottom: var(--space-16) !important;
}

.footer-tagline {
  max-width: 36ch;
}

.logo-footer {
  margin-bottom: var(--space-16);
}


.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: var(--space-16);
  flex-wrap: wrap;
  margin-top: var(--space-28);
  padding-top: var(--space-20);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Forms ------------------------------------------------------------------- */
.field {
  margin-bottom: var(--space-16);
}

.field label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-4);
  font-size: 0.95rem;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field input[type="password"],
.field select,
.field textarea {
  width: 100%;
  padding: var(--space-12) var(--space-12);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--bg-alt);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--primary);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  background: var(--bg);
}

.price-fields {
  margin: 0 0 var(--space-16);
  padding: var(--space-16) var(--space-16) 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.price-fields legend {
  padding: 0 var(--space-8);
  font-weight: 500;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-12);
}

.field-error input,
.field-error select,
.field-error textarea {
  border-color: var(--error);
}

.error {
  color: var(--error);
  font-size: 0.88rem;
  margin: var(--space-4) 0 0;
}

.checkbox {
  display: flex;
  gap: var(--space-8);
  align-items: flex-start;
  font-weight: 400 !important;
}

.checkbox input {
  margin-top: var(--space-4);
}

/* Admin ------------------------------------------------------------------ */
.admin-body {
  /* the admin is a work tool: always light, whatever the OS theme */
  color-scheme: light;
  background: var(--bg-alt);
}

.admin-body h1,
.admin-body h2 {
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: none;
  letter-spacing: -0.01em;
}

.admin-body h2 {
  font-size: 1.25rem;
  margin: 1.4em 0 0.6em;
}

.admin-main {
  padding: var(--space-24) var(--space-16) var(--space-48);
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-12);
}

.panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-20);
  margin: var(--space-20) 0;
}

.panel-danger {
  border-color: var(--error);
}

.login-box {
  max-width: 380px;
  margin: var(--space-60) auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-28);
  box-shadow: var(--shadow-sm);
}

.flash {
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-sm);
  margin: var(--space-12) 0;
}

.flash-success {
  background: var(--success-soft);
  color: var(--success);
}

.flash-error {
  background: var(--error-soft);
  color: var(--error);
}

/* "look at this, it is not an error" — test_flash_categories pins every
   category in use to a rule here */
.flash-warning {
  background: var(--warn-soft);
  color: var(--warn);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  font-size: 0.95rem;
}

.table th,
.table td {
  text-align: left;
  padding: var(--space-12) var(--space-12);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.table th {
  background: var(--bg-alt);
  font-weight: 500;
}

.table-services,
.table-bookings {
  display: block;
  overflow-x: auto;
}

.badge {
  display: inline-block;
  padding: 2px var(--space-12);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--bg-alt);
  color: var(--text-muted);
  white-space: nowrap;
}

.badge-published {
  background: var(--success-soft);
  color: var(--success);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-12);
  margin: var(--space-20) 0;
}

.stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-16);
  text-decoration: none;
  color: inherit;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.actions {
  white-space: nowrap;
}

.actions .btn {
  margin-bottom: var(--space-4);
}

/* Scroll reveal: js/site.js adds .has-reveal to <html> only once it has an
   IntersectionObserver ready to flip .is-visible on — so with JS off, a
   blocked script or reduced motion nothing is ever hidden. */
.has-reveal .reveal {
  transition: opacity 0.7s var(--ease-out), transform 0.6s var(--ease-out),
    box-shadow 0.4s ease, border-color 0.4s ease, background 0.35s ease;
}

.has-reveal .reveal:not(.is-visible) {
  opacity: 0;
  transform: translateY(28px);
  transition-delay: calc(var(--i, 0) * 80ms);
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }

  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

  .btn:hover,
  .drive-cta .btn:hover,
  .drive-cta .btn:active {
    transform: none;
  }
}
.privacy-choices { padding-block: 1rem; }
.privacy-choices .btn { margin: .25rem .5rem .25rem 0; }
.privacy-choices p, .legal { overflow-wrap: anywhere; }
