:root {
  --gold: #ebd50d;
  --gold-soft: rgba(235, 213, 13, 0.32);
  --gold-strong: rgba(255, 238, 140, 0.58);
  --text: #f7f1d0;
  --panel-a: rgba(8, 8, 8, 0.78);
  --panel-b: rgba(18, 18, 18, 0.86);
  --panel-c: rgba(28, 28, 28, 0.82);
  --quantity-grid: minmax(190px, 1fr) minmax(128px, 150px);
  --results-qty-width: 76px;
  --results-sqft-width: 96px;
  --results-card-title-size: 19px;
  --results-card-row-size: 16px;
  --results-card-header-size: 16px;
  --scale-card-title-size: 19px;
  --scale-row-size: 16px;
  --section-heading-size: 30px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 10% 0%, #323232 0%, #0a0a0a 30%, #000 100%);
}

.waiting-time-progress {
  width: min(420px, 86vw);
  margin: 0 auto;
}

.waiting-time-progress__track {
  position: relative;
  isolation: isolate;
  height: 20px;
  overflow: hidden;
  border: 1px solid rgba(235, 213, 13, 0.45);
  border-radius: 999px;
  background: rgba(13, 13, 13, 0.88);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7);
}

.waiting-time-progress__elapsed {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  padding: 0 8px;
  color: #f5e8a8;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  /*
   * Difference blending preserves the yellow label over the dark track, while
   * making it dark where the yellow fill has advanced underneath it.
   */
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
}

.waiting-time-progress__fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b79a10, #ebd50d);
  box-shadow: 0 0 10px rgba(235, 213, 13, 0.38);
  transition: width 0.4s ease;
}

.waiting-time-progress__labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: #f5e8a8;
  font-size: 0.9rem;
}

.solver-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 0 22px 22px;
}

.solver-page .brand-banner {
  width: calc(100% + 44px);
  margin: 0 -22px 22px;
  padding: clamp(0.75rem, 2vw, 1.5rem) clamp(0.75rem, 3vw, 2.5rem);
  background: #000;
}

.solver-page .brand-banner__image {
  max-height: min(14vw, 210px);
}

.solver-shell {
  width: min(1500px, 100%);
  margin: 0 auto;
}

.solver-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 30px;
}

.solver-left {
  display: flex;
  flex-direction: column;
  gap: 22px;
  order: 1;
}

.solver-right {
  order: 2;
}


.content-block,
.select-options-panel {
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(12,12,12,0.96), rgba(18,18,18,0.88));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 14px 28px rgba(0,0,0,0.18);
}

.select-options-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.options-heading {
  grid-column: 1 / -1;
  margin: 0 0 2px;
  color: #fff6c6;
  font-size: var(--section-heading-size);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.option-block {
  padding: 16px 18px;
}

.select-options-panel .option-block {
  border: 0;
  box-shadow: none;
  padding-right: 0;
  padding-left: 0;
}

.option-block--choice-one,
.option-block--choice-two,
.option-block--example {
  grid-column: 1 / -1;
}

.option-choice-label {
  display: block;
  cursor: pointer;
}

.option-choice-btn {
  appearance: none;
  align-self: start;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 0;
  border: 2px solid var(--gold);
  border-radius: 50%;
  cursor: pointer;
  background:
    radial-gradient(circle at 35% 32%, rgba(255, 255, 255, .2), transparent 26%),
    linear-gradient(145deg, #050505 0%, #171717 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .8),
    0 0 12px rgba(235, 213, 13, .24),
    inset 0 0 0 3px #050505;
}

.option-choice-btn:checked {
  border-color: #fff6c6;
  background:
    radial-gradient(circle, #fff6c6 0 34%, var(--gold) 35% 54%, transparent 56%),
    linear-gradient(145deg, #050505 0%, #171717 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .86),
    0 0 16px rgba(235, 213, 13, .62),
    0 0 28px rgba(235, 213, 13, .2),
    inset 0 0 0 3px #050505;
}

.option-choice-btn:focus-visible {
  outline: 2px solid #fff6a8;
  outline-offset: 3px;
}

.option-block--example .section-title {
  margin-bottom: 0;
  text-transform: none;
}

.collapsible-card__header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}

.collapsible-card__header .section-title {
  margin-bottom: 0;
}

.collapsible-card__content {
  padding-top: 8px;
}

.collapsible-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(235, 213, 13, .75);
  border-radius: 50%;
  background: linear-gradient(145deg, #050505 0%, #171717 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .8),
    0 0 12px rgba(235, 213, 13, .24),
    inset 0 1px 0 rgba(255,255,255,0.06);
  cursor: pointer;
}

.collapsible-toggle:hover {
  border-color: #fff6c6;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .8),
    0 0 16px rgba(235, 213, 13, .42),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

.collapsible-toggle:focus-visible {
  outline: 2px solid #fff6a8;
  outline-offset: 3px;
}

.collapsible-toggle__arrow {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #fff6c6;
  transition: transform .18s ease;
}

.collapsible-toggle[aria-expanded="true"] .collapsible-toggle__arrow {
  transform: rotate(180deg);
}

.attempt-note-emphasis {
  display: inline-block;
}

.section-title {
  margin: 0 0 8px;
  font-size: var(--section-heading-size);
  font-weight: 900;
  text-transform: uppercase;
  color: #fff6c6;
}
.section-subtitle {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
  color: #f5e8a8;
}
.section-copy {
  margin: 0;
  line-height: 1.3;
  font-size: 16px;
  text-transform: uppercase;
  color: #efe4b7;
}

.option-choice {
  display: inline-grid;
  grid-template-columns: 24px auto;
  gap: 10px;
  align-items: center;
  margin: 0 0 8px;
  cursor: pointer;
}

.option-choice__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-choice__control {
  position: relative;
  width: 16px;
  height: 16px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 32%, rgba(255, 255, 255, .2), transparent 26%),
    linear-gradient(145deg, #050505 0%, #171717 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .8),
    0 0 12px rgba(235, 213, 13, .24),
    inset 0 0 0 3px #050505;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.option-choice__control::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff6c6 0%, var(--gold) 48%, #bfa900 100%);
  box-shadow: 0 0 10px rgba(235, 213, 13, .72);
  opacity: 0;
  transform: scale(.45);
  transition: opacity .16s ease, transform .16s ease;
}

.option-choice:hover .option-choice__control {
  border-color: #fff6c6;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .8),
    0 0 16px rgba(235, 213, 13, .42),
    inset 0 0 0 3px #050505;
}

.option-choice__input:checked + .option-choice__control {
  border-color: #fff6c6;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .86),
    0 0 16px rgba(235, 213, 13, .62),
    0 0 28px rgba(235, 213, 13, .2),
    inset 0 0 0 3px #050505;
}

.option-choice__input:checked + .option-choice__control::after {
  opacity: 1;
  transform: scale(1);
}

.option-choice__input:focus-visible + .option-choice__control {
  outline: 2px solid #fff6a8;
  outline-offset: 3px;
}

.option-choice__title {
  margin-bottom: 0;
}

.attempt-note-block { margin-top: -8px; }
.attempt-note { color: #fff8dc; }

.quantity-heading {
  margin: 0 0 18px;
  font-size: var(--section-heading-size);
  font-weight: 900;
  text-transform: uppercase;
  color: #fff6c6;
}

.quantity-block {
  padding: 18px 20px 20px;
}

.quantity-title {
  margin: 0 0 18px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #f5e8a8;
}

.quantity-column-headings {
  display: grid;
  grid-template-columns: var(--quantity-grid);
  gap: 12px;
  align-items: end;
  padding: 0 14px;
  margin-bottom: 8px;
}

.quantity-column-headings span {
  color: #f5e8a8;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.quantity-form { display: flex; flex-direction: column; gap: 7px; }

.quantity-row {
  min-height: 41px;
  border-radius: 8px;
  border: 1px solid var(--gold-soft);
  background: linear-gradient(90deg, rgba(15, 15, 15, .94), rgba(32, 32, 32, .84));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 8px 18px rgba(0,0,0,0.14);
  display: grid;
  grid-template-columns: var(--quantity-grid);
  gap: 12px;
  align-items: center;
  padding: 6px 10px;
}

.quantity-row label {
  font-size: var(--section-heading-size);
  font-weight: 800;
  color: #fff8df;
}

.quantity-row input,
.quantity-total-pill {
  width: 100%;
  height: 27px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #050505 0%, #101010 100%);
  color: #fff8df;
  font-size: 23px;
  line-height: 1;
  font-weight: 900;
  padding: 0 10px;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.04), inset 0 -1px 0 rgba(255,255,255,0.03), 0 0 0 1px rgba(235,213,13,0.22);
}

.quantity-row input,
.quantity-total-pill { text-align: center; }

.quantity-row input::-webkit-outer-spin-button,
.quantity-row input::-webkit-inner-spin-button,
.quantity-total-pill::-webkit-outer-spin-button,
.quantity-total-pill::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.quantity-row input,
.quantity-total-pill {
  appearance: textfield;
  -moz-appearance: textfield;
}

.quantity-row input[readonly],
.quantity-total-pill[readonly] {
  color: #e9dfb6;
  background: #111;
  cursor: default;
}

.results-block {
  --results-qty-width: 76px;
  --results-sqft-width: 96px;
  margin-top: 22px;
  padding: 18px 20px 20px;
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(12,12,12,0.96), rgba(18,18,18,0.88));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 14px 28px rgba(0,0,0,0.18);
  overflow: hidden;
}

.results-heading-row {
  display: grid;
  grid-template-columns: minmax(300px, .85fr) minmax(220px, .62fr) minmax(320px, 1.4fr);
  gap: 14px;
  align-items: end;
  margin-bottom: 10px;
}

.pattern-confirmation-box,
.results-subheading {
  color: #f5e8a8;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.pattern-confirmation-label {
  margin: 0;
  color: #fff6c6;
  font-size: var(--section-heading-size);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.pattern-confirmation-box {
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
  background: linear-gradient(180deg, #050505 0%, #101010 100%);
  color: #fff8df;
  text-align: center;
}

.results-heading-row .section-title--results { margin-bottom: 0; }

.results-subheading { margin: 2px 0 0; }

.results-master-header {
  display: none;
  grid-column: 4 / 6;
  grid-template-columns: var(--results-qty-width) var(--results-sqft-width);
  gap: 8px;
  color: #f5e8a8;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.results-master-header span,
.results-card-column-header span:not(:first-child),
.results-mobile-card-header span:not(:first-child),
.inventory-template-row span:not(:first-child),
.inventory-template-footer span:not(:first-child) {
  text-align: center;
}

.results-template-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  max-height: none;
  min-height: 0;
  overflow-y: visible;
  overscroll-behavior: contain;
  padding-right: 0;
  scrollbar-color: rgba(248, 237, 190, 0.46) rgba(8, 8, 8, 0.68);
  scrollbar-width: thin;
}

.results-template-list::-webkit-scrollbar { width: 8px; }
.results-template-list::-webkit-scrollbar-track { background: rgba(8, 8, 8, 0.68); }
.results-template-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(248, 237, 190, 0.46);
}

.inventory-template-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--gold-soft);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(15, 15, 15, .94), rgba(28, 28, 28, .82));
}

.inventory-template-title {
  margin: 0;
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(235, 213, 13, .18);
  color: #fff8df;
  font-size: var(--results-card-title-size);
  line-height: 1.05;
  font-weight: 900;
  text-transform: uppercase;
}

.inventory-template-row,
.inventory-template-footer,
.results-card-column-header,
.results-mobile-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--results-qty-width) var(--results-sqft-width);
  gap: 8px;
  align-items: center;
  color: #f5e8a8;
  font-size: var(--results-card-row-size);
  font-weight: 900;
  text-transform: uppercase;
}

.results-card-column-header {
  padding: 6px 12px;
  border-bottom: 1px solid rgba(235, 213, 13, .16);
  font-size: var(--results-card-header-size);
}

.inventory-template-row,
.inventory-template-footer { padding: 8px 12px; }
.inventory-template-row { border-bottom: 1px solid rgba(235, 213, 13, .16); }
.inventory-template-footer { color: #fff8df; }
.inventory-template-empty {
  min-height: 64px;
  border-bottom: 1px solid rgba(235, 213, 13, .18);
  background: linear-gradient(180deg, rgba(255,255,255,0.018), rgba(0,0,0,0.05));
}
.results-mobile-card-header { display: none; }

.quantity-total-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
  min-height: 58px;
  margin-top: 2px;
  padding: 10px 14px;
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(15, 15, 15, .94), rgba(32, 32, 32, .84));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 8px 18px rgba(0,0,0,0.14);
}

.quantity-total-label {
  min-width: 0;
  color: #fff8df;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
}

.quantity-total-pill { grid-column: 2; }

.solver-action-row {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 76px minmax(240px, 1fr);
  align-items: center;
  gap: 136px;
}

.back-btn,
.generate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  border-radius: 8px;
  border: 1px solid rgba(235, 213, 13, 0.25);
  background: linear-gradient(180deg, #fff6a8 0%, #ebd50d 45%, #b79a10 100%);
  color: #151515;
  text-decoration: none;
  font-weight: 900;
  text-transform: uppercase;
  padding: 0 16px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.45);
}

.generate-action-row .generate-btn {
  width: 100%;
  min-width: 260px;
}

.generate-action-row .back-btn--desktop {
  width: 76px;
}

.purchase-row {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 12px;
}

.purchase-row .purchase-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(520px, 94%);
  height: 42px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff6a8 0%, #ebd50d 48%, #b79a10 100%);
  color: #151515;
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .03em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0,0,0,.45), 0 0 18px rgba(235,213,13,.25), inset 0 2px 4px rgba(255,255,255,.4), inset 0 -2px 4px rgba(0,0,0,.3);
}

.back-btn[disabled],
.generate-btn[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

.footage-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footage-label {
  font-size: 12px;
  font-weight: 700;
  color: #f7ecbc;
  text-transform: uppercase;
}

@media (max-width: 1100px) {
  :root {
    --quantity-grid: minmax(140px, 1fr) minmax(90px, 130px);
  }

  .solver-grid {
    display: flex;
    flex-direction: column;
    gap: 22px;
  }

  .solver-left,
  .solver-right { display: contents; }
  .select-options-panel { order: 1; }
  .quantity-block { order: 2; }
  .results-block { order: 3; }
  .purchase-row { order: 4; }
  .solver-action-row.generate-action-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin: 8px 4px 0;
  }
}

@media (max-width: 720px) {
  .solver-page { padding: 0 12px 12px; }
  .solver-page .brand-banner { width: calc(100% + 24px); margin: 0 -12px 12px; }
  .quantity-block { padding: 14px; }
  .section-subtitle { font-size: 15px; }
  .section-copy { font-size: 13px; }

  .quantity-column-headings,
  .quantity-row {
    grid-template-columns: minmax(0, 1fr) 82px;
    gap: 8px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .quantity-row input,
  .quantity-total-pill { height: 27px; font-size: 23px; padding: 0 8px; }

  .quantity-total-row {
    gap: 8px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .solver-action-row {
    grid-template-columns: minmax(70px, auto) minmax(160px, 1fr);
    gap: 12px;
  }

  .purchase-row { margin-top: 2px; }

  .results-block {
    --results-qty-width: 54px;
    --results-sqft-width: 62px;
  }

  .select-options-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .option-block { padding: 12px; }

  .results-heading-row {
    display: block;
  }

  .pattern-confirmation-label,
  .pattern-confirmation-box,
  .pattern-results-heading-group {
    margin-bottom: 8px;
  }

  .results-master-header,
  .results-card-column-header { display: none; }
  .results-mobile-card-header {
    display: grid;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(235, 213, 13, .16);
    font-size: 11px;
  }

  .inventory-template-title { font-size: 14px; }
  .inventory-template-row,
  .inventory-template-footer { font-size: 12px; padding: 7px 8px; }
}

@media (max-width: 420px) {
  :root {
    --quantity-grid: minmax(0, 1fr) 64px;
  }

  .quantity-column-headings,
  .quantity-row { gap: 6px; }
  .quantity-column-headings span { font-size: 11px; }
  .quantity-total-row { gap: 6px; }
  .quantity-total-label { font-size: 12px; }
  .quantity-total-pill { font-size: 14px; }
  .back-btn,
  .generate-btn { height: 38px; padding: 0 12px; font-size: 12px; }
  .generate-action-row .generate-btn { min-width: 0; }
  .purchase-row .purchase-btn { height: 38px; font-size: 13px; }
}

.scale-section {
  min-width: 0;
  margin-top: 22px;
  padding: 18px 20px 20px;
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(12,12,12,0.96), rgba(18,18,18,0.88));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 14px 28px rgba(0,0,0,0.18);
}

.scale-title {
  margin: 0 0 6px;
  color: #fff6c6;
  font-size: var(--section-heading-size);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.scale-subtitle {
  margin: 0 0 16px;
  color: #f5e8a8;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
}

.scale-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.scale-column {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(235, 213, 13, .24);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(15, 15, 15, .94), rgba(28, 28, 28, .82));
}

.scale-column h3 {
  margin: 0 0 10px;
  color: #fff8df;
  font-size: var(--scale-card-title-size);
  line-height: 1.05;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.scale-column dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.scale-column dl div {
  display: grid;
  grid-template-columns: 46px 18px 1fr;
  gap: 10px;
  align-items: center;
  color: #f5e8a8;
  font-size: var(--scale-row-size);
  line-height: 1.22;
  font-weight: 900;
}

.scale-column dt,
.scale-column dd {
  margin: 0;
}

.scale-column dt {
  text-align: left;
}

.scale-column dd {
  text-align: left;
}

.purchase-row--mobile,
.solver-action-row--mobile {
  display: none;
}


@media (max-width: 1100px) {
  .scale-section { order: 3; }
  .results-block { order: 4; }
  .purchase-row { order: 5; }

  .results-template-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results-template-list > :last-child { grid-column: 1 / -1; }

  .purchase-row--desktop,
  .back-btn--desktop {
    display: none;
  }

  .purchase-row--mobile,
  .solver-action-row--mobile {
    display: flex;
  }

  .solver-action-row--mobile {
    justify-content: center;
    grid-template-columns: minmax(140px, 220px);
    margin-top: 14px;
  }
}

@media (max-width: 720px) {
  :root { --section-heading-size: 24px; }
  .scale-section { padding: 16px 12px 18px; }
  .scale-title { font-size: var(--section-heading-size); }
  .scale-subtitle { font-size: 12px; text-align: center; }
  .scale-grid { gap: 6px; }
  .scale-column { padding: 10px 4px; }
  .scale-column h3 { font-size: clamp(10px, 3.2vw, var(--scale-card-title-size)); }
  .scale-column dl div {
    grid-template-columns: minmax(18px, 1fr) 10px minmax(22px, 1fr);
    gap: 2px;
    font-size: clamp(11px, 3.1vw, var(--scale-row-size));
  }
}

@media (max-width: 560px) {
  .results-template-list { grid-template-columns: 1fr; }
  .results-template-list > :last-child { grid-column: auto; }
}
.purchase-row .purchase-btn:disabled,
.purchase-row .purchase-btn[aria-disabled="true"] {
  background: linear-gradient(180deg, #777 0%, #555 48%, #333 100%);
  color: #cfcfcf;
  cursor: not-allowed;
  opacity: .65;
  box-shadow: inset 0 2px 4px rgba(255,255,255,.12), inset 0 -2px 4px rgba(0,0,0,.35);
}

.pattern-confirmation-box--active {
  background: linear-gradient(180deg, #a8f0b6 0%, #6fd687 100%);
  border-color: rgba(195, 255, 205, 0.95);
  color: #06250d;
  box-shadow: 0 0 18px rgba(111, 214, 135, 0.35);
}

.pattern-confirmation-box--failed {
  background: linear-gradient(180deg, #f0b0a8 0%, #df8174 100%);
  border-color: rgba(255, 205, 198, 0.95);
  color: #310a07;
  box-shadow: 0 0 18px rgba(223, 129, 116, 0.28);
}

.app-modal[hidden] { display: none; }
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(5px);
}
.app-modal__panel {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid var(--gold-soft);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(16,16,16,0.98), rgba(30,30,30,0.96));
  box-shadow: 0 22px 50px rgba(0,0,0,0.42);
  color: #fff8df;
  text-align: center;
}
.app-modal__panel p {
  margin: 0 0 18px;
  color: #f5e8a8;
  font-size: 1.1rem;
  font-weight: 700;
}

/* The selection heading spans the instructions and inventory columns. */
.selection-heading {
  margin-bottom: 20px;
  font-size: 30px;
  line-height: 1.15;
}

.select-options-panel .section-title {
  font-size: 24px;
}

.select-options-panel .section-copy {
  font-size: calc(16px + 1pt);
}

@media (max-width: 720px) {
  .select-options-panel .section-copy {
    font-size: calc(13px + 1pt);
  }
}

.quantity-form .generate-btn:disabled {
  background: #555;
  border-color: #777;
  color: #ddd;
  box-shadow: none;
  opacity: 1;
}
