/* Stourbridge Flooring Co. — quotation request
   Palette and type from the brand identity portfolio. */

:root {
  /* Brand palette */
  --charcoal: #252421;
  --ivory: #F3EFE7;
  --stone: #D2C6B5;
  --taupe: #A99A86;

  /* Working tokens */
  --paper: #FBF9F5;
  --ink: #252421;
  --ink-2: #5C574E;
  --ink-3: #736C60;
  --line: rgba(37, 36, 33, .11);
  --line-strong: rgba(37, 36, 33, .2);
  --tint: #EFE9DF;
  --tint-2: #E7DFD2;
  --olive: #4F5A39;
  --olive-tint: rgba(86, 99, 61, .1);
  --brick: #9B3A2C;

  --font-display: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);

  --r-card: 18px;
  --r: 12px;
  --shadow-card: 0 1px 2px rgba(37, 36, 33, .04), 0 18px 40px -18px rgba(37, 36, 33, .18);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
kbd { font-family: inherit; }

[hidden] { display: none !important; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 22px clamp(16px, 4vw, 40px);
}

.wordmark {
  display: inline-flex;
  flex-direction: column;
  line-height: 1;
  text-decoration: none;
  color: var(--ink);
}

.wordmark__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.wordmark__sub {
  margin-top: 5px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.topbar__tag {
  margin: 0;
  padding-left: 22px;
  border-left: 1px solid var(--taupe);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.topbar__phone {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  transition: background-color 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .topbar__phone:hover { background: var(--tint); }
}

/* ---------- Layout ---------- */

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 560px);
  justify-content: center;
  align-items: start;
  gap: 32px;
  padding: 4px 16px 20px;
}

.aside { display: none; }

@media (min-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 560px) 300px; }
  .aside {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    max-height: min(740px, calc(100dvh - 150px));
    padding-top: 8px;
  }
}

.signoff {
  margin: 0;
  padding: 0 16px 28px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 17px;
  font-style: italic;
  font-weight: 500;
  color: var(--ink-2);
}

/* ---------- Card ---------- */

.card {
  display: flex;
  flex-direction: column;
  height: min(740px, calc(100dvh - 150px));
  min-height: 580px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}

.card__head {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  padding: 12px 14px 10px;
}

.card__title {
  margin: 0;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .01em;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--ink);
  transition: background-color 150ms ease, transform 160ms var(--ease-out), opacity 200ms var(--ease-out);
}

.icon-btn:active { transform: scale(.94); }
.icon-btn:focus-visible { outline: 2px solid var(--charcoal); outline-offset: 1px; }
.icon-btn[data-hidden] { opacity: 0; pointer-events: none; transform: translateX(4px); }

@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover { background: var(--tint); }
}

/* Progress */

.progress {
  height: 3px;
  margin: 0 24px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(169, 154, 134, .28);
}

.progress__fill {
  display: block;
  height: 100%;
  background: var(--charcoal);
  transform-origin: left center;
  transform: scaleX(var(--p, 0));
  transition: transform 520ms var(--ease-in-out);
}

/* Estimate strip */

.estimate { border-bottom: 1px solid var(--line); }
.estimate[hidden] { display: none; }

.estimate__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px 12px;
  text-align: left;
}

.estimate__toggle:focus-visible { outline: 2px solid var(--charcoal); outline-offset: -2px; border-radius: 6px; }

.estimate__label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }

.estimate__value {
  margin-left: auto;
  font-size: 14.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.005em;
}

.estimate__value.is-empty,
.aside__price-value.is-empty {
  font-weight: 500;
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: 0;
}

.estimate__chev { color: var(--ink-2); transition: transform 280ms var(--ease-out); }
.estimate__toggle[aria-expanded="true"] .estimate__chev { transform: rotate(180deg); }

.estimate__drawer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 340ms var(--ease-drawer);
}

.estimate__drawer.is-open { grid-template-rows: 1fr; }

.estimate__drawer-inner {
  min-height: 0;
  overflow: hidden;
}

.estimate__drawer .summary {
  max-height: 42dvh;
  overflow-y: auto;
  padding: 0 24px;
}

.estimate__note {
  margin: 0;
  padding: 10px 24px 14px;
  font-size: 12px;
  color: var(--ink-2);
}

@media (min-width: 1000px) {
  .estimate__chev, .estimate__drawer { display: none; }
  .estimate__toggle { cursor: default; }
}

/* Body + stage */

.card__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 30px 32px 36px;
  scrollbar-width: thin;
  scrollbar-color: var(--stone) transparent;
}

.stage { position: relative; }

.step { will-change: auto; }

.step.is-leaving {
  position: absolute;
  inset: 0 0 auto 0;
  pointer-events: none;
}

/* Footer */

.card__foot {
  padding: 14px 24px 18px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.card.is-done .card__foot { display: none; }

/* ---------- Buttons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--r);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .005em;
  text-decoration: none;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: 2px solid var(--charcoal); outline-offset: 2px; }

.btn--primary {
  width: 100%;
  height: 54px;
  overflow: hidden;
  background: var(--charcoal);
  color: var(--ivory);
}

.btn--dark { background: var(--charcoal); color: var(--ivory); }

.btn--quiet { background: transparent; color: var(--ink); }

.btn--outline {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover, .btn--dark:hover { background: #393631; }
  .btn--quiet:hover { background: var(--tint); }
  .btn--outline:hover { border-color: var(--ink-3); }
}

.btn__content {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: opacity 200ms ease, filter 200ms ease, transform 200ms var(--ease-out);
}

.btn__kbd {
  display: none;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 6px;
  border: 1px solid rgba(243, 239, 231, .28);
  font-size: 12px;
  line-height: 20px;
  color: rgba(243, 239, 231, .72);
}

@media (hover: hover) and (pointer: fine) {
  .btn__kbd { display: inline-block; }
}

.btn__spinner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(243, 239, 231, .25);
  border-top-color: var(--ivory);
  opacity: 0;
  transform: scale(.8);
  transition: opacity 200ms ease, transform 200ms var(--ease-out);
}

.btn.is-loading .btn__content { opacity: 0; filter: blur(2px); transform: scale(.98); }
.btn.is-loading .btn__spinner { opacity: 1; transform: scale(1); animation: spin 640ms linear infinite; }
.btn.is-loading { pointer-events: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Step typography ---------- */

.overline {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.q {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 3.6vw, 34px);
  line-height: 1.1;
  letter-spacing: -.005em;
  color: var(--ink);
  outline: none;
  text-wrap: balance;
}

.hint {
  margin: 10px 0 0;
  max-width: 46ch;
  font-size: 14.5px;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* Inline step error */

.error {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 240ms var(--ease-out);
}

.error__inner {
  min-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 180ms ease;
}

.error.is-visible { grid-template-rows: 1fr; }
.error.is-visible .error__inner { opacity: 1; }

.error p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--brick);
}

/* ---------- Single choice rows ---------- */

.options {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 26px 0 0;
  padding: 0;
  border: 0;
}

.opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 13px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--paper);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms var(--ease-out);
}

.opt:active { transform: scale(.985); }

.opt input,
.tile input,
.sw input,
.chip input,
.seg input,
.check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.opt:has(input:focus-visible) { outline: 2px solid var(--charcoal); outline-offset: 2px; }
.opt:has(input:checked) { border-color: var(--charcoal); background: var(--tint); }

.opt__radio {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--taupe);
  transition: border-color 160ms ease;
}

.opt__radio::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--charcoal);
  opacity: 0;
  transform: scale(.4);
  transition: transform 220ms var(--ease-out), opacity 140ms ease;
}

.opt:has(input:checked) .opt__radio { border-color: var(--charcoal); }
.opt:has(input:checked) .opt__radio::after { opacity: 1; transform: scale(1); }

.opt__text { display: grid; gap: 1px; min-width: 0; }
.opt__label { font-size: 15px; font-weight: 500; }
.opt__sub { font-size: 13px; color: var(--ink-2); }

.opt__key {
  margin-left: auto;
  flex: none;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  color: var(--ink-3);
  opacity: 0;
  transition: opacity 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .opt:hover { border-color: rgba(37, 36, 33, .38); }
  .opt:hover .opt__key { opacity: 1; }
}

/* ---------- Material tiles ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 26px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--paper);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 160ms ease, box-shadow 200ms ease, transform 160ms var(--ease-out);
}

.tile:active { transform: scale(.98); }
.tile:has(input:focus-visible) { outline: 2px solid var(--charcoal); outline-offset: 2px; }
.tile:has(input:checked) { border-color: var(--charcoal); box-shadow: 0 0 0 1px var(--charcoal); }

.tile__swatch {
  display: block;
  aspect-ratio: 2.2 / 1;
  overflow: hidden;
  background: var(--tint);
  border-bottom: 1px solid var(--line);
}

.tile__swatch svg {
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 700ms var(--ease-out);
}

.tile__text { display: grid; gap: 1px; padding: 12px 14px 14px; }
.tile__label { font-size: 15px; font-weight: 600; }
.tile__sub { font-size: 12.5px; color: var(--ink-2); }

.tile__check {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--charcoal);
  color: var(--ivory);
  box-shadow: 0 2px 8px rgba(37, 36, 33, .25);
  opacity: 0;
  transform: scale(.8);
  transition: opacity 160ms ease, transform 240ms var(--ease-out);
}

.tile:has(input:checked) .tile__check { opacity: 1; transform: scale(1); }

@media (hover: hover) and (pointer: fine) {
  .tile:hover { border-color: rgba(37, 36, 33, .38); }
  .tile:hover .tile__swatch svg { transform: scale(1.06); }
}

/* ---------- Thickness cross-section ---------- */

.opt__section { flex: none; width: 44px; height: 26px; margin-left: auto; overflow: visible; }
.opt__section + .opt__key { margin-left: 12px; }

.sec__core { fill: var(--stone); stroke: var(--taupe); stroke-width: .8; stroke-linejoin: round; transition: fill 160ms ease, stroke 160ms ease; }
.sec__wear { fill: var(--taupe); transition: fill 160ms ease; }
.sec__back { fill: var(--taupe); transition: fill 160ms ease; }
.sec__pile { fill: none; stroke: var(--taupe); stroke-width: 1.4; stroke-linecap: round; transition: stroke 160ms ease; }
.sec__pad { fill: var(--stone); stroke: var(--taupe); stroke-width: .8; transition: fill 160ms ease, stroke 160ms ease; }
.sec__cell { fill: var(--taupe); opacity: .7; transition: fill 160ms ease; }

.opt:has(input:checked) .sec__core { fill: #C4B7A3; stroke: var(--charcoal); }
.opt:has(input:checked) .sec__wear { fill: var(--charcoal); }
.opt:has(input:checked) .sec__back { fill: var(--charcoal); }
.opt:has(input:checked) .sec__pile { stroke: var(--charcoal); }
.opt:has(input:checked) .sec__pad { fill: #C4B7A3; stroke: var(--charcoal); }
.opt:has(input:checked) .sec__cell { fill: var(--charcoal); }

/* ---------- Colour ---------- */

.colour { min-width: 0; margin: 22px 0 0; padding: 0; border: 0; }

.preview {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--tint);
}

.preview__floor { position: relative; aspect-ratio: 320 / 112; }

.preview__layer,
.preview__layer svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

/* Soft daylight falling across the floor */
.preview__floor::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 150% at 12% 0%, rgba(255, 255, 255, .22), transparent 55%),
    linear-gradient(to bottom, transparent 50%, rgba(37, 36, 33, .14));
}

/* A requested colour is still to be found: show an outline waiting to be filled */
.preview__floor::before {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 1;
  border: 1.5px dashed rgba(37, 36, 33, .32);
  border-radius: 10px;
  opacity: 0;
  transition: opacity 200ms ease;
}

.preview.is-request .preview__floor::before { opacity: 1; }

.preview__cap {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  display: grid;
  gap: 1px;
  max-width: calc(100% - 20px);
  padding: 7px 12px 8px;
  border-radius: 10px;
  background: rgba(251, 249, 245, .93);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 2px rgba(37, 36, 33, .06), 0 6px 16px -6px rgba(37, 36, 33, .28);
}

.preview__name,
.preview__spec { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.preview__name { font-size: 14px; font-weight: 600; }
.preview__spec { font-size: 12px; color: var(--ink-2); }

.swatches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

/* Four stone shades sit better as a square than three-and-one */
.swatches:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.sw {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 56px;
  padding: 8px 10px 8px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--paper);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms var(--ease-out);
}

.sw:active { transform: scale(.97); }
.sw:has(input:focus-visible) { outline: 2px solid var(--charcoal); outline-offset: 2px; }
.sw:has(input:checked) { border-color: var(--charcoal); background: var(--tint); }

.sw__chip {
  position: relative;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background-color: var(--c);
  box-shadow: inset 0 0 0 1px rgba(37, 36, 33, .12);
}

.sw__chip--wood {
  background-image:
    repeating-linear-gradient(to bottom, transparent 0 8.5px, rgba(50, 35, 20, .24) 8.5px 9.5px),
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, .07) 0 2px, transparent 2px 4.5px);
}

.sw__chip--stone {
  background-image:
    linear-gradient(90deg, transparent calc(50% - .5px), rgba(37, 36, 33, .22) 0 calc(50% + .5px), transparent 0),
    linear-gradient(transparent calc(50% - .5px), rgba(37, 36, 33, .22) 0 calc(50% + .5px), transparent 0),
    linear-gradient(135deg, rgba(255, 255, 255, .2), transparent 60%);
}

.sw__chip--carpet {
  background-image:
    radial-gradient(rgba(0, 0, 0, .16) .7px, transparent 1.1px),
    radial-gradient(rgba(255, 255, 255, .14) .7px, transparent 1.1px);
  background-size: 3px 3px;
  background-position: 0 0, 1.5px 1.5px;
}

.sw__check {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--charcoal);
  color: var(--ivory);
  box-shadow: 0 0 0 2px var(--paper);
  opacity: 0;
  transform: scale(.8);
  transition: opacity 160ms ease, transform 240ms var(--ease-out);
}

.sw__check svg { width: 11px; height: 11px; }
.sw:has(input:checked) .sw__check { opacity: 1; transform: scale(1); box-shadow: 0 0 0 2px var(--tint); }

.sw__label { min-width: 0; font-size: 13.5px; font-weight: 500; line-height: 1.25; }

.options.options--after { margin-top: 10px; }

/* The request field opens beneath its option; the negative margin cancels the list gap while closed */
.request {
  display: grid;
  grid-template-rows: 0fr;
  margin-top: -10px;
  transition: grid-template-rows 260ms var(--ease-out);
}

.colour:has(input[value="request"]:checked) .request { grid-template-rows: 1fr; }

.request__inner { min-height: 0; overflow: hidden; opacity: 0; transition: opacity 200ms ease; }
.colour:has(input[value="request"]:checked) .request__inner { opacity: 1; }

.request__field { padding: 14px 2px 4px; }
.request__note { margin: 2px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }

@media (hover: hover) and (pointer: fine) {
  .sw:hover { border-color: rgba(37, 36, 33, .38); }
}

/* ---------- Multi-select chips ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.chip-wrap {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper);
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms var(--ease-out);
}

.chip-wrap:has(.chip:active) { transform: scale(.97); }
.chip-wrap:has(input:checked) { border-color: var(--charcoal); background: var(--tint); }
.chip-wrap:has(input:focus-visible) { outline: 2px solid var(--charcoal); outline-offset: 2px; }

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.chip__box,
.check__box {
  flex: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--taupe);
  background: var(--paper);
  color: var(--ivory);
  transition: background-color 160ms ease, border-color 160ms ease;
}

.chip__box svg,
.check__box svg {
  width: 12px;
  height: 12px;
  stroke-dasharray: 16;
  stroke-dashoffset: 16;
  transition: stroke-dashoffset 240ms var(--ease-out);
}

.chip:has(input:checked) .chip__box,
.check:has(input:checked) .check__box {
  background: var(--charcoal);
  border-color: var(--charcoal);
}

.chip:has(input:checked) .chip__box svg,
.check:has(input:checked) .check__box svg { stroke-dashoffset: 0; }

@media (hover: hover) and (pointer: fine) {
  .chip-wrap:hover { border-color: rgba(37, 36, 33, .38); }
}

/* Stepper that unfolds inside a selected chip */

.stepper {
  display: grid;
  grid-template-columns: 0fr;
  transition: grid-template-columns 280ms var(--ease-out);
}

.chip-wrap:has(input:checked) .stepper { grid-template-columns: 1fr; }

.stepper__inner {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

/* spacing lives on children so the collapsed track is truly 0px wide */
.stepper__inner > :last-child { margin-right: 5px; }

.stepper__inner::before {
  content: "";
  flex: none;
  width: 1px;
  height: 20px;
  margin-right: 4px;
  background: var(--line-strong);
}

.stepper button {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: background-color 150ms ease, transform 160ms var(--ease-out), opacity 150ms ease;
}

.stepper button:active { transform: scale(.9); }
.stepper button:disabled { opacity: .3; cursor: default; }
.stepper button:focus-visible { outline: 2px solid var(--charcoal); outline-offset: 0; }

@media (hover: hover) and (pointer: fine) {
  .stepper button:not(:disabled):hover { background: var(--tint-2); }
}

.stepper output {
  min-width: 14px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- Checkbox row ---------- */

.check {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.check__box { width: 20px; height: 20px; border-radius: 6px; margin-top: 0; }
.check:has(input:focus-visible) .check__box { outline: 2px solid var(--charcoal); outline-offset: 2px; }

/* ---------- Floor space ---------- */

.area { margin-top: 22px; }

.area__top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.area__readout { display: flex; align-items: baseline; gap: 6px; }

.area__num {
  font-family: var(--font-display);
  font-size: 60px;
  font-weight: 600;
  line-height: .9;
  font-variant-numeric: lining-nums tabular-nums;
  transition: opacity 200ms ease;
}

.area__unit { font-size: 16px; font-weight: 700; color: var(--ink-2); }

.area__compare {
  margin: 0 0 4px;
  max-width: 24ch;
  text-align: right;
  font-size: 13.5px;
  color: var(--ink-2);
}

.area.is-unsure .area__num { opacity: .35; }

.plan {
  position: relative;
  margin: 14px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--ivory);
}

.plan svg { display: block; width: 100%; height: auto; }

.plan__wall {
  fill: none;
  stroke: var(--charcoal);
  stroke-width: 2.2;
  transition: stroke-dasharray 200ms ease;
}

.area.is-unsure .plan__wall { stroke-dasharray: 5 4; stroke-width: 1.4; }
.area.is-unsure .plan__floor { opacity: .45; }
.plan__floor { transition: opacity 200ms ease; }

.plan__dim line { stroke: var(--ink-2); stroke-width: .8; }

.plan__dim text {
  font-family: var(--font-body);
  font-size: 9.5px;
  font-weight: 600;
  fill: var(--ink-2);
  letter-spacing: .02em;
}

.plan figcaption {
  position: absolute;
  left: 12px;
  bottom: 9px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Range slider */

.range {
  --pct: 20%;
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 32px;
  margin: 14px 0 0;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}

.range:focus { outline: none; }

.range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--charcoal) var(--pct), rgba(169, 154, 134, .35) var(--pct));
}

.range::-moz-range-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--charcoal) var(--pct), rgba(169, 154, 134, .35) var(--pct));
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -12px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--charcoal);
  box-shadow: 0 2px 8px rgba(37, 36, 33, .18);
  transition: transform 160ms var(--ease-out), box-shadow 160ms ease;
}

.range::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--charcoal);
  box-shadow: 0 2px 8px rgba(37, 36, 33, .18);
  transition: transform 160ms var(--ease-out);
}

.range:active::-webkit-slider-thumb { transform: scale(1.12); box-shadow: 0 4px 14px rgba(37, 36, 33, .22); }
.range:active::-moz-range-thumb { transform: scale(1.12); }
.range:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--charcoal); outline-offset: 3px; }
.range:focus-visible::-moz-range-thumb { outline: 2px solid var(--charcoal); outline-offset: 3px; }

.range__scale {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.area__opts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--tint);
  font-size: 13px;
  font-weight: 600;
  transition: background-color 150ms ease, transform 160ms var(--ease-out), opacity 200ms ease;
}

.pill:active { transform: scale(.97); }
.pill:focus-visible { outline: 2px solid var(--charcoal); outline-offset: 2px; }

@media (hover: hover) and (pointer: fine) {
  .pill:hover { background: var(--tint-2); }
}

/* Measurement calculator */

.calc {
  margin-top: 20px;
  border-top: 1px solid var(--line);
}

.calc__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 0 4px;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}

.calc__toggle:focus-visible { outline: 2px solid var(--charcoal); outline-offset: 2px; border-radius: 6px; }
.calc__toggle svg:last-child { margin-left: auto; color: var(--ink-2); transition: transform 280ms var(--ease-out); }
.calc__toggle[aria-expanded="true"] svg:last-child { transform: rotate(180deg); }

.calc__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 320ms var(--ease-drawer);
}

.calc__body.is-open { grid-template-rows: 1fr; }
.calc__inner { min-height: 0; overflow: hidden; }
.calc__pad { padding-top: 10px; }

.calc__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto 36px;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.calc__row.is-new { animation: rise 280ms var(--ease-out) both; }

.calc__x, .calc__unit { font-size: 13px; color: var(--ink-2); font-weight: 600; }

.calc__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-size: 13.5px;
}

.calc__total strong { font-variant-numeric: tabular-nums; }

.link-btn {
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--taupe);
  text-underline-offset: 3px;
  padding: 6px 0;
  transition: text-decoration-color 150ms ease;
}

.link-btn:focus-visible { outline: 2px solid var(--charcoal); outline-offset: 2px; border-radius: 4px; }

@media (hover: hover) and (pointer: fine) {
  .link-btn:hover { text-decoration-color: var(--charcoal); }
}

.icon-btn--sm { width: 36px; height: 36px; color: var(--ink-2); }

/* ---------- Fields ---------- */

.fields { display: grid; gap: 16px; margin-top: 24px; }

.field { display: grid; gap: 7px; min-width: 0; }

.field__label { font-size: 13px; font-weight: 600; }

.input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #FFFEFC;
  font-size: 16px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder { color: #9A9285; }
.input:focus { outline: none; border-color: var(--charcoal); box-shadow: 0 0 0 3px rgba(37, 36, 33, .08); }
.input[aria-invalid="true"] { border-color: var(--brick); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(155, 58, 44, .12); }

.input--sm { height: 44px; font-size: 15px; padding: 0 12px; }

.input--postcode {
  height: 60px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.input--postcode::placeholder { letter-spacing: .08em; font-weight: 500; }

.textarea {
  height: auto;
  min-height: 140px;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

.field__meta {
  display: flex;
  justify-content: flex-end;
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.field__error {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 220ms var(--ease-out);
}

.field__error > span {
  min-height: 0;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--brick);
  opacity: 0;
  transition: opacity 160ms ease;
}

.field__error.is-visible { grid-template-rows: 1fr; }
.field__error.is-visible > span { opacity: 1; }

/* Segmented control with a sliding thumb */

.seg {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: var(--r);
  background: var(--tint);
}

.seg__thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px - (var(--n) - 1) * 4px) / var(--n));
  border-radius: 9px;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(37, 36, 33, .08), 0 2px 8px rgba(37, 36, 33, .06);
  transform: translateX(calc(var(--idx, 0) * (100% + 4px)));
  transition: transform 300ms var(--ease-out), opacity 150ms ease;
}

.seg[data-empty] .seg__thumb { opacity: 0; }

.seg label {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 40px;
  padding: 6px 4px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  text-align: center;
  color: var(--ink-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 200ms ease;
}

.seg label:has(input:checked) { color: var(--ink); font-weight: 600; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--charcoal); outline-offset: 0; }

/* Photo drop zone */

.drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 16px 18px;
  border: 1.5px dashed rgba(169, 154, 134, .9);
  border-radius: var(--r);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms var(--ease-out);
}

.drop:active { transform: scale(.99); }
.drop.is-over { background: var(--tint); border-color: var(--charcoal); }
.drop:has(input:focus-visible) { outline: 2px solid var(--charcoal); outline-offset: 2px; }

@media (hover: hover) and (pointer: fine) {
  .drop:hover { background: var(--tint); }
}

.drop__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--tint-2);
}

.drop__title { display: block; font-size: 14.5px; font-weight: 600; }
.drop__sub { display: block; font-size: 12.5px; color: var(--ink-2); }

.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.thumbs:empty { display: none; }

.thumb {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 10px;
  background: var(--tint);
  animation: pop 280ms var(--ease-out) both;
}

.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.thumb button {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(37, 36, 33, .72);
  color: var(--ivory);
  transition: transform 160ms var(--ease-out), background-color 150ms ease;
}

.thumb button:active { transform: scale(.9); }
.thumb button:focus-visible { outline: 2px solid var(--ivory); outline-offset: 1px; }

.thumb.is-leaving { animation: none; opacity: 0; transform: scale(.94); transition: opacity 150ms ease, transform 150ms ease; }

/* Postcode status */

.pc-status {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 260ms var(--ease-out);
}

.pc-status.is-visible { grid-template-rows: 1fr; }

.pc-status__inner { min-height: 0; overflow: hidden; }

.pc-status__box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--r);
  font-size: 14px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 200ms ease, transform 260ms var(--ease-out), background-color 200ms ease, color 200ms ease;
}

.pc-status.is-visible .pc-status__box { opacity: 1; transform: none; }
.pc-status[data-tone="in"] .pc-status__box { background: var(--olive-tint); color: var(--olive); }
.pc-status[data-tone="out"] .pc-status__box { background: var(--tint); color: var(--ink-2); }
.pc-status[data-tone="bad"] .pc-status__box { background: rgba(155, 58, 44, .07); color: var(--brick); }
.pc-status__box strong { display: block; color: inherit; font-weight: 700; }
.pc-status__box svg { flex: none; margin-top: 1px; }

/* ---------- Summary list ---------- */

.summary { list-style: none; margin: 0; padding: 0; }

.summary li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.summary li.is-new { animation: rise 320ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); }

.summary__k {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.summary__v {
  grid-column: 1;
  font-size: 14px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.summary__edit {
  grid-column: 2;
  grid-row: 1 / 3;
  padding: 6px 2px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: var(--taupe);
  text-underline-offset: 3px;
  transition: opacity 150ms ease, color 150ms ease;
}

.summary__edit:focus-visible { outline: 2px solid var(--charcoal); outline-offset: 2px; border-radius: 4px; opacity: 1; }

@media (hover: hover) and (pointer: fine) {
  .summary__edit { opacity: 0; }
  .summary li:hover .summary__edit { opacity: 1; }
  .summary__edit:hover { color: var(--ink); }
}

.summary__empty {
  font-size: 13.5px;
  color: var(--ink-3);
}

/* ---------- Aside ---------- */

.aside .overline { margin-bottom: 14px; flex: none; }

.aside .summary {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--stone) transparent;
}

/* Compact rows: label left, answer right */
.aside .summary li {
  grid-template-columns: 84px minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 10px;
  padding: 9px 0;
}

.aside .summary__k { grid-column: 1; grid-row: 1; font-size: 10px; }
.aside .summary__v { grid-column: 2; grid-row: 1; font-size: 13.5px; line-height: 1.4; }
.aside .summary__edit { grid-column: 3; grid-row: 1; padding: 0 2px; font-size: 12px; }

.aside__price {
  position: relative;
  flex: none;
  margin-bottom: 14px;
  padding: 26px 22px 20px;
  border-radius: 16px;
  background: var(--charcoal);
  color: var(--ivory);
}

.aside__price::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 22px;
  width: 22px;
  height: 1.5px;
  background: var(--ivory);
  opacity: .8;
}

.aside__price[hidden] { display: none; }

.aside__price-label {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--stone);
}

.aside__price-value {
  display: block;
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}

.aside__price-value.is-empty { color: var(--stone); font-family: var(--font-body); font-size: 13px; padding: 8px 0 2px; }

.aside__note { margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--stone); }

.aside__values {
  flex: none;
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--taupe);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink-2);
}

.aside__included {
  flex: none;
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

/* Standard-inclusion note under a question */

.note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 22px 0 0;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--olive-tint);
  color: var(--olive);
  font-size: 13.5px;
  line-height: 1.45;
}

.note svg { flex: none; margin-top: 2px; }
.note strong { font-weight: 700; }

/* ---------- Confirmation ---------- */

.done__mark { width: 56px; height: 56px; margin-bottom: 20px; color: var(--charcoal); }

.done__mark circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: draw 700ms var(--ease-out) 80ms forwards;
}

.done__mark path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 34;
  stroke-dashoffset: 34;
  animation: draw 420ms var(--ease-out) 460ms forwards;
}

@keyframes draw { to { stroke-dashoffset: 0; } }

.ref {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 24px 0 0;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
}

.ref > div { padding: 14px 16px; }
.ref > div + div { border-left: 1px solid var(--line-strong); }

.ref dt {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.ref dd {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}

.fine { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-2); }

.sub-h {
  margin: 30px 0 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
}

.timeline { list-style: none; margin: 16px 0 0; padding: 0; counter-reset: t; }

.timeline li {
  position: relative;
  padding: 0 0 18px 42px;
  counter-increment: t;
}

.timeline li::before {
  content: counter(t);
  position: absolute;
  left: 0;
  top: -1px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--taupe);
  background: var(--paper);
  font-size: 12px;
  font-weight: 700;
}

.timeline li::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 29px;
  bottom: 3px;
  width: 1px;
  background: var(--line-strong);
}

.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline strong { display: block; font-size: 14.5px; }
.timeline span { display: block; font-size: 13.5px; color: var(--ink-2); }

.done__project { margin-top: 30px; }
.done__project .summary li { padding: 9px 0; }

.done__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.done__actions .btn { flex: 1 1 180px; }

/* ---------- Dialog ---------- */

.dialog {
  width: min(420px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.dialog::backdrop {
  background: rgba(37, 36, 33, .34);
  opacity: 0;
  transition: opacity 200ms ease;
}

.dialog.is-open::backdrop { opacity: 1; }

.dialog__panel {
  padding: 26px 24px 18px;
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 30px 70px -24px rgba(37, 36, 33, .45);
  opacity: 0;
  transform: scale(.96);
  transition: opacity 200ms var(--ease-out), transform 240ms var(--ease-out);
}

.dialog.is-open .dialog__panel { opacity: 1; transform: none; }
.dialog.is-closing .dialog__panel { transition-duration: 140ms; }
.dialog.is-closing::backdrop { transition-duration: 140ms; }

.dialog__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.15;
}

.dialog__body { margin: 10px 0 0; font-size: 14.5px; color: var(--ink-2); }

.dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}

/* ---------- Motion ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } }
@keyframes fade { from { opacity: 0; } }

.step.is-entering .stagger {
  animation: rise 420ms var(--ease-out) both;
  animation-delay: calc(40ms + var(--i, 0) * 32ms);
}

/* ---------- Small screens: the card becomes the page ---------- */

@media (max-width: 640px) {
  body { height: 100dvh; min-height: 0; }
  .topbar { padding: 14px 16px 12px; }
  .topbar__tag { display: none; }
  .wordmark__name { font-size: 19px; }
  .wordmark__sub { font-size: 11px; }
  .layout { display: flex; flex-direction: column; min-height: 0; padding: 0; }
  .card {
    flex: 1;
    height: auto;
    min-height: 0;
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    box-shadow: 0 -1px 0 var(--line);
  }
  .card__head { padding: 8px 8px 8px; }
  .progress { margin: 0 16px; }
  .estimate__toggle { padding: 11px 16px; }
  .estimate__drawer .summary { padding: 0 16px; }
  .estimate__note { padding: 10px 16px 14px; }
  .card__body { padding: 24px 16px 28px; }
  .card__foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .signoff { display: none; }
  .tiles { gap: 10px; }
  .tile__text { padding: 10px 12px 12px; }
  .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview__floor { aspect-ratio: 2.2 / 1; }
  .preview__cap { left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 6px 10px 7px; }
  .preview__name { font-size: 13.5px; }
  .preview__spec { font-size: 11.5px; }
  .area__num { font-size: 52px; }
  .area__compare { text-align: left; max-width: none; }
  .calc__row { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto 36px; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .step.is-entering .stagger,
  .summary li.is-new,
  .calc__row.is-new,
  .thumb { animation-name: fade; animation-duration: 200ms; }
  .progress__fill { transition-duration: 200ms; transition-timing-function: ease; }
  .opt:active, .tile:active, .sw:active, .btn:active, .chip-wrap:has(.chip:active), .pill:active, .drop:active { transform: none; }
  .tile__swatch svg { transition: none; }
  .dialog__panel { transform: none; }
  .pc-status__box { transform: none; }
  .request, .request__inner { transition: none; }
}

/* ---------- Print: a clean copy of the confirmation ---------- */

@media print {
  body { background: #fff; display: block; }
  .topbar__tag, .topbar__phone, .aside, .signoff, .card__head, .progress, .estimate, .card__foot, .done__actions, .dialog { display: none !important; }
  .layout { display: block; padding: 0; }
  .card { height: auto; min-height: 0; border: 0; box-shadow: none; overflow: visible; }
  .card__body { overflow: visible; padding: 16px 0; }
  .summary__edit { display: none; }
}
