/* The live household estimator and the address lookup (UX revision v1.2, lane C).
   Loaded by templates/_estimator.html, so any page that includes it gets the styles.
   DESIGN.md: ink carries interaction, 48px targets (56px steppers), 3px radius for inputs
   and cards, 6px for buttons, figures in mono with tabular numerals, one highlighter. */

.home-body { display: flex; flex-direction: column; gap: var(--space-xl); max-width: 720px; min-width: 0; }
.estimator { display: flex; flex-direction: column; gap: var(--space-xl); min-width: 0; }
.est-q { border-top: 1px solid var(--rule) !important; padding-top: var(--space-lg) !important; min-width: 0; }
fieldset.field .est-title {
  font: 700 1.375rem/1.25 var(--display);
  margin-bottom: var(--space-sm);
  float: left; width: 100%;
}
.est-title + * { clear: both; }
.estimator [hidden], .address-block [hidden] { display: none !important; }
.js [data-nojs-only] { display: none !important; }

/* Steppers: real buttons around a number input (the input alone without JavaScript). */
.stepper { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); }
.stepper input[type="number"] {
  width: 5.5em; min-height: 56px; text-align: center;
  font: 600 1.5rem/1 var(--mono); font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.stepper input[type="number"]::-webkit-outer-spin-button,
.js .stepper input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; flex: none;
  font: 700 1.75rem/1 var(--body);
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--pencil); border-radius: var(--radius-md);
  cursor: pointer;
}
.stepper-btn:hover { border-color: var(--ink); }
.stepper-btn:focus-visible { outline: 3px solid var(--marker); outline-offset: 2px; }
.stepper-btn[disabled] { opacity: .4; cursor: default; }
.stepper-unit { color: var(--pencil); }
.kwp-out { font: 600 1.125rem/1.3 var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.kwp-out:empty { display: none; }
.est-sub { display: flex; flex-direction: column; gap: var(--space-md); margin-top: var(--space-md); }
.wp-field { max-width: 260px; }

/* Cards: the existing radio .option, laid out as a grid of equal tiles. */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: var(--space-sm); }
.cards-label { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
.cards-label .card-unknown { grid-column: span 2; }
.card { min-height: 56px; padding: 8px 10px; gap: 8px; font-size: 1.0625rem; }
.card span { overflow-wrap: break-word; hyphens: auto; min-width: 0; }

/* Toggles: a checkbox drawn as a switch; the input stays in the accessibility tree. */
.toggles { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.toggle { position: relative; min-height: 56px; padding-left: 12px; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track {
  position: relative; flex: none;
  width: 48px; height: 28px;
  border: 2px solid var(--ink); border-radius: 14px;
  background: var(--surface);
}
.toggle-track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--pencil);
}
.toggle input:checked + .toggle-track { background: var(--ink); }
.toggle input:checked + .toggle-track::after { left: 22px; background: var(--paper); }
.toggle:has(input:focus-visible) { outline: 3px solid var(--marker); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .toggle-track::after { transition: left 80ms ease-out; }
}

/* The live line: a small document with the four figures. */
.estimate {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: var(--space-lg);
  display: flex; flex-direction: column; gap: var(--space-md);
}
.estimate h3 { margin: 0; font: 700 1.25rem/1.25 var(--display); display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: baseline; }
.est-tag { font: 700 .8125rem/1.3 var(--body); letter-spacing: .04em; text-transform: uppercase; color: var(--pencil); }
.est-empty { margin: 0; color: var(--pencil); }
.est-figures {
  margin: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-md);
}
.est-figures div { min-width: 0; }
.est-figures dt { font: 700 .8125rem/1.3 var(--body); letter-spacing: .04em; text-transform: uppercase; color: var(--pencil); }
.est-figures dd { margin: 4px 0 0; font: 600 1.375rem/1.2 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.est-figures div:last-child dd .num {
  background: linear-gradient(transparent 12%, var(--marker) 12%, var(--marker) 88%, transparent 88%);
  color: var(--on-marker); padding: 0 2px;
}
.est-split { margin: 0; max-width: 66ch; }
.est-source { margin: 0; }
.est-show { align-self: flex-start; }

/* "Eigen cijfers invullen" and "Ik weet mijn verbruik". */
.exact summary {
  cursor: pointer; min-height: 48px;
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700;
}
.exact-title { font: 700 1.25rem/1.25 var(--display); text-decoration: underline; text-underline-offset: .15em; }
.exact[open] summary { margin-bottom: var(--space-md); }
.exact > p { margin: 0 0 var(--space-lg); max-width: 66ch; }
.exact .form-grid { margin-top: var(--space-lg); }
/* Address lookup. */
.address-block { min-width: 0; }
.address-grid { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 7em) minmax(0, 7em); gap: var(--space-md); align-items: end; }
.address-actions { margin: var(--space-md) 0 0; }
.address-result:empty { display: none; }
.address-result { margin-top: var(--space-md); }
.address-result p { margin: 0 0 var(--space-sm); }
.address-found { font-weight: 700; }

.house-summary h3 span { margin-right: 4px; }

@media (max-width: 640px) {
  .est-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .estimate { padding: var(--space-md); }
  .address-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .address-grid .field:first-child { grid-column: 1 / -1; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards-label { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
