/* The question steps: native progress bar, quick-pick chips, live cost meter, review screen, phone action bar. */
:where(.page, .estimator-admin) .btn { min-height: 44px; }
.btn--link { display: inline-flex; align-items: center; justify-content: center; }

.progress__bar { display: block; width: 100%; height: 8px; border: 0; border-radius: var(--r-control); background: var(--border); overflow: hidden; appearance: none; }
.progress__bar::-webkit-progress-bar { background: var(--border); }
.progress__bar::-webkit-progress-value { background: var(--blue); }
.progress__bar::-moz-progress-bar { background: var(--blue); }

.field-error {
  margin: var(--s2) 0 0; padding: var(--s2) var(--s3); font-weight: 500;
  background: var(--error-bg); border-left: 4px solid var(--error-line); border-radius: var(--r-control);
}
.talk { margin-top: var(--s5); }

/* Chips: one tap per answer. The radio sits invisibly over the label so the whole chip is the target. */
.chipset { border: 0; padding: 0; margin: var(--s4) 0 0; min-width: 0; }
.chipset legend { font-weight: 600; padding: 0; margin-bottom: var(--s2); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.form .chip { position: relative; margin-top: 0; font-weight: 400; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s3);
  background: var(--white); border: 1px solid var(--border); border-radius: var(--r-control); font-weight: 500;
}
.chip:hover span { border-color: var(--charcoal); }
.chip input:checked + span { padding: 0 calc(var(--s3) - 1px); background: var(--surface-2); border: 2px solid var(--charcoal); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--brand-dark); outline-offset: 2px; }
.chip--unsure span { color: var(--text-2); }
.form .exact { display: block; margin-top: var(--s3); font-size: 14px; line-height: 20px; font-weight: 500; }
.chipset input[type="number"] { display: block; width: 160px; margin-top: var(--s1); }

/* Sizing step: questions beside the live cost meter on wide screens, a slim bar on top on phones. */
.sizing { display: grid; gap: var(--s4); grid-template-columns: minmax(0, 1fr); }
.meter { order: -1; position: sticky; top: var(--header-h); z-index: 5; padding: var(--s2) var(--s3); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-card); }
.meter__lead { margin: 0; font-size: 14px; line-height: 20px; color: var(--text-2); }
.meter__figure { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; }
.meter__figure--idle { font-size: 16px; line-height: 24px; font-weight: 500; color: var(--text-2); }
.meter__note { margin: 0; }
@media (min-width: 768px) {
  .sizing { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: var(--s6); }
  .meter { order: 0; top: calc(var(--header-h) + var(--s4)); padding: var(--s4); }
  .meter__figure { font-size: 32px; line-height: 40px; }
  .meter__figure--idle { font-size: 16px; line-height: 24px; }
}

/* Review screen: every answer with a Change link. */
.review { margin: 0 0 var(--s4); }
.review__row { display: grid; gap: var(--s1); padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.review dt { font-weight: 600; }
.review dd { margin: 0; }
.review dd p { margin: 0 0 var(--s1); }
.review__change { display: inline-block; padding: var(--s1) 0; font-weight: 600; }
@media (min-width: 768px) { .review__row { grid-template-columns: 220px minmax(0, 1fr); gap: var(--s4); } }

/* Phones: the main button lives in a sticky bar at the bottom, above the home indicator. */
@media (max-width: 767px) {
  .action-bar {
    position: sticky; bottom: 0; z-index: 4; flex-wrap: nowrap; gap: var(--s2);
    margin: var(--s4) calc(var(--s3) * -1) 0; padding: var(--s3) var(--s3) calc(var(--s3) + env(safe-area-inset-bottom));
    background: var(--white); border-top: 1px solid var(--border);
  }
  .action-bar .btn--primary { flex: 1; }
  .form .action-bar .btn, .form--wide .action-bar .btn { margin-top: 0; }
}
