/* ═══════════════════════════════════════════════════════
   Pelham Joinery — Configurator v4 CSS
   Served from public/ to bypass Tailwind processing

   LAYOUT-ONLY overrides. Buttons, labels, inputs, and
   typography now come from globals.css (.btn, .label,
   .form input, .cs-filter-btn).
   ═══════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════
   CONFIGURATOR WRAPPER (matches index.html)
   ═══════════════════════════════════════ */
.configurator {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 2.5rem;
  margin-top: 2rem;
}


/* ═══════════════════════════════════════
   ROOT
   ═══════════════════════════════════════ */
.cfg-root {
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}


/* ═══════════════════════════════════════
   STEPPER
   ═══════════════════════════════════════ */
.cfg-stepper {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 2.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cfg-stepper__step {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.8rem 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  white-space: nowrap;
  transition: color 0.2s;
  position: relative;
}

.cfg-stepper__step::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: transparent;
  transition: background 0.2s;
}

.cfg-stepper__step:hover {
  color: var(--navy);
}

.cfg-stepper__step--active {
  color: var(--navy);
}
.cfg-stepper__step--active::after {
  background: var(--navy);
}

.cfg-stepper__step--done {
  color: var(--gold);
}
.cfg-stepper__step--done::after {
  background: var(--gold);
}

.cfg-stepper__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-light);
  flex-shrink: 0;
  transition: all 0.2s;
}

/* The digit's box trimmed to the digit itself (cap height to baseline), so the flex centring centres the ink: a
   font's line box has the baseline where its metrics say, and Gill Sans's leaves a digit 2 px above the circle's
   centre; and no tracking, which the step's uppercase letter-spacing adds after the one glyph and pulls it left
   (William, 3 Nov 2026: "the numbers aren't symmetrical with the round buttons"). A browser without text-box
   trimming draws it as before. */
.cfg-stepper__glyph {
  display: block;
  letter-spacing: 0;
  text-box-trim: trim-both;
  text-box-edge: cap alphabetic;
}

.cfg-stepper__tick {
  display: block;
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cfg-stepper__step--active .cfg-stepper__number {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
}

.cfg-stepper__step--done .cfg-stepper__number {
  background: var(--gold);
  border-color: var(--gold);
  color: white;
}

.cfg-stepper__label {
  display: inline;
}


/* ═══════════════════════════════════════
   STEP BODY
   ═══════════════════════════════════════ */
.cfg-body {
  min-height: 400px;
}

.cfg-step {
  animation: cfgFadeIn 0.3s ease;
}

@keyframes cfgFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cfg-step-title {
  font-family: inherit;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 0.5rem;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.cfg-step-sub {
  font-size: 0.92rem;
  color: var(--text-mid);
  margin: 0 0 2rem;
  line-height: 1.6;
}


/* ═══════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════ */
.cfg-section {
  margin-bottom: 2.5rem;
}

/* Optional tag — unique to configurator */
.cfg-opt-tag {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-light);
  font-size: 0.875rem;
}


/* ═══════════════════════════════════════
   CARD GRIDS
   ═══════════════════════════════════════ */
.cfg-card-grid {
  display: grid;
  gap: 0.75rem;
}
.cfg-card-grid--2col { grid-template-columns: repeat(2, 1fr); }
.cfg-card-grid--3col { grid-template-columns: repeat(3, 1fr); }
.cfg-card-grid--4col { grid-template-columns: repeat(4, 1fr); }
.cfg-card-grid--5col { grid-template-columns: repeat(5, 1fr); }


/* ═══════════════════════════════════════
   CARDS
   ═══════════════════════════════════════ */
.cfg-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
  padding: 1rem 0.75rem;
  background: var(--white);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.cfg-card:hover {
  border-color: rgba(14, 34, 65, 0.35);
  background: rgba(14, 34, 65, 0.02);
}

.cfg-card--selected {
  border-color: var(--navy);
  background: rgba(14, 34, 65, 0.04);
}

.cfg-card--large {
  padding: 1.8rem 1.2rem;
}

.cfg-card--skip {
  border-style: dashed;
  opacity: 0.65;
}

.cfg-card--skip:hover,
.cfg-card--skip.cfg-card--selected {
  opacity: 1;
}

.cfg-card__icon {
  width: 40px;
  height: 40px;
  color: var(--navy);
  margin-bottom: 0.2rem;
}

.cfg-card__icon--grid {
  width: 36px;
  height: 48px;
}

.cfg-card__icon--profile {
  /* sections and swatches (48x32 viewBox): the same 40px height as the elevation icons */
  width: 60px;
  height: 40px;
}

.cfg-card__icon svg {
  width: 100%;
  height: 100%;
}

.cfg-card__swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.cfg-card__label {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy);
}

.cfg-card__caption {
  font-size: 0.875rem;
  color: var(--text-mid);
  line-height: 1.35;
}

.cfg-card__desc {
  font-size: 0.875rem;
  color: var(--text-mid);
  line-height: 1.35;
}

.cfg-card__badge {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--gold-ink);
  /* the wash over white, so a render behind the badge never shows through */
  background: linear-gradient(var(--gold-wash), var(--gold-wash)), var(--white);
  border: 1px solid var(--gold-line);
  border-radius: 2px;
  padding: 0.15rem 0.5rem;
  line-height: 1.3;
  white-space: nowrap;
}

.cfg-card__link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gold-ink, #8A6A22);
  text-decoration: none;
  transition: color 0.2s;
  margin-top: 0.15rem;
}

.cfg-card__link:hover {
  color: var(--navy);
  text-decoration: underline;
}


/* ═══════════════════════════════════════
   SWATCH CARDS (compact — ironmongery etc.)
   ═══════════════════════════════════════ */
.cfg-swatch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.cfg-swatch-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--white);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.cfg-swatch-card:hover {
  border-color: rgba(14, 34, 65, 0.35);
}

.cfg-swatch-card--selected {
  border-color: var(--navy);
  background: rgba(14, 34, 65, 0.04);
}

.cfg-swatch-card--skip {
  border-style: dashed;
  opacity: 0.65;
}

.cfg-swatch-card--skip:hover,
.cfg-swatch-card--skip.cfg-swatch-card--selected {
  opacity: 1;
}

.cfg-swatch-card__dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.cfg-swatch-card__label {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}

/* Library swatches (William, 29 Oct 2026: "add proper metal finishes and their library swatches"): each ironmongery finish as a
   sphere drawn in the model's own studio, its name under it, as the pH Suite catalogue shows its finishes. */
.cfg-swatch-card--sphere {
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.4rem;
  width: 96px;
  padding: 0.65rem 0.4rem 0.55rem;
}

.cfg-swatch-card__sphere {
  display: block;
  width: 56px;
  height: 56px;
}

.cfg-swatch-card--sphere .cfg-swatch-card__dot {
  width: 56px;
  height: 56px;
  border: 1px dashed rgba(14, 34, 65, 0.35);
}

/* A stain on the timber chosen: the timber's swatch with the stain's tone multiplied over it (lib/stains `stainCss`). */
.cfg-swatch-card__chip {
  display: block;
  width: 56px;
  height: 56px;
  background-size: cover;
  background-blend-mode: multiply;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* How a timber is usually finished, a quiet line under its name. */
.cfg-card__note {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: var(--text-light, #6D6961);
  letter-spacing: 0.01em;
}

/* A timber's card: a square of its own scan in place of the drawn icon. */
.cfg-card__swatch {
  display: block;
  width: 88px;
  height: 88px;
  margin: 0 auto 0.5rem;
  object-fit: cover;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.cfg-swatch-card--sphere .cfg-swatch-card__label {
  white-space: normal;
  text-align: center;
  line-height: 1.25;
}


/* ═══════════════════════════════════════
   CHECKBOX ROW
   ═══════════════════════════════════════ */
.cfg-checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cfg-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: var(--white);
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color 0.2s;
}

.cfg-checkbox:hover {
  border-color: var(--navy);
}

.cfg-checkbox--checked {
  border-color: var(--navy);
  background: rgba(14, 34, 65, 0.04);
}

.cfg-checkbox__box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--navy);
  flex-shrink: 0;
}

.cfg-checkbox--checked .cfg-checkbox__box {
  border-color: var(--navy);
  background: var(--navy);
  color: white;
}


/* ═══════════════════════════════════════
   DIMENSIONS LAYOUT
   ═══════════════════════════════════════ */
.cfg-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cfg-dim-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cfg-dim-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cfg-dim-row__index {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-light);
  padding-bottom: 0.7rem;
  min-width: 1.5rem;
}

.cfg-dim-row__x {
  font-size: 0.92rem;
  color: var(--text-light);
  padding-bottom: 0.55rem;
}

.cfg-dim-row__field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cfg-dim-row__field--qty {
  max-width: 70px;
}

.cfg-dim-row__field--label {
  flex: 1;
  min-width: 120px;
}

/* Override .form input margin-bottom inside dimension rows */
.cfg-dim-row .form input,
.cfg-dim-row .form label {
  margin-bottom: 0;
}

/* The Arch row (2 Nov 2026): a rise of the customer's own under its cards, and the line that every arch is templated on site. */
.cfg-arch-rise {
  margin-top: 1rem;
}

.cfg-arch-rise .cfg-dim-row__field {
  max-width: 160px;
}

.cfg-arch-rise__range {
  font-size: 0.875rem;
  color: var(--text-mid);
  padding-bottom: 0.7rem;
}

.cfg-size-limits {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-mid);
}

.cfg-arch-note {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-mid);
}


/* ═══════════════════════════════════════
   COLOUR FIELDS LAYOUT
   ═══════════════════════════════════════ */
.cfg-colour-fields {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.cfg-colour-field {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Override .form input margin-bottom inside colour fields */
.cfg-colour-field.form input,
.cfg-colour-field.form label {
  margin-bottom: 0;
}

/* The paint colour picker (25 Oct 2026, task 8D): RAL swatches, "any other colour", and what is chosen. */
.cfg-section--colour { display: grid; gap: 1.75rem; }
.cfg-colour { display: grid; gap: 0.75rem; }
.cfg-colour .label { margin-bottom: 0; }
.cfg-colour__swatches { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.5rem; }
.cfg-colour__swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.6rem 0.3rem 0.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.cfg-colour__swatch:hover { border-color: rgba(14, 34, 65, 0.35); }
.cfg-colour__swatch--selected { border-color: var(--navy); background: rgba(14, 34, 65, 0.04); }
.cfg-colour__chip {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
/* The "any other colour" chip: a wheel of the chart, so it reads as "more colours" and not as one. */
.cfg-colour__chip--other { background: conic-gradient(#F1ECE1, #CBD0CC, #383E42, #27352A, #6C7C98, #5E2028, #E6D2B5, #F1ECE1); }
.cfg-colour__name { font-size: 0.82rem; font-weight: 700; line-height: 1.2; text-align: center; color: var(--navy); }
.cfg-colour__ral { font-size: 0.82rem; line-height: 1.2; text-align: center; color: var(--text-mid); }
.cfg-colour__other { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; padding: 0.9rem 1rem; background: var(--white); border: 1px solid var(--border); }
.cfg-colour__pick { flex: 0 0 auto; min-width: 0; }
.cfg-colour__pick input[type="color"] {
  width: 56px;
  height: 42px;
  padding: 0.15rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: var(--white);
  cursor: pointer;
}
.cfg-colour__chosen { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-size: 0.9rem; color: var(--text); }
.cfg-colour__dot { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.12); }
.cfg-colour__hint { color: var(--text-mid); }
.cfg-colour__note { margin: 0; font-size: 0.875rem; line-height: 1.5; color: var(--text-mid); }
@media (max-width: 720px) { .cfg-colour__swatches { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 420px) { .cfg-colour__swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); } }


/* ═══════════════════════════════════════
   UNIQUE CONFIGURATOR BUTTONS
   (icon × and danger — no global equivalent)
   ═══════════════════════════════════════ */
.cfg-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 0.9rem;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.3s ease;
}

.cfg-danger {
  color: var(--error-dark);
  border-color: rgba(197, 48, 48, 0.15);
}
.cfg-danger:hover {
  background: var(--error-bg);
  border-color: var(--error-dark);
}

/* Disabled state for global .btn inside configurator */
.cfg-nav .btn:disabled,
.cfg-quote-form .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}


/* ═══════════════════════════════════════
   NAVIGATION BAR
   ═══════════════════════════════════════ */
.cfg-nav {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.cfg-nav .btn-outline {
  margin-right: auto;
}


/* ═══════════════════════════════════════
   SUMMARY — Compact collapsible spec cards
   ═══════════════════════════════════════ */
.cfg-spec-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

/* Expand / Collapse all controls */
.cfg-spec-list__controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  justify-content: flex-end;
}

.cfg-spec-list__toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-light);
  padding: 0;
  transition: color 0.2s;
}

.cfg-spec-list__toggle:hover {
  color: var(--navy);
}

.cfg-spec-list__sep {
  color: var(--border);
  font-size: 0.875rem;
}

/* Single spec card row */
.cfg-spec-card {
  border-bottom: 1px solid var(--border);
}

.cfg-spec-card:last-child {
  border-bottom: none;
}

.cfg-spec-card--current .cfg-spec-card__header {
  background: rgba(14, 34, 65, 0.03);
}

/* Clickable header row */
.cfg-spec-card__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  min-height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s;
}

.cfg-spec-card__header:hover {
  background: rgba(14, 34, 65, 0.02);
}

.cfg-spec-card__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--text-light);
  flex-shrink: 0;
}

.cfg-spec-card--current .cfg-spec-card__index {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
  font-size: 0.58rem;
}

.cfg-spec-card__title {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
  /* A long name ("Two lights over boarding front door") wraps inside the card on a tablet or a narrow window; nowrap ran it
     out past the card's edge and under the model (William, 18 Nov 2026). */
  min-width: 0;
  text-align: left;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.cfg-spec-card__subtitle {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  color: var(--text-mid);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1;
}

.cfg-spec-card__chevron {
  color: var(--text-light);
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

/* Expanded body */
.cfg-spec-card__body {
  padding: 0.25rem 1rem 0.85rem 3rem;
  animation: cfgFadeIn 0.15s ease;
}

.cfg-spec-card__specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
}

.cfg-spec-card__tag {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.5;
}

.cfg-spec-card__tag-label {
  font-weight: 600;
  color: var(--navy);
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

/* Separator dot between tags */
.cfg-spec-card__tag + .cfg-spec-card__tag::before {
  content: '·';
  margin-right: 0.6rem;
  color: var(--border);
}

.cfg-spec-card__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
}


/* ═══════════════════════════════════════
   ADD PRODUCT BUTTON (dashed, full-width)
   ═══════════════════════════════════════ */
.cfg-add-product-btn {
  display: block;
  width: 100%;
  padding: 0.7rem 1rem;
  margin-top: 0.5rem;
  background: none;
  border: 1.5px dashed var(--border);
  color: var(--text-mid);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.cfg-add-product-btn:hover {
  border-color: var(--navy);
  color: var(--navy);
}

/* ═══════════════════════════════════════
   ADD A SURROUND (a front door's optional extra, folded shut; 18 Nov 2026)
   ═══════════════════════════════════════ */
.cfg-surround {
  margin: 1.5rem 0 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--cfg-r, 0);
  background: var(--white);
}
.cfg-surround__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.75rem;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  color: var(--navy);
  text-align: left;
  cursor: pointer;
}
.cfg-surround__title { flex: 1 1 auto; font-size: 1rem; font-weight: 600; letter-spacing: 0.02em; }
/* The surround chosen, on a line of its own under the heading: the column is too narrow for both side by side. */
.cfg-surround__chosen { order: 3; flex: 1 0 100%; font-size: 0.9rem; color: var(--text-mid); }
.cfg-surround__chevron { flex: none; color: var(--text-mid); }
.cfg-surround__sub { margin: 0.35rem 0 0; max-width: 520px; font-size: 0.95rem; line-height: 1.55; color: var(--text-mid); }
.cfg-surround__pictured {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  margin: 0.85rem 0 0;
  padding: 0.7rem 0.9rem;
  border-radius: var(--cfg-r-sm, 0);
  background: var(--off-white, #f8f7f5);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--navy);
}
.cfg-surround__add {
  flex: none;
  padding: calc(0.4rem + 0.1em) 1.1rem calc(0.4rem - 0.1em);
  border: 1px solid var(--navy);
  border-radius: 999px;
  background: var(--navy);
  color: var(--white);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cfg-surround__add:hover { background: var(--white); color: var(--navy); }
.cfg-surround__body { margin-top: 1.25rem; }
.cfg-surround__body .cfg-section { margin-bottom: 0.25rem; }
@media (max-width: 640px) {
  .cfg-surround { padding: 0.9rem 1rem; }
}

/* ═══════════════════════════════════════
   SERVICE PLAN UPSELL
   ═══════════════════════════════════════ */
.cfg-service-upsell {
  margin: 1.5rem 0;
  padding: 1.5rem;
  border: 1px solid var(--border);
  background: var(--off-white, #f8f7f5);
}

.cfg-service-upsell__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.cfg-service-upsell__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.02em;
  margin-bottom: 0.3rem;
}

.cfg-service-upsell__sub {
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 1.55;
  max-width: 480px;
}

.cfg-service-upsell__dismiss {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-light);
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}
.cfg-service-upsell__dismiss:hover { color: var(--navy); }

/* One plan to a row (18 Nov 2026): the column is too narrow for three side by side, and the third ran out of the box. */
.cfg-service-upsell__options {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
}

.cfg-service-upsell__option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 1rem;
  row-gap: 0.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  background: var(--white, #fff);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s;
  min-width: 0;
}
.cfg-service-upsell__option:hover { border-color: var(--navy); }
.cfg-service-upsell__option--selected {
  border-color: var(--navy);
  background: rgba(14, 34, 65, 0.03);
}
.cfg-service-upsell__option--ineligible {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f9f9f8;
}
.cfg-service-upsell__option--ineligible:hover { border-color: var(--border); }

.cfg-service-upsell__plan-lock {
  grid-column: 1 / -1;
  justify-self: start;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--gold-ink);
  /* the wash over white, so a render behind the badge never shows through */
  background: linear-gradient(var(--gold-wash), var(--gold-wash)), var(--white);
  border: 1px solid var(--gold-line);
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
}

.cfg-service-upsell__plan-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.02em;
}

.cfg-service-upsell__plan-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  white-space: nowrap;
}
.cfg-service-upsell__plan-price span {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-mid);
}

.cfg-service-upsell__plan-desc {
  grid-column: 1 / -1;
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 1.5;
}

.cfg-service-upsell__note {
  font-size: 0.9rem;
  color: var(--text-mid);
  margin-top: 0.8rem;
  line-height: 1.5;
}

@media (max-width: 700px) {
  .cfg-service-upsell { padding: 1rem; }
}

/* ═══════════════════════════════════════
   SUMMARY ACTIONS & ESTIMATE NOTE
   ═══════════════════════════════════════ */
.cfg-summary-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

.cfg-estimate-note {
  background: var(--subtle-bg);
  border-left: 3px solid var(--gold);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.cfg-estimate-note p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.6;
}


/* ═══════════════════════════════════════
   QUOTE / ESTIMATE FORM LAYOUT
   ═══════════════════════════════════════ */
.cfg-quote-form {
  border: 1px solid var(--border);
  padding: 2rem;
  background: var(--off-white);
  /* The form sits in a column beside the model at a desk, so it lays out by its own width, not the window's. */
  container-type: inline-size;
}

.cfg-quote-form__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem 1.5rem;
  margin-top: 1.5rem;
}

/* What Send still waits for, beside the greyed-out button. */
.cfg-quote-form__needs {
  margin: 0;
  margin-right: auto;
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.5;
}

/* The rows below the details (message, photos) sit at one spacing. */
.cfg-quote-form__row {
  margin-top: 1.5rem;
}
.cfg-quote-form__row.form label {
  display: block;
  margin-bottom: 0.4rem;
}
.cfg-quote-form__row.form textarea {
  margin-bottom: 0;
}

.cfg-quote-form__title {
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 1.5rem;
  letter-spacing: 0.02em;
}

/* Name and email, then phone and postcode: two columns wide enough to show what is typed (three cut "Your full name" short). */
.cfg-quote-form__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.5rem;
}

.cfg-quote-form__field.form input {
  width: 100%;
  min-width: 0;
}

.cfg-quote-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Override .form input margin-bottom inside quote form fields */
.cfg-quote-form__field.form input,
.cfg-quote-form__field.form label {
  margin-bottom: 0;
}

/* Narrow (a phone, or the column beside the model): one field a row, and the line about what is missing above a
   full-width Send. After the rules above, so it wins over them. */
@container (max-width: 34rem) {
  .cfg-quote-form__fields {
    grid-template-columns: 1fr;
  }
  .cfg-quote-form__footer {
    flex-direction: column;
    align-items: stretch;
  }
  .cfg-quote-form__needs {
    margin-right: 0;
  }
  .cfg-quote-form__footer .btn {
    width: 100%;
  }
}


/* ═══════════════════════════════════════
   STEP CONTENT / SECTION GROUPS
   (Used in GlazingStep / HardwareStep)
   ═══════════════════════════════════════ */
.cfg-step-content {
  animation: cfgFadeIn 0.3s ease;
}

.cfg-section-group {
  margin-bottom: 2rem;
}

.cfg-group-label {
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin: 0 0 1rem;
}

.cfg-info-bar {
  padding: 0.8rem 1rem;
  background: var(--subtle-bg);
  font-size: 0.875rem;
  color: var(--text-mid);
  line-height: 1.5;
}

.cfg-info-bar p { margin: 0; }
.cfg-info-bar strong { color: var(--navy); font-weight: 600; }

.cfg-info-bar--muted {
  border-left: 3px solid var(--gold);
}


/* ═══════════════════════════════════════
   OPTION CARD (CfgCardGrid generic)
   ═══════════════════════════════════════ */
.cfg-option-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  padding: 1.5rem 1.2rem;
  background: var(--white);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.cfg-option-card:hover {
  border-color: rgba(14, 34, 65, 0.35);
  background: rgba(14, 34, 65, 0.02);
}

.cfg-option-card--selected {
  border-color: var(--navy);
  background: rgba(14, 34, 65, 0.04);
}

.cfg-option-card__swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.cfg-option-card__icon {
  width: 48px;
  height: 48px;
  color: var(--navy);
  margin-bottom: 0.3rem;
}

.cfg-option-card__icon svg {
  width: 100%;
  height: 100%;
}

.cfg-option-card__label {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy);
}

.cfg-option-card__caption {
  font-size: 0.875rem;
  color: var(--text-mid);
  line-height: 1.4;
}

.cfg-option-card__desc {
  font-size: 0.875rem;
  color: var(--text-mid);
  line-height: 1.4;
}

.cfg-option-card__badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--gold-ink);
  /* the wash over white, so a render behind the badge never shows through */
  background: linear-gradient(var(--gold-wash), var(--gold-wash)), var(--white);
  border: 1px solid var(--gold-line);
  border-radius: 2px;
  padding: 0.15rem 0.5rem;
  line-height: 1.3;
  white-space: nowrap;
}

.cfg-option-card__link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gold-ink, #8A6A22);
  text-decoration: none;
  transition: color 0.2s;
  margin-top: 0.15rem;
}

.cfg-option-card__link:hover {
  color: var(--navy);
  text-decoration: underline;
}

.cfg-option-card__check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.73rem;
  line-height: 1;
  pointer-events: none;
}


/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 960px) {
  .configurator {
    padding: 1.5rem;
  }
  .cfg-card-grid--3col {
    grid-template-columns: repeat(2, 1fr);
  }
  .cfg-stepper__step {
    font-size: 0.82rem;
    padding: 0.6rem 0.3rem;
  }
}

@media (max-width: 640px) {
  .cfg-card-grid--3col,
  .cfg-card-grid--4col,
  .cfg-card-grid--5col {
    grid-template-columns: repeat(2, 1fr);
  }
  .cfg-quote-form__fields {
    grid-template-columns: 1fr;
  }
  .cfg-quote-form {
    padding: 1.25rem;
  }
  .cfg-stepper {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .cfg-stepper::-webkit-scrollbar { display: none; }
  .cfg-stepper__label {
    display: none;
  }
  .cfg-stepper__step {
    flex: 0 0 auto;
    min-width: 70px;
    min-height: 44px;
    justify-content: center;
    font-size: 0.82rem;
    padding: 0.7rem 0.4rem;
  }
  .cfg-stepper__number {
    width: 28px;
    height: 28px;
    font-size: 0.82rem;
  }
  .configurator {
    padding: 1.2rem;
  }
  .cfg-step-title {
    font-size: 1.1rem;
  }
  .cfg-card,
  .cfg-option-card {
    padding: 0.75rem 0.6rem;
  }
  .cfg-card--large {
    padding: 1.2rem 0.8rem;
  }
  .cfg-card__icon {
    width: 32px;
    height: 32px;
  }
  .cfg-card--large .cfg-card__icon {
    width: 38px;
    height: 38px;
  }
  .cfg-card__icon--grid {
    width: 28px;
    height: 38px;
  }
  .cfg-card__icon--profile {
    width: 48px;
    height: 32px;
  }
  .cfg-card__label {
    font-size: 0.875rem;
  }
  .cfg-card__caption,
  .cfg-card__desc {
    font-size: 0.875rem;
  }
  .cfg-dim-row {
    gap: 0.5rem;
  }
  .cfg-nav {
    flex-direction: column-reverse;
    gap: 0.8rem;
  }
  .cfg-nav .btn {
    width: 100%;
    min-height: 48px;
    font-size: 0.875rem;
    text-align: center;
  }
  .cfg-summary__row {
    flex-direction: column;
    gap: 0.3rem;
  }
  .cfg-summary__label {
    width: auto;
  }
  /* 16px prevents iOS zoom on focus */
  .form input,
  .form textarea {
    font-size: 16px;
  }
}

@media (max-width: 380px) {
  .configurator {
    padding: 0.75rem;
  }
  .cfg-step-title {
    font-size: 1rem;
  }
}

/* ─── The item as built, drawn on the summary card (6 Sep 2026) ─── */
.cfg-spec-card__drawing { display: inline-flex; width: 40px; height: 40px; flex: 0 0 40px; align-items: center; justify-content: center; color: var(--navy, #1B2F4A); margin-right: 2px; }
.cfg-spec-card__drawing svg { width: 40px; height: 40px; stroke: currentColor; }
.cfg-spec-card__section { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; color: var(--navy, #1B2F4A); }
.cfg-spec-card__section-drawing { display: inline-flex; width: 60px; height: 40px; flex: 0 0 60px; }
.cfg-spec-card__section-drawing svg { width: 60px; height: 40px; stroke: currentColor; }
.cfg-spec-card__section-label { font-size: 0.875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-light, #7A8290); }

/* ─── Cards that show YOUR item with the option applied, and the item as built so far (6 Sep 2026) ─── */
.cfg-card__icon--built { width: 48px; height: 48px; }
.cfg-card__icon--built svg { width: 48px; height: 48px; }
.cfg-built { display: flex; align-items: center; gap: 14px; margin: 0 0 1.25rem; padding: 10px 14px; border: 1px solid var(--border, #E3DED2); background: var(--off-white, #F7F5F0); color: var(--navy, #1B2F4A); }
.cfg-built__drawing { display: inline-flex; width: 72px; height: 72px; flex: 0 0 72px; }
.cfg-built__drawing svg { width: 72px; height: 72px; stroke: currentColor; }
.cfg-built__label { font-size: 0.875rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-light, #7A8290); }

/* ─── Carry on where you left off (6 Sep 2026) ─── */
.cfg-resume { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0 0 1.25rem; padding: 0.9rem 1.1rem; border: 1px solid var(--gold, #B8943E); background: var(--off-white, #F7F5F0); }
.cfg-resume__text { display: flex; flex-direction: column; gap: 2px; font-size: 0.92rem; color: var(--text-mid, #4B5563); }
.cfg-resume__text strong { color: var(--navy, #1B2F4A); font-size: 0.95rem; }
.cfg-resume__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.cfg-resume__actions .btn { padding: 0.55rem 1rem; font-size: 0.875rem; }

/* ─── Office mode (the workshop pack, Task 12): the band over the steps while the office builds a job's item and the saved line ─── */
.cfg-job { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0 0 1.25rem; padding: 0.9rem 1.1rem; border: 1px solid var(--navy, #1B2F4A); background: var(--off-white, #F7F5F0); }
.cfg-job--failed { border-color: #B91C1C; }
.cfg-job__text { margin: 0; font-size: 0.95rem; font-weight: 600; color: var(--navy, #1B2F4A); overflow-wrap: anywhere; }
.cfg-job .btn { padding: 0.55rem 1rem; font-size: 0.875rem; }
.cfg-job__saved { margin: 0.75rem 0 0; font-size: 0.9rem; font-weight: 600; color: var(--navy, #1B2F4A); }
.cfg-job__saved a { margin-left: 0.35rem; color: var(--navy, #1B2F4A); }


/* ═══════════════════════════════════════
   THE REFRESH (17 Nov 2026)
   William: "That beige colour is quite ugly somehow, and the interface feels a bit dated. Make it feel more
   modern and cool." Cool neutrals in place of the warm off-whites, the tool out of its box and wider, the
   stage larger with its tabs laid over it, soft corners. Scoped to .configurator and .section--cfg, so the
   rest of the site keeps its look.
   ═══════════════════════════════════════ */
.section--cfg .section-inner { max-width: 1360px; }
.page-hero:has(+ .section--cfg) { padding: 104px 2rem 0.5rem; border-bottom: 0; }
.page-hero:has(+ .section--cfg) h1 { font-size: clamp(1.5rem, 1.4vw + 1rem, 2.1rem); }
.page-hero:has(+ .section--cfg) p { margin-top: 0.4rem; font-size: 0.95rem; max-width: 640px; }
.section.section--cfg { padding-top: 1rem; }

.configurator {
  --off-white: #F4F5F7;
  --subtle-bg: #F4F5F7;
  --selected-bg: #EEF1F6;
  --border: rgba(14, 34, 65, 0.11);
  --cfg-r: 12px;
  --cfg-r-sm: 8px;
  background: none;
  border: 0;
  padding: 0;
  margin-top: 0.75rem;
}

/* The beta note: one quiet line, no block of colour. */
.configurator .cfg-beta { align-items: center; margin: 2rem 0 0; padding: 0.55rem 0.9rem; background: none; border: 1px solid var(--border); border-radius: var(--cfg-r); font-size: 0.875rem; line-height: 1.5; }
.configurator .cfg-beta__tag { margin-top: 0; border-radius: 999px; padding: 0.32rem 0.6rem 0.26rem; }

/* The steps as one track of pills. */
.configurator .cfg-stepper { gap: 2px; padding: 4px; margin-bottom: 1.5rem; border-bottom: 0; background: var(--off-white); border-radius: 999px; }
.configurator .cfg-stepper__step { border-radius: 999px; padding: 0.6rem 0.5rem; transition: color 0.2s, background 0.2s, box-shadow 0.2s; }
.configurator .cfg-stepper__step::after { display: none; }
.configurator .cfg-stepper__step:hover { background: rgba(14, 34, 65, 0.05); }
.configurator .cfg-stepper__step--active { background: var(--white); box-shadow: 0 1px 2px rgba(14, 34, 65, 0.1), 0 0 0 1px rgba(14, 34, 65, 0.06); }
.configurator .cfg-stepper__step--done { color: var(--navy); }
.configurator .cfg-stepper__step--done .cfg-stepper__number { background: rgba(14, 34, 65, 0.1); border-color: transparent; color: var(--navy); }

/* Cards, fields and buttons: soft corners, a ring when chosen. */
.configurator .cfg-card { border-radius: var(--cfg-r); transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, transform 0.15s; }
.configurator .cfg-card:hover { background: var(--white); border-color: rgba(14, 34, 65, 0.3); box-shadow: 0 6px 18px rgba(14, 34, 65, 0.07); transform: translateY(-1px); }
.configurator .cfg-card--selected, .configurator .cfg-card--selected:hover { background: var(--white); border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy), 0 6px 18px rgba(14, 34, 65, 0.08); }
/* Design & Quote is the one rounded place (William, 18 Nov 2026: square buttons across the site, rounder ones here). The
   scope is the section, not .configurator, so the project board's chips and the phone's full-screen stage are in it too. */
.section--cfg, .cfg-full { --r-btn: 999px; }
.configurator .btn { border-radius: 999px; }
.configurator :is(input[type="text"], input[type="number"], input[type="email"], input[type="tel"], textarea, select) { border-radius: var(--cfg-r-sm); }
.configurator .cfg-reach { background: var(--off-white); border: 0; border-radius: var(--cfg-r); }
.configurator .cfg-reach__verdict, .configurator .cfg-stage__rule { border-radius: 0 var(--cfg-r-sm) var(--cfg-r-sm) 0; }
.configurator :is(.cfg-resume, .cfg-job) { border-radius: var(--cfg-r); }
.configurator .cfg-nav { margin-top: 2rem; }

/* The stage: no frame of its own, the view large, the views' tabs laid over its top edge. */
.configurator .cfg-stage { padding: 0; border: 0; background: none; }
@media (max-width: 1023.98px) { .configurator .cfg-stage { position: relative; } }
.configurator .cfg-stage__view, .configurator .cfg-stage__icon { border-radius: 18px; }
.configurator .cfg-stage__sheet { border: 1px solid var(--border); border-radius: 18px; padding: 3.4rem 1.25rem 1.25rem; }
.configurator .cfg-stage__sheet:not(:first-child) { padding-top: 1.25rem; }
.configurator .cfg-stage__tabs { position: absolute; top: 12px; left: 12px; z-index: 2; gap: 2px; margin: 0; padding: 3px; background: rgba(255, 255, 255, 0.82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-radius: 999px; box-shadow: 0 1px 2px rgba(14, 34, 65, 0.08), 0 0 0 1px rgba(14, 34, 65, 0.06); }
.configurator .cfg-stage__tabs .cs-filter-btn { border: 0; border-radius: 999px; padding: calc(0.36rem + 0.13em) 0.9rem calc(0.36rem - 0.13em); font-size: 0.9rem; color: var(--text-mid); transition: background 0.15s, color 0.15s; }
.configurator .cfg-stage__tabs .cs-filter-btn:hover { color: var(--navy); background: rgba(14, 34, 65, 0.06); }
.configurator .cfg-stage__tabs .cs-filter-btn.active { background: var(--navy); color: var(--white); }
.configurator .cfg-stage__actions { gap: 0.4rem; margin-top: 0.7rem; }
.configurator .cfg-stage__actions .cs-filter-btn { border-radius: 999px; padding: calc(0.36rem + 0.13em) 0.85rem calc(0.36rem - 0.13em); font-size: 0.9rem; background: var(--white); color: var(--text-mid); transition: border-color 0.15s, color 0.15s, background 0.15s; }
.configurator .cfg-stage__actions .cs-filter-btn.active { background: var(--navy); color: var(--white); }
.configurator .cfg-viewer__hint { border-radius: 999px; background: rgba(255, 255, 255, 0.82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
@media (min-width: 1024px) {
  .configurator .cfg-root--stage { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); column-gap: 3rem; }
  .configurator .cfg-root--stage > .cfg-stage { top: 88px; max-height: calc(100vh - 96px); }
  .configurator .cfg-root--stage > .cfg-stage .cfg-stage__view { aspect-ratio: auto; height: min(760px, calc(100vh - 300px)); min-height: 360px; max-height: none; }
  .configurator .cfg-root--stage .cfg-stage__sheet:not(:only-child) svg { max-height: 44vh; }
}
.cfg-full { background: #F4F5F7; }

/* Before you start, now the postcode alone: one slim row, the question on the left and the box on the right. */
.configurator .cfg-reach { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 19rem); column-gap: 1.5rem; align-items: center; margin-bottom: 1.5rem; padding: 0.85rem 1.1rem; }
.configurator .cfg-reach > .label { grid-column: 1; }
.configurator .cfg-reach > .cfg-step-sub { grid-column: 1; margin: 0.15rem 0 0; }
.configurator .cfg-reach__grid { grid-column: 2; grid-row: 1 / span 2; display: block; }
.configurator .cfg-reach__verdict { grid-column: 1 / -1; margin-top: 0.75rem; }
@media (max-width: 640px) {
  .configurator .cfg-reach { grid-template-columns: minmax(0, 1fr); }
  .configurator .cfg-reach__grid { grid-column: 1; grid-row: auto; margin-top: 0.6rem; }
}

/* How to measure (Size step): a guide that opens in place. */
.cfg-measure { margin: 0 0 1.5rem; border: 1px solid var(--border); border-radius: var(--cfg-r, 0); background: var(--white); }
.cfg-measure > summary { display: flex; align-items: center; gap: 0.6rem; padding: 0.8rem 1rem; cursor: pointer; list-style: none; font-weight: 600; color: var(--navy); font-size: 0.95rem; }
.cfg-measure > summary::-webkit-details-marker { display: none; }
.cfg-measure > summary::before { content: ''; width: 18px; height: 18px; flex: none; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 16 16 3l5 5L8 21z'/%3E%3Cpath d='m7 12 2 2m1-5 2 2m1-5 2 2'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 16 16 3l5 5L8 21z'/%3E%3Cpath d='m7 12 2 2m1-5 2 2m1-5 2 2'/%3E%3C/svg%3E") center / contain no-repeat; }
.cfg-measure > summary::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform 0.2s; }
.cfg-measure[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.cfg-measure__body { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 1.25rem; align-items: start; padding: 0.25rem 1rem 1rem; }
.cfg-measure__diagram { width: 100%; height: auto; }
.cfg-measure__wall { fill: var(--off-white); stroke: none; }
.cfg-measure__opening { fill: var(--white); stroke: var(--navy); stroke-width: 1.5; }
.cfg-measure__w, .cfg-measure__h { fill: var(--navy); stroke: var(--navy); stroke-width: 1; }
.cfg-measure__h { fill: var(--gold-ink); stroke: var(--gold-ink); }
.cfg-measure__diag { fill: none; stroke: var(--text-light); stroke-width: 0.8; stroke-dasharray: 3 3; }
.cfg-measure__lead { margin: 0 0 0.6rem; font-size: 0.9rem; color: var(--text); }
.cfg-measure__steps { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.45rem; font-size: 0.9rem; line-height: 1.5; color: var(--text-mid); }
.cfg-measure__steps strong { color: var(--navy); font-weight: 600; }
.cfg-measure__foot { margin: 0.75rem 0 0; font-size: 0.875rem; color: var(--text-light); }
@media (max-width: 560px) { .cfg-measure__body { grid-template-columns: 1fr; } .cfg-measure__diagram { max-width: 160px; } }

/* A section broken into its details (lib/drawing/details): the head, the rails and the cill one under another at one scale, a break
   line where the plain run between them is left out; a horizontal section's jambs side by side the same way. */
.cfg-stage__details { display: flex; flex-direction: column; align-items: center; gap: 0; margin: 0 auto; max-width: 460px; }
.cfg-stage__detail { position: relative; width: 100%; margin: 0; padding: 0; }
.cfg-stage__sheet .cfg-stage__detail svg { display: block; width: 100%; height: auto; max-height: none; }
.cfg-stage__detail figcaption { position: absolute; top: 0.35rem; left: 0; margin: 0; padding: 0.2rem 0.55rem; border-radius: 999px; background: var(--off-white); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em; color: var(--navy); }
.cfg-stage__detail + .cfg-stage__detail { margin-top: 0.9rem; padding-top: 0.9rem; }
.cfg-stage__detail + .cfg-stage__detail::before { content: ''; position: absolute; top: -4px; left: 22%; right: 22%; height: 8px; background: linear-gradient(135deg, transparent 45%, var(--text-light) 45%, var(--text-light) 55%, transparent 55%) 0 0 / 10px 8px repeat-x, linear-gradient(45deg, transparent 45%, var(--text-light) 45%, var(--text-light) 55%, transparent 55%) 5px 0 / 10px 8px repeat-x; opacity: 0.55; }
.cfg-stage__details[data-run="across"] { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 1.5rem 1.75rem; max-width: none; }
.cfg-stage__details[data-run="across"] .cfg-stage__detail { width: auto; margin: 0; padding: 0 0 1.6rem; }
.cfg-stage__details[data-run="across"] .cfg-stage__detail::before { display: none; }
.cfg-stage__sheet .cfg-stage__details[data-run="across"] .cfg-stage__detail svg { width: auto; height: 230px; max-width: 100%; }
.cfg-stage__details[data-run="across"] .cfg-stage__detail figcaption { top: auto; bottom: 0; left: 50%; transform: translateX(-50%); white-space: nowrap; }
.configurator .cfg-root--stage .cfg-stage__sheet:not(:only-child) .cfg-stage__detail svg { max-height: none; }

/* A chosen card: one even navy line all round, 2 px, following the corner (the Continue strip that sat in its foot is gone:
   a card moves on at one click). */
.configurator .cfg-card--selected, .configurator .cfg-card--selected:hover,
.configurator .cfg-card--type.cfg-card--selected { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); background: var(--white); }

/* The address at the postcode (Yours step): a list to choose from, the choice as one line, or two boxes by hand. */
.cfg-address__note { margin: 0; font-size: 0.92rem; color: var(--text-mid); }
.cfg-address select { width: 100%; }
.cfg-address__chosen { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: var(--cfg-r-sm, 0); background: var(--off-white); font-size: 0.92rem; color: var(--text); }
.cfg-address__chosen strong { color: var(--navy); font-weight: 600; }
.cfg-address__change { flex: none; border: 0; background: none; padding: 0.25rem 0; font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--navy); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* The ironmongery packs (Finish step): each a full row, its words on the left and every piece in it pictured and named. */
.cfg-card-grid--packs { grid-template-columns: minmax(0, 1fr); }
.configurator .cfg-card--pack { align-items: stretch; text-align: left; gap: 0.9rem; padding: 1.1rem 1.1rem 1rem; }
.cfg-pack__head { display: flex; flex-direction: column; gap: 0.2rem; }
.cfg-pack__head .cfg-card__label { font-size: 1.02rem; }
.cfg-pack__pieces { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 0.6rem; }
.cfg-pack__piece { display: flex; flex-direction: column; min-width: 0; }
.cfg-pack__piece img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: var(--off-white); }
.cfg-pack__name { margin-top: 0.4rem; font-size: 0.875rem; font-weight: 600; line-height: 1.3; color: var(--navy); }
.cfg-pack__maker { font-size: 0.82rem; line-height: 1.3; color: var(--text-light); }
.configurator .cfg-card--pack .cfg-pack__adds, .configurator .cfg-card--pack .cfg-pack__finishes { margin: 0; justify-content: flex-start; }
/* Beside the stage the steps' column is narrow: cards with words in them take two across, never four slivers. */
@media (min-width: 1024px) {
  .configurator .cfg-root--stage .cfg-body :is(.cfg-card-grid--3col, .cfg-card-grid--4col, .cfg-card-grid--5col) { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

/* Piece by piece from the hardware range (Finish step): a slot's pieces in a row that scrolls sideways, the chosen one ringed. */
.cfg-pieces { margin: 0 0 1.1rem; }
.cfg-pieces__title { margin: 0 0 0.45rem; font-size: 0.9rem; font-weight: 600; color: var(--navy); }
.cfg-pieces__row { display: grid; grid-auto-flow: column; grid-auto-columns: 132px; gap: 0.6rem; overflow-x: auto; padding: 2px 2px 0.6rem; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.cfg-piece { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0.4rem 0.4rem 0.55rem; border: 1px solid var(--border); border-radius: var(--cfg-r, 0); background: var(--white); font: inherit; text-align: left; cursor: pointer; scroll-snap-align: start; transition: border-color 0.15s, box-shadow 0.15s; }
.cfg-piece:hover { border-color: rgba(14, 34, 65, 0.3); }
.cfg-piece--chosen, .cfg-piece--chosen:hover { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.cfg-piece img, .cfg-piece__blank { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: var(--off-white); }
.cfg-piece__blank { background: repeating-linear-gradient(135deg, var(--off-white) 0 8px, transparent 8px 16px); border: 1px dashed var(--border); }
.cfg-piece__name { margin-top: 0.4rem; font-size: 0.82rem; font-weight: 600; line-height: 1.3; color: var(--navy); }
.cfg-piece__code { margin-top: 0.1rem; font-size: 0.82rem; line-height: 1.3; color: var(--text-light); }
.cfg-pieces-fold > summary::before { display: none; }
.cfg-pieces-fold > summary .cfg-opt-tag { font-weight: 400; }
.cfg-pieces-fold__body { padding: 0.25rem 1rem 0.5rem; }

/* The view's own buttons (Viewer3D): nearer, further, up, down, back. Over the model's lower right corner. */
.cfg-viewer__moves { position: absolute; right: 12px; bottom: 12px; z-index: 2; display: flex; flex-direction: column; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 1px 2px rgba(14, 34, 65, 0.08), 0 0 0 1px rgba(14, 34, 65, 0.06); }
.cfg-viewer__moves button { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 999px; background: none; font: inherit; font-size: 1.15rem; line-height: 1; color: var(--navy, #0E2241); cursor: pointer; transition: background 0.15s; }
.cfg-viewer__moves button:hover { background: rgba(14, 34, 65, 0.08); }
.cfg-viewer__moves button:active { background: rgba(14, 34, 65, 0.16); }
@media (pointer: coarse) { .cfg-viewer__moves button { width: 44px; height: 44px; } }
