/* Canonical product configurator presentation.
   Base controls, shell, choice-page, progress, motion, details, personal-field,
   optional-field and multi-person presentation are staged here first. Checkout,
   sale and add-on layers remain in their existing owners until validated migrations. */

/* Base configurator controls. Later shell and choice-page rules intentionally
   refine these values, matching the legacy source order. */
.product-price-card--configurator {
  padding: clamp(22px, 3vw, 30px);
}

.reading-configurator {
  display: grid;
  gap: 18px;
}

.config-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  padding-bottom: 4px;
}

.config-intro h2 {
  margin: 0;
  color: #fff4e3;
  font-size: clamp(1.65rem, 2.5vw, 2.25rem);
  line-height: 1;
}

.config-intro > p {
  max-width: 280px;
  margin: 0;
  color: #bfb09b;
  font-size: .88rem;
  line-height: 1.5;
  text-align: right;
}

.config-step {
  min-width: 0;
  margin: 0;
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid rgba(214, 160, 90, .16);
}

.config-step legend,
.config-step-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  margin: 0 0 14px;
  padding: 0;
  color: #f5dfbd;
}

.config-step legend > span:last-child,
.config-step-heading > span:last-child {
  display: grid;
  gap: 3px;
}

.config-step legend strong,
.config-step-heading strong {
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1.15;
}

.config-step legend small,
.config-step-heading small {
  color: #afa18f;
  font: 500 .79rem/1.45 ui-sans-serif, system-ui, sans-serif;
}

.config-step-number {
  display: grid;
  place-items: center;
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  border: 1px solid rgba(218, 170, 94, .42);
  border-radius: 50%;
  color: #e2b66d;
  font: 800 .72rem/1 ui-sans-serif, system-ui, sans-serif;
}

.config-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

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

.config-choice {
  position: relative;
  display: block;
  min-width: 0;
  cursor: pointer;
}

.config-choice input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.config-choice > span {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 13px 14px;
  border: 1px solid rgba(214, 160, 90, .16);
  border-radius: 11px;
  background: rgba(255, 244, 227, .035);
  transition: border-color .16s ease, background-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.config-choice strong {
  color: #f6e8d0;
  font-size: .93rem;
  line-height: 1.2;
}

.config-choice small {
  color: #aa9c89;
  font-size: .76rem;
  line-height: 1.35;
}

.config-choice:hover > span {
  border-color: rgba(224, 176, 103, .4);
  background: rgba(255, 244, 227, .055);
  transform: translateY(-1px);
}

.config-choice input:checked + span {
  border-color: rgba(224, 176, 103, .78);
  background: linear-gradient(135deg, rgba(126, 79, 34, .28), rgba(83, 47, 81, .18));
  box-shadow: inset 0 0 0 1px rgba(224, 176, 103, .12), 0 8px 24px rgba(0, 0, 0, .14);
}

.config-choice input:focus-visible + span {
  outline: 3px solid rgba(224, 173, 102, .92);
  outline-offset: 3px;
}

.config-locked-value,
.config-fixed-question {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 14px;
  border: 1px solid rgba(214, 160, 90, .14);
  border-radius: 10px;
  background: rgba(255, 244, 227, .028);
  color: #f1dfc3;
}

.config-locked-value span {
  color: #a99a86;
  font-size: .76rem;
}

.config-fixed-question {
  display: block;
  font-family: var(--display);
  font-size: 1.15rem;
  line-height: 1.3;
}

.config-question-label {
  display: block;
  margin: 0 0 7px;
  color: #d8a45f;
  font: 800 .7rem/1 ui-sans-serif, system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.config-question {
  width: 100%;
  resize: vertical;
  min-height: 104px;
  padding: 13px 14px;
  border: 1px solid rgba(214, 160, 90, .2);
  border-radius: 11px;
  background: rgba(255, 250, 241, .07);
  color: #fff4e3;
  font: inherit;
  line-height: 1.5;
}

.config-question::placeholder {
  color: rgba(221, 207, 188, .48);
}

.config-question:focus {
  outline: 3px solid rgba(224, 173, 102, .3);
  outline-offset: 2px;
  border-color: rgba(224, 176, 103, .7);
}

.config-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  margin-top: 2px;
  padding: 17px 18px;
  border: 1px solid rgba(224, 176, 103, .36);
  border-radius: 12px;
  background: linear-gradient(120deg, rgba(124, 73, 32, .24), rgba(53, 22, 71, .2));
}

.config-summary-copy {
  display: grid;
  gap: 3px;
}

.config-summary-copy > span,
.config-total > span {
  color: #c9bba7;
  font: 700 .68rem/1.2 ui-sans-serif, system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .11em;
}

.config-summary-copy strong {
  color: #f8ead2;
  font-size: .94rem;
}

.config-summary-copy small {
  color: #ac9e8a;
  font-size: .76rem;
  line-height: 1.35;
}

.config-total {
  display: grid;
  justify-items: end;
  gap: 3px;
  min-width: 86px;
}

.config-total strong {
  color: #f0c879;
  font-family: var(--display);
  font-size: 1.65rem;
  line-height: 1;
}

@media (max-width: 620px) {
  .config-intro {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }

  .config-intro > p {
    max-width: none;
    text-align: left;
  }

  .config-choice-grid,
  .config-choice-grid--three {
    grid-template-columns: 1fr;
  }

  .config-choice > span {
    min-height: 0;
  }

  .config-summary {
    grid-template-columns: 1fr;
  }

  .config-total {
    justify-items: start;
  }

  .config-locked-value {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

/* Product configurator shell foundation. Keep this before the choice-page
   refinement because equal-specificity choice rules intentionally win later. */
.product-configurator-shell {
  margin-top: clamp(34px, 4.8vw, 60px);
}

.product-configurator-shell .product-price-card--configurator {
  margin-top: 0;
  padding: clamp(28px, 4vw, 42px);
  border-color: rgba(220, 170, 96, .30);
  background:
    radial-gradient(circle at 88% 0%, rgba(91, 40, 112, .18), transparent 34%),
    linear-gradient(135deg, rgba(24, 17, 12, .91), rgba(15, 10, 8, .87));
  box-shadow: 0 28px 76px rgba(0, 0, 0, .24);
}

.product-configurator-shell .reading-configurator {
  width: 100%;
  max-width: none;
  gap: 20px;
}

.product-configurator-shell .config-intro {
  padding-bottom: 10px;
}

.product-configurator-shell .config-intro > p {
  max-width: 420px;
}

.product-configurator-shell .config-step {
  padding-top: 22px;
}

.product-configurator-shell .config-choice-grid {
  gap: 12px;
}

.product-configurator-shell .config-choice > span {
  min-height: 78px;
  padding: 15px 17px;
}

.product-configurator-shell .config-question {
  min-height: 120px;
}

@media (min-width: 1100px) {
  .product-configurator-shell .config-choice-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .product-configurator-shell {
    margin-top: 30px;
  }

  .product-configurator-shell .product-price-card--configurator {
    padding: 22px 18px;
  }
}

.config-page--choices {
  display: grid;
  gap: 18px;
}

.config-page--choices .config-intro {
  align-items: start;
  padding: 4px 4px 12px;
}

.config-page--choices .config-intro h2 {
  margin-top: 3px;
  font-size: clamp(2rem, 3vw, 2.7rem);
  line-height: .98;
}

.config-page--choices .config-intro > p {
  max-width: 390px;
  padding: 12px 14px;
  border: 1px solid rgba(214, 160, 90, .14);
  border-radius: 11px;
  background: rgba(255, 244, 227, .025);
  color: #b9aa96;
  text-align: left;
}

.config-page--choices .config-step {
  padding: 21px 22px 22px;
  border: 1px solid rgba(214, 160, 90, .17);
  border-radius: 15px;
  background:
    radial-gradient(circle at 92% 0%, rgba(92, 43, 104, .09), transparent 34%),
    rgba(255, 244, 227, .023);
  box-shadow: inset 0 0 0 1px rgba(255, 244, 227, .008);
}

.config-page--choices .config-step legend,
.config-page--choices .config-step-heading {
  margin-bottom: 17px;
  gap: 14px;
}

.config-page--choices .config-step legend strong,
.config-page--choices .config-step-heading strong {
  color: #f7e6c8;
  font-size: 1.18rem;
}

.config-page--choices .config-step legend small,
.config-page--choices .config-step-heading small {
  margin-top: 1px;
  max-width: 720px;
  color: #aa9b88;
  font-size: .8rem;
}

.config-page--choices .config-step-number {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  border-color: rgba(226, 178, 102, .5);
  background: rgba(147, 89, 36, .09);
  color: #efc57d;
  font-size: .76rem;
}

.config-page--choices .config-choice-grid {
  gap: 13px;
}

.config-page--choices .config-choice > span {
  position: relative;
  min-height: 88px;
  padding: 17px 18px;
  border-radius: 12px;
  border-color: rgba(214, 160, 90, .17);
  background: linear-gradient(145deg, rgba(255, 244, 227, .04), rgba(255, 244, 227, .025));
  align-content: center;
}

.config-page--choices .config-choice strong {
  padding-right: 28px;
  color: #f8ead3;
  font-size: 1rem;
}

.config-page--choices .config-choice small {
  max-width: 92%;
  color: #a99b88;
  font-size: .77rem;
  line-height: 1.42;
}

.config-page--choices .config-choice:hover > span {
  border-color: rgba(229, 183, 111, .5);
  background: linear-gradient(145deg, rgba(255, 244, 227, .058), rgba(100, 50, 103, .05));
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .1);
}

.config-page--choices .config-choice input:checked + span {
  border-color: rgba(232, 188, 118, .82);
  background:
    linear-gradient(135deg, rgba(139, 86, 35, .27), rgba(83, 43, 87, .18)),
    rgba(255, 244, 227, .035);
  box-shadow:
    inset 0 0 0 1px rgba(239, 196, 128, .12),
    0 10px 28px rgba(0, 0, 0, .14);
}

.config-page--choices .config-choice input:checked + span::after {
  content: "✓";
  position: absolute;
  top: 13px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 1px solid rgba(235, 190, 118, .58);
  border-radius: 50%;
  background: rgba(128, 76, 30, .24);
  color: #f3cc88;
  font: 800 .68rem/1 ui-sans-serif, system-ui, sans-serif;
}

.config-page--choices .config-choice input:checked + span .config-choice-increment {
  color: #f3cb83;
}

.config-page--choices .config-summary {
  margin-top: 0;
  padding: 20px 21px;
  border-radius: 14px;
  border-color: rgba(229, 181, 108, .42);
  background:
    radial-gradient(circle at 96% 0%, rgba(111, 48, 126, .16), transparent 34%),
    linear-gradient(120deg, rgba(126, 75, 32, .25), rgba(44, 22, 57, .24));
  box-shadow: inset 0 0 0 1px rgba(255, 244, 227, .018), 0 12px 30px rgba(0, 0, 0, .11);
}

.config-page--choices .config-summary-copy {
  gap: 5px;
}

.config-page--choices .config-summary-copy strong {
  color: #faecd5;
  font-size: 1.02rem;
}

.config-page--choices .config-summary-copy small {
  max-width: 560px;
}

.config-page--choices .config-summary-actions {
  gap: 20px;
}

.config-page--choices .config-total {
  min-width: 104px;
  padding-right: 3px;
}

.config-page--choices .config-total strong {
  font-size: 2rem;
}

.config-page--choices .config-continue-button {
  min-width: 190px;
  min-height: 46px;
  box-shadow: 0 8px 22px rgba(118, 66, 22, .18);
}

@media (min-width: 781px) {
  .config-page--choices .config-intro {
    display: block;
    min-height: 70px;
    padding-right: min(470px, 51%);
  }

  .config-page--choices .config-intro > p {
    max-width: 520px;
    margin-top: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
  }
}

@media (max-width: 780px) {
  .config-page--choices .config-intro > p {
    width: 100%;
    max-width: none;
  }

  .config-page--choices .config-step {
    padding: 18px 16px;
  }

  .config-page--choices .config-choice > span {
    min-height: 0;
  }

  .config-page--choices .config-summary {
    padding: 18px;
  }
}

/* Configurator progress geometry. Small-text sizes and current/complete text
   colours remain centralized in visual-system.css. */
.reading-configurator {
  position: relative;
}

.config-stage-track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 6px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(214, 160, 90, .16);
}

.config-stage-track > span {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-weight: 750;
  letter-spacing: .04em;
  transition: color .55s ease, opacity .55s ease;
}

.config-stage-track b {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border: 1px solid rgba(214, 160, 90, .22);
  border-radius: 50%;
  color: inherit;
  transition: border-color .55s ease, background-color .55s ease, color .55s ease;
}

.config-stage-track .is-current b {
  border-color: rgba(231, 182, 105, .76);
  background: rgba(139, 88, 37, .22);
  color: #ffe2aa;
}

.config-stage-track .is-complete b::before {
  content: "✓";
}

@media (min-width: 781px) {
  .reading-configurator > .config-stage-track {
    position: absolute;
    top: 3px;
    right: 0;
    z-index: 4;
    width: min(440px, 48%);
    margin: 0;
    padding: 0;
    border-bottom: 0;
  }

  .reading-configurator > .config-stage-track > span {
    position: relative;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
    padding: 5px 9px;
    border: 1px solid rgba(214, 160, 90, .12);
    border-radius: 999px;
    background: rgba(255, 244, 227, .018);
  }

  .reading-configurator > .config-stage-track > span:not(:last-child)::after {
    content: "";
    position: absolute;
    left: calc(100% + 1px);
    top: 50%;
    width: 10px;
    height: 1px;
    background: rgba(214, 160, 90, .20);
  }

  .reading-configurator > .config-stage-track .is-current {
    border-color: rgba(229, 181, 108, .36);
    background: linear-gradient(135deg, rgba(136, 82, 34, .16), rgba(74, 34, 82, .14));
    box-shadow: inset 0 0 0 1px rgba(255, 239, 210, .018);
  }
}

@media (max-width: 780px) {
  .config-stage-track > span {
    justify-content: center;
  }

  .config-stage-track > span > span {
    display: none;
  }

  .reading-configurator > .config-stage-track {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 18px;
    padding: 0;
    border-bottom: 0;
  }

  .reading-configurator > .config-stage-track > span {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 6px 7px;
    border: 1px solid rgba(214, 160, 90, .12);
    border-radius: 999px;
    background: rgba(255, 244, 227, .018);
    letter-spacing: .025em;
    white-space: nowrap;
  }

  .reading-configurator > .config-stage-track > span > span {
    display: inline !important;
  }

  .reading-configurator > .config-stage-track b {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
  }

  .reading-configurator > .config-stage-track .is-current {
    border-color: rgba(229, 181, 108, .34);
    background: linear-gradient(135deg, rgba(136, 82, 34, .16), rgba(74, 34, 82, .14));
  }
}

@media (max-width: 390px) {
  .reading-configurator > .config-stage-track > span {
    gap: 4px;
    padding-inline: 5px;
  }

  .reading-configurator > .config-stage-track b {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
  }
}

/* Configurator page and reveal motion. Layout/content ownership stays separate. */
.config-page {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .72s ease, transform 1.05s cubic-bezier(.16, 1, .3, 1);
}

.config-page.is-active {
  opacity: 1;
  transform: translateY(0);
}

.config-page.is-leaving {
  opacity: 0;
  transform: translateY(-8px);
}

.config-page[hidden] {
  display: none !important;
}

.product-price-card--configurator.config-page-resizing {
  transition: height 1.15s cubic-bezier(.16, 1, .3, 1), box-shadow 1.15s cubic-bezier(.16, 1, .3, 1);
}

.config-reveal-shell {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-12px);
  transition:
    grid-template-rows 1.15s cubic-bezier(.16, 1, .3, 1),
    opacity .78s ease .12s,
    transform 1.15s cubic-bezier(.16, 1, .3, 1);
}

.config-reveal-shell[hidden] {
  display: none !important;
}

.config-reveal-shell.is-visible {
  grid-template-rows: 1fr;
  opacity: 1;
  transform: translateY(0);
}

.config-reveal-inner {
  min-height: 0;
  overflow: hidden;
}

.config-reveal-shell .config-step,
.config-reveal-shell .config-summary {
  transform-origin: top center;
  transition: opacity .72s ease .20s, transform 1.05s cubic-bezier(.16, 1, .3, 1);
}

.config-reveal-shell:not(.is-visible) .config-step,
.config-reveal-shell:not(.is-visible) .config-summary {
  opacity: 0;
  transform: translateY(-8px) scale(.995);
}

.product-price-card--configurator {
  transform-origin: top center;
}

.product-price-card--configurator.config-wave-active {
  animation: config-wave-breathe 1.45s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes config-wave-breathe {
  0% { box-shadow: 0 28px 76px rgba(0, 0, 0, .24); }
  42% { box-shadow: 0 34px 92px rgba(33, 10, 43, .34), 0 0 0 1px rgba(224, 176, 103, .06); }
  100% { box-shadow: 0 28px 76px rgba(0, 0, 0, .24); }
}

@media (prefers-reduced-motion: reduce) {
  .config-page,
  .product-price-card--configurator.config-page-resizing,
  .config-reveal-shell,
  .config-reveal-shell .config-step,
  .config-reveal-shell .config-summary {
    transition: none;
  }

  .product-price-card--configurator.config-wave-active {
    animation: none;
  }
}

/* Configurator details intake. Scoped page refinements remain later in the
   legacy base until their own audited migration. */
.config-summary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.config-continue-button[hidden] {
  display: none;
}

.config-continue-button {
  min-width: 170px;
  white-space: nowrap;
}

.config-page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.config-page-heading h2 {
  margin: 3px 0 8px;
  color: #fff4e3;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1;
}

.config-page-heading > div > p:last-child {
  max-width: 650px;
  margin: 0;
  color: #b8a995;
  line-height: 1.55;
}

.config-text-button {
  appearance: none;
  border: 0;
  padding: 8px 0;
  background: none;
  color: #d9ae6c;
  cursor: pointer;
  font: 800 .76rem/1.2 ui-sans-serif, system-ui, sans-serif;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.config-text-button:hover {
  color: #f0c77f;
}

.config-text-button:focus-visible {
  outline: 2px solid #e0ad66;
  outline-offset: 5px;
  border-radius: 3px;
}

.config-details-layout {
  display: grid;
  grid-template-columns: minmax(230px, .72fr) minmax(0, 1.7fr);
  column-gap: clamp(26px, 4vw, 54px);
  row-gap: 24px;
  align-items: start;
}

.config-details-recap {
  grid-column: 1;
  grid-row: 1 / span 2;
  position: sticky;
  top: 92px;
  display: grid;
  gap: 8px;
  padding: 22px;
  border: 1px solid rgba(218, 170, 94, .25);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(113, 67, 30, .20), rgba(50, 27, 55, .14));
  box-shadow: inset 0 0 0 1px rgba(255, 244, 227, .018);
}

.config-details-recap > strong {
  color: #f8e6ca;
  font-family: var(--display);
  font-size: 1.22rem;
  line-height: 1.25;
}

.config-details-recap > span {
  min-height: 1.2em;
  color: #ac9c87;
  font-size: .78rem;
  line-height: 1.4;
}

.config-details-price {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(218, 170, 94, .16);
}

.config-details-price small {
  color: #b8a995;
  font: 750 .68rem/1 ui-sans-serif, system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.config-details-price strong {
  color: #f0c879;
  font-family: var(--display);
  font-size: 1.75rem;
  line-height: 1;
}

.config-details-fields {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  gap: 24px;
}

.config-details-actions {
  grid-column: 2;
  grid-row: 2;
}

.config-detail-field {
  padding-top: 22px;
  border-top: 1px solid rgba(214, 160, 90, .16);
}

.config-detail-field:first-child {
  padding-top: 0;
  border-top: 0;
}

.config-question-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.config-question-label > span {
  color: rgba(210, 190, 166, .55);
  font-size: .62rem;
  letter-spacing: .08em;
}

.config-field-note {
  display: block;
  margin-top: 7px;
  color: #9f917e;
  font-size: .76rem;
  line-height: 1.45;
}

.config-question--context {
  min-height: 150px;
}

.config-details-ready {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 17px 18px;
  border: 1px solid rgba(224, 176, 103, .25);
  border-radius: 12px;
  background: rgba(255, 244, 227, .035);
}

.config-details-ready > div {
  display: grid;
  gap: 3px;
}

.config-details-ready span {
  color: #c9bba7;
  font: 750 .65rem/1.2 ui-sans-serif, system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .11em;
}

.config-details-ready strong {
  color: #f5dfbd;
  font-size: .9rem;
}

.config-details-ready > small {
  max-width: 280px;
  color: #9f917e;
  font-size: .74rem;
  line-height: 1.4;
  text-align: right;
}

@media (max-width: 780px) {
  .config-summary-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .config-continue-button {
    width: 100%;
  }

  .config-page-heading {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }

  .config-details-layout {
    grid-template-columns: 1fr;
    row-gap: 24px;
  }

  .config-details-fields {
    grid-column: 1;
    grid-row: auto;
    order: 1;
  }

  .config-details-recap {
    grid-column: 1;
    grid-row: auto;
    order: 2;
    position: static;
  }

  .config-details-actions {
    grid-column: 1;
    grid-row: auto;
    order: 3;
  }

  .config-details-ready {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }

  .config-details-ready > small {
    max-width: none;
    text-align: left;
  }
}

/* Personal-information fields used on the configurator details page. */
.config-personal-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
}

.config-personal-heading .config-field-note {
  margin-top: 0;
}

.config-personal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.config-mini-field {
  display: grid;
  gap: 7px;
}

.config-mini-field > span {
  color: #d6c4ab;
  font: 760 .7rem/1.25 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .035em;
}

.config-mini-field em {
  margin-left: 5px;
  color: rgba(210, 190, 166, .55);
  font-style: normal;
  font-weight: 650;
  font-size: .62rem;
  letter-spacing: .06em;
}

.config-text-input {
  width: 100%;
  min-height: 46px;
  box-sizing: border-box;
  border: 1px solid rgba(214, 160, 90, .22);
  border-radius: 10px;
  padding: 11px 13px;
  background: rgba(255, 244, 227, .045);
  color: #f6e8d3;
  font: 500 .92rem/1.35 ui-sans-serif, system-ui, sans-serif;
  transition: border-color .35s ease, background-color .35s ease, box-shadow .35s ease;
}

.config-text-input::placeholder {
  color: rgba(203, 187, 165, .45);
}

.config-text-input:hover {
  border-color: rgba(224, 176, 103, .38);
}

.config-text-input:focus {
  outline: 0;
  border-color: rgba(231, 182, 105, .76);
  background: rgba(255, 244, 227, .065);
  box-shadow: 0 0 0 3px rgba(183, 120, 49, .11);
}

.config-text-input[type="date"] {
  color-scheme: dark;
}

@media (max-width: 700px) {
  .config-personal-grid {
    grid-template-columns: 1fr;
  }
}

/* Focused question and clearer optional context, October 2026.
   Keep the context textarea roomy while making the required question concise. */
.config-page--details .config-question:not(.config-question--context) {
  height: 76px;
  min-height: 76px;
}

.config-page--details .config-detail-field--optional .config-optional-card {
  border-color: rgba(224, 176, 103, .38);
  background: linear-gradient(110deg, rgba(177, 111, 45, .075), rgba(255, 244, 227, .035));
}

.config-page--details .config-detail-field--optional .config-optional-toggle-copy strong {
  color: #ffdfaa;
}

.config-page--details .config-detail-field--optional .config-optional-toggle-copy small {
  color: #d3bfa3;
}

.config-page--details .config-detail-field--optional .config-optional-toggle:hover {
  background: rgba(224, 176, 103, .065);
}

/* Optional details disclosure cards. */
.config-detail-field--optional {
  padding-top: 22px;
}

.config-optional-card {
  border: 1px solid rgba(214, 160, 90, .18);
  border-radius: 14px;
  background: rgba(255, 244, 227, .024);
  overflow: clip;
  transition: border-color .38s ease, background-color .38s ease, box-shadow .38s ease;
}

.config-optional-card:hover {
  border-color: rgba(224, 176, 103, .34);
  background: rgba(255, 244, 227, .032);
}

.config-optional-card.is-open,
.config-optional-card.has-value {
  border-color: rgba(224, 176, 103, .28);
}

.config-optional-card.is-open {
  background: rgba(255, 244, 227, .042);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .12);
}

.config-optional-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  text-align: left;
  cursor: pointer;
}

.config-optional-toggle:focus-visible {
  outline: 2px solid rgba(231, 182, 105, .82);
  outline-offset: -2px;
}

.config-optional-toggle-copy {
  display: grid;
  gap: 4px;
}

.config-optional-toggle-copy strong {
  color: #f5e0be;
  font-size: .96rem;
  line-height: 1.2;
}

.config-optional-toggle-copy small {
  color: #a59580;
  font-size: .75rem;
  line-height: 1.45;
}

.config-optional-toggle-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
  flex: 0 0 auto;
}

.config-optional-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(224, 176, 103, .11);
  color: #ddb374;
  font: 760 .63rem/1 ui-sans-serif, system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.config-optional-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #c9b9a3;
  font-size: .75rem;
  line-height: 1.3;
}

.config-optional-summary::after {
  content: "+";
  color: #d6a45e;
  font: 500 1.05rem/1 var(--display);
  transition: transform .45s cubic-bezier(.22, .7, .2, 1), color .3s ease;
}

.config-optional-card.is-open .config-optional-summary::after {
  transform: rotate(45deg);
  color: #f0c879;
}

.config-optional-card.has-value .config-optional-summary {
  color: #ecd9b8;
}

.config-optional-panel {
  padding: 0 18px 18px;
  animation: configOptionalOpen .55s cubic-bezier(.22, .7, .2, 1) both;
}

.config-optional-field-label {
  display: block;
  margin-bottom: 10px;
  color: #d6c4ab;
  font: 760 .72rem/1.25 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .04em;
}

@keyframes configOptionalOpen {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 620px) {
  .config-optional-toggle {
    align-items: start;
    flex-direction: column;
  }

  .config-optional-toggle-meta {
    justify-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .config-optional-panel {
    animation: none;
  }
}

/* Multi-person details cards. Reuse the canonical optional-open keyframe. */
.config-people-list {
  display: grid;
  gap: 16px;
}

.config-person-card {
  border: 1px solid rgba(214, 160, 90, .18);
  border-radius: 14px;
  padding: 18px;
  background: rgba(255, 244, 227, .024);
  box-shadow: inset 0 0 0 1px rgba(255, 244, 227, .012);
}

.config-person-card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 15px;
}

.config-person-card-heading > div {
  display: grid;
  gap: 3px;
}

.config-person-card-heading span {
  color: #a99882;
  font: 760 .62rem/1 ui-sans-serif, system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.config-person-card-heading strong {
  color: #f3dfbd;
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1.2;
}

.config-remove-person {
  border: 0;
  padding: 4px 0;
  background: transparent;
  color: #b8a68d;
  font: 700 .68rem/1.2 ui-sans-serif, system-ui, sans-serif;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.config-remove-person:hover {
  color: #e2bd7c;
}

.config-remove-person:focus-visible {
  outline: 2px solid #e0ad66;
  outline-offset: 4px;
  border-radius: 3px;
}

.config-person-extras {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.config-person-extra {
  border: 1px solid rgba(214, 160, 90, .16);
  border-radius: 11px;
  background: rgba(255, 244, 227, .02);
  overflow: clip;
}

.config-person-extra[open] {
  border-color: rgba(224, 176, 103, .3);
  background: rgba(255, 244, 227, .035);
}

.config-person-extra > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 11px 12px;
  cursor: pointer;
  user-select: none;
}

.config-person-extra > summary::-webkit-details-marker {
  display: none;
}

.config-person-extra > summary > span {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
}

.config-person-extra > summary strong {
  color: #d9c6aa;
  font: 760 .7rem/1.2 ui-sans-serif, system-ui, sans-serif;
}

.config-person-extra > summary em {
  color: rgba(210, 190, 166, .5);
  font: 650 .58rem/1 ui-sans-serif, system-ui, sans-serif;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.config-person-extra > summary small {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #aa9a84;
  font-size: .68rem;
}

.config-person-extra > summary small::after {
  content: "+";
  color: #d6a45e;
  font: 500 1rem/1 var(--display);
  transition: transform .4s cubic-bezier(.22, .7, .2, 1);
}

.config-person-extra[open] > summary small::after {
  transform: rotate(45deg);
}

.config-person-extra-body {
  padding: 0 12px 12px;
  animation: configOptionalOpen .5s cubic-bezier(.22, .7, .2, 1) both;
}

.config-add-person {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  min-height: 42px;
  border: 1px solid rgba(224, 176, 103, .25);
  border-radius: 10px;
  padding: 9px 14px;
  background: rgba(255, 244, 227, .03);
  color: #ddc8a8;
  font: 760 .75rem/1 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
  transition: border-color .3s ease, background-color .3s ease, color .3s ease;
}

.config-add-person span {
  color: #e1b66f;
  font-family: var(--display);
  font-size: 1.05rem;
}

.config-add-person:hover {
  border-color: rgba(224, 176, 103, .48);
  background: rgba(255, 244, 227, .05);
  color: #f1dfc3;
}

.config-add-person:focus-visible {
  outline: 2px solid #e0ad66;
  outline-offset: 4px;
}

@media (max-width: 620px) {
  .config-person-card {
    padding: 15px;
  }

  .config-person-extras {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .config-person-extra-body {
    animation: none;
  }
}

/* Desktop-only details-page positioning. These are the final effective values
   after the earlier progress-clearance rules in the legacy cascade. */
@media (min-width: 781px) {
  .config-page--details .config-page-heading {
    position: relative;
    display: block;
    align-items: initial;
    min-height: 154px;
    padding-right: min(470px, 51%);
  }

  .config-page--details .config-text-button {
    position: absolute;
    top: 45px;
    right: 0;
  }

  .config-page--details .config-text-button[data-config-back-to-choices] {
    top: 124px;
    right: 0;
    z-index: 5;
  }
}

/* Contextual guidance stays visible while each configurator choice unlocks the next. */
.config-next-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  padding: 17px 19px;
  border: 1px solid rgba(225, 174, 100, .4);
  border-radius: 13px;
  background: linear-gradient(120deg, rgba(125, 77, 33, .19), rgba(70, 33, 79, .18));
}

.config-next-action.is-ready {
  border-color: rgba(226, 184, 119, .6);
  background: linear-gradient(120deg, rgba(113, 80, 39, .26), rgba(70, 45, 77, .21));
}

.config-next-action-copy {
  display: grid;
  gap: 5px;
  flex: 1 1 270px;
  min-width: 0;
}

.config-next-action-copy > span {
  color: #dfb879;
  font: 800 .7rem/1.3 ui-sans-serif, system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.config-next-action-copy > strong {
  color: #fff0d6;
  font-family: var(--display);
  font-size: clamp(1.08rem, 1.6vw, 1.32rem);
  line-height: 1.25;
}

.config-next-action-copy > p {
  max-width: 650px;
  margin: 0;
  color: #c9baa5;
  font-size: .88rem;
  line-height: 1.55;
}

.config-next-action-advance[hidden] { display: none; }

.config-next-action-advance {
  flex: 0 1 auto;
  min-height: 46px;
  white-space: normal;
}

.config-page--choices .config-next-action { margin-bottom: 3px; }
.config-next-action--details,
.config-next-action--review { margin-bottom: 24px; }

.config-page--choices .config-step.is-next-choice {
  border-color: rgba(234, 184, 110, .52);
  box-shadow: inset 0 0 0 1px rgba(234, 184, 110, .07);
}

@media (max-width: 620px) {
  .config-next-action { padding: 15px 16px; }
  .config-next-action-advance { width: 100%; }
}

/* Required-field feedback near the action, including narrow/mobile layouts. */
.config-details-action-hint {
  margin: 0 0 10px;
  color: #f0cf9e;
  font-size: .87rem;
  line-height: 1.5;
}
.config-question-error {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(232, 135, 107, .5);
  border-radius: 9px;
  background: rgba(128, 42, 39, .18);
  color: #ffd9c8;
  font-size: .84rem;
  line-height: 1.45;
}
.config-question-error[hidden],
.config-character-warning[hidden] { display: none; }
.config-question[aria-invalid="true"] {
  border-color: #e89b78;
  box-shadow: 0 0 0 2px rgba(232, 155, 120, .2);
}
.config-character-warning {
  color: #f0c397;
  font-weight: 650;
}
