:root { --site-header-height: 109px; scroll-padding-top: var(--site-header-height); }
@media (max-width: 760px) {
  :root { --site-header-height: 101px; }
}

.summary-rail { top: calc(var(--site-header-height) + 1rem); }
.expert-print-note { margin: .65rem 0; }

.expert-print-dimensions { margin: .6rem 0; }
.expert-print-dimensions dl { margin: .5rem 0 0; }
.expert-print-dimensions dt { font-weight: 700; }
.expert-print-dimensions dd { margin: 0 0 .55rem; }
.expert-print-dimensions dd > span { display: block; }

.expert-section-index, .expert-fit-alert { min-width: 0; }
.expert-section-index[hidden], .expert-fit-alert[hidden],
body[data-expert-sections] [data-expert-section-inactive],
body[data-expert-sections] .workflow-strip { display: none; }

.expert-section-index {
  display: flex;
  flex-direction: column;
  gap: .22rem;
  padding: .65rem;
  background: #fffdf8;
  border: 1px solid #d8ded5;
  border-radius: 12px;
}
.expert-section-link {
  padding: .65rem .55rem;
  border-radius: 6px;
  color: #21392e;
  text-decoration: none;
}
.expert-section-link[aria-current] {
  background: #e6f0ea;
  color: #1e5444;
  font-weight: 700;
}
.expert-section-picker { display: none; }
.expert-fit-alert {
  grid-column: 1 / -1;
  padding: .85rem 1rem;
  border: 1px solid #e5c7b8;
  border-radius: 12px;
  color: #6b301f;
  background: #fff1ea;
}
.expert-fit-alert h2, .expert-fit-alert p { margin: 0 0 .45rem; }

body[data-expert-sections] #construction-step .feature-grid { grid-template-columns: minmax(0, 1fr); }
body[data-expert-sections] #construction-step .feature-badge { display: none; }
body[data-expert-sections] #joinery-step .feature-badge,
body[data-expert-sections] #joinery-step .feature-grid:not(:has(> .feature-tile:not([hidden]))),
body[data-expert-sections] #proof-joinery-settings:not(:has(> :not([hidden]))),
body[data-expert-sections] #proof-export-mode-status[data-state="ready"],
body[data-expert-sections] #proof-export-mode-editor .field-label[hidden],
body[data-expert-sections] #proof-export-mode-editor > .technical-details { display: none; }
body[data-expert-sections] #joinery-step .feature-tile { min-height: 0; }
body[data-expert-sections] #proof-drawkey-settings .joinery-parameter-grid { margin-top: .55rem; }
body[data-expert-sections] #proof-drawkey-settings .status-line { margin-bottom: .5rem; }
body[data-expert-sections] #output-step .card-body > .control-grid { grid-template-columns: minmax(0, 1fr); }
html[data-choice-groups="ready"] body[data-expert-sections] #output-step .choice-select-fallback { display: none; }

#expert-output-plan { margin-top: .85rem; padding: .7rem .8rem; background: var(--surface-2); border-radius: .55rem; }
#expert-output-plan h3 { margin: 0; font-size: .92rem; }
#expert-output-plan ul { display: flex; flex-wrap: wrap; gap: .25rem .55rem; list-style: none; margin: .45rem 0 0; padding: 0; }
#expert-output-plan li { padding: .18rem .45rem; border: 1px solid var(--border); border-radius: .3rem; font-size: .8rem; }
#expert-output-plan p { margin: .4rem 0 0; font-size: .8rem; color: var(--muted); }
#expert-output-plan ul[hidden] { display: none; }

.expert-retention-option > #proof-rebate-editor { margin: 0; min-width: 0; }
.expert-retention-option #proof-rebate-editor-grid label[hidden] { display: none; }
html[data-choice-groups="ready"] .expert-retention-option #proof-rebate-depth-mode-fallback { display: none; }
.expert-cam-count { margin: .25rem 0 .55rem; }
.expert-cam-details { margin: 0 0 .55rem; }
.expert-cam-details > .joinery-parameter-grid { margin-top: .5rem; }
body[data-expert-sections][data-expert-retention-blocked] :is(
  #proof-status, #proof-readiness-detail, #proof-strip-settings-status, #proof-retention-cam-hole-settings-status,
  #proof-extender-settings-status, #proof-drawkey-settings-status
) { display: none; }

@media (min-width: 1050px) {
  body[data-expert-sections] .workspace {
    grid-template-columns: minmax(154px, .55fr) minmax(0, 2.25fr) minmax(235px, 1fr);
  }
  body[data-expert-sections] .workspace .results-card { grid-column: 2 / -1; }
  body[data-expert-sections] .expert-section-index,
  body[data-expert-sections] .summary-rail {
    position: sticky;
    top: calc(var(--site-header-height) + 1rem);
  }
}
@media (max-width: 1049px) {
  :root:has(body[data-expert-sections]) {
    scroll-padding-top: calc(var(--expert-picker-height, 56px) + .5rem);
  }
  body[data-expert-sections] .site-header { position: static; }
  body[data-expert-sections] .workspace { grid-template-columns: minmax(0, 1fr); }
  body[data-expert-sections] .summary-rail { position: static; }
  body[data-expert-sections] .app-shell > .expert-section-index {
    position: sticky;
    inset-block-start: 0;
    z-index: 19;
    margin-block-end: .75rem;
    padding: .3rem .55rem;
  }
  .expert-section-link { display: none; }
  .expert-section-picker {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    gap: .55rem;
    font-size: .875rem;
    font-weight: 650;
  }
  .expert-section-picker select { min-width: 0; min-height: 44px; font-size: 1rem; }
}

body[data-expert-sections] :is(.config-stack h2, #proof-strip-thickness) { scroll-margin-block-start: 1rem; }

body[data-expert-sections] #construction-step .feature-grid { gap: .45rem; }
body[data-expert-sections] #construction-step .feature-tile { min-height: 0; padding: .6rem .7rem; }
body[data-expert-sections][data-expert-retention-blocked] #proof-readiness-badge,
body[data-expert-sections] #proof-profile-note { display: none; }

.expert-context-link {
  color: #1e5444;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: .18em;
}
.expert-context-link[hidden], .expert-catalog-finish[hidden] { display: none; }
.expert-catalog-finish { margin-bottom: .9rem; }
.expert-added-panel .finish-presentation { margin: .65rem 0 0; }
body:not([data-expert-sections]) .expert-added-panel { display: none; }

.expert-compatibility[hidden] { display: none; }

#proof-frame-dimension-grid:not([data-expert-inches]) .expert-inches,
#proof-frame-dimension-grid[data-expert-inches] .expert-millimeters { display: none; }
#expert-inches-hint { margin: 0; }
#expert-inches-hint[hidden], .expert-earlier-results[hidden] { display: none; }
.expert-earlier-results { margin: .75rem 1rem; }
.expert-earlier-results { overflow-wrap: anywhere; }

.expert-field-with-help { min-width: 0; }
#proof-rebate-editor[data-depth-mode="source_default"] .expert-field-with-help:has(.rebate-parameter-field) { display: none; }
.expert-field-help { margin: .15rem 0 0; }
.expert-field-help summary {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding-inline: .3rem;
  color: var(--muted);
  cursor: pointer;
  font-size: .75rem;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: .15em;
  list-style: none;
}
.expert-field-help summary::-webkit-details-marker { display: none; }
.expert-field-help summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.expert-field-help p { margin: .15rem 0 .35rem; color: var(--muted); font-size: .78rem; }
