/* Keep the existing site shell, fonts and palette. */
body {
  display: flex;
  flex-direction: column;
}
.bom-masthead {
  text-align: center;
  padding: 32px 24px 28px;
}
.masthead-brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  text-decoration: none;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 300;
  letter-spacing: -0.035em;
}
.masthead-brand img {
  width: auto;
  height: 105px;
  object-fit: contain;
  margin-bottom: 10px;
  filter: drop-shadow(0 4px 8px #0005);
}
.bom-card {
  display: flex;
  flex-direction: column;
  width: min(1040px, calc(100% - 48px));
  height: clamp(640px, calc(100svh - 420px), 800px);
  margin: 40px auto 56px;
  padding: clamp(24px, 3vw, 32px);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 8px 24px #0000001a;
}
h1 {
  flex-shrink: 0;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}
#app {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.intro {
  max-width: 680px;
  margin: 0 auto;
}
[hidden] {
  display: none !important;
}
.question-panel > label {
  flex-shrink: 0;
  display: block;
  font-weight: 400;
}
.configuration {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 680px;
  margin: 20px auto 0;
}
.question-progress {
  flex-shrink: 0;
  margin-bottom: 20px;
}
#question-progress {
  color: var(--green-dark);
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.step-markers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.step-markers li {
  height: 4px;
  border-radius: 4px;
  background: var(--border);
}
.step-markers li.is-current,
.step-markers li.is-complete {
  background: var(--green);
}
.question-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 0;
}
.question-explanation {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  overscroll-behavior-y: contain;
  margin-bottom: 20px;
  padding-right: 8px;
}
.question-explanation::-webkit-scrollbar {
  width: 8px;
}
.question-explanation::-webkit-scrollbar-track {
  background: var(--page);
  border-radius: 4px;
}
.question-explanation::-webkit-scrollbar-thumb {
  background: var(--muted);
  border: 2px solid var(--page);
  border-radius: 4px;
}
.question-explanation .question-blurb {
  margin-bottom: 0;
}
#configuration-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.question-panel h2 {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
}
.question-panel h2:focus,
#export-title:focus {
  outline: none;
}
.question-blurb {
  margin: 0 0 24px;
}
.choice-guide {
  margin: 0;
}
.choice-guide > div + div {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.choice-guide dt {
  font-weight: 400;
  color: var(--text);
}
.choice-guide dd {
  margin: 4px 0 0;
  text-align: left;
  color: var(--muted);
}
.choice-impact {
  flex-shrink: 0;
  margin: 16px 0 0;
  padding: 14px 16px;
  border-left: 3px solid var(--green);
  background: color-mix(in srgb, var(--green) 6%, var(--surface));
  font-size: 0.9rem;
}
.question-navigation {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
#next-question {
  margin-left: auto;
  min-width: 128px;
}
.results {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: visible;
  max-width: 680px;
  margin: 20px auto 0;
  padding: 0;
  border: 0;
}
.build-complete {
  margin-bottom: 8px;
  color: var(--green-dark);
  font-size: 0.9rem;
}
.build-review {
  margin: 8px 0 12px;
}
.build-review > div {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 0;
}
.results-actions {
  margin-top: auto;
}
.results .exports {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.results .exports button {
  padding-inline: 8px;
}
#return-to-beginning {
  width: 100%;
  margin-top: 12px;
}
.build-review dt {
  color: var(--muted);
}
.build-review dd {
  margin: 0;
}
button.edit-answer {
  border: 0;
  background: transparent;
  color: var(--green-dark);
  padding: 8px 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
button.edit-answer:hover {
  color: var(--text);
  background: transparent;
}
#download-title {
  margin: 0 0 16px;
}
.select-control {
  display: block;
  position: relative;
  margin-top: 8px;
}
.select-control::after {
  content: "";
  position: absolute;
  top: calc(50% - 6px);
  right: 18px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}
select {
  appearance: none;
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 11px 44px 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-weight: 400;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
}
select:hover {
  border-color: var(--muted);
}
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}
.configuration-summary {
  margin-bottom: 20px;
  color: var(--text);
}
.exports {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
button {
  margin-top: 0;
  min-height: 46px;
  cursor: pointer;
}
button:hover {
  background: var(--green-dark);
}
button.secondary {
  color: var(--text);
  background: var(--surface);
  border-color: var(--muted);
}
button.secondary:hover {
  background: var(--page);
}
#export-status:empty {
  display: none;
}
#export-status {
  margin: 8px 0 0;
  font-size: 0.9rem;
  line-height: 1.4;
}
#storage-status {
  margin: 16px 0 0;
}
.print-only {
  display: none;
}
footer {
  margin-top: auto;
}
.skip {
  z-index: 20;
}
@media (max-width: 760px) {
  .build-review > div {
    grid-template-columns: 1fr auto;
    gap: 2px 12px;
  }
  .build-review dt {
    grid-column: 1;
    font-size: 0.85rem;
  }
  .build-review dd {
    grid-column: 1;
  }
  .build-review dd:last-child {
    grid-column: 2;
    grid-row: 1 / 3;
  }
  .question-navigation {
    gap: 10px;
  }
  #next-question {
    min-width: 0;
  }
  .bom-masthead {
    padding-top: 70px;
  }
  .bom-card {
    width: calc(100% - 32px);
    height: clamp(640px, calc(100svh - 394px), 800px);
    margin: 24px auto 32px;
    padding: 24px 20px;
  }
}
@media (prefers-color-scheme: dark) {
  #question-progress,
  .build-complete,
  button.edit-answer {
    color: #7de1a3;
  }
}
@media (forced-colors: active) {
  select {
    appearance: auto;
  }
  .select-control::after {
    display: none;
  }
}
@media print {
  @page {
    size: auto;
    margin: 14mm;
  }
  :root {
    color-scheme: light;
    --text: #000;
    --muted: #333;
    --surface: #fff;
    --border: #bbb;
    --green: #000;
    --green-dark: #000;
  }
  body {
    display: block;
    background: #fff;
    font-size: 10pt;
  }
  html {
    scrollbar-gutter: auto;
  }
  #app {
    display: block;
  }
  header,
  footer,
  .skip,
  .configuration,
  .build-review,
  .build-complete,
  #download-title,
  .intro,
  .results-actions,
  #export-title,
  #storage-status,
  #change-status,
  noscript {
    display: none !important;
  }
  .print-only {
    display: block;
  }
  #build-results[hidden] {
    display: block !important;
  }
  .bom-card {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    line-height: 1.25;
  }
  h1 {
    text-align: left !important;
    font-size: 19pt;
  }
  .results {
    display: block;
    overflow: visible;
    scrollbar-gutter: auto;
    margin: 16px 0 0;
    padding: 0;
    border: 0;
  }
  .configuration-summary {
    font-size: 10pt;
  }
  .bom-category {
    margin-top: 12px;
    padding-top: 0;
    border-top: 0;
    break-inside: avoid;
  }
  .bom-category h3 {
    margin: 0;
    padding: 8px 0;
    font-size: 12pt;
    border-bottom: 1px solid #000;
    break-after: avoid;
  }
  .bom-table {
    table-layout: fixed;
    font-size: 10pt;
  }
  .bom-table .quantity-column {
    width: 110px;
  }
  .bom-table th,
  .bom-table td {
    padding: 4px 6px;
    overflow-wrap: anywhere;
  }
  .bom-table th {
    font-weight: 400;
  }
  .bom-table tr {
    break-inside: avoid;
  }
  .bom-table thead {
    display: table-header-group;
  }
  .component-name,
  .specification {
    display: block;
  }
  .component-note,
  .specification,
  .required .unit {
    font-size: 9pt;
  }
  .component-note {
    margin: 2px 0 0;
  }
  .required {
    text-align: right;
  }
  .required .unit {
    display: inline;
    margin-left: 3px;
  }
}
