/* ------------------------------------------------------------------
   PREEN bay kiosk · screens
   Per-screen composition. Screen classes are prefixed .s-<screen>.
   Components come from components.css; nothing here restyles them
   beyond layout.
   ------------------------------------------------------------------ */

/* ---------- section header shared by bays + catalog ---------- */
.k-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: var(--sp-5);
}
.k-head__copy { display: grid; gap: 10px; }
.k-head__aside { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* ================= LOCK (staff sign-in) ================= */
.s-lock {
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 520px);
  gap: var(--sp-8);
  align-items: center;
  align-content: center;
  min-height: 0;
}
.s-lock__copy { display: grid; gap: var(--sp-5); max-width: 620px; }
.s-lock__copy .k-display { text-wrap: balance; }
/* The only eyebrow that sits straight on the photo with no panel behind it (a light strip in portrait). */
body[data-theme="dark"] .s-lock__copy .k-eyebrow { color: #fff; }
.s-lock__facts { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.s-lock__form { display: grid; gap: var(--sp-4); }
.s-lock__form h2 { font-size: var(--fs-h2); }
.s-lock__or {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  color: var(--k-fg-muted);
  font-size: var(--fs-xs);
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.s-lock__or::before, .s-lock__or::after { content: ""; height: 1px; background: var(--k-line); }
.s-demo {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 84px;
  padding: 12px 18px 12px 14px;
  border: 1.5px solid var(--k-line);
  border-radius: var(--r-lg);
  background: var(--k-surface-2);
  color: var(--k-fg);
  text-align: left;
  overflow: hidden;
  position: relative;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast);
}
@media (hover: hover) { .s-demo:hover { transform: translateY(-2px); border-color: var(--p-gold); } }
.s-demo:active { transform: scale(0.98); }
.s-demo__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, #dbeaff, #f4d3be);
  color: var(--p-navy);
}
.s-demo__icon svg { width: 28px; height: 28px; }
.s-demo b { display: block; font-size: var(--fs-md); font-weight: 800; }
.s-demo span { color: var(--k-fg-muted); font-size: var(--fs-xs); font-weight: 700; }
.s-demo svg.arrow { width: 22px; height: 22px; color: var(--k-fg-muted); }

/* ================= BAYS ================= */
.s-bays { grid-template-rows: auto minmax(0, 1fr); }
.s-bays__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: var(--sp-5);
  align-content: start;
  max-width: 1296px;
  /* Scroll when the bays do not fit, instead of squeezing every card. The wide padding keeps the hover
     lift and most of the soft card shadow inside the scroll box, so its edge does not show as a
     rectangle; the negative margin keeps the cards where they were. */
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  --bays-bleed: min(28px, var(--page-x));
  padding: 6px var(--bays-bleed) 40px;
  margin: -6px calc(-1 * var(--bays-bleed)) 0;
}
.s-bays__grid::-webkit-scrollbar { display: none; }
/* overflow:hidden made each card a scroll container with a 0 minimum height, so the grid squeezed the
   cards and the photo covered the bay name, the address and "Open this bay". clip keeps the rounded
   corners without that; max-content pins the photo row to the photo. */
.s-bays__grid .k-card { grid-template-rows: max-content 1fr; overflow: clip; }
/* width:100% stops a height-capped photo from getting narrower than its card. The cap keeps one full
   row plus the top of the next row on a 768-800 px tall tablet, so staff can see the list scrolls. */
.s-bays__grid .k-card__media { aspect-ratio: 16 / 9; width: 100%; max-height: 22vh; }

/* ================= WELCOME: see "WELCOME · windshield" further down ================= */

/* voucher code on the offer */
.s-offer__voucher { display: flex; gap: 12px; }
.s-offer__voucher[hidden] { display: none; }
.s-offer__voucher input {
  flex: 1;
  /* An input's default size (20 characters at 28px) set a minimum width wider than the offer column on a
     1024 px tablet and pushed Pay and the prices past the panel. flex: 1 still fills the row. */
  width: 0;
  min-width: 0;
  min-height: var(--hit-min);
  border: 2px solid var(--k-line);
  border-radius: var(--r-pill);
  background: var(--k-surface);
  color: var(--k-fg);
  font: inherit;
  font-size: 28px;
  letter-spacing: 0.3em;
  text-align: center;
}

/* ================= CATALOG ================= */
.s-catalog { grid-template-rows: auto minmax(0, 1fr) auto; gap: var(--sp-5); }
/* A tap anywhere on a wash card opens its details (catalog.js), so the whole card is a target. */
.s-catalog .k-card:not(.is-disabled) { cursor: pointer; }
.s-catalog__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-5);
  min-height: 0;
  align-content: start;
  align-items: stretch;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 6px 6px 16px;
  margin: -6px -6px 0;
}
.s-catalog__grid::-webkit-scrollbar { display: none; }
.s-catalog__grid--rail {
  grid-auto-flow: column;
  grid-auto-columns: minmax(360px, 30vw);
  grid-template-columns: none;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.s-catalog__grid--rail::-webkit-scrollbar { display: none; }
.s-catalog__grid--rail .k-card { scroll-snap-align: start; }
.s-catalog__grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 980px; }
.s-catalog__grid--one { grid-template-columns: minmax(0, 620px); }
.s-catalog__grid--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.s-catalog__grid--four .k-card__body { padding: 16px 18px 18px; }
/* Equal-height cards: the price button always sits on the bottom edge. */
.s-catalog__grid .k-card__body { grid-template-rows: auto auto 1fr auto; }
.s-catalog__grid .k-card__meta { align-self: start; }
/* Equal height means the height of the TALLEST card. `overflow: hidden` made each card a scroll
   container, and the grid then sized the row from the shorter cards: a card with one more line (the
   daytime-price chip) had its photo spill over the name and Details, and its price clipped at the
   bottom. `clip` keeps the rounded corners without that side effect; `max-content` pins the photo
   row to the photo. The cap keeps the price buttons on screen on a shorter tablet. */
.s-catalog__grid .k-card { grid-template-rows: max-content 1fr; overflow: clip; }
/* `width: 100%` matters: a grid item with an aspect ratio is not stretched, so a height cap made
   the photo narrower than its card and left a white strip down the right edge. */
.s-catalog__grid .k-card__media { width: 100%; max-height: 26vh; }
/* One row of posters on a landscape tablet: the row takes the whole height the screen has and the
   photo takes whatever the text leaves, so no card is cut at the bottom and a 21" glass has no empty
   band under the cards. Stacked and portrait layouts keep natural heights and scroll. */
@media (min-width: 981px) and (min-aspect-ratio: 1/1) {
  /* Nothing scrolls vertically here, and a scroll box clipped the card shadows into a hard-edged
     rectangle behind the cards. */
  .s-catalog__grid:not(.s-catalog__grid--rail) { grid-auto-rows: minmax(0, 1fr); overflow: visible; }
  .s-catalog__grid .k-card { grid-template-rows: minmax(120px, 1fr) auto; }
  .s-catalog__grid .k-card__media { aspect-ratio: auto; height: 100%; max-height: none; min-height: 0; }
  /* Three lines reserved on every card, so photos and names line up across the row. */
  .s-catalog__grid .k-card__desc { -webkit-line-clamp: 3; min-height: calc(1.4em * 3); }
}
/* Daytime price sits on the photo, so the text block keeps the same height on every card. */
.k-card__deal {
  position: absolute;
  left: 16px;
  bottom: 14px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: rgba(10, 122, 84, 0.94);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(4, 40, 28, 0.28);
}
.k-card__deal .k-icon { width: 16px; height: 16px; }
.s-catalog__facts {
  display: flex;
  gap: var(--sp-6);
  flex-wrap: wrap;
  color: var(--k-fg-muted);
  font-weight: 800;
  font-size: var(--fs-sm);
}
.s-catalog__facts span { display: inline-flex; align-items: center; gap: 10px; }
.s-catalog__facts svg { width: 22px; height: 22px; color: var(--p-blue); }
.s-catalog__dock {
  display: grid;
  gap: var(--sp-5);
}
.s-catalog__phone {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 640px;
  padding: 12px 14px;
  border-radius: var(--r-xl);
  background: #fff;
  color: var(--p-ink);
  box-shadow: var(--sh-2);
}
.s-catalog__phone .k-qr {
  flex: 0 0 148px;
  padding: 8px;
  box-shadow: none;
}
.s-catalog__phone .k-qr__code { max-width: 132px; }
.s-catalog__phone p:last-child {
  margin: 6px 0 0;
  color: var(--k-fg-muted);
  font-weight: 750;
  line-height: 1.4;
}
.s-hold {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 28, 43, 0.55);
}
.s-hold[hidden] { display: none; }
.s-hold__card {
  width: min(520px, 100%);
  display: grid;
  gap: 8px;
}
.s-hold__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.05;
}
.s-hold__price {
  margin: 0;
  font-weight: 900;
  font-size: 22px;
}
.s-hold__more { margin: 0; color: var(--k-fg-muted); font-weight: 750; }
.s-hold__actions { display: grid; gap: 10px; margin-top: 8px; }
.s-hold__actions .k-btn { min-height: 56px; }
.s-catalog__empty { max-width: 560px; display: grid; gap: 12px; }

/* ================= DETAILS ================= */
.s-details { grid-template-rows: minmax(0, 1fr); min-height: 0; }
.s-details .k-split { grid-template-columns: minmax(0, 1.15fr) minmax(400px, 0.95fr); }
.s-details__hero {
  position: relative;
  min-height: 0;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--sh-3);
  isolation: isolate;
  background: var(--p-navy);
}
.s-details__hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: k-fade 600ms var(--ease-out) both;
}
.s-details__hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11,28,43,0.10) 0%, rgba(11,28,43,0.05) 40%, rgba(11,28,43,0.82) 100%);
}
.s-details__hero .k-back { position: absolute; top: 20px; left: 20px; z-index: 3; }
/* The caption carries its own shade, from clear above it to navy behind the text, so the name, the lede
   and the chips stay readable wherever the photo is bright (on a 1024 px tablet the caption covers the
   lower two thirds of the photo, over the silver car and the spray). */
.s-details__caption {
  --cap-fade: clamp(56px, 7vw, 110px);
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  display: grid;
  gap: 12px;
  padding: var(--cap-fade) clamp(22px, 3vw, 40px) clamp(22px, 3vw, 40px);
  color: #fff;
  background: linear-gradient(180deg, rgba(11, 28, 43, 0) 0, rgba(11, 28, 43, 0.66) var(--cap-fade), rgba(11, 28, 43, 0.86) 100%);
  pointer-events: none; /* its clear top must never take a tap meant for All washes */
}
.s-details__caption h1 { font-size: clamp(40px, 4.6vw, 68px); text-shadow: 0 6px 30px rgba(0,0,0,0.35); }
.s-details__caption .k-lede { color: rgba(255,255,255,0.86); max-width: 38ch; }
/* The chips sit on the photo: a navy base keeps "4 min" / "4 steps" readable over a bright spray. */
.s-details__hero .s-details__caption .k-chip { background: rgba(11, 28, 43, 0.62); border-color: rgba(255,255,255,0.22); color: #fff; backdrop-filter: blur(8px); }
.s-details__info {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: var(--sp-4);
  min-height: 0;
}
.s-details__scroll {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  padding-right: 4px;
  mask-image: linear-gradient(180deg, #000 calc(100% - 28px), transparent);
}
.s-details__scroll::-webkit-scrollbar { display: none; }
.s-details__pay { display: grid; gap: 12px; }
.s-details__pay .k-btn { justify-content: space-between; padding: 0 22px 0 32px; }
/* Only Pay splits its label and price; "Gift voucher? 6-digit code" and "I have a code" are centred. */
.s-details__pay .k-btn--ghost { justify-content: center; padding: 0 30px; }
.s-details__pay .k-btn .k-price { color: #fff; font-size: clamp(26px, 2.4vw, 34px); }
/* Large enough to count as large text on the blue button (3:1), white instead of 72% white. */
.s-details__pay .k-btn .k-price small { color: #fff; font-size: max(0.62em, 19px); }
/* The reader instruction a driver reads from the car right before paying. */
.s-details__note { font-size: var(--fs-sm); color: var(--k-fg-muted); font-weight: 700; text-align: center; }
.s-details__note .k-icon { width: 18px; height: 18px; vertical-align: -3px; }

/* ================= OFFER ================= */
.s-offer__panel {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: var(--sp-4);
  min-height: 0;
}
.s-offer__line { display: flex; align-items: end; justify-content: space-between; gap: var(--sp-4); }
.s-offer__line .k-price { font-size: clamp(30px, 3vw, 44px); }
.s-offer__special { margin: 6px 0 0; color: var(--p-success, #0e9f6e); font-size: var(--fs-sm); font-weight: 800; }
/* The success green is too dark to read on the dark glass at arm's length. */
body[data-theme="dark"] .s-offer__special { color: #6ee7b7; }
.s-offer__special .k-icon { width: 18px; height: 18px; vertical-align: -3px; }
/* The one optional upgrade: a photo of the better wash, its name and one line, the extra price and a
   switch. Off, a slow light sweeps across it; on, it glows in the accent and the photo gets a tick.
   The fixed blue comes first; color-mix() then follows the owner's accent where the browser has it. */
.s-offer__up {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: var(--hit-cta);
  padding: 12px 20px 12px 12px;
  border: 0;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.02)), var(--k-surface-2);
  box-shadow: inset 0 0 0 1.5px var(--k-line), 0 14px 32px rgba(0, 0, 0, 0.16);
  color: var(--k-fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: box-shadow var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  container-type: inline-size;
}
.s-offer__up::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, 0.16) 50%, transparent 62%);
  transform: translateX(-140%);
  animation: k-sweep 4.2s var(--ease-in-out) 1.2s infinite;
  pointer-events: none;
}
@media (hover: hover) { .s-offer__up:hover { box-shadow: inset 0 0 0 1.5px var(--k-accent), 0 14px 32px rgba(0, 0, 0, 0.16); } }
.s-offer__up:active { transform: scale(0.985); }
.s-offer__up[aria-pressed="true"] {
  background: radial-gradient(120% 160% at 0% 0%, rgba(58, 166, 255, 0.34), transparent 62%), rgba(58, 166, 255, 0.12);
  background: radial-gradient(120% 160% at 0% 0%, color-mix(in srgb, var(--k-accent) 34%, transparent), transparent 62%), color-mix(in srgb, var(--k-accent) 12%, transparent);
  box-shadow: inset 0 0 0 2px var(--k-accent), 0 18px 40px rgba(58, 166, 255, 0.26);
  box-shadow: inset 0 0 0 2px var(--k-accent), 0 18px 40px color-mix(in srgb, var(--k-accent) 26%, transparent);
}
.s-offer__up[aria-pressed="true"]::after { animation: none; opacity: 0; }

.s-offer__thumb { position: relative; width: clamp(76px, 6.4vw, 120px); aspect-ratio: 1; }
.s-offer__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  transition: transform var(--dur-base) var(--ease-emph);
}
.s-offer__up[aria-pressed="true"] .s-offer__thumb img { transform: scale(1.04); }
.s-offer__badge {
  position: absolute;
  right: -8px;
  bottom: -8px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--k-accent);
  color: var(--k-accent-fg);
  box-shadow: 0 0 0 3px var(--k-surface-solid), 0 6px 14px rgba(0, 0, 0, 0.3);
  transform: scale(0);
  transition: transform var(--dur-base) var(--ease-emph);
}
.s-offer__badge .k-icon { width: 22px; height: 22px; stroke-width: 3; }
.s-offer__up[aria-pressed="true"] .s-offer__badge { transform: scale(1); }

.s-offer__up-copy { display: grid; gap: 3px; min-width: 0; }
.s-offer__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--k-accent-text);
  font-size: var(--fs-xs);
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.s-offer__eyebrow .k-icon { width: 16px; height: 16px; }
/* The name wraps rather than ending in "…": the driver has to read which wash it is. */
.s-offer__up-copy b {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.2vw, 34px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.s-offer__why {
  display: -webkit-box;
  overflow: hidden;
  color: var(--k-fg-muted);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.s-offer__up-side { display: grid; justify-items: end; gap: 10px; }
.s-offer__up-price { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.s-offer__plus { color: var(--k-accent-text); font-family: var(--font-display); font-size: clamp(24px, 2.2vw, 32px); font-weight: 700; line-height: 1; }
.s-offer__up-price .k-price { font-size: clamp(26px, 2.4vw, 38px); }
/* A phone-style switch: everyone reads on and off from it at a glance. */
.s-offer__switch {
  position: relative;
  width: 66px;
  height: 38px;
  border-radius: var(--r-pill);
  background: rgba(127, 144, 166, 0.32);
  box-shadow: inset 0 0 0 1.5px var(--k-line);
  transition: background var(--dur-base) var(--ease-out);
}
.s-offer__switch i {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  transition: transform var(--dur-base) var(--ease-emph);
}
.s-offer__up[aria-pressed="true"] .s-offer__switch { background: var(--k-accent); box-shadow: none; }
.s-offer__up[aria-pressed="true"] .s-offer__switch i { transform: translateX(28px); }
/* A narrow panel (1024 px screens): name and price first, the extra line goes, the photo shrinks. */
@container (max-width: 420px) {
  .s-offer__up { gap: 14px; }
  .s-offer__thumb { width: 64px; }
  .s-offer__why { display: none; }
}
.s-offer__total {
  display: flex;
  align-items: end;
  justify-content: space-between;
  align-self: end;
  gap: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--k-line);
  font-weight: 900;
  font-size: var(--fs-lg);
}
.s-offer__total .k-price { font-size: clamp(40px, 4.4vw, 64px); }

/* ================= PAY ================= */
/* One glass sheet, and on the side where the Worldline reader is mounted (?reader=left|right|below|above)
   a lit "Card reader" marker at the edge of the screen. The disc sits on the reader's side of the sheet and
   its waves run to the marker: the whole screen points at the reader. The disc carries the state
   (data-state on the scene): waiting (waves) → checking (a turning ring; the demo reader only, the live
   adapter reports just the outcome) → approved (green tick and a splash of drops), or late once the
   countdown ran out. The reference QR is the receipt, so it now waits on the queue screen. */
.s-pay {
  --pay-pad: clamp(26px, 3.2vw, 56px);
  --pay-gap: clamp(14px, 1.6vw, 24px);
  --disc: clamp(170px, min(21vw, 31vh), 340px);
  --glow: #7adfff;
  --wave: 2.4s;
  /* The sheet's column gap, and the share of its width the disc's column takes (0.92fr of 2fr). The marker
     for a reader above or below uses both to sit right over or under the disc. */
  --pay-cg: clamp(20px, 3vw, 48px);
  --hero-share: 0.46;
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr);
  column-gap: var(--pay-gap);
  row-gap: var(--pay-gap);
  min-height: 0;
}
.s-pay--left { grid-template-columns: auto minmax(0, 1fr); }
.s-pay--below { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
.s-pay--above { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
.s-pay--left .s-pay__reader, .s-pay--above .s-pay__reader { order: -1; }

/* ---- the sheet ---- */
.s-pay__stage {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "copy hero" "foot foot";
  column-gap: var(--pay-cg);
  row-gap: clamp(14px, 2.2vh, 26px);
  padding: var(--pay-pad);
  min-height: 0;
  min-width: 0;
}
.s-pay--left .s-pay__stage { grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); grid-template-areas: "hero copy" "foot foot"; }
/* A reader above or below: the disc takes the whole right column and sits at its top or bottom edge. */
.s-pay--below .s-pay__stage, .s-pay--above .s-pay__stage { grid-template-areas: "copy hero" "foot hero"; }

.s-pay__copy {
  grid-area: copy;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(14px, 2.4vh, 26px);
  min-width: 0;
}
.s-pay__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(38px, 4.3vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  max-width: 11ch;
  text-wrap: balance;
}
.s-pay__ways { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.s-pay__ways li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.07);
  font-weight: 800;
  font-size: var(--fs-md);
}
.s-pay__ways .k-icon { width: 22px; height: 22px; color: var(--glow); }
.s-pay__sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-top: clamp(2px, 1vh, 12px); }
.s-pay__price.k-price { font-size: clamp(54px, 6.2vw, 104px); }
.s-pay__wash { display: inline-flex; align-items: center; gap: 8px; color: var(--k-fg-muted); font-weight: 800; font-size: var(--fs-md); }
.s-pay__wash .k-icon { width: 20px; height: 20px; color: var(--glow); }

/* ---- the disc ---- */
.s-pay__hero {
  grid-area: hero;
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: calc(var(--disc) + 24px);
}
.s-pay--below .s-pay__hero { place-items: end center; }
.s-pay--above .s-pay__hero { place-items: start center; }
.s-pay__disc {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: var(--disc);
  aspect-ratio: 1;
  border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.34), transparent 44%),
    radial-gradient(circle at 50% 62%, #1d86e0 0%, #0f53a3 56%, #0a2f5c 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.24),
    inset 0 -20px 44px rgba(4, 18, 36, 0.45),
    0 0 0 14px rgba(122, 223, 255, 0.07),
    0 28px 72px rgba(0, 120, 210, 0.42);
  transition: background 420ms var(--ease-out), box-shadow 420ms var(--ease-out);
}
/* A soft, still halo: the light the waves come from. */
.s-pay__disc::before {
  content: "";
  position: absolute;
  inset: -18%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(122, 223, 255, 0.3), transparent 72%);
}
.s-pay__glyph {
  grid-area: 1 / 1;
  width: 48%;
  height: 48%;
  transition: opacity 260ms var(--ease-out), transform 460ms var(--ease-emph);
}
/* The three arcs light up from the inside out, then leave the disc as the travelling waves. */
.s-pay__glyph--tap path { animation: s-pay-arc var(--wave) var(--ease-out) infinite; }
.s-pay__glyph--tap path:nth-child(2) { animation-delay: 0.16s; }
.s-pay__glyph--tap path:nth-child(3) { animation-delay: 0.32s; }
.s-pay__glyph--ok { opacity: 0; transform: scale(0.55); }
.s-pay__glyph--ok path { stroke-dasharray: 60; stroke-dashoffset: 60; }
.s-pay__orbit {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  opacity: 0;
  background: conic-gradient(from 0deg, transparent 0 58%, rgba(122, 223, 255, 0.55) 84%, #fff 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  transition: opacity 260ms var(--ease-out);
}

/* ---- the waves: from the disc's edge to the marker ---- */
.s-pay__waves { position: absolute; z-index: 0; pointer-events: none; transition: opacity 320ms var(--ease-out); }
.s-pay__waves i { position: absolute; inset: 0; animation: s-pay-run-x var(--wave) linear infinite; }
.s-pay__waves i::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: calc(var(--disc) * 0.6);
  aspect-ratio: 1;
  border: 5px solid transparent;
  border-right-color: var(--glow);
  border-radius: 50%;
  translate: -50% -50%;
  filter: drop-shadow(0 0 10px rgba(122, 223, 255, 0.7));
  -webkit-mask: linear-gradient(180deg, transparent 16%, #000 36%, #000 64%, transparent 84%);
  mask: linear-gradient(180deg, transparent 16%, #000 36%, #000 64%, transparent 84%);
  animation: s-pay-grow var(--wave) linear infinite;
  animation-delay: inherit;
}
.s-pay__waves i:nth-child(2) { animation-delay: calc(var(--wave) * -0.25); }
.s-pay__waves i:nth-child(3) { animation-delay: calc(var(--wave) * -0.5); }
.s-pay__waves i:nth-child(4) { animation-delay: calc(var(--wave) * -0.75); }
.s-pay--right .s-pay__waves, .s-pay--left .s-pay__waves { top: 50%; height: var(--disc); margin-top: calc(var(--disc) / -2); }
.s-pay--right .s-pay__waves { left: calc(50% + var(--disc) * 0.34); right: calc(-1 * (var(--pay-pad) + var(--pay-gap))); }
.s-pay--left .s-pay__waves { right: calc(50% + var(--disc) * 0.34); left: calc(-1 * (var(--pay-pad) + var(--pay-gap))); transform: scaleX(-1); }
.s-pay--below .s-pay__waves, .s-pay--above .s-pay__waves { left: 50%; width: var(--disc); margin-left: calc(var(--disc) / -2); }
.s-pay--below .s-pay__waves { top: calc(100% - var(--disc) * 0.16); bottom: calc(-1 * (var(--pay-pad) + var(--pay-gap))); }
.s-pay--above .s-pay__waves { bottom: calc(100% - var(--disc) * 0.16); top: calc(-1 * (var(--pay-pad) + var(--pay-gap))); transform: scaleY(-1); }
.s-pay--below .s-pay__waves i, .s-pay--above .s-pay__waves i { animation-name: s-pay-run-y; }
.s-pay--below .s-pay__waves i::before, .s-pay--above .s-pay__waves i::before {
  left: 50%;
  top: 0;
  border-right-color: transparent;
  border-bottom-color: var(--glow);
  -webkit-mask: linear-gradient(90deg, transparent 16%, #000 36%, #000 64%, transparent 84%);
  mask: linear-gradient(90deg, transparent 16%, #000 36%, #000 64%, transparent 84%);
}

/* ---- the marker at the edge of the glass, next to the real reader ---- */
.s-pay__reader {
  --nudge-x: 7px;
  --nudge-y: 0px;
  /* Above the waves: they run into the marker instead of over it. */
  position: relative;
  z-index: 2;
  align-self: center;
  justify-self: center;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 14px;
  border-radius: var(--r-pill);
  /* the deep blue: white on it is 5.8:1 */
  background: linear-gradient(180deg, #0a6fb0, var(--p-blue-deep));
  color: #fff;
  font-weight: 900;
  font-size: var(--fs-sm);
  box-shadow: 0 0 0 6px rgba(122, 223, 255, 0.12), 0 0 44px rgba(0, 178, 226, 0.5), var(--sh-3);
  pointer-events: none;
}
/* The marker's glow stays still: the waves arriving and the arrow already move toward it. */
.s-pay__reader span { writing-mode: vertical-rl; letter-spacing: 0.04em; }
.s-pay__reader .k-icon { width: 28px; height: 28px; }
.s-pay__reader .k-icon:last-child { animation: s-pay-nudge 1.2s var(--ease-in-out) infinite; }
.s-pay--left .s-pay__reader { --nudge-x: -7px; }
.s-pay--left .s-pay__reader .k-icon:last-child { rotate: 180deg; }
.s-pay--below .s-pay__reader, .s-pay--above .s-pay__reader { --nudge-x: 0px; flex-direction: row; padding: 13px 24px; }
/* Right under (or over) the disc's column, not the middle of the glass: its right edge goes to the centre of
   that column and translate moves it back by half its own width. */
.s-pay--below .s-pay__reader, .s-pay--above .s-pay__reader {
  justify-self: end;
  margin-right: calc(var(--pay-pad) + (100% - 2 * var(--pay-pad) - var(--pay-cg)) * var(--hero-share) / 2);
  translate: 50% 0;
}
.s-pay--below .s-pay__reader span, .s-pay--above .s-pay__reader span { writing-mode: horizontal-tb; }
.s-pay--below .s-pay__reader { --nudge-y: 7px; }
.s-pay--below .s-pay__reader .k-icon:last-child { rotate: 90deg; }
.s-pay--above .s-pay__reader { --nudge-y: -7px; }
.s-pay--above .s-pay__reader .k-icon:last-child { rotate: -90deg; }

/* ---- status, countdown, Cancel ---- */
.s-pay__foot {
  grid-area: foot;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px 22px;
  padding-top: clamp(14px, 2vh, 22px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.s-pay__status { display: flex; align-items: center; gap: 12px; min-width: 0; margin: 0; font-weight: 800; font-size: var(--fs-md); }
.s-pay__dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--glow); animation: s-pay-dot 1.6s ease-out infinite; }
.s-pay__timer { display: inline-flex; align-items: center; gap: 10px; color: var(--k-fg-muted); font-weight: 900; font-size: var(--fs-md); }
.s-pay__timer[hidden] { display: none; }
.s-pay__timer svg { width: 40px; height: 40px; rotate: -90deg; }
.s-pay__timer-track { fill: none; stroke: rgba(255, 255, 255, 0.16); stroke-width: 4; }
.s-pay__timer-bar { fill: none; stroke: var(--glow); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 500ms linear, stroke 300ms ease; }
.s-pay__timer.is-low { color: #f7d27a; }
.s-pay__timer.is-low .s-pay__timer-bar { stroke: #f2c14e; }
.s-pay__cancel.k-back { justify-self: end; min-height: 64px; padding: 0 26px 0 20px; font-size: var(--fs-md); }
.s-pay__error { grid-column: 1 / -1; }

/* ---- states ---- */
.s-pay[data-state="checking"] .s-pay__waves, .s-pay[data-state="late"] .s-pay__waves, .s-pay[data-state="approved"] .s-pay__waves { opacity: 0; }
.s-pay[data-state="checking"] .s-pay__orbit, .s-pay[data-state="late"] .s-pay__orbit { opacity: 1; animation: k-spin 1.1s linear infinite; }
.s-pay[data-state="checking"] .s-pay__glyph--tap path, .s-pay[data-state="late"] .s-pay__glyph--tap path { animation: none; opacity: 0.9; }
.s-pay[data-state="checking"] .s-pay__dot, .s-pay[data-state="late"] .s-pay__dot { background: #f2c14e; animation: k-blink 1s ease-in-out infinite; }
.s-pay[data-state="checking"] .s-pay__reader .k-icon, .s-pay[data-state="late"] .s-pay__reader .k-icon { animation: none; }
.s-pay[data-state="approved"] .s-pay__disc {
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.36), transparent 44%),
    radial-gradient(circle at 50% 62%, #2fd39a 0%, #0e9f6e 58%, #0a6a4b 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.3),
    inset 0 -20px 44px rgba(3, 40, 26, 0.4),
    0 0 0 16px rgba(61, 220, 151, 0.12),
    0 28px 80px rgba(14, 159, 110, 0.55);
  animation: k-pop 560ms var(--ease-emph);
}
.s-pay[data-state="approved"] .s-pay__disc::before { background: radial-gradient(closest-side, rgba(61, 220, 151, 0.4), transparent 72%); }
.s-pay[data-state="approved"] .s-pay__glyph--tap { opacity: 0; transform: scale(0.55); }
.s-pay[data-state="approved"] .s-pay__glyph--ok { opacity: 1; transform: none; }
.s-pay[data-state="approved"] .s-pay__glyph--ok path { animation: k-draw 520ms 140ms var(--ease-out) forwards; }
.s-pay[data-state="approved"] .s-pay__dot { background: #3ddc97; animation: none; }
.s-pay[data-state="approved"] .s-pay__timer { visibility: hidden; }
/* Paid: the ways to pay have done their job. They fade but keep their room, so nothing jumps. */
.s-pay__ways { transition: opacity 260ms var(--ease-out), visibility 260ms; }
.s-pay[data-state="approved"] .s-pay__ways { opacity: 0; visibility: hidden; }
.s-pay[data-state="approved"] .s-pay__reader { opacity: 0.4; transition: opacity 320ms ease; }
.s-pay[data-state="approved"] .s-pay__reader .k-icon { animation: none; }
.s-pay__splash { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; pointer-events: none; }
/* The backdrop photo (a hand tapping a phone on a terminal) showed through behind the price and argued with
   the disc. Darker here: the disc and the marker are the only lit things on this screen. */
body[data-screen="pay"] .k-backdrop__scrim {
  background: linear-gradient(180deg, rgba(7, 19, 31, 0.86) 0%, rgba(7, 19, 31, 0.9) 50%, rgba(7, 19, 31, 0.95) 100%);
}

@keyframes s-pay-run-x { 0% { transform: translateX(0); opacity: 0; } 12% { opacity: 1; } 80% { opacity: 0.9; } 100% { transform: translateX(100%); opacity: 0; } }
@keyframes s-pay-run-y { 0% { transform: translateY(0); opacity: 0; } 12% { opacity: 1; } 80% { opacity: 0.9; } 100% { transform: translateY(100%); opacity: 0; } }
@keyframes s-pay-grow { from { scale: 0.72; } to { scale: 1.3; } }
@keyframes s-pay-arc { 0%, 100% { opacity: 0.38; } 18% { opacity: 1; } 46% { opacity: 0.38; } }
@keyframes s-pay-nudge { 0%, 100% { translate: 0 0; } 50% { translate: var(--nudge-x) var(--nudge-y); } }
@keyframes s-pay-dot { 0% { box-shadow: 0 0 0 0 rgba(122, 223, 255, 0.6); } 100% { box-shadow: 0 0 0 12px rgba(122, 223, 255, 0); } }

/* Reduced motion: the waves stand still as three arcs pointing at the reader; nothing travels or spins. */
@media (prefers-reduced-motion: reduce) {
  .s-pay__waves i, .s-pay__waves i::before, .s-pay__glyph--tap path, .s-pay__reader .k-icon { animation: none; }
  .s-pay__waves i:nth-child(1) { transform: translateX(10%); opacity: 1; }
  .s-pay__waves i:nth-child(2) { transform: translateX(34%); opacity: 0.7; }
  .s-pay__waves i:nth-child(3) { transform: translateX(58%); opacity: 0.45; }
  .s-pay__waves i:nth-child(4) { display: none; }
  .s-pay--below .s-pay__waves i:nth-child(1), .s-pay--above .s-pay__waves i:nth-child(1) { transform: translateY(10%); }
  .s-pay--below .s-pay__waves i:nth-child(2), .s-pay--above .s-pay__waves i:nth-child(2) { transform: translateY(34%); }
  .s-pay--below .s-pay__waves i:nth-child(3), .s-pay--above .s-pay__waves i:nth-child(3) { transform: translateY(58%); }
}

/* 1280 × 800 and other short glass: the title and the price give way to the disc. */
@media (max-height: 860px) {
  .s-pay__title { font-size: clamp(34px, 3.9vw, 56px); }
  .s-pay__price.k-price { font-size: clamp(50px, 5.4vw, 84px); }
}
/* Portrait or narrow glass: one column. The disc sits between the words and the status, centred, and its
   waves still run to the marker on the reader's side. With the reader below, the status moves above the
   disc so the waves never cross it. */
@media (max-width: 980px) {
  .s-pay__stage, .s-pay--left .s-pay__stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "copy" "hero" "foot"; }
  .s-pay--below .s-pay__stage { grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "copy" "foot" "hero"; }
  .s-pay--above .s-pay__stage { grid-template-rows: minmax(0, 1fr) auto auto; grid-template-areas: "hero" "copy" "foot"; }
  .s-pay { --disc: clamp(160px, 42vw, 340px); }
  .s-pay__copy { align-items: center; text-align: center; }
  .s-pay__title { max-width: 14ch; }
  .s-pay__ways, .s-pay__sum { justify-content: center; }
  /* One column: the disc is centred, and so is the marker. */
  .s-pay--below .s-pay__reader, .s-pay--above .s-pay__reader { justify-self: center; margin-right: 0; translate: none; }
}
@media (max-width: 640px) {
  .s-pay { --pay-pad: 22px; --pay-gap: 10px; --disc: clamp(140px, 44vw, 200px); }
  .s-pay__title { font-size: 32px; }
  .s-pay__price.k-price { font-size: 48px; }
  .s-pay__ways li { min-height: 42px; font-size: var(--fs-sm); }
  .s-pay__foot { grid-template-columns: minmax(0, 1fr) auto; }
  .s-pay__cancel.k-back { grid-column: 1 / -1; justify-self: stretch; justify-content: center; }
  .s-pay__reader { padding: 14px 10px; gap: 10px; }
}

/* ================= QUEUE ================= */
/* One message: join the line, and how many cars are in front. No minutes (a wash's length is not known),
   and nothing about the wash itself: the pay station does not know what happens in the bay.
   Left: a glowing disc with the count, the headline, the lane, "Next customer". Right: the receipt. */
.s-queue { grid-template-rows: minmax(0, 1fr); min-height: 0; }
.s-queue .k-split { grid-template-columns: minmax(0, 1.3fr) minmax(340px, 0.7fr); }
/* A column, not a row template: rows were set by position, so the "Code accepted" banner pushed the
   headline into the lane's shrinking row. The column is as wide as the panel, so a long lane or banner
   can no longer grow past it into the receipt panel. */
.s-queue__place { display: flex; flex-direction: column; gap: var(--sp-5); min-height: 0; min-width: 0; }
.s-queue__place > * { flex: none; min-width: 0; }
.s-queue__top { display: grid; gap: var(--sp-3); }
.s-queue__tags { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

/* ---- the disc + headline ---- */
.s-queue__hero { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: clamp(20px, 2.6vw, 44px); }
.s-queue__disc {
  --disc: clamp(128px, 13vw, 210px);
  --tone: var(--p-sky);
  --fill: rgba(58, 166, 255, 0.16);
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  align-content: center;
  width: var(--disc);
  height: var(--disc);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.05) 62%), var(--fill);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.22), 0 26px 60px rgba(0, 0, 0, 0.38);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background var(--dur-slow) var(--ease-out);
}
/* A comet of light runs round the rim: the line is alive. */
.s-queue__disc::before {
  content: "";
  position: absolute;
  inset: -7px;
  z-index: -1;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 62%, var(--tone) 86%, #fff 91%, transparent 95%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px));
  animation: k-spin 3.4s linear infinite;
}
/* A soft halo in the state's colour. */
.s-queue__disc::after {
  content: "";
  position: absolute;
  inset: -22%;
  z-index: -2;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--tone) 34%, transparent), transparent);
  animation: k-breathe 3.2s ease-in-out infinite;
}
.s-queue__disc.is-bump { animation: k-pop 480ms var(--ease-emph); }
.s-queue__disc b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: calc(var(--disc) * 0.5);
  line-height: 0.92;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.s-queue__disc small {
  margin-top: 4px;
  font-size: var(--fs-xs);
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}
.s-queue__disc .k-icon { width: calc(var(--disc) * 0.34); height: calc(var(--disc) * 0.34); stroke-width: 2.4; }

/* next: amber, one arrow nudging toward the bay */
.s-queue__hero[data-state="next"] .s-queue__disc { --tone: #ffc861; --fill: rgba(255, 200, 97, 0.16); }
.s-queue__next { display: grid; color: #ffe2a8; }
.s-queue__next .k-icon { animation: q-nudge 1.5s var(--ease-in-out) infinite; }

/* plate (plate queue): paid, the wash waits for the camera at the barrier; an amber camera */
.s-queue__hero[data-state="plate"] .s-queue__disc { --tone: #ffc861; --fill: rgba(255, 200, 97, 0.16); }
.s-queue__cam { display: grid; color: #ffe2a8; }
.s-queue__cam .k-icon { animation: k-breathe 2.4s ease-in-out infinite; }
.s-queue__words .k-lede[hidden] { display: none; }

/* The code that sends the wash when the camera cannot read the plate (js/ui/queue-scene.js plateWait).
   The digits are the code screen's white tiles, big enough to read and remember from the car seat. */
.q-wait-wrap { container-type: inline-size; }
.q-wait {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(16px, 2.4vw, 36px);
  padding: clamp(18px, 2.2vw, 32px);
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 90% at 86% 12%, rgba(255, 200, 97, 0.14), transparent 60%),
    linear-gradient(180deg, rgba(10, 24, 40, 0.55), rgba(6, 15, 26, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.q-wait__copy { display: grid; gap: 10px; min-width: 0; }
.q-wait__ask { display: flex; align-items: center; gap: 10px; margin: 0; color: #ffe2a8; font-weight: 900; font-size: var(--fs-md); }
.q-wait__ask .k-icon { flex: none; width: 26px; height: 26px; }
.q-wait__how { margin: 0; color: #fff; font-weight: 800; font-size: clamp(22px, 2vw, 32px); line-height: 1.3; text-wrap: balance; }
/* "I have a code", drawn like the Welcome door it points to. */
.q-wait__how b {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0.18em;
  padding: 0 14px 0 10px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.26);
  white-space: nowrap;
}
.q-wait__how b .k-icon { width: 0.9em; height: 0.9em; }
.q-wait__digits { display: flex; gap: clamp(8px, 1vw, 14px); margin: 0; perspective: 500px; }
.q-wait__digits b {
  display: grid;
  place-items: center;
  width: clamp(58px, 5.4vw, 104px);
  height: clamp(76px, 7.2vw, 136px);
  border-radius: clamp(14px, 1.4vw, 22px);
  background: #fff;
  color: var(--p-ink);
  font-family: var(--font-display);
  font-size: clamp(46px, 4.6vw, 90px);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34), inset 0 -6px 0 rgba(11, 28, 43, 0.07);
  animation: s-code-digit 560ms var(--ease-emph) both;
  animation-delay: calc(240ms + var(--i, 0) * 90ms);
}
/* A narrow panel (1024 px glass, portrait): the sentence above, the digits under it. */
@container (max-width: 620px) {
  .q-wait { grid-template-columns: minmax(0, 1fr); }
}

.s-queue__words h1 { font-size: clamp(38px, 4.4vw, 68px); line-height: 1; letter-spacing: -0.03em; text-wrap: balance; }
.s-queue__words .k-lede { margin-top: 12px; font-size: var(--fs-lg); }

/* ---- the queue scene: the line of cars and the bay it leads to (js/ui/queue-scene.js) ---- */
.s-queue__place > #lane { flex: 1 0 auto; display: grid; align-content: center; }
.q-scene-wrap {
  padding: 18px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 90% at 82% 10%, rgba(58, 166, 255, 0.16), transparent 60%),
    linear-gradient(180deg, rgba(10, 24, 40, 0.55), rgba(6, 15, 26, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.q-scene { position: relative; }
.q-scene svg { display: block; width: 100%; height: auto; overflow: visible; }

/* Cars */
.q-car__shadow { fill: rgba(0, 0, 0, 0.42); }
.q-car__shine { stroke: rgba(255, 255, 255, 0.55); stroke-width: 2; stroke-linecap: round; fill: none; }
.q-car__door { stroke: rgba(10, 20, 32, 0.28); stroke-width: 1.6; fill: none; }
.q-car__outline { fill: none; stroke: #fff; stroke-width: 3; stroke-linejoin: round; }
.q-car { transform-box: fill-box; }
.q-line .q-car { animation: q-car-in 520ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 80ms); }
.q-car.is-you { animation: q-you-in 640ms var(--ease-emph) both; }
.q-you-glow { animation: q-glow 2.4s ease-in-out infinite; }

/* The YOU flag */
.q-flag { animation: q-bob 2.6s ease-in-out infinite; }
.q-flag__box { fill: #fff; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35)); }
.q-flag__text { font-family: var(--font-ui); font-weight: 900; font-size: 30px; letter-spacing: 0.12em; fill: #0b1c2b; }

/* "+N" when the line is longer than the picture */
.q-more__box { fill: rgba(255, 255, 255, 0.1); stroke: rgba(255, 255, 255, 0.45); stroke-width: 2; stroke-dasharray: 7 6; }
.q-more__text { font-family: var(--font-ui); font-weight: 900; font-size: 32px; fill: #fff; }

/* Road */
.q-horizon { fill: url(#qs-horizon); }
.q-road { fill: url(#qs-asphalt); }
.q-road__edge { stroke: rgba(255, 255, 255, 0.18); stroke-width: 2; }
.q-road__lane { stroke: rgba(255, 255, 255, 0.4); stroke-width: 3; stroke-dasharray: 24 18; fill: none; }
.q-road__stop { stroke: #fff; stroke-width: 6; stroke-linecap: round; opacity: 0.85; }
.q-road__label { font-family: var(--font-ui); font-weight: 900; font-size: 17px; letter-spacing: 0.16em; text-transform: uppercase; fill: rgba(255, 255, 255, 0.82); }

/* The bay: where the line leads. Nothing in it moves, and its sign only names it. */
.q-bay__inside { fill: url(#qs-inside); }
.q-bay__mouth { fill: url(#qs-mouth); }
.q-bay__light { fill: rgba(200, 236, 255, 0.7); filter: drop-shadow(0 0 6px rgba(160, 220, 255, 0.8)); }
.q-bay__roof-edge { fill: #1a3858; }
.q-bay__tile { stroke: rgba(255, 255, 255, 0.05); stroke-width: 2; }
.q-bay__floor { fill: #13263b; }
.q-bay__drain { stroke: rgba(255, 255, 255, 0.14); stroke-width: 3; stroke-dasharray: 4 6; }
.q-bay__roof { fill: #23496f; }
.q-bay__pillar { fill: #2b5a89; }
.q-bay__sign { fill: #0a1726; stroke: rgba(255, 255, 255, 0.16); }
.q-bay__sign-text { font-family: var(--font-ui); font-weight: 900; font-size: 16px; letter-spacing: 0.16em; text-transform: uppercase; fill: #dcecff; }
.q-bay__nozzles { stroke: #8fc8ff; stroke-width: 4; stroke-dasharray: 2 24; stroke-linecap: round; }
.q-roller { fill: rgba(58, 166, 255, 0.32); }
.q-roller__stripes rect, .q-brush__stripes rect { fill: rgba(170, 220, 255, 0.5); }

/* The line moved up one place: everyone slides forward once. */
/* A car moving up: it pulls away, rolls, and stops (no snap), slow enough to follow from the car seat. */
.q-scene.is-advance .q-queue { animation: q-advance 1.1s cubic-bezier(0.45, 0, 0.2, 1) both; }
.q-scene.is-advance .q-line .q-car, .q-scene.is-advance .q-car.is-you { animation: none; }

/* The button keeps its one-line label ("Next customer" wrapped at 1024 px); the timer text wraps instead. */
.s-queue__actions { display: grid; grid-template-columns: minmax(max-content, 1fr) auto; align-items: center; gap: var(--sp-4); }
.s-queue__actions .k-btn { white-space: nowrap; }
.s-queue__auto { display: grid; gap: 6px; font-size: var(--fs-xs); font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--k-fg-muted); }
.s-queue__auto .k-wait { width: min(100%, 180px); }
/* Short tablets: a little less air between the rows keeps "Next customer" inside the panel when the
   "Code accepted" banner is shown (1024 × 768). */
@media (max-height: 800px) {
  .s-queue__place { gap: 14px; }
  .s-queue__disc { --disc: clamp(116px, 12vw, 168px); }
  /* With the banner up the column was still too tall at 1280 × 800: the banner takes the chips' row
     (the top bar and the receipt already name the wash and say paid or free). */
  .s-queue__top:has(.k-banner) .s-queue__tags { display: none; }
}

/* ---- receipt ---- */
.s-queue__receipt {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  justify-items: center;
  align-items: center;
  gap: var(--sp-4);
  min-height: 0;
  text-align: center;
}
.s-queue__receipt-head { justify-self: stretch; display: flex; align-items: center; gap: 14px; text-align: left; }
.s-queue__receipt-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 17px;
  background: rgba(58, 166, 255, 0.18);
  box-shadow: inset 0 0 0 1.5px rgba(122, 223, 255, 0.35);
  color: var(--p-sky);
}
.s-queue__receipt-icon .k-icon { width: 26px; height: 26px; }
.s-queue__receipt-head h2 { margin-top: 2px; font-size: var(--fs-h3); line-height: 1.05; }

.s-queue__qr {
  position: relative;
  width: min(100%, 264px, 38vh);
  aspect-ratio: 1;
  padding: 14px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 26px 54px rgba(0, 0, 0, 0.38), 0 0 0 6px rgba(255, 255, 255, 0.08);
}
.s-queue__qr.is-ready { animation: q-qr-in 720ms var(--ease-emph) both; }
.s-queue__qr-code, .s-queue__qr-code svg { display: block; width: 100%; height: 100%; }
.s-queue__qr-wait {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  background: linear-gradient(90deg, #e9f1f9 0%, #f8fbfe 50%, #e9f1f9 100%) 0 0 / 200% 100%;
  animation: q-shimmer 1.2s linear infinite;
}
/* Camera-viewfinder corners just outside the white card. */
.s-queue__corner {
  --c: var(--p-sky);
  --l: 30px;
  --w: 4px;
  position: absolute;
  inset: -12px;
  pointer-events: none;
  background:
    linear-gradient(var(--c), var(--c)) left top / var(--l) var(--w),
    linear-gradient(var(--c), var(--c)) left top / var(--w) var(--l),
    linear-gradient(var(--c), var(--c)) right top / var(--l) var(--w),
    linear-gradient(var(--c), var(--c)) right top / var(--w) var(--l),
    linear-gradient(var(--c), var(--c)) left bottom / var(--l) var(--w),
    linear-gradient(var(--c), var(--c)) left bottom / var(--w) var(--l),
    linear-gradient(var(--c), var(--c)) right bottom / var(--l) var(--w),
    linear-gradient(var(--c), var(--c)) right bottom / var(--w) var(--l);
  background-repeat: no-repeat;
  opacity: 0.9;
}
/* A scan line sweeps the code three times, then rests. */
.s-queue__beam {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 14px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, rgba(22, 119, 255, 0.95), transparent);
  box-shadow: 0 0 18px 5px rgba(22, 119, 255, 0.32);
  opacity: 0;
  animation: q-scan 2.2s var(--ease-in-out) 0.9s 3;
  pointer-events: none;
}
/* No receipt (a wash started with a phone code: never charged here): just the reference, large. */
.s-queue__refcard {
  display: grid;
  gap: 10px;
  justify-items: center;
  align-self: center;
  width: min(100%, 320px);
  padding: clamp(24px, 3vw, 36px) 20px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.14);
  animation: q-qr-in 600ms var(--ease-emph) both;
}
.s-queue__refcard span { font-size: var(--fs-xs); font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; color: var(--k-fg-muted); }
.s-queue__refcard b { font-family: var(--font-ui); font-size: clamp(28px, 2.8vw, 40px); font-weight: 900; letter-spacing: 0.1em; overflow-wrap: anywhere; }
.s-queue__scan { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: var(--fs-md); font-weight: 800; }
.s-queue__scan .k-icon { width: 24px; height: 24px; color: var(--p-sky); flex: none; }
.s-queue__sum {
  justify-self: stretch;
  display: grid;
  gap: 8px;
  margin: 0;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--k-line);
}
.s-queue__sum div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.s-queue__sum dt { font-size: var(--fs-xs); font-weight: 800; color: var(--k-fg-muted); }
.s-queue__sum dd { margin: 0; font-size: var(--fs-sm); font-weight: 900; text-align: right; overflow-wrap: anywhere; }
.s-queue__ref { letter-spacing: 0.08em; }

@keyframes q-nudge { 0%, 100% { transform: translateX(-8%); } 50% { transform: translateX(10%); } }
@keyframes q-car-in { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes q-you-in { 0% { opacity: 0; transform: translateX(-60px); } 70% { opacity: 1; transform: translateX(6px); } 100% { opacity: 1; transform: none; } }
@keyframes q-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes q-glow { from { opacity: 0.55; } to { opacity: 1; } }
@keyframes q-advance { from { transform: translateX(-172px); } to { transform: none; } }
@keyframes q-shimmer { to { background-position: -200% 0; } }
@keyframes q-qr-in { from { opacity: 0; transform: scale(0.86) rotate(-3deg); } to { opacity: 1; transform: none; } }
@keyframes q-scan {
  0% { top: 14px; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { top: calc(100% - 17px); opacity: 0; }
}

/* ================= STATUS (declined / blocked / closed / outage) ================= */
.s-status { max-width: 640px; width: 100%; display: grid; gap: var(--sp-4); text-align: center; justify-items: center; }
/* The site name above "We're closed". */
.s-status__site {
  font-family: var(--font-display);
  font-size: clamp(42px, 6vw, 72px);
  letter-spacing: 0.04em;
  margin: 0;
}
.s-status h1 { text-wrap: balance; }
.s-status .k-lede { text-align: center; }
.s-status__actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; justify-content: center; margin-top: var(--sp-2); }
/* Declined: the failed payment and the drive-through confirm take turns in one panel, with its layout. */
.s-status__view { display: contents; }
.s-status__view[hidden] { display: none; }
.s-status__error { justify-self: stretch; text-align: center; }
/* "Can't pay? Drive through without a wash": quiet, under the main choices, still a full touch target. */
.s-status__drive {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--hit-min, 64px);
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--k-fg-muted);
  font: inherit;
  font-weight: 800;
  font-size: var(--fs-md);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.s-status__drive .k-icon { flex: none; width: 24px; height: 24px; }
.s-status__drive:active { background: rgba(11, 28, 43, 0.06); }
/* The server's sentence after Yes ("The barrier opens. …"): an answer, read from the car. */
.s-status__say { font-size: clamp(30px, 3vw, 44px); line-height: 1.15; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .s-lock { grid-template-columns: minmax(0, 1fr) minmax(340px, 460px); gap: var(--sp-6); }
  .s-details .k-split, .s-queue .k-split { grid-template-columns: minmax(0, 1fr) minmax(340px, 0.9fr); }
}
@media (max-width: 980px) {
  .s-lock { grid-template-columns: 1fr; align-content: start; }
  .s-lock__copy .k-display { font-size: clamp(36px, 8vw, 56px); }
  .s-catalog__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s-catalog__grid .k-card__media { max-height: 30vh; }
  /* minmax(0, …): a plain 1fr column grew to the lane's width (869-1021 px on an 800 px glass). */
  .s-details .k-split, .s-queue .k-split { grid-template-columns: minmax(0, 1fr); }
  .s-details__hero { min-height: 320px; }
  .s-details, .s-pay, .s-queue { overflow-y: auto; }
  .s-queue__disc { --disc: 112px; }
  /* Portrait: the line panel takes its natural height and the receipt panel sits under it. */
  .s-queue .k-split { grid-template-rows: auto auto; }
}
/* Portrait tablet (800 × 1280): one column of wide cards, photo on the left and the minutes beside the
   price, so every price button is on the glass without scrolling. The rail (5+ washes) keeps its own flow. */
@media (max-width: 980px) and (orientation: portrait) {
  .s-catalog__grid:not(.s-catalog__grid--rail) { grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(auto, 300px); }
  .s-catalog__grid:not(.s-catalog__grid--rail) .k-card { grid-template-columns: 40% minmax(0, 1fr); grid-template-rows: none; }
  .s-catalog__grid:not(.s-catalog__grid--rail) .k-card__media { aspect-ratio: auto; max-height: none; min-height: 0; }
  /* The photo fills whatever height the text needs instead of setting the row height itself. */
  .s-catalog__grid:not(.s-catalog__grid--rail) .k-card__media img { position: absolute; inset: 0; }
  .s-catalog__grid:not(.s-catalog__grid--rail) .k-card__body { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 12px; }
  .s-catalog__grid:not(.s-catalog__grid--rail) :is(.k-card__head, .k-card__desc) { grid-column: 1 / -1; }
  .s-catalog__grid:not(.s-catalog__grid--rail) .k-card__meta { align-self: end; padding-bottom: 16px; }
  .s-catalog__grid:not(.s-catalog__grid--rail) .k-card__choose { align-self: end; margin-top: 0; }
}
@media (max-width: 640px) {
  .s-catalog__grid { grid-template-columns: 1fr; }
  .k-head { grid-template-columns: 1fr; align-items: start; }
  .k-head__aside { justify-content: flex-start; }
  .s-queue__actions { grid-template-columns: 1fr; }
}

/* ================= WELCOME · windshield ================= */
/* The glass rests here between drivers. A dark photo of the bay fills it (welcomePhoto: the owner's bay
   photo, else a wash in full spray). The owner's sign and the live bay status sit at the top; "Stay in
   the car." and the two doors sit at the bottom, near a hand reaching out of the car window. The water,
   the wiper and the arrival fog are drawn by ui/glass.js (styles in kiosk.css). */
body[data-screen="welcome"] .k-backdrop__scrim {
  background:
    linear-gradient(90deg, rgba(6, 18, 29, 0.66) 0%, rgba(6, 18, 29, 0.22) 55%, rgba(6, 18, 29, 0.08) 100%),
    linear-gradient(180deg, rgba(6, 18, 29, 0.66) 0%, rgba(6, 18, 29, 0.2) 24%, rgba(6, 18, 29, 0.38) 50%, rgba(6, 18, 29, 0.88) 80%, rgba(6, 18, 29, 0.96) 100%);
}
/* The rising bubbles and the pastel glows belong to the light screens: here the glass carries the water. */
body[data-screen="welcome"] :is(.k-water, .k-mist, .k-backdrop__glow) { display: none; }
/* Log out is for staff: on the photo it stays quiet so drivers read the doors first. */
body[data-screen="welcome"] #logout { background: rgba(6, 18, 29, 0.36); border-color: rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.86); }

/* The hero row is at least as tall as the headline, so it can never be laid over the sign. */
.s-welcome {
  grid-template-rows: auto minmax(min-content, 1fr);
  align-content: stretch;
  gap: clamp(14px, 2.2vh, 26px);
  color: #fff;
}
/* Only a phone-sized or very short glass may run out of room: there the scene scrolls. Any overflow
   clips, so the padding and the matching negative margin keep the door shadows, the green "code
   waiting" ring and the focus outline inside the scroll box. Kiosk sizes never scroll and never clip. */
@media (max-width: 640px), (max-height: 600px) {
  .s-welcome {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    padding: 12px 12px 20px;
    margin: -12px -12px -20px;
  }
  .s-welcome::-webkit-scrollbar { display: none; }
}
.s-welcome__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-5);
  min-width: 0;
}
.s-welcome__sign { display: grid; gap: 6px; min-width: 0; }
.s-welcome__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 2.6vw, 44px);
  line-height: 1;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 144;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}
.s-welcome__line { font-size: var(--fs-sm); font-weight: 800; color: rgba(255, 255, 255, 0.8); }
.s-welcome__status {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  max-width: min(44ch, 52%);
  padding: 10px 22px 10px 18px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(6, 18, 29, 0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: var(--fs-md);
  font-weight: 800;
  line-height: 1.25;
}
.s-welcome__status i {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.22);
}
.s-welcome__status.is-busy i { background: #7adfff; box-shadow: 0 0 0 5px rgba(122, 223, 255, 0.22); animation: k-blink 1.6s ease-in-out infinite; }
.s-welcome__status.is-warn { border-color: rgba(251, 191, 36, 0.55); }
.s-welcome__status.is-warn i { background: #fbbf24; box-shadow: 0 0 0 5px rgba(251, 191, 36, 0.22); }

.s-welcome__hero { align-self: end; display: grid; gap: clamp(10px, 1.6vh, 18px); }
.s-welcome__title {
  font-size: clamp(54px, min(8.4vw, 13.5vh), 150px);
  line-height: 0.94;
  letter-spacing: -0.03em;
  text-wrap: balance;
  text-shadow: 0 6px 44px rgba(0, 0, 0, 0.35);
}
.s-welcome__lede {
  max-width: 48ch;
  font-size: clamp(19px, 1.65vw, 27px);
  font-weight: 700;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.88);
}

/* Free first car after an owner reset: a gold slip above the doors. */
.s-welcome__gift {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(14px, 1.6vw, 24px);
  padding: clamp(14px, 1.6vw, 22px) clamp(14px, 1.6vw, 22px) clamp(14px, 1.6vw, 22px) clamp(18px, 2vw, 28px);
  border-radius: clamp(24px, 2.4vw, 34px);
  background: linear-gradient(115deg, #fff6dc 0%, #ffe6a6 52%, #f7c766 100%);
  color: #3b2204;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  animation: k-spring-in 760ms var(--ease-emph) 300ms both;
}
.s-welcome__gift-icon {
  display: grid;
  place-items: center;
  width: clamp(54px, 4.6vw, 72px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #3b2204;
  color: #ffd56b;
}
.s-welcome__gift-icon .k-icon { width: 48%; height: 48%; }
.s-welcome__gift-copy { display: grid; gap: 4px; min-width: 0; margin: 0; }
.s-welcome__gift-copy b { font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 2.4vw, 40px); line-height: 1.05; letter-spacing: -0.015em; }
.s-welcome__gift-copy span { font-size: var(--fs-md); font-weight: 800; color: #5b3809; }
.s-welcome__gift .k-btn { white-space: nowrap; }

/* ---------- the two doors ---------- */
.s-welcome__doors {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(14px, 1.6vw, 24px);
}
.s-door {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(16px, 1.7vw, 28px);
  min-height: clamp(116px, 18vh, 200px);
  padding: clamp(16px, 1.8vw, 28px) clamp(16px, 1.8vw, 28px) clamp(16px, 1.8vw, 28px) clamp(18px, 2.2vw, 34px);
  border-radius: clamp(26px, 2.6vw, 40px);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), background var(--dur-base), border-color var(--dur-base);
}
.s-door:active { transform: scale(0.975); }
.s-door:focus-visible { outline: 4px solid #fff; outline-offset: 4px; }
.s-door__copy { display: grid; gap: clamp(6px, 0.8vh, 10px); min-width: 0; }
.s-door__copy b {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 3.1vw, 56px);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
}
.s-door__copy span { font-size: clamp(17px, 1.35vw, 22px); font-weight: 800; line-height: 1.3; }
.s-door__go {
  display: grid;
  place-items: center;
  width: clamp(58px, 5.2vw, 84px);
  aspect-ratio: 1;
  border-radius: 50%;
  transition: transform var(--dur-base) var(--ease-emph);
}
.s-door__go .k-icon { width: 42%; height: 42%; stroke-width: 2.6; }
.s-door:active .s-door__go { transform: translateX(6px); }

/* Choose a wash: the default path, a foam-white slab. */
.s-door--wash {
  border: 0;
  color: var(--p-ink);
  background: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45), inset 0 -4px 0 rgba(22, 119, 255, 0.12), inset 0 1px 0 #fff;
}
.s-door--wash .s-door__copy span { color: #3a536b; }
.s-door--wash .s-door__go { background: var(--p-ink); color: #fff; box-shadow: 0 12px 26px rgba(11, 28, 43, 0.32); }
/* The shared touch ripple is white with a screen blend: invisible on white. */
.s-door--wash .k-ripple { background: radial-gradient(circle, rgba(22, 119, 255, 0.24) 0%, rgba(22, 119, 255, 0.1) 40%, transparent 70%); mix-blend-mode: normal; }

/* This bay's washes, fanned like a hand of cards. Pressing the door opens the fan a little. */
/* The outer cards swing past the box when they tilt: the side margins keep them off the door edge and
   off the title. */
.s-door__fan {
  position: relative;
  width: clamp(104px, 9.4vw, 156px);
  height: clamp(80px, 7.2vw, 120px);
  margin-inline: clamp(8px, 0.9vw, 16px);
}
.s-door__fan img {
  position: absolute;
  top: 0;
  left: 50%;
  width: 56%;
  height: 100%;
  object-fit: cover;
  border-radius: clamp(10px, 1vw, 16px);
  border: 3px solid #fff;
  box-shadow: 0 10px 22px rgba(11, 28, 43, 0.28);
  transform-origin: 50% 100%;
  transform: translate(var(--tx, -50%), var(--ty, 0)) rotate(var(--r, 0deg));
  transition: transform var(--dur-base) var(--ease-emph);
}
.s-door__fan[data-count="3"] img:nth-child(1) { --r: -11deg; --tx: -84%; --ty: 4%; }
.s-door__fan[data-count="3"] img:nth-child(2) { z-index: 2; }
.s-door__fan[data-count="3"] img:nth-child(3) { --r: 11deg; --tx: -16%; --ty: 4%; z-index: 1; }
.s-door__fan[data-count="2"] img:nth-child(1) { --r: -8deg; --tx: -74%; --ty: 3%; }
.s-door__fan[data-count="2"] img:nth-child(2) { --r: 7deg; --tx: -26%; z-index: 1; }
.s-door--wash:active .s-door__fan[data-count="3"] img:nth-child(1) { --r: -17deg; --tx: -94%; }
.s-door--wash:active .s-door__fan[data-count="3"] img:nth-child(3) { --r: 17deg; --tx: -6%; }
.s-door--wash:active .s-door__fan[data-count="2"] img:nth-child(1) { --r: -13deg; --tx: -82%; }
.s-door--wash:active .s-door__fan[data-count="2"] img:nth-child(2) { --r: 12deg; --tx: -18%; }

.s-door__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(62px, 5.6vw, 92px);
  aspect-ratio: 1;
  border-radius: clamp(18px, 1.6vw, 26px);
}
.s-door__icon .k-icon { width: 46%; height: 46%; }
.s-door__icon--wash { background: linear-gradient(145deg, #dff0ff, #fff); color: var(--p-blue-deep); box-shadow: inset 0 0 0 1.5px rgba(22, 119, 255, 0.18); }
.s-door__icon--code { background: linear-gradient(145deg, #ffe7a3, #f6b649); color: #3b2204; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 12px 26px rgba(0, 0, 0, 0.28); }
/* The keypad glyph is nine dots: a heavier stroke keeps them readable from the car. */
.s-door__icon--code .k-icon { stroke-width: 3.6; }

/* I have a code: tinted glass, until a phone Go waits here. */
.s-door--code {
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07));
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.s-door--code .s-door__copy span { color: rgba(255, 255, 255, 0.86); }
.s-door--code .s-door__go { background: #fff; color: var(--p-ink); }
/* How many Gos wait for their code: a badge on the keypad tile, like an app icon. */
.s-door__badge {
  position: absolute;
  top: -10px;
  right: -10px;
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  border: 2px solid #fff;
  background: var(--p-success-strong);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(14, 159, 110, 0.45);
  animation: k-pop 460ms var(--ease-emph);
}
.s-door__badge[hidden] { display: none; }
.s-door--code.is-waiting {
  border-color: rgba(110, 231, 183, 0.75);
  background: linear-gradient(180deg, rgba(16, 163, 112, 0.62), rgba(8, 112, 78, 0.62));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), 0 0 0 6px rgba(52, 211, 153, 0.18);
}
.s-door--code.is-waiting .s-door__copy span { color: #e3fff3; }
.s-door--code.is-waiting .s-door__go { color: #07583e; animation: k-breathe 1.8s var(--ease-in-out) infinite; }

/* A touch on empty glass: the main door nudges to show where to tap. */
.s-door--wash.is-nudge { animation: k-door-nudge 640ms var(--ease-emph); }
.s-door--wash.is-nudge .s-door__go { animation: k-go-nudge 640ms var(--ease-emph); }
@keyframes k-door-nudge { 0%, 100% { transform: none; } 35% { transform: translateY(-6px) scale(1.015); } 70% { transform: translateY(1px) scale(0.998); } }
@keyframes k-go-nudge { 0%, 100% { transform: none; } 40% { transform: translateX(10px); } 75% { transform: translateX(-2px); } }

@media (hover: hover) {
  .s-door--wash:hover { box-shadow: 0 34px 80px rgba(0, 0, 0, 0.5), inset 0 -4px 0 rgba(22, 119, 255, 0.18), inset 0 1px 0 #fff; }
  .s-door--code:hover { border-color: rgba(255, 255, 255, 0.42); }
}

/* ---------- the car's plate (licence-plate recognition) ---------- */
.s-welcome__plate:empty,
.s-welcome__plate-ask:empty { display: none; }

/* The plate the camera read, on its own: the plate, where it came from, and "Not your car?". */
.s-plate-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(12px, 1.4vw, 20px);
  animation: k-spring-in 620ms var(--ease-emph) both;
}
.s-plate-row__note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(6, 18, 29, 0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: var(--fs-sm);
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
}
.s-plate-row__note .k-icon { width: 20px; height: 20px; }
.s-plate-row__fix {
  min-height: 52px;
  margin-left: auto;
  padding: 0 22px;
  border-radius: var(--r-pill);
  border: 1.5px solid rgba(255, 255, 255, 0.42);
  background: rgba(6, 18, 29, 0.36);
  color: #fff;
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 800;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-base);
}
.s-plate-row__fix:active { transform: scale(0.96); }
.s-plate-row__fix:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }

/* A wash from the plate's Preen account: a white card with a mint ring. "Use my wash" on an ink pill
   (an unsure read, one tap); a green "Drive in" pill once the camera started it. */
.s-plate-row--saved { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.s-saved {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(14px, 1.6vw, 26px);
  min-width: 0;
  padding: clamp(12px, 1.2vw, 18px);
  border: 0;
  border-radius: clamp(24px, 2.4vw, 36px);
  background: linear-gradient(115deg, #ffffff 0%, #f1fbf6 62%, #dcf7ea 100%);
  color: var(--p-ink);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.42), 0 0 0 4px rgba(52, 211, 153, 0.6);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.s-saved:active { transform: scale(0.98); }
.s-saved:focus-visible { outline: 4px solid #fff; outline-offset: 4px; }
.s-saved__photo img {
  display: block;
  width: clamp(84px, 8vw, 128px);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: clamp(14px, 1.3vw, 20px);
  box-shadow: 0 10px 22px rgba(11, 28, 43, 0.25);
}
.s-saved__copy { display: grid; gap: clamp(4px, 0.7vh, 8px); min-width: 0; }
.s-saved__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #067a52;
}
.s-saved__eyebrow .k-icon { width: 18px; height: 18px; stroke-width: 3; }
.s-saved__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 2.7vw, 48px);
  line-height: 1;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.s-saved__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: var(--fs-sm);
  font-weight: 800;
  color: #3a536b;
}
.s-saved__pay {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: clamp(64px, 6.2vw, 88px);
  padding: 0 12px 0 clamp(20px, 2vw, 30px);
  border-radius: var(--r-pill);
  background: var(--p-ink);
  color: #fff;
  font-size: clamp(20px, 1.9vw, 32px);
  font-weight: 900;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 14px 30px rgba(11, 28, 43, 0.35);
}
.s-saved__pay i {
  display: grid;
  place-items: center;
  width: clamp(44px, 3.8vw, 60px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #34d399;
  color: var(--p-ink);
  transition: transform var(--dur-base) var(--ease-emph);
}
.s-saved__pay .k-icon { width: 46%; height: 46%; stroke-width: 2.8; }
.s-saved:active .s-saved__pay i { transform: translateX(6px); }
.s-saved.is-busy { opacity: 0.8; }
.s-plate-row--saved .s-plate-row__fix { align-self: center; }

/* No plate on show: the quiet way to type it, under the doors. */
.s-welcome__plate-ask { display: flex; justify-content: center; }
.s-plate-ask {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  max-width: 100%;
  padding: 6px 24px 6px 7px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(6, 18, 29, 0.48);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: rgba(255, 255, 255, 0.9);
  font: inherit;
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-base);
}
.s-plate-ask:active { transform: scale(0.97); }
.s-plate-ask:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }
.s-plate-ask b { color: #fff; font-weight: 900; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.s-plate-ask__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  color: var(--p-ink);
}
.s-plate-ask__icon .k-icon { width: 26px; height: 26px; }
@media (hover: hover) {
  .s-plate-ask:hover, .s-plate-row__fix:hover { border-color: rgba(255, 255, 255, 0.7); }
  .s-saved:hover { box-shadow: 0 32px 72px rgba(0, 0, 0, 0.48), 0 0 0 5px rgba(52, 211, 153, 0.75); }
}

/* An account wash is the driver's next step: the welcome headline steps back to make room for it. */
.s-welcome:has(.s-saved) .s-welcome__lede { display: none; }
.s-welcome:has(.s-saved) .s-welcome__title { font-size: clamp(44px, min(6vw, 10vh), 108px); }

/* Short landscape glass (1024 × 768, 1280 × 720): a smaller headline and doors keep it all on screen. */
@media (max-height: 760px) and (min-aspect-ratio: 1/1) {
  .s-welcome__title { font-size: clamp(48px, min(7vw, 12vh), 96px); }
  .s-door { min-height: 112px; }
  .s-welcome:has(.s-plate-row) .s-door { min-height: 96px; }
}
@media (max-height: 860px) and (min-aspect-ratio: 1/1) {
  .s-welcome:has(.s-plate-row) .s-welcome__lede { display: none; }
}
@media (max-width: 1180px) {
  .s-welcome__doors { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
}
/* Portrait: one column, the doors stacked at full width. The fan and the keypad tile share one leading
   column, so the two door titles line up. */
@media (max-width: 980px) {
  .s-welcome__doors { grid-template-columns: minmax(0, 1fr); }
  .s-welcome__title { font-size: clamp(50px, 11vw, 112px); }
  .s-door { min-height: clamp(112px, 13vh, 168px); grid-template-columns: 120px minmax(0, 1fr) auto; }
  .s-door > :first-child { justify-self: center; }
}
@media (max-width: 760px) {
  .s-plate-row--saved { grid-template-columns: minmax(0, 1fr); }
  .s-plate-row--saved .s-plate-row__fix { justify-self: start; }
  .s-saved { grid-template-columns: auto minmax(0, 1fr); }
  .s-saved__pay { grid-column: 1 / -1; justify-content: space-between; }
  .s-plate-ask { font-size: var(--fs-sm); }
}
@media (max-width: 640px) {
  .s-welcome__top { flex-direction: column; align-items: flex-start; gap: 14px; }
  .s-welcome__status { max-width: 100%; min-height: 44px; font-size: var(--fs-sm); }
  .s-welcome__gift { grid-template-columns: auto minmax(0, 1fr); }
  .s-welcome__gift .k-btn { grid-column: 1 / -1; }
  .s-door { min-height: 100px; grid-template-columns: 90px minmax(0, 1fr) auto; }
  .s-door__go { width: 52px; }
  .s-door__fan { width: 78px; height: 62px; margin-inline: 6px; }
}

/* ================= PLATE (type your plate) ================= */
/* The bay from Welcome behind misted glass, as on the code screen. The plate the driver types is drawn
   as the plate on the car; a Swiss (QWERTZ) keyboard of glass keys fills the bottom of the glass. */
body:has(.s-plate) .k-backdrop__photo {
  filter: blur(14px) saturate(0.9) brightness(0.92);
  transition: opacity 720ms var(--ease-out), transform 12s linear, filter 700ms var(--ease-out);
}
body:has(.s-plate) .k-backdrop__scrim {
  background:
    radial-gradient(120% 90% at 18% 40%, rgba(11, 28, 43, 0.35), transparent 70%),
    linear-gradient(180deg, rgba(11, 28, 43, 0.66) 0%, rgba(11, 28, 43, 0.76) 55%, rgba(11, 28, 43, 0.88) 100%);
}
.s-plate {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(12px, 2vh, 26px);
  min-height: 0;
  color: #fff;
}
.s-plate__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "back back" "lead board";
  align-items: end;
  gap: clamp(10px, 1.6vh, 18px) clamp(20px, 3vw, 48px);
}
.s-plate__head .k-back {
  grid-area: back;
  background: rgba(6, 18, 29, 0.42);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}
.s-plate__lead { grid-area: lead; display: grid; gap: clamp(6px, 1vh, 12px); min-width: 0; }
.s-plate__from {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-sm);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7adfff;
}
.s-plate__from .k-icon { width: 24px; height: 24px; }
.s-plate__lead h1 {
  font-size: clamp(34px, min(3.6vw, 6.4vh), 66px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.s-plate__lede { font-size: clamp(17px, 1.4vw, 23px); font-weight: 700; color: rgba(255, 255, 255, 0.86); }
.s-plate__board { grid-area: board; display: grid; justify-items: end; gap: 8px; min-width: 0; }
.s-plate__view .k-plate__text::after {
  content: "";
  width: 0.07em;
  height: 0.78em;
  margin-left: 0.08em;
  border-radius: 2px;
  background: #1677ff;
  animation: k-caret 1.05s steps(1) infinite;
}
.s-plate__view.is-empty .k-plate { opacity: 0.94; }
.s-plate.is-checking .s-plate__view .k-plate { animation: k-breathe 1.2s var(--ease-in-out) infinite; }
.s-plate__status { min-height: 1.4em; font-size: var(--fs-md); font-weight: 800; color: rgba(255, 255, 255, 0.88); text-align: right; max-width: 34ch; }
.s-plate__error { text-align: right; max-width: 34ch; }
@keyframes k-caret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.s-plate__kb { display: grid; align-content: center; gap: clamp(7px, 1.1vh, 12px); min-height: 0; }
.s-plate__row { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: clamp(7px, 0.8vw, 12px); }
.s-plate__key {
  display: grid;
  place-items: center;
  min-height: clamp(48px, 8.4vh, 96px);
  border-radius: clamp(12px, 1.2vw, 18px);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font: inherit;
  font-size: clamp(22px, min(2.3vw, 4vh), 38px);
  font-weight: 900;
  cursor: pointer;
  transition: transform var(--dur-fast), background var(--dur-fast);
}
.s-plate__row[data-row="0"] .s-plate__key { background: rgba(255, 255, 255, 0.2); }
.s-plate__key:active { transform: scale(0.95); background: rgba(255, 255, 255, 0.34); }
.s-plate__key:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.s-plate__key--soft { background: rgba(6, 18, 29, 0.36); font-size: var(--fs-sm); letter-spacing: 0.06em; }
.s-plate__key--soft .k-icon { width: 34px; height: 34px; }
.s-plate__key--wide { grid-column: span 3; }
@media (hover: hover) { .s-plate__key:hover { background: rgba(255, 255, 255, 0.24); } }

.s-plate__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px clamp(14px, 1.6vw, 24px); }
.s-plate__privacy {
  flex: 1 1 320px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.78);
}
.s-plate__privacy .k-icon { flex: none; width: 24px; height: 24px; color: #7adfff; }
.s-plate__find { min-width: min(380px, 100%); }
.s-plate__find:disabled { opacity: 0.45; }
.s-plate__choose[hidden] { display: none; }

@media (max-width: 760px) {
  /* Narrow glass scrolls instead of squeezing the keyboard row under the footer. */
  .s-plate { grid-template-rows: auto auto auto; align-content: start; }
  .s-plate__view .k-plate { --plate-h: clamp(50px, 14vw, 72px); }
  .s-plate__head { grid-template-columns: minmax(0, 1fr); grid-template-areas: "back" "lead" "board"; }
  .s-plate__board { justify-items: start; }
  .s-plate__status, .s-plate__error { text-align: left; }
  .s-plate__row { gap: 5px; }
  .s-plate__key { min-height: 46px; border-radius: 10px; font-size: 19px; }
  .s-plate__key--soft { font-size: 12px; letter-spacing: 0; }
  .s-plate__find, .s-plate__choose { flex: 1 1 100%; min-width: 0; }
}
@media (max-width: 640px), (max-height: 600px) {
  .s-plate { overflow-y: auto; scrollbar-width: none; padding: 12px 12px 20px; margin: -12px -12px -20px; }
}

/* ================= CODE (I have a code) ================= */
/* The bay from Welcome behind misted glass. The four tiles are the phone's tiles: empty ones are frosted
   glass, a typed digit flips in on white. Checking sweeps a light across them (the Welcome's wiper), a
   match lights them green, a wrong code shakes them and its digits fall off. The keypad sits on a dark
   glass slab on the right and turns into Yes there, under the driver's hand. */

/* Misted bay photo (only while this screen is up; the scrim lifts a little so the bay still reads). */
body:has(.s-code) .k-backdrop__photo {
  filter: blur(14px) saturate(0.9) brightness(0.92);
  transition: opacity 720ms var(--ease-out), transform 12s linear, filter 700ms var(--ease-out);
}
body:has(.s-code) .k-backdrop__scrim {
  background:
    radial-gradient(120% 90% at 18% 40%, rgba(11, 28, 43, 0.35), transparent 70%),
    linear-gradient(180deg, rgba(11, 28, 43, 0.66) 0%, rgba(11, 28, 43, 0.74) 55%, rgba(11, 28, 43, 0.86) 100%);
}

.s-code {
  --sky-glow: #7adfff;
  --mint: #3ddc97;
  --tile-w: clamp(84px, 8.2vw, 168px);
  --tile-h: min(clamp(106px, 10.6vw, 212px), 19vh);
  --tile-digit: clamp(54px, 6.2vw, 124px);
  --key-h: clamp(72px, 12.5vh, 132px);
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.64fr);
  grid-template-rows: minmax(0, 1fr);
  gap: clamp(24px, 3vw, 56px);
  align-content: stretch;
  min-height: 0;
}

/* ---------- left: lead, tiles, message, steps ---------- */
.s-code__main {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2.2vh, 28px);
  min-height: 0;
}
.s-code__main > .k-back { align-self: flex-start; }

/* The lead and the tiles sit together in the middle of the free height; the steps keep the foot. */
.s-code__lead { margin-top: auto; }
.s-code__head { display: grid; gap: 12px; }
.s-code__from {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--sky-glow);
  font-weight: 800;
  font-size: var(--fs-sm);
}
.s-code__from svg { width: 22px; height: 22px; }
.s-code__head h1 {
  max-width: 15ch;
  color: #fff;
  font-size: clamp(34px, 3.6vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.s-code__lede {
  max-width: 46ch;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 700;
  font-size: var(--fs-md);
  line-height: 1.4;
}

/* The phone in the driver's hand: its tiles light up first, then the glass's. */
.s-code__phone {
  width: clamp(150px, 13vw, 214px);
  padding: 8px;
  border-radius: 30px;
  background: #050f19;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.14), 0 0 70px rgba(122, 223, 255, 0.16);
  transform: rotate(-6deg);
  animation: s-code-phone-in 760ms var(--ease-emph) 80ms both;
}
.s-code__phone-screen {
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 20px 10px 16px;
  border-radius: 23px;
  color: #fff;
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(0, 178, 226, 0.4), transparent 55%),
    linear-gradient(180deg, #10263b 0%, #0b1c2b 100%);
}
.s-code__phone-label { color: var(--sky-glow); font-size: 12px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; }
.s-code__phone-digits { display: flex; gap: 5px; perspective: 400px; }
.s-code__phone-digits b {
  display: grid;
  place-items: center;
  width: clamp(26px, 2.3vw, 38px);
  height: clamp(34px, 3vw, 48px);
  border-radius: 9px;
  background: #fff;
  color: var(--p-ink);
  font-family: var(--font-display);
  font-size: clamp(19px, 1.7vw, 27px);
  font-weight: 600;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
  animation: s-code-digit 560ms var(--ease-emph) both;
  animation-delay: calc(300ms + var(--i, 0) * 90ms);
}
.s-code__phone-line { max-width: 18ch; color: rgba(232, 240, 248, 0.86); font-size: 12px; font-weight: 800; line-height: 1.3; text-align: center; }

/* ---------- the four tiles, with the phone they come from ---------- */
.s-code__board { display: grid; justify-items: start; gap: clamp(8px, 1.4vh, 14px); }
.s-code__row { display: flex; align-items: center; gap: clamp(20px, 2.6vw, 48px); }
.s-code__cells { display: flex; gap: clamp(12px, 1.4vw, 22px); }
.s-code__cells.is-error { animation: k-shake 420ms var(--ease-emph); }

.s-code__cell {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--tile-w);
  height: var(--tile-h);
  border-radius: clamp(18px, 1.8vw, 28px);
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -20px 30px rgba(0, 0, 0, 0.16);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--p-ink);
  overflow: hidden;
  perspective: 600px;
  transition: background 240ms var(--ease-out), border-color 240ms var(--ease-out), box-shadow 240ms var(--ease-out), translate 320ms var(--ease-emph);
  /* After the phone's tiles: the code "arrives" on the glass. */
  animation: s-code-tile-in 640ms var(--ease-emph) both;
  animation-delay: calc(620ms + var(--i, 0) * 80ms);
}
.s-code__cell b {
  font-family: var(--font-display);
  font-size: var(--tile-digit);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: lining-nums;
  transform-origin: 50% 70%;
}
/* A typed digit: the glass tile becomes the phone's white tile. */
.s-code__cell.is-filled {
  border-color: #fff;
  background: #fff;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34), inset 0 -6px 0 rgba(11, 28, 43, 0.07);
}
.s-code__cell.is-in b { animation: s-code-flip 460ms var(--ease-emph) both; }
/* The next tile waits with a caret, like a text field. */
.s-code__cell.is-next {
  border-color: var(--sky-glow);
  box-shadow: 0 0 0 4px rgba(122, 223, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.s-code__cell.is-next::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 5px;
  height: 44%;
  margin: auto;
  border-radius: 5px;
  background: var(--sky-glow);
  box-shadow: 0 0 18px rgba(122, 223, 255, 0.85);
  animation: k-blink 1.1s steps(1, end) infinite;
}
/* Checking: a light wipes across the four tiles, one after another. */
.s-code__cell::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 46%;
  background: linear-gradient(100deg, transparent 0%, rgba(58, 166, 255, 0.34) 45%, rgba(255, 255, 255, 0.7) 52%, transparent 100%);
  opacity: 0;
  transform: translateX(-160%) skewX(-14deg);
  pointer-events: none;
}
.s-code__cells.is-busy .s-code__cell { border-color: var(--sky-glow); }
.s-code__cells.is-busy .s-code__cell::after {
  opacity: 1;
  animation: s-code-wipe 1.15s var(--ease-in-out) infinite;
  animation-delay: calc(var(--i, 0) * 95ms);
}
/* Found: the tiles light green one after another and lift, then the wash ticket takes their place. */
.s-code__cells.is-found .s-code__cell {
  border-color: var(--mint);
  background: linear-gradient(180deg, #f0fff8, #c9f6e2);
  box-shadow: 0 0 0 5px rgba(61, 220, 151, 0.3), 0 20px 40px rgba(0, 0, 0, 0.3);
  translate: 0 -6px;
  transition-delay: calc(var(--i, 0) * 70ms);
}
.s-code__cells.is-found .s-code__cell b { color: #07583e; }
/* Wrong: coral rims until the next key. */
.s-code__cells.is-error .s-code__cell {
  border-color: #ff8a8a;
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.24);
}
/* A wrong digit falls off its tile (a decorative copy; the tile is already empty). */
.s-code__drop {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--tile-digit);
  font-style: normal;
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
  animation: s-code-drop 620ms cubic-bezier(0.55, 0, 0.75, 0.35) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

/* One reserved row under the tiles: the hint, "Checking your code…" and the error take turns in it,
   so nothing below ever moves. It holds two lines of the error. */
.s-code__msg {
  --code-err: max(22px, var(--fs-lg));
  display: grid;
  align-items: center;
  width: 100%;
  min-height: calc(var(--code-err) * 2.5);
}
.s-code__status, .s-code__error, .s-code__hint { grid-area: 1 / 1; margin: 0; }
.s-code__status { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 800; font-size: var(--fs-md); }
.s-code__status:not(:empty)::before {
  content: "";
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.24);
  border-top-color: var(--sky-glow);
  animation: k-spin 800ms linear infinite;
}
.s-code__error { max-width: 100%; font-size: var(--code-err); font-weight: 800; line-height: 1.25; text-wrap: balance; }
.s-code__hint { max-width: 46ch; color: rgba(255, 255, 255, 0.74); font-weight: 700; font-size: var(--fs-sm); line-height: 1.4; }
.s-code__error:not(:empty) ~ .s-code__hint,
.s-code__status:not(:empty) ~ .s-code__hint,
.s-code__board:has(.is-busy) .s-code__hint,
.s-code__board:has(.is-found) .s-code__hint { visibility: hidden; }

/* ---------- the steps: one quiet row at the foot ---------- */
.s-code__how { margin-top: auto; }
.s-code__how .k-howto { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.s-code__how .k-howto__item {
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 18px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(11, 28, 43, 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.s-code__how .k-howto__num { width: 38px; height: 38px; font-size: var(--fs-sm); }
.s-code__how .k-howto__num svg { width: 18px; height: 18px; }
.s-code__how .k-howto__item b { font-size: var(--fs-sm); line-height: 1.25; }
/* The lede and the phone already say what the bodies say; the titles carry the steps. */
.s-code__how .k-howto__item div > span { display: none; }
.s-code__how .k-howto__item.is-on { border-color: var(--sky-glow); background: rgba(58, 166, 255, 0.18); }

/* ---------- right: the keypad on a dark glass slab ---------- */
.s-code__side {
  display: grid;
  align-content: center;
  min-height: 0;
  padding: clamp(18px, 2vw, 30px);
  border-radius: clamp(28px, 2.6vw, 40px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(19, 48, 92, 0.46), rgba(11, 28, 43, 0.66));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 40px 80px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  backdrop-filter: blur(24px) saturate(1.2);
  animation: s-code-slab-in 700ms var(--ease-emph) 140ms both;
}
.s-code__keys[hidden], .s-code__decide[hidden], .s-code__ticket[hidden] { display: none; }
.s-code__keypad { gap: clamp(10px, 1.2vw, 16px); }
.s-code__keypad .k-keypad__key {
  min-height: var(--key-h);
  border-radius: clamp(18px, 1.6vw, 26px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 10px 24px rgba(0, 0, 0, 0.24);
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(34px, 3vw, 50px);
  font-weight: 600;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast), border-color var(--dur-fast), opacity var(--dur-base);
}
@media (hover: hover) { .s-code__keypad .k-keypad__key:hover { background: rgba(255, 255, 255, 0.2); } }
.s-code__keypad .k-keypad__key:active {
  transform: scale(0.95);
  border-color: rgba(122, 223, 255, 0.7);
  background: rgba(122, 223, 255, 0.28);
}
/* Clear and Delete are a word and a glyph, not digits: no glass, so the ten digits stand out. */
.s-code__keypad .k-keypad__key--soft {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: rgba(255, 255, 255, 0.88);
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  font-weight: 800;
  letter-spacing: 0.02em;
}
.s-code__keypad .k-keypad__key--soft .k-icon { width: 34px; height: 34px; }
/* While the code is checked the digit keys dim, so a slow answer never looks like a dead keypad. */
.s-code:has(.s-code__cells.is-busy, .s-code__cells.is-found) .s-code__keypad .k-keypad__key:not(.k-keypad__key--soft) { opacity: 0.4; }

/* ---------- found: the wash ticket (left) and Yes (right, where the keypad was) ---------- */
.s-code[data-mode="match"] .s-code__lead,
.s-code[data-mode="match"] .s-code__board { display: none; }
.s-code[data-mode="match"] .s-code__ticket { margin-top: auto; }

.s-code__ticket {
  display: grid;
  grid-template-columns: minmax(170px, 0.85fr) minmax(0, 1.15fr);
  min-height: clamp(250px, 44vh, 440px);
  border-radius: clamp(24px, 2.4vw, 36px);
  overflow: hidden;
  background: #fff;
  color: var(--p-ink);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.4);
  animation: s-code-ticket-in 720ms var(--ease-emph) both;
}
.s-code__ticket-photo { position: relative; background: var(--p-navy); }
.s-code__ticket-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: k-kenburns 14s linear both;
}
.s-code__ticket-body {
  position: relative;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: clamp(22px, 2.6vw, 42px);
}
/* The tear line of a ticket between the photo and the wash. */
.s-code__ticket-body::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;
  border-left: 3px dotted rgba(11, 28, 43, 0.16);
}
.s-code__found {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--p-success-strong);
  font-weight: 900;
  font-size: var(--fs-sm);
}
.s-code__found svg {
  width: 26px;
  height: 26px;
  padding: 4px;
  border-radius: 50%;
  background: var(--p-success-strong);
  color: #fff;
}
.s-code__wash-name { font-family: var(--font-display); font-size: clamp(36px, 3.6vw, 62px); font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.s-code__wash-price { color: var(--p-muted); font-weight: 900; font-size: var(--fs-lg); }
.s-code__wash-price.is-free { color: #0a6b4a; }
/* "Already paid": the driver paid in the app, the glass takes no money. */
.s-code__paid { display: flex; align-items: flex-start; gap: 8px; color: #0a6b4a; font-weight: 800; font-size: var(--fs-sm); line-height: 1.4; }
.s-code__paid .k-icon { flex: none; width: 20px; height: 20px; margin-top: 1px; }
/* The code that matched, as the same tiles as on the phone. */
.s-code__ticket-code {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--p-line);
  color: var(--p-muted);
  font-weight: 800;
  font-size: var(--fs-sm);
}
.s-code__ticket-digits { display: flex; gap: 6px; perspective: 400px; }
.s-code__ticket-digits b {
  display: grid;
  place-items: center;
  width: 36px;
  height: 44px;
  border-radius: 10px;
  background: var(--p-ink);
  color: #fff;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  animation: s-code-digit 480ms var(--ease-emph) both;
  animation-delay: calc(360ms + var(--i, 0) * 70ms);
}

.s-code__decide {
  display: grid;
  gap: clamp(12px, 1.8vh, 18px);
  align-content: center;
  animation: s-code-decide-in 560ms var(--ease-emph) 120ms both;
}
.s-code__decide h2 { margin-bottom: 6px; color: #fff; font-size: clamp(32px, 3.2vw, 54px); line-height: 1.04; letter-spacing: -0.02em; }
.s-code__yes { min-height: calc(var(--hit-cta) + 24px); font-size: clamp(22px, 1.9vw, 28px); }
.s-code__yes svg { width: 28px; height: 28px; }
.s-code__match-error { font-size: var(--fs-md); font-weight: 800; }

/* ---------- motion ---------- */
@keyframes s-code-phone-in { from { opacity: 0; transform: rotate(-14deg) translateY(30px) scale(0.92); } to { opacity: 1; transform: rotate(-6deg); } }
@keyframes s-code-digit { from { opacity: 0; transform: translateY(10px) rotateX(-75deg); } to { opacity: 1; transform: none; } }
@keyframes s-code-tile-in { 0% { opacity: 0; transform: translateY(-18px) scale(0.9); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes s-code-flip { 0% { opacity: 0; transform: translateY(-10%) rotateX(-95deg); } 60% { opacity: 1; transform: rotateX(12deg); } 100% { opacity: 1; transform: none; } }
@keyframes s-code-wipe { from { transform: translateX(-160%) skewX(-14deg); } to { transform: translateX(320%) skewX(-14deg); } }
@keyframes s-code-drop { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(105%) rotate(16deg); } }
@keyframes s-code-slab-in { from { opacity: 0; transform: translateX(32px); } to { opacity: 1; transform: none; } }
@keyframes s-code-ticket-in { 0% { opacity: 0; transform: translateY(28px) scale(0.96); } 60% { opacity: 1; transform: translateY(-3px) scale(1.005); } 100% { opacity: 1; transform: none; } }
@keyframes s-code-decide-in { from { opacity: 0; transform: translateY(20px) scale(0.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .s-code__cell::after, .s-code__drop { display: none; }
  .s-code__ticket-photo img { animation: none; }
  .s-code__phone { transform: rotate(-6deg); }
}

/* ---------- sizes ---------- */
@media (max-width: 1180px) {
  .s-code { grid-template-columns: minmax(0, 1fr) minmax(330px, 0.7fr); }
}
/* Too narrow for the phone beside the tiles: the lede still says where the code is. */
@media (max-width: 1100px) {
  .s-code__phone { display: none; }
}
/* Short landscape glass (1280 × 800, 1024 × 768): every key, the message row and the steps must fit. */
@media (max-height: 900px) and (min-aspect-ratio: 1/1) {
  .s-code { --key-h: clamp(64px, 13.6vh, 112px); }
  .s-code__main { gap: 12px; }
  .s-code__head { gap: 8px; }
  .s-code__head h1 { font-size: clamp(30px, 3.2vw, 46px); }
  .s-code__lede { font-size: var(--fs-sm); }
  .s-code__msg { --code-err: max(20px, var(--fs-md)); }
}
/* Portrait or narrow: one column that scrolls. The phone drawing gives way to the keypad. */
@media (max-width: 980px) {
  .s-code { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; overflow-y: auto; }
  /* Content height here: squeezed into the stage, the keypad slid over the steps. */
  .s-code__main, .s-code__side { min-height: auto; }
  /* Portrait glass (800 × 1280): the steps stay one row and the keys shrink, so the whole keypad fits. */
  .s-code { --key-h: clamp(64px, 8vh, 104px); }
  .s-code__ticket { grid-template-columns: minmax(0, 1fr); grid-template-rows: 200px auto; }
  .s-code__ticket-body::before { display: none; }
}

/* An account wash the camera already started: a status card, not a button. */
.s-saved--started { cursor: default; animation: q-qr-in 600ms var(--ease-emph) both; }
.s-saved--started:active { transform: none; }
.s-saved__pay--go { background: #067a52; }
.s-saved__pay--go i { background: #fff; color: #067a52; }

/* Receipt by email (queue): the address, an unticked offers box, Send. */
.s-queue__mail {
  justify-self: stretch;
  align-self: start;
  display: grid;
  gap: clamp(10px, 1.6vh, 16px);
  text-align: left;
}
.s-queue__field { display: grid; gap: 8px; font-size: var(--fs-sm); font-weight: 800; color: var(--k-fg-muted); }
.s-queue__field input {
  width: 100%;
  min-height: clamp(60px, 7vh, 76px);
  padding: 0 20px;
  border: 0;
  border-radius: var(--r-md, 18px);
  background: #fff;
  color: var(--p-ink);
  font: inherit;
  font-size: clamp(20px, 1.8vw, 26px);
  font-weight: 700;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.25);
}
.s-queue__field input::placeholder { color: #7d93a8; font-weight: 600; }
.s-queue__field input:focus-visible { outline: 4px solid var(--p-sky); outline-offset: 2px; }
.s-queue__field input:disabled { opacity: 0.5; }
.s-queue__optin {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 12px 4px;
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
}
.s-queue__optin input {
  width: 32px;
  height: 32px;
  margin: 0;
  accent-color: #34d399;
  cursor: pointer;
}
.s-queue__send { justify-self: stretch; gap: 12px; }
.s-queue__send .k-icon { width: 24px; height: 24px; }
.s-queue__mail-error:empty { display: none; }
.s-queue__sent {
  justify-self: stretch;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-radius: var(--r-lg);
  background: rgba(52, 211, 153, 0.14);
  box-shadow: inset 0 0 0 1.5px rgba(52, 211, 153, 0.45);
  font-size: var(--fs-md);
  font-weight: 800;
  overflow-wrap: anywhere;
  animation: q-qr-in 600ms var(--ease-emph) both;
}
.s-queue__sent .k-icon { flex: none; width: 26px; height: 26px; color: #34d399; stroke-width: 3; }
@media (max-width: 760px) {
  .s-queue__optin input { width: 28px; height: 28px; }
}
/* With the email form the receipt panel takes its natural height (the form never squeezes into the summary). */
.s-queue__receipt:has(.s-queue__mail, .s-queue__sent) { grid-template-rows: auto auto auto; align-content: start; }
/* Stacked (portrait, phone): both panels take their natural height and the screen scrolls. */
@media (max-width: 980px) {
  .s-queue { grid-template-rows: auto; align-content: start; }
}
