/* Operate: keep the current task close to its reference and continuation.
   The controls lead in source order; the desktop grid places the stage left.
   Loaded after the original builder sheet and before the embedded overrides. */
.dh-page {
  --dh-ink: #162033;
  --dh-muted: #465166;
  --dh-line: #cbd2dc;
  color: var(--dh-ink);
  padding-block: 1rem 3rem;
}

.dh-heading {
  max-width: none;
  margin: .5rem 0 1.25rem;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--dh-ink);
}
.dh-heading h1 {
  max-width: 30ch;
  margin: .25rem 0 .5rem;
  font-size: clamp(1.75rem, 2.6vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -.015em;
}
.dh-heading > p { max-width: 65ch; margin: 0; color: var(--dh-muted); font-size: .9375rem; line-height: 1.5; }
.dh-heading .dh-model-label { color: var(--nachon-blue-dark); font-size: .875rem; font-weight: 750; }
.dh-mobile-continuation { border-top: 1px solid var(--dh-line); padding-top: .625rem; }
.dh-mobile-continuation a { color: var(--nachon-blue-dark); text-underline-offset: .2em; }

.dh-stepper ol { gap: .5rem; border: 0; margin-bottom: 1.25rem; }
.dh-stepper li { flex: 1; min-width: 0; }
.dh-stepper a {
  height: 100%;
  min-height: 48px;
  padding: .625rem .75rem;
  border: 1px solid var(--dh-line);
  border-bottom: 4px solid var(--dh-line);
  color: var(--dh-muted);
  line-height: 1.35;
}
.dh-stepper a:hover { background: var(--selector-selected); color: var(--nachon-blue-dark); }
.dh-stepper a[aria-current="step"] {
  background: var(--nachon-blue);
  color: #fff;
  border-color: var(--nachon-blue);
  border-bottom-color: var(--nachon-yellow);
}

.dh-workspace { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
.dh-controls, .dh-stage { min-width: 0; grid-column: auto; grid-row: auto; }
.dh-controls [data-step] > h2, .dh-controls [data-step] > section > h2 {
  display: block;
  padding: 0;
  margin: 0 0 .5rem;
  border: 0;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.2;
}
.dh-step-intro { max-width: 58ch; margin: 0 0 1rem; color: var(--dh-muted); }
.dh-controls fieldset { margin-bottom: 1.25rem; }
.dh-controls legend { font-size: 1rem; margin-bottom: .625rem; }
.dh-controls label { font-size: .9375rem; }
.dh-controls input:not([type=radio]), .dh-controls select { min-height: 48px; padding: .625rem .75rem; }
.dh-dimensions { align-items: end; }
.dh-dimensions > :last-child { grid-column: auto; }
.dh-note { line-height: 1.55; }
.dh-controls .dh-option { padding: .875rem; border-radius: 2px; line-height: 1.4; }
.dh-controls .dh-option:has(input:checked) {
  border: 2px solid var(--nachon-blue);
  padding: calc(.875rem - 1px);
  background: var(--selector-selected);
  color: var(--nachon-blue-dark);
}
.dh-option small { margin-top: .2rem; line-height: 1.4; }
.dh-swing .dh-options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.dh-swing .dh-option { display: grid; grid-template-columns: 1.25rem 1fr; align-items: center; }
.dh-swing .dh-option svg { justify-self: center; }
.dh-swing .dh-option span { grid-column: 1 / -1; text-align: center; }
.dh-rosettes .dh-option { flex: 1 1 12rem; }
.dh-rosettes .dh-option > span { min-width: 0; }
[data-step="4"] .dh-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
[data-step="4"] .dh-option img { width: 40px; height: 40px; flex: none; }

.dh-tabs { gap: .5rem; margin-block: 1rem 1.25rem; }
.dh-tabs a { font-size: .875rem; font-weight: 650; line-height: 1.4; }
.dh-tabs a[aria-current="page"] { color: #fff; background: var(--nachon-blue); }
.dh-products { gap: 1rem; align-items: start; }
.dh-products > p { grid-column: 1 / -1; padding: 1rem; margin: 0; background: var(--selector-stage); line-height: 1.55; }
/* Accommodates the current card and PR #2630's named media/title wrappers.
   Keep that PR's search hooks and catalog behavior in its own change. */
.dh-product { min-width: 0; color: var(--dh-ink); }
.dh-product > div { overflow: hidden; border: 1px solid var(--dh-line); border-radius: 2px; }
.dh-product img { min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; object-fit: contain; }
.dh-product > span, .dh-product-title { line-height: 1.4; overflow-wrap: anywhere; }
.dh-product[aria-current="true"] { color: var(--nachon-blue-dark); border-bottom-color: var(--nachon-blue); }
.dh-product[aria-current="true"] > div { border: 2px solid var(--nachon-blue); background: var(--selector-selected); }
.dh-pagination { margin-bottom: 1rem; }
.dh-placement { border-top: 1px solid var(--dh-line); border-bottom: 1px solid var(--dh-line); padding-block: .75rem; }
.dh-placement > summary { display: list-item; padding-block: .5rem; color: var(--nachon-blue-dark); }

.dh-stage { position: static; padding: 1.25rem; border: 1px solid var(--dh-line); border-top: 4px solid var(--nachon-blue); }
.dh-stage > h2 { display: block; margin: 0 0 .5rem; padding: 0; border: 0; font-size: 1.125rem; }
.dh-stage-summary { margin: 0 0 1.25rem; font-size: .875rem; line-height: 1.55; color: var(--dh-muted); overflow-wrap: anywhere; }
.dh-stage figure > img { display: block; height: min(42vh, 380px); }
.dh-stage figcaption { margin-top: .5rem; font-size: .875rem; }
.dh-swing-plan[hidden] { display: none; }
.dh-swing-plan svg { width: 8rem; height: 8rem; flex: none; }
.dh-swing-plan figcaption { margin: 0; }
.dh-preview-caption { line-height: 1.55; }
.dh-hardware-selected { display: grid; grid-template-columns: 6rem minmax(0, 1fr); column-gap: 1rem; margin-top: 1rem; padding-top: 1rem; }
.dh-hardware-selected h3 { grid-column: 2; margin: 0; font-size: 1rem; line-height: 1.4; overflow-wrap: anywhere; }
.dh-hardware-selected .dh-note { grid-column: 2; margin-bottom: 0; }
.dh-hardware-photo { grid-column: 1; grid-row: 1 / span 2; align-self: start; padding: .5rem; border: 1px solid var(--dh-line); }
.dh-hardware-photo img { display: block; height: 88px; }
.dh-stage:focus { outline: 3px solid var(--nachon-blue); outline-offset: 3px; }

.dh-review-list { gap: 0; border-top: 1px solid var(--dh-line); }
.dh-review-list div { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); align-items: center; padding: .625rem 0; }
.dh-review-list dt { font-size: .875rem; font-weight: 600; color: var(--dh-muted); }
.dh-review-list dd { font-size: .9375rem; font-weight: 650; }
.dh-review-list dd > span { min-width: 0; overflow-wrap: anywhere; }
.dh-review-list a { flex: none; padding-inline: .5rem; font-size: .875rem; text-underline-offset: .2em; }
.dh-quote-form { display: grid; gap: 1.5rem; }
.dh-quantity { max-width: 12rem; }
.dh-cart-route { padding: 1rem; background: var(--selector-selected); border: 1px solid var(--dh-line); }
.dh-cart-route h3, .dh-direct-route h3 { margin: 0 0 .75rem; font-size: 1.125rem; line-height: 1.35; }
.dh-cart-route .dh-note { margin: 0 0 1rem; }
.dh-cart-actions { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; }
.dh-cart-actions a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; text-underline-offset: .2em; }
.dh-direct-route { border-top: 1px solid var(--dh-line); padding-top: 1.5rem; }
.dh-contact-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.dh-direct-route .dh-note { margin-block: 1rem; }
.dh-quote-form button { min-height: 48px; font: inherit; font-weight: 700; }
.dh-quote-form button:disabled { opacity: .65; cursor: default; }
.dh-feedback:empty { margin: 0; }

.dh-step-nav, .dh-stepper-on .dh-step-nav {
  position: static;
  margin-top: 1.5rem;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--dh-line);
  background: #fff;
  justify-content: flex-end;
}
.dh-running-summary-bar { display: none; }
.dh-step-nav .btn-cta, .dh-step-nav .btn-secondary { min-height: 50px; min-width: 8rem; font: inherit; font-weight: 750; }
.dh-step-nav .btn-cta { min-width: 11rem; }
.dh-page :focus-visible { outline: 3px solid var(--nachon-blue-dark); outline-offset: 3px; box-shadow: var(--focus-ring); }
.dh-page [hidden] { display: none; }

@media (min-width: 900px) {
  .dh-workspace { grid-template-columns: minmax(260px, .8fr) minmax(0, 1.25fr); gap: clamp(1.5rem, 3vw, 2.5rem); }
  .dh-stage { grid-column: 1; grid-row: 1; position: sticky; top: 1.5rem; }
  .dh-controls { grid-column: 2; grid-row: 1; }
}
@media (min-width: 1024px) {
  body:has(.dh-stepper-on) { padding-bottom: 0; }
}
@media (max-width: 760px) {
  .dh-page { padding-top: 1rem; }
  .dh-heading { margin-top: .5rem; }
  .dh-mobile-continuation .dh-running-summary-top { font-size: .8125rem; font-weight: 500; }
  .dh-stepper ol { gap: .375rem; margin-bottom: 1.5rem; }
  .dh-stepper li { flex-basis: calc(50% - .375rem); }
  .dh-stepper a { padding: .625rem .75rem; min-height: 48px; font-size: .875rem; }
  .dh-workspace { gap: 1.5rem; }
  .dh-products { gap: .875rem; }
  .dh-stage figure > img { height: 280px; }
  .dh-contact-fields { grid-template-columns: minmax(0, 1fr); }
  .dh-step-nav .btn-cta { flex: 1; }
}
@media (max-width: 420px) {
  .dh-dimensions { gap: .75rem; }
  .dh-dimensions label { font-size: .875rem; }
  [data-step="4"] .dh-options { grid-template-columns: minmax(0, 1fr); }
  .dh-review-list div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .dh-cart-actions .btn-secondary, .dh-direct-route > .btn-cta { width: 100%; }
}

/* Preserve the embedded task's compact hierarchy and existing responsive grid. */
html.embed .dh-heading { background: transparent; border: 0; padding: 0; color: var(--dh-ink); }
html.embed .dh-heading > p { color: var(--dh-muted); }
html.embed .dh-heading .dh-model-label { color: var(--nachon-blue-dark); margin-bottom: .5rem; }
html.embed .dh-stepper a[aria-current="step"] { color: var(--nachon-blue-dark); }
@media (max-width: 760px) {
  /* The embedded reference grid reserves its first column for the door only. */
  html.embed .dh-stage:has(> figure:not(.dh-preview)) > .dh-hardware-selected { grid-column: 1 / -1; }
}
