/* Public car page (D104). The landing's look (apps/landing/src/styles.css): its colours, Inter for
   text, Manrope for headings and the brand word (not Unbounded, which cost ~32 kB for one word,
   D106), all served from our origin. Light only, like the landing. Mobile first: 360–430 px is
   the main case (a QR sticker scanned on a phone). */

/* @font-face rules are generated by the API from the fontsource packages (car-page/assets.ts). */
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/auto/assets/inter-cyrillic-ext-wght-normal.ca15706333.woff2) format('woff2-variations');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/auto/assets/inter-cyrillic-wght-normal.71d5ee93cc.woff2) format('woff2-variations');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/auto/assets/inter-latin-ext-wght-normal.34b9c504ca.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/auto/assets/inter-latin-wght-normal.3100e775e8.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Manrope Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/auto/assets/manrope-cyrillic-ext-wght-normal.de37de877d.woff2) format('woff2-variations');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}
@font-face {
  font-family: 'Manrope Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/auto/assets/manrope-cyrillic-wght-normal.c268b459a9.woff2) format('woff2-variations');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'Manrope Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/auto/assets/manrope-latin-ext-wght-normal.3911b66d9f.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/auto/assets/manrope-latin-wght-normal.a30ddcd349.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  --font:
    "Inter Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Manrope Variable", "Inter Variable", system-ui, sans-serif;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #0e1726;
  --text-2: #26303f;
  --muted: #3b4658;
  --hint: #5a6578;
  --border: #e2e6ec;
  --border-soft: #eef1f4;
  --primary: #1d63d8;
  --primary-hover: #164faf;
  --primary-soft: #e8f0fd;
  --primary-ink: #1747a6;
  --dark: #0e1726;
  --dark-text: #c3cbd8;
  --dark-link: #9cc0ff;
  --tick: #17663a;
  --tick-soft: #e3f5ea;
  --radius: 16px;
  --gutter: 16px;
  --column: 760px;
  /* D106: the container of a car page on a computer, and its panel on the right. */
  --column-wide: 1200px;
  --panel: 380px;
  --bar-height: 0px;
  /* The landing's shadows: cards float a little over the tinted page. */
  --shadow-card: 0 1px 2px rgba(14, 23, 38, 0.04), 0 8px 24px rgba(14, 23, 38, 0.05);
  --shadow: 0 18px 40px rgba(14, 23, 38, 0.1);
  --shadow-photo: 0 22px 48px rgba(14, 23, 38, 0.16);
  /* A photo's frame before its picture arrives, and around a crop that has not loaded. */
  --photo-bg: linear-gradient(160deg, #26334a 0%, #0e1726 100%);
}

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

html {
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* D106: depth instead of one flat tone, in the landing's colours: a soft blue light from the top
   corners fading into the page grey, and a faint second glow further down. Gradients only, no
   image and no request. */
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 10% -180px, rgba(29, 99, 216, 0.12), transparent 70%),
    radial-gradient(900px 560px at 100% 0, rgba(47, 128, 237, 0.08), transparent 70%),
    radial-gradient(760px 640px at 0 1150px, rgba(29, 99, 216, 0.06), transparent 70%),
    linear-gradient(180deg, #edf2fb 0, rgba(245, 246, 248, 0) 760px);
  background-repeat: no-repeat;
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.has-bar {
  --bar-height: calc(76px + env(safe-area-inset-bottom));
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
p,
dl,
dd,
figure {
  margin: 0;
}

h1,
h2 {
  font-family: var(--font-head);
  text-wrap: balance;
}

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

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

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
}

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

.wrap {
  width: 100%;
  max-width: calc(var(--column) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Header: the logo leads to the site, «Продаєте авто?» to the block at the bottom. */
.top {
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(226, 230, 236, 0.9);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
}

.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  color: var(--text);
}

.logo img {
  width: 32px;
  height: 32px;
}

.logo-word {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.04em;
}

.top-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

/* D110: the demo page's thin strip above the header, in the footer's dark: the car is an example,
   and «Підключити свій» opens the bot. In the flow of the page, so it never covers anything. */
.demo-strip {
  background: var(--dark);
  color: var(--dark-text);
  font-size: 14px;
  line-height: 1.35;
}

.demo-strip .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding-block: 6px;
}

.demo-strip-text {
  min-width: 0;
}

.demo-strip-text b {
  color: #fff;
  font-weight: 700;
}

.demo-strip-link {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 150ms ease-out;
}

.demo-strip-link:hover {
  background: var(--primary-hover);
}

/* A 44 px tap target, though the pill itself is thinner. */
.demo-strip-link::after {
  content: "";
  position: absolute;
  inset: -6px -4px;
}

.demo-strip :focus-visible {
  outline-color: #fff;
}

/* Gallery: edge to edge on a phone, swiped with CSS scroll snap (no script needed). */
.gallery {
  position: relative;
  background: var(--dark);
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.gallery-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

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

.slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  overflow: hidden;
}

.slide-link {
  display: block;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}

.slide-link:focus-visible {
  outline-offset: -4px;
}

/* One photo in its 4:3 frame, as the post shows it (D54, D55, D106). A 4:3 photo fills it; a
   photo of another shape sits whole on a blurred, darkened copy of itself; the seller's crop
   fills it with that part of the photo, placed by the page's own rule for it (.crop-N sets the
   size and offset, from the stored crop). */
.photo {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--photo-bg);
}

.photo-img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.photo-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(22px) brightness(0.7);
  transform: scale(1.15);
}

.photo.is-cropped .photo-img {
  position: absolute;
  max-width: none;
  width: var(--crop-w, 100%);
  height: var(--crop-h, 100%);
  left: var(--crop-x, 0);
  top: var(--crop-y, 0);
  /* A crop is 4:3 to within 2 %: cover evens out the rest, as the post does. */
  object-fit: cover;
}

.gallery-count {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(14, 23, 38, 0.62);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.gallery-count svg {
  width: 15px;
  height: 15px;
}

.gallery-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 30px;
  display: flex;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}

.gallery-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transition:
    background-color 150ms ease-out,
    transform 150ms ease-out;
}

.gallery-dots span.is-current {
  background: #fff;
  transform: scale(1.25);
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(14, 23, 38, 0.18);
}

.gallery-arrow svg {
  width: 22px;
  height: 22px;
}

.gallery-arrow[disabled] {
  opacity: 0;
  pointer-events: none;
}

.gallery-prev {
  left: 12px;
}

.gallery-next {
  right: 12px;
}

/* Arrows only where there is a mouse; phones swipe. */
@media (hover: hover) and (pointer: fine) {
  .gallery-arrow {
    display: inline-flex;
  }
}

/* No photos yet: a quiet band instead of a big empty frame. */
.no-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 168px;
  padding: 24px 16px 40px;
  background: linear-gradient(160deg, #e8f0fd 0%, #f5f6f8 100%);
  color: var(--hint);
  font-size: 14px;
}

.no-photo svg {
  width: 56px;
  height: 56px;
  color: #9fb4d6;
}

/* Thumbnails under the frame, from a tablet up (D106): plain links to the slides. */
.thumbs {
  display: none;
}

/* Content: white cards on the grey page; the first one rides over the photo's bottom edge. */
.content {
  flex: 1;
  padding-bottom: 32px;
}

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

.card + .card {
  margin-top: 12px;
}

.card h2 {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.005em;
  margin-bottom: 14px;
}

.headline {
  position: relative;
  margin: -24px calc(-1 * var(--gutter)) 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 22px 22px 0 0;
  padding: 20px var(--gutter) 22px;
  box-shadow: none;
}

/* The contact buttons of the panel: a computer only (D106); a phone has its bar. */
.panel-contacts {
  display: none;
}

.headline-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 10px;
}

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

.headline h1 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.015em;
}

.price {
  margin-top: 12px;
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.price-cut {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 6px;
  font-size: 15px;
  color: var(--hint);
  font-variant-numeric: tabular-nums;
}

.price-cut s {
  text-decoration-thickness: 1.5px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.pill-cut {
  background: var(--tick-soft);
  color: var(--tick);
}

.sold-note {
  margin-top: 12px;
  font-size: 16px;
  color: var(--muted);
}

.where {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 12px;
  font-size: 15px;
  color: var(--muted);
}

.where span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.where svg {
  width: 17px;
  height: 17px;
  color: var(--hint);
}

/* Status chips: the landing's pills, with a dot. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px 4px 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--chip-text);
  background: var(--chip-bg);
}

.chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.chip-in_transit {
  --chip-text: var(--primary-ink);
  --chip-bg: var(--primary-soft);
}

.chip-customs {
  --chip-text: #8a4b00;
  --chip-bg: #fff1db;
}

.chip-available {
  --chip-text: var(--tick);
  --chip-bg: var(--tick-soft);
}

.chip-reserved {
  --chip-text: #5b2e9e;
  --chip-bg: #f0e9fb;
}

.chip-sold {
  --chip-text: #3a4250;
  --chip-bg: #eceef1;
}

/* Key facts: two columns of tiles. */
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.fact {
  position: relative;
  min-width: 0;
  padding: 11px 12px 11px 42px;
  border-radius: 12px;
  background: var(--bg);
}

.fact svg {
  position: absolute;
  left: 12px;
  top: 13px;
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.fact dt {
  font-size: 13px;
  line-height: 1.3;
  color: var(--hint);
}

.fact dd {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.fact-wide {
  grid-column: 1 / -1;
}

.vin {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 0.04em;
  user-select: all;
  -webkit-user-select: all;
}

/* The seller's description: their lines as they wrote them. */
.description {
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.description p + p {
  margin-top: 12px;
}

/* Seller: the template's conditions, their lines and paragraphs as the seller typed them. */
.conditions {
  color: var(--text-2);
  line-height: 1.6;
  overflow-wrap: anywhere;
  margin-bottom: 16px;
}

.conditions p + p {
  margin-top: 12px;
}

/* Formatting a seller typed as tags (D108): only these reach the page. */
.description code,
.conditions code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.94em;
}

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

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  transition:
    background-color 150ms ease-out,
    border-color 150ms ease-out;
}

.btn svg {
  flex: none;
  width: 22px;
  height: 22px;
}

.btn-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  min-width: 0;
}

.btn-text small {
  font-size: 14px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* The number and the username under a button's label pass WCAG AA on its colour (D106). */
.btn-primary .btn-text small {
  color: #eef4ff;
}

.btn-soft .btn-text small {
  color: var(--primary-ink);
}

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

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

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

.btn-soft:hover {
  background: #dbe7fc;
}

.contact-button {
  justify-content: flex-start;
  padding-inline: 18px;
}

/* The contact bar stays at the bottom of a phone screen while the seller block is out of view. */
.contact-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  gap: 8px;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 20px rgba(14, 23, 38, 0.08);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  transition: transform 200ms ease-out;
}

.contact-bar .btn {
  flex: 1;
  min-height: 52px;
  gap: 8px;
  padding-inline: 12px;
}

.contact-bar.is-hidden {
  transform: translateY(110%);
}

/* «Продаєте авто?»: the modest way in for sellers; a full-width band on a computer (D106). */
.growth {
  display: grid;
  gap: 14px;
  margin-top: 12px;
  padding: 20px 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #e8f0fd 0%, #eef4fe 100%);
}

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

.growth-head img {
  width: 40px;
  height: 40px;
  flex: none;
}

.growth h2 {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
}

.growth-text {
  color: var(--text-2);
  font-size: 15px;
}

.growth-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 18px;
}

.growth-actions .btn {
  min-height: 48px;
  padding-inline: 20px;
  font-size: 15px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
}

/* Not found / no longer for sale */
.message {
  padding: 40px 0 8px;
  text-align: center;
}

.message svg {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: #9fb4d6;
}

.message h1 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
}

.message-text {
  max-width: 34em;
  margin: 10px auto 0;
  color: var(--muted);
}

.message .growth {
  margin-top: 32px;
  text-align: left;
}

/* Footer: the landing's dark band. */
.foot {
  background: var(--dark);
  color: var(--dark-text);
  font-size: 14px;
  /* The dark band runs on under the phone's contact bar. */
  padding: 24px 0 calc(28px + var(--bar-height));
}

.foot .wrap {
  display: grid;
  gap: 8px;
}

.foot .logo-word {
  color: #fff;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
}

.foot nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--dark-link);
  text-decoration: underline;
}

.foot :focus-visible {
  outline-color: #fff;
}

/* Full-screen photos (built by the page script). */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: #000;
  color: #fff;
}

.viewer[hidden] {
  display: none;
}

.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: env(safe-area-inset-top) 8px 0 16px;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.viewer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.viewer-close svg {
  width: 26px;
  height: 26px;
}

.viewer-stage {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
}

.viewer .gallery-track {
  flex: 1;
}

/* The same 4:3 picture as on the page, as large as the screen allows. */
.viewer .slide {
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer .photo {
  width: min(100%, calc((100vh - 88px - env(safe-area-inset-top)) * 4 / 3));
  height: auto;
  aspect-ratio: 4 / 3;
  background: transparent;
}

@supports (height: 100dvh) {
  .viewer .photo {
    width: min(100%, calc((100dvh - 88px - env(safe-area-inset-top)) * 4 / 3));
  }
}

.viewer .gallery-arrow {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: none;
}

html.viewer-open,
html.viewer-open body {
  overflow: hidden;
}

/* The QR sticker's print page (D105): on screen the sticker with «Друкувати»; on paper only the
   sticker, A5 wide (148 mm, D106) in the middle of an A4 sheet, with a dashed line to cut along. */
.print-page .content {
  padding-top: 16px;
}

.qr-card {
  text-align: center;
}

.qr-card h1 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
}

.qr-car {
  margin-top: 4px;
  color: var(--muted);
}

.qr-sticker {
  max-width: 420px;
  margin: 20px auto 0;
}

.qr-sticker svg {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.qr-print {
  width: 100%;
  max-width: 420px;
  margin: 20px auto 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.qr-note {
  max-width: 30em;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.qr-back {
  margin-top: 8px;
}

@page {
  size: A4 portrait;
  margin: 15mm;
}

@media print {
  .print-page,
  .print-page .content {
    background: #fff;
  }

  .print-page .skip-link,
  .print-page .top,
  .print-page .foot,
  .print-page .qr-card > :not(.qr-sticker) {
    display: none;
  }

  .print-page .content,
  .print-page .wrap {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .qr-card {
    border: 0;
    padding: 0;
    background: none;
  }

  .qr-sticker {
    width: 148mm;
    max-width: none;
    margin: 0 auto;
    break-inside: avoid;
  }

  .qr-sticker svg {
    width: 148mm;
    border: 0;
    border-radius: 0;
    outline: 0.3mm dashed #8a94a3;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* From a tablet up: a centred column, the photos larger and rounded. The contact bar stays until
   the computer's panel takes the buttons (D110), its buttons over the column. */
@media (min-width: 768px) {
  :root {
    --gutter: 24px;
  }

  .top .wrap {
    min-height: 64px;
  }

  .gallery-frame {
    max-width: calc(var(--column) + 2 * var(--gutter));
    margin: 24px auto 0;
    padding: 0 var(--gutter);
  }

  .gallery {
    border-radius: 20px;
    box-shadow: var(--shadow-photo);
  }

  .no-photo {
    border-radius: 20px;
    min-height: 200px;
    padding-bottom: 24px;
  }

  /* The thumbnails say where you are: no dots over the photo. */
  .gallery-dots {
    display: none;
  }

  .thumbs {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    padding: 3px;
    overflow-x: auto;
    scrollbar-width: thin;
    scroll-behavior: smooth;
  }

  .thumb {
    position: relative;
    flex: 0 0 96px;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    overflow: hidden;
    opacity: 0.72;
    box-shadow: 0 0 0 1px rgba(14, 23, 38, 0.08);
    transition:
      opacity 150ms ease-out,
      box-shadow 150ms ease-out;
  }

  .thumb:hover {
    opacity: 1;
  }

  .thumb[aria-current="true"] {
    opacity: 1;
    box-shadow:
      0 0 0 2px var(--surface),
      0 0 0 4px var(--primary);
  }

  .thumb .photo-backdrop {
    filter: blur(8px) brightness(0.7);
  }

  .slide {
    scroll-margin-top: 16px;
  }

  .headline {
    margin: 16px 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-card);
  }

  .headline h1 {
    font-size: 32px;
  }

  .price {
    font-size: 36px;
  }

  .card {
    padding: 24px;
  }

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

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

  .growth {
    padding: 24px;
  }

  .contact-bar {
    padding-inline: max(var(--gutter), calc((100% - var(--column)) / 2));
  }

  .message {
    padding-top: 64px;
  }
}

/* D106: a computer uses its width. A 1200 px container, the gallery large on the left with its
   thumbnails, the details under it, and on the right a panel with the status, the name, the price
   and the contacts that stays in view while the details scroll by. «Продаєте авто?» becomes a
   band across the page above the footer. */
@media (min-width: 1024px) {
  .car-page .wrap {
    max-width: calc(var(--column-wide) + 2 * var(--gutter));
  }

  .car-page .content {
    padding-bottom: 0;
  }

  .car {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--panel);
    grid-template-areas:
      "media side"
      "info side";
    align-items: start;
    gap: 24px 32px;
    max-width: calc(var(--column-wide) + 2 * var(--gutter));
    margin: 0 auto;
    padding: 32px var(--gutter) 0;
  }

  .car-media {
    grid-area: media;
    min-width: 0;
  }

  .car .gallery-frame {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .car-side {
    grid-area: side;
    position: sticky;
    top: 24px;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .car-info {
    grid-area: info;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .car-info > .card + .card {
    margin-top: 16px;
  }

  .headline {
    margin: 0;
    padding: 28px;
    border-radius: 20px;
    box-shadow: var(--shadow);
  }

  .headline h1 {
    font-size: 30px;
  }

  .price {
    margin-top: 14px;
    font-size: 40px;
  }

  .panel-contacts {
    display: grid;
    gap: 10px;
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--border-soft);
  }

  .panel-contacts .btn {
    min-height: 60px;
  }

  /* The panel has the buttons from here, so the bar goes (D106, D110). */
  body.has-bar {
    --bar-height: 0px;
  }

  .contact-bar {
    display: none;
  }

  /* The panel has the buttons: the seller block keeps the conditions, or goes. */
  .seller .contacts {
    display: none;
  }

  .seller .conditions {
    margin-bottom: 0;
  }

  .seller-bare {
    display: none;
  }

  .band {
    margin-top: 64px;
    padding: 44px 0 52px;
    background:
      radial-gradient(700px 300px at 85% 0, rgba(255, 255, 255, 0.7), transparent 70%),
      linear-gradient(135deg, #e3edfd 0%, #eef4fe 55%, #e6effd 100%);
    border-top: 1px solid #d6e3fa;
  }

  .band .growth {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "head actions"
      "text actions";
    align-items: center;
    gap: 6px 40px;
    margin: 0;
    padding: 0;
    background: none;
    border-radius: 0;
  }

  .band .growth-head {
    grid-area: head;
  }

  .band .growth-head img {
    width: 48px;
    height: 48px;
  }

  .band .growth h2 {
    font-size: 26px;
  }

  .band .growth-text {
    grid-area: text;
    max-width: 640px;
    padding-left: 60px;
    font-size: 16px;
  }

  .band .growth-actions {
    grid-area: actions;
    flex-wrap: nowrap;
  }

  .band .growth-actions .btn {
    min-height: 52px;
    padding-inline: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .demo-strip-link,
  .gallery-dots span,
  .contact-bar,
  .thumb {
    transition: none;
  }

  .thumbs {
    scroll-behavior: auto;
  }
}
