@scope (#wood-mdf-medicine-cabinets-content) {
  .part-choice {
    display: inline-block;
    padding: 0 0 3px;
    border: 0;
    border-bottom: 1px solid #73867b;
    background: transparent;
    color: #243e32;
    font: 700 1rem/1.4 system-ui, sans-serif;
    text-align: left;
    cursor: pointer;
  }

  .part-choice[aria-pressed="true"] {
    color: #8b551d;
    border-bottom: 2px solid #8b551d;
  }

  .part-material {
    display: block;
    margin-top: 6px;
    color: #28513d;
    font-weight: 700;
  }

  .part-material:empty {
    display: none;
  }

  #material-builder .component-context {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 650;
    color: #f2dfc1;
  }

  .part-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .part-shortcuts button {
    padding: 10px 16px;
    min-height: 44px;
    border: 1px solid #bccbc366;
    background: transparent;
    color: #f5f7f5;
    font: 600 .92rem/1.2 system-ui, sans-serif;
    cursor: pointer;
  }

  .part-shortcuts button[aria-pressed="true"] {
    background: #f2dfc1;
    border-color: #f2dfc1;
    color: #20332a;
  }

  #material-builder .selection-output {
    margin-top: 2px;
  }

  #frame-material,
  #body-material,
  #back-material,
  #shelf-material,
  #style-reference {
    scroll-margin-top: var(--wood-anchor-offset, 150px);
  }

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

  .interface-card {
    min-width: 0;
    border: 1px solid #d8d5ca;
    background: white;
  }

  .interface-card figure {
    margin: 0;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: #efe8df;
  }

  .interface-card img {
    display: block;
    width: 100%;
    height: auto;
  }

  .interface-copy {
    display: grid;
    gap: 14px;
    padding: 24px;
  }

  .interface-copy h3 {
    margin: 0;
    font-size: 1.65rem;
    line-height: 1.15;
  }

  .interface-copy p {
    margin: 0;
    color: #5d6860;
    font-size: .96rem;
    line-height: 1.6;
  }

  .interface-copy .button {
    min-height: 48px;
    justify-content: center;
    text-align: center;
    white-space: normal;
    height: auto;
    padding: 12px 14px;
  }

  .text-link {
    display: inline-block;
    justify-self: start;
    border: 0;
    padding: 2px 0;
    background: transparent;
    color: #285947;
    font: 600 .9rem/1.45 system-ui, sans-serif;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
  }

  .installation-link {
    margin: 24px 0 0;
    max-width: 90ch;
    color: #5d6860;
  }

  .installation-link a {
    color: #285947;
    text-decoration: underline;
  }

  :is(.part-shortcuts, .component-list) button:focus-visible,
  .text-link:focus-visible {
    outline: 3px solid #ba8c46;
    outline-offset: 4px;
  }

  .hero .actions > a {
    padding-inline: 18px;
  }

  @media (max-width: 740px) {
    .interface-grid {
      grid-template-columns: minmax(0, 1fr);
      gap: 20px;
    }

    .interface-copy {
      padding: 20px;
    }

    .part-shortcuts {
      gap: 6px;
    }

    .part-shortcuts button {
      padding: 10px 11px;
      font-size: .86rem;
    }

    .hero .actions > a {
      padding-inline: 12px;
    }
  }
}

/* Keep component controls legible against the site's shared button treatment. */
#wood-mdf-medicine-cabinets-content .part-shortcuts button {
  border: 1px solid #bccbc366 !important;
  background: transparent !important;
  color: #f5f7f5 !important;
  box-shadow: none !important;
}
#wood-mdf-medicine-cabinets-content .part-shortcuts button[aria-pressed="true"] {
  border-color: #f2dfc1 !important;
  background: #f2dfc1 !important;
  color: #20332a !important;
}
#wood-mdf-medicine-cabinets-content .part-choice {
  padding: 0 0 3px !important;
  min-height: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid #73867b !important;
  background: transparent !important;
  color: #243e32 !important;
  box-shadow: none !important;
}
#wood-mdf-medicine-cabinets-content .part-choice[aria-pressed="true"] {
  border-bottom: 2px solid #8b551d !important;
  color: #8b551d !important;
}

@scope (#wood-mdf-medicine-cabinets-content) {
  .route-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .material-samples {
    display: block;
    margin: 0;
    background: #f7f1e8;
    color: #243e32;
  }

  .material-samples img {
    display: block;
    width: 100%;
    height: auto;
  }

  .material-samples figcaption {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    padding: 18px 22px;
    background: #f7f1e8;
    font-size: .92rem;
    line-height: 1.5;
  }

  .material-samples strong {
    display: block;
    margin-bottom: 5px;
  }

  .image-zoom {
    display: block;
    cursor: zoom-in;
  }

  .image-zoom:focus-visible {
    outline: 3px solid #bb8243;
    outline-offset: 3px;
  }

  .anatomy-photo .image-zoom {
    width: 100%;
    height: 100%;
  }

  @media (max-width: 740px) {
    .route-list {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .route-list .route {
      min-height: 128px;
    }
    .route-list .route strong {
      font-size: 1.25rem;
    }
    .route-list .route small {
      font-size: .88rem;
    }
    .material-samples figcaption {
      gap: 10px;
      padding: 14px 12px;
      font-size: .78rem;
    }
  }
}
.material-image-dialog {
  width: min(1300px, calc(100% - 28px));
  max-width: calc(100% - 28px);
  max-height: 94dvh;
  overflow: auto;
  padding: 48px 12px 12px;
  border: 0;
  background: #fbfaf7;
}
.material-image-dialog::backdrop {
  background: #15201dd9;
}
.material-image-dialog > img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(94dvh - 64px);
  object-fit: contain;
}
.material-image-dialog [data-image-close] {
  position: absolute;
  top: 8px;
  right: 12px;
  min-height: 36px;
  padding: 5px 12px;
  border: 1px solid #526458;
  color: #243e32;
  background: #fff;
  cursor: pointer;
}

@scope (#wood-mdf-medicine-cabinets-content) {
  .material-samples .image-zoom {
    width: 100%;
    aspect-ratio: 5 / 2;
    overflow: hidden;
  }

  .material-samples .image-zoom img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 50%;
  }
}

@scope (#wood-mdf-medicine-cabinets-content) {
  .part-list .component { padding-block: 14px; }
  .risk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .risk { padding: 24px; }
  .risk p { max-width: 64ch; font-size: .95rem; }
  .sample-case {
    padding: 28px;
    border: 1px solid #8ea39866;
    background: #ffffff08;
  }
  .example-label {
    margin: 0 0 22px;
    color: #ebcfaa;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .06em;
  }
  .sample-schedule {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
    gap: 24px;
  }
  .sample-schedule > div { min-width: 0; }
  .sample-schedule dt {
    margin-bottom: 9px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
  }
  .sample-schedule dd {
    margin: 0;
    color: #d7e1da;
    font-size: .95rem;
    line-height: 1.6;
  }
  .sample-outcome {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px 36px;
    align-items: center;
    margin-top: 26px;
    padding-top: 24px;
    border-top: 1px solid #8ea39866;
  }
  .sample-outcome h3, .approval-record h3 {
    margin: 0 0 9px;
    color: #fff;
    font-size: 1.55rem;
    line-height: 1.2;
  }
  .sample-outcome p, .approval-record p {
    margin: 0;
    color: #d7e1da;
    font-size: .95rem;
    line-height: 1.6;
  }
  .sample-outcome button {
    max-width: 260px;
    min-height: 48px;
    height: auto;
    padding: 12px 18px;
    text-align: center;
    white-space: normal;
  }
  .sample-outcome button:focus-visible {
    outline: 3px solid #edc58e;
    outline-offset: 4px;
  }
  .approval-record { margin-top: 28px; max-width: 100ch; }
  @media (max-width: 1000px) {
    .sample-outcome { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .sample-outcome button { justify-self: start; max-width: none; }
  }
  @media (max-width: 740px) {
    .risk-grid, .sample-schedule { grid-template-columns: minmax(0, 1fr); }
    .risk { padding: 20px; }
    .sample-case { padding: 20px; }
    .sample-schedule { gap: 16px; }
    .sample-schedule > div + div { border-top: 1px solid #8ea39844; padding-top: 16px; }
    .sample-outcome { margin-top: 20px; padding-top: 20px; }
  }
}
