/* Warm paper workspace, limestone diagrams and powder-coated navy controls. */
.builder-breadcrumb {
  color: var(--muted);
  align-items: center;
  gap: 10px;
  font-size: 16px;
  display: flex;
}
.builder-breadcrumb a {
  color: var(--rust);
  text-underline-offset: 4px;
  font-weight: 650;
  text-decoration: underline;
}
.builder-intro {
  background: var(--cream);
  padding: 64px 0 70px;
}
.builder-intro .back-to-shop {
  color: var(--rust);
  text-underline-offset: 5px;
  margin-bottom: 28px;
  font-weight: 650;
  text-decoration: underline;
  display: inline-block;
}
.builder-intro h1 {
  max-width: 850px;
  font-size: clamp(42px, 5vw, 68px);
  text-wrap: balance;
}
.builder-intro p {
  color: var(--muted);
  max-width: 760px;
  margin: 22px 0 0;
  font-size: 20px;
}
.custom-builder {
  background: var(--stone);
  padding: 52px 0 96px;
}
.custom-progress {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 34px;
  margin-bottom: 28px;
  display: grid;
}
.custom-progress > div:first-child {
  flex-direction: column;
  min-width: 250px;
  display: flex;
}
.custom-progress span {
  color: var(--rust);
  letter-spacing: 0;
  font-size: 14px;
  font-weight: 700;
}
.custom-progress strong {
  font-size: 21px;
}
.custom-progress-track {
  background: var(--line);
  border-radius: 3px;
  height: 6px;
  overflow: hidden;
}
.custom-progress-track i {
  transform-origin: 0;
  background: var(--navy);
  width: 100%;
  height: 100%;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  display: block;
}
.custom-builder-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  align-items: start;
  gap: 30px;
  display: grid;
}
.custom-workspace {
  background: var(--paper);
  border-radius: 14px;
  min-width: 0;
  padding: 38px;
}
.custom-workspace section > h2 {
  font-size: clamp(29px, 2.6vw, 39px);
  text-wrap: balance;
}
.custom-workspace section > h2 + p {
  color: var(--muted);
  max-width: 680px;
  margin: 12px 0 30px;
}
.custom-type-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  display: grid;
}
.custom-type-grid button {
  border: 1px solid var(--field-line);
  min-width: 0;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  background: var(--paper);
  border-radius: 12px;
  overflow: hidden;
  flex-direction: column;
  padding: 0 0 20px;
  display: flex;
}
:is(
  .custom-type-grid button:hover,
  .custom-type-grid button:focus-visible,
  .custom-type-grid button.selected
) {
  border-color: var(--navy);
}
.custom-type-grid img {
  aspect-ratio: 4/3;
  object-fit: contain;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  width: 100%;
}
.custom-type-grid strong,
.custom-type-grid span {
  margin-inline: 18px;
}
.custom-type-grid strong {
  margin-top: 17px;
  font-size: 18px;
  line-height: 1.25;
}
.custom-type-grid span {
  color: var(--muted);
  margin-top: 7px;
  font-size: 14px;
  line-height: 1.45;
}
.measure-tabs,
.builder-choice-row {
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  display: flex;
}
.measure-tabs button,
.builder-choice-row button {
  border: 1px solid var(--field-line);
  min-height: 52px;
  color: var(--ink);
  cursor: pointer;
  background: var(--paper);
  border-radius: 6px;
  padding: 10px 18px;
  font-weight: 650;
}
.measure-tabs button[aria-pressed="true"],
.builder-choice-row button[aria-pressed="true"] {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--paper);
}
:is(
  .measure-tabs button:focus-visible,
  .builder-choice-row button:focus-visible
) {
  outline-offset: 2px;
  outline: 3px solid var(--focus);
}
.branded-diagram {
  border: 1px solid var(--line);
  background: var(--paper);
  max-width: 720px;
  margin: 0 0 26px;
  position: relative;
  overflow: hidden;
}
.diagram-heading {
  text-align: center;
  padding: 20px 24px 4px;
}
.diagram-heading img {
  width: 184px;
  height: auto;
  margin: 0 auto 8px;
  display: block;
}
.diagram-heading figcaption {
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
}
.diagram-heading p {
  color: var(--muted);
  margin: 5px 0 0;
  font-size: 15px;
}
.diagram-art {
  object-fit: contain;
  width: 100%;
  height: auto;
  display: block;
}
.diagram-made-logo {
  width: 88px;
  height: auto;
  position: absolute;
  bottom: 12px;
  right: 18px;
}
.custom-field-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  display: grid;
}
.custom-field {
  max-width: 720px;
  color: var(--ink);
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
  font-size: 15px;
  font-weight: 650;
  display: flex;
}
.custom-field-grid .custom-field {
  min-width: 0;
  max-width: none;
}
.custom-field input,
.custom-field select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 54px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--field-line);
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  padding: 10px 13px;
}
.custom-field input:focus,
.custom-field select:focus {
  outline-offset: 2px;
  border-color: var(--ink);
  outline: 3px solid var(--focus);
}
.custom-workspace fieldset {
  border: 0;
  margin: 0 0 28px;
  padding: 0;
}
.custom-workspace legend {
  margin-bottom: 12px;
  font-size: 20px;
  font-weight: 700;
}
.colour-fieldset {
  max-width: 720px;
}
.colour-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  display: grid;
}
.colour-grid button {
  border: 1px solid var(--field-line);
  min-width: 0;
  min-height: 58px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  background: var(--paper);
  border-radius: 6px;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  font-weight: 650;
  display: flex;
}
:is(.colour-grid button:hover, .colour-grid button:focus-visible) {
  border-color: var(--navy);
}
.colour-grid button[aria-pressed="true"] {
  border-color: var(--navy);
  background: var(--cream);
  box-shadow: inset 0 0 0 1px var(--navy);
}
.colour-swatch {
  border: 1px solid var(--field-line);
  border-radius: 50%;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  box-shadow: inset 0 1px 2px #ffffff73;
}
.colour-note {
  color: var(--muted);
  max-width: 64ch;
  margin: 12px 0 0;
  font-size: 14px;
}
.custom-review {
  border-top: 1px solid var(--line);
  margin: 0;
}
.custom-review div {
  border-bottom: 1px solid var(--line);
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
  padding: 16px 0;
  display: grid;
}
.custom-review dt {
  color: var(--muted);
}
.custom-review dd {
  margin: 0;
  font-weight: 650;
}
.custom-complete .button {
  margin-top: 14px;
}
.custom-complete button.button {
  cursor: pointer;
}
.custom-actions {
  border-top: 1px solid var(--line);
  justify-content: space-between;
  gap: 16px;
  margin-top: 38px;
  padding-top: 26px;
  display: flex;
}
.custom-actions .button {
  cursor: pointer;
  min-width: 130px;
}
.custom-actions .button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.custom-preview {
  border: 0;
  border-radius: 14px;
  background: var(--paper);
  position: sticky;
  top: 22px;
  overflow: hidden;
  box-shadow: 0 18px 46px #03304c12;
}
.preview-sheet {
  background: var(--paper);
}
.live-preview-figure {
  text-align: center;
  background: var(--paper);
  min-height: 390px;
  margin: 0;
  padding: 24px 20px 64px;
  position: relative;
}
.live-preview-brand {
  width: 170px;
  height: auto;
  margin: 0 auto 2px;
  display: block;
}
.live-preview-figure figcaption {
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
}
.live-rail-svg {
  width: 100%;
  height: auto;
  margin: 6px auto 0;
  display: block;
}
.live-preview-made {
  width: 64px;
  height: auto;
  position: absolute;
  bottom: 10px;
  right: 16px;
}
.preview-summary {
  border-top: 1px solid var(--line);
  padding: 25px 28px 28px;
}
.preview-summary > div:first-child {
  flex-direction: column;
  display: flex;
}
.preview-summary > div:first-child span {
  color: var(--rust);
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 700;
}
.preview-summary > div:first-child strong {
  font-size: 27px;
}
.preview-summary ul {
  color: var(--muted);
  margin: 20px 0;
  padding-left: 21px;
  font-size: 15px;
}
.preview-summary li {
  margin: 7px 0;
}
.preview-price {
  border-top: 1px solid var(--line);
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 3px 16px;
  padding-top: 18px;
  display: grid;
}
.preview-price span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}
.preview-price strong {
  color: var(--rust);
  font-size: 30px;
  line-height: 1;
}
.preview-price small {
  color: var(--muted);
  grid-column: 1/-1;
  margin-top: 4px;
}
.builder-quote-dialog {
  width: min(860px, 100% - 32px);
  max-height: min(920px, 100dvh - 32px);
  color: var(--ink);
  background: var(--paper);
  border: 0;
  border-radius: 14px;
  margin: auto;
  padding: 0;
  overflow: auto;
  box-shadow: 0 28px 80px #03304c38;
}
.builder-quote-dialog::backdrop {
  background: #03304cb8;
}
.builder-quote-modal {
  min-width: 0;
}
.builder-quote-header {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
  padding: 30px 34px 25px;
  display: flex;
}
.builder-quote-header img {
  width: 175px;
  height: auto;
  margin-bottom: 16px;
  display: block;
}
.builder-quote-header h2 {
  font-size: clamp(30px, 4vw, 42px);
}
.builder-quote-header p {
  color: var(--muted);
  margin: 8px 0 0;
}
.builder-modal-close {
  border: 1px solid var(--navy);
  color: var(--navy);
  cursor: pointer;
  background: var(--paper);
  border-radius: 6px;
  flex: none;
  min-height: 48px;
  padding: 8px 15px;
  font-weight: 650;
}
:is(.builder-modal-close:hover, .builder-modal-close:focus-visible) {
  outline-offset: 2px;
  background: var(--cream);
  outline: 3px solid var(--focus);
}
.builder-modal-close:disabled {
  cursor: wait;
  opacity: 0.55;
}
.builder-quote-design {
  background: var(--cream);
  border-radius: 10px;
  margin-bottom: 26px;
  padding: 22px 24px;
}
.builder-quote-design h3 {
  margin: 0 0 14px;
  font-size: 20px;
}
.builder-quote-design dl {
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
  margin: 0;
  display: grid;
}
.builder-quote-design dl > div {
  border-top: 1px solid var(--line);
  grid-template-columns: minmax(90px, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  min-width: 0;
  padding: 9px 0;
  display: grid;
}
.builder-quote-design dt {
  color: var(--muted);
}
.builder-quote-design dd {
  overflow-wrap: anywhere;
  min-width: 0;
  margin: 0;
  font-weight: 650;
}
.builder-quote-actions {
  justify-content: flex-end;
  gap: 14px;
  display: flex;
}
.builder-quote-actions .button {
  cursor: pointer;
}
.builder-quote-actions .button:disabled {
  cursor: wait;
  opacity: 0.65;
  box-shadow: none;
  transform: none;
}
.builder-quote-success {
  text-align: center;
  padding: 48px 34px;
}
.builder-quote-success > strong {
  color: #1f6b3b;
  font-size: 30px;
  display: block;
}
.builder-quote-success p {
  color: var(--muted);
  max-width: 600px;
  margin: 14px auto 0;
}
.builder-quote-success .quote-reference {
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
}
.builder-quote-success .button {
  cursor: pointer;
  margin-top: 26px;
}
@media (max-width: 1050px) {
  .custom-builder-grid {
    grid-template-columns: 1fr;
  }
  .custom-preview {
    grid-template-columns: minmax(300px, 0.85fr) 1fr;
    display: grid;
    position: static;
  }
  .preview-summary {
    border-top: 0;
    border-left: 1px solid var(--line);
  }
}
@media (max-width: 760px) {
  .custom-type-grid {
    grid-template-columns: 1fr;
  }
  .custom-type-grid button {
    grid-template-rows: auto 1fr;
    grid-template-columns: 180px 1fr;
    padding: 0;
    display: grid;
  }
  .custom-type-grid img {
    aspect-ratio: 4/3;
    border-bottom: 0;
    border-right: 1px solid var(--line);
    grid-row: 1/3;
  }
  .custom-type-grid strong,
  .custom-type-grid span {
    margin-inline: 18px;
  }
  .custom-type-grid strong {
    margin-top: 20px;
  }
  .custom-type-grid span {
    margin-bottom: 20px;
  }
  .custom-preview {
    display: block;
  }
  .preview-summary {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .custom-field-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .builder-breadcrumb {
    display: none;
  }
  .builder-intro {
    padding: 44px 0 50px;
  }
  .builder-intro p {
    font-size: 18px;
  }
  .custom-builder {
    padding: 48px 0 72px;
  }
  .custom-progress {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .custom-workspace {
    padding: 28px 18px;
  }
  .custom-type-grid button {
    padding-bottom: 20px;
    display: flex;
  }
  .custom-type-grid img {
    aspect-ratio: 4/3;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .custom-field-grid {
    grid-template-columns: 1fr;
  }
  .diagram-made {
    bottom: 10px;
    right: 12px;
  }
  .custom-review div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .custom-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
}
@media (max-width: 560px) {
  .branded-diagram {
    padding: 0;
  }
  .colour-grid {
    grid-template-columns: 1fr;
  }
  .live-preview-figure {
    min-height: 0;
  }
  .live-preview-brand {
    width: 170px;
  }
}
@media (max-width: 620px) {
  .builder-quote-dialog {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
  }
  .builder-quote-header {
    padding: 22px 20px 20px;
  }
  .builder-quote-header img {
    width: 150px;
  }
  .builder-quote-header p {
    font-size: 15px;
  }
  .builder-modal-close {
    min-height: 44px;
    padding: 6px 10px;
  }
  .builder-quote-design {
    padding: 18px;
  }
  .builder-quote-design dl {
    grid-template-columns: 1fr;
  }
  .builder-quote-actions {
    flex-direction: column-reverse;
  }
  .builder-quote-success {
    padding: 38px 20px;
  }
}
.custom-builder [hidden] {
  display: none !important;
}
.custom-builder h2:focus {
  outline: none;
}
.builder-measure-error {
  color: #a32920;
  font-weight: 700;
  margin-top: 16px;
}
.builder-quote-body {
  padding: 30px 34px 34px;
}
.builder-quote-body .builder-quote-form {
  padding: 0;
}
.builder-quote-body .quote-form {
  margin: 0;
}
.builder-quote-dialog {
  overscroll-behavior: contain;
  scrollbar-color: var(--rust) var(--cream);
}
.builder-quote-design dl > div {
  font-size: 14px;
}
.preview-price strong {
  font-variant-numeric: tabular-nums;
}
@media (max-width: 560px) {
  .builder-quote-body {
    padding: 22px 20px 26px;
  }
  .builder-quote-header {
    gap: 12px;
  }
  .builder-quote-header h2 {
    font-size: 28px;
  }
  .builder-quote-design dl > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .custom-progress-track i {
    transition: none;
  }
}

/* Clear geometry and local detail without interrupting the four-step flow. */
.custom-type-grid button.selected {
  background: var(--cream);
  border-color: var(--navy);
  box-shadow: inset 0 0 0 1px var(--navy);
}
.builder-detail {
  border-bottom: 1px solid var(--line);
  margin: 12px 0;
  padding: 0 0 12px;
  color: var(--ink);
  font-size: 14px;
}
.builder-detail summary {
  min-height: 44px;
  align-content: center;
  cursor: pointer;
  font-weight: 750;
  text-underline-offset: 4px;
}
.builder-detail summary:hover {
  color: var(--rust);
  text-decoration: underline;
}
.builder-detail summary:focus-visible {
  outline: 3px solid var(--rust);
  outline-offset: 3px;
}
.builder-detail a {
  display: inline-block;
  color: var(--rust);
  padding: 8px 0 16px;
  text-underline-offset: 4px;
}
.builder-detail img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.measurement-guide {
  background: var(--cream);
  border: 0;
  border-radius: 10px;
  padding: 24px;
}
.measurement-guide > figcaption {
  font-size: 21px;
  font-weight: 650;
}
.measurement-guide svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  margin: 18px 0;
}
.measurement-guide svg text {
  font: 650 25px "DM Sans", sans-serif;
  fill: var(--ink);
}
.measurement-guide svg .guide-small,
.measurement-guide svg .guide-label {
  font-size: 24px;
}
.guide-stairs {
  fill: none;
  stroke: var(--field-line);
  stroke-width: 3;
  stroke-linejoin: round;
}
.guide-rail {
  stroke: var(--navy);
  stroke-width: 8;
  stroke-linecap: round;
}
.guide-extension {
  fill: none;
  stroke: var(--copper);
  stroke-width: 1.5;
  stroke-dasharray: 4 5;
}
.guide-measure {
  fill: none;
  stroke: var(--copper);
  stroke-width: 2.5;
}
.guide-point,
.guide-count circle {
  fill: var(--paper);
  stroke: var(--copper);
  stroke-width: 2;
}
.measurement-guide svg .guide-numeral text {
  text-anchor: middle;
  font-size: 21px;
  fill: var(--copper);
}
.measure-instructions {
  padding-left: 23px;
  margin: 0;
  font-size: 16px;
}
.measure-instructions li + li {
  margin-top: 8px;
}
.guide-note {
  color: var(--muted);
  font-size: 14px;
  margin: 16px 0 0;
}
.preview-svg-label {
  font: 600 18px "DM Sans", sans-serif;
  fill: var(--navy);
}
.preview-ground {
  fill: var(--cream);
}
.preview-wall {
  fill: var(--stone);
  stroke: var(--line);
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.preview-stair-side,
.preview-tread,
.preview-riser {
  stroke: var(--field-line);
  stroke-width: 1.25;
  stroke-linejoin: round;
}
.preview-stair-side {
  fill: var(--line);
}
.preview-tread {
  fill: var(--cream);
}
.preview-riser {
  fill: var(--stone);
}
.preview-supports {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
}
.preview-fixing-point {
  fill: var(--paper);
  stroke: var(--copper);
  stroke-width: 2.5;
}
.preview-endpoint {
  fill: var(--paper);
  stroke: var(--navy);
  stroke-width: 1.5;
}
.preview-diagram-note,
.preview-fixing-note {
  margin: 0 auto 8px;
  color: var(--muted);
  max-width: 42ch;
  font-size: 13px;
  line-height: 1.5;
}
.preview-fixing-note {
  color: var(--ink);
  font-weight: 650;
}
.preview-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 18px 24px;
  background: var(--cream);
  color: var(--muted);
  font-size: 12px;
}
.preview-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-weight: 700;
}
.legend-fixing {
  width: 11px;
  height: 11px;
  border: 2px solid var(--copper);
  border-radius: 50%;
  background: var(--paper);
}
.preview-legend p {
  margin: 0;
}
@media (min-width: 761px) and (max-width: 1250px) {
  .custom-type-grid {
    grid-template-columns: 1fr;
  }
  .custom-type-grid button {
    display: grid;
    grid-template-columns: minmax(160px, .8fr) 1fr;
    grid-template-rows: auto 1fr;
    padding: 0;
  }
  .custom-type-grid img {
    grid-row: 1 / 3;
    height: 100%;
    border-bottom: 0;
  }
  .custom-type-grid span {
    margin-bottom: 18px;
  }
}
@media (min-width: 761px) and (max-width: 1050px) {
  .custom-type-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .custom-type-grid button {
    display: flex;
  }
  .custom-type-grid img {
    height: auto;
  }
}
@media (min-width: 761px) and (max-width: 1050px) {
  .custom-preview {
    grid-template-columns: minmax(300px, .85fr) 1fr;
  }
  .preview-legend {
    grid-column: 1;
  }
  .preview-summary {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: stretch;
  }
}
@media (max-width: 560px) {
  .measurement-guide {
    padding: 20px 14px;
  }
  .measurement-guide > figcaption {
    font-size: 19px;
  }
  .measure-instructions {
    font-size: 15px;
  }
  .measurement-guide svg {
    margin: 18px 0;
  }
  .preview-legend {
    padding-inline: 20px;
  }
}

/* Keep artwork colours in product swatches; theme the explanatory geometry only. */
.custom-type-grid button:hover {
  background: var(--cream);
}
.custom-builder :is(button, summary, a):focus-visible,
.builder-quote-dialog :is(button, input, select, textarea, a):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}
.measure-tabs button:hover,
.builder-choice-row button:hover {
  border-color: var(--navy);
}
.custom-builder :is(input, select),
.builder-quote-dialog :is(input, select, textarea) {
  caret-color: var(--copper);
  accent-color: var(--navy);
}
.builder-quote-dialog ::selection,
.custom-builder ::selection {
  background: var(--focus-light);
  color: var(--ink);
}
.measurement-guide marker path {
  fill: var(--copper);
}
.custom-review dd {
  overflow-wrap: anywhere;
}
@media (max-width: 560px) {
  .custom-progress > div:first-child {
    min-width: 0;
  }
  .custom-type-grid strong,
  .custom-type-grid span {
    margin-inline: 18px;
  }
  .preview-summary {
    padding: 24px 20px;
  }
  .preview-price {
    gap: 8px;
  }
}
