/* drawer.css — Unit 17: state eligibility pill rows inside the calculator card.
   The refine-drawer rules are gone (drawer removed; fields are now sliders).
   Unit 66: the main-form VPP pill (#vpp-question, right after the upgrade cards) joins the
   #state-toggles-body rows on every check-pill rule below — same 44px target, focus and
   hidden-row behaviour in both containers. */

#state-toggles {
  margin: 0;
  padding: 1.25rem 0 0;
  border: 0;
  border-top: 1px solid var(--ec-slate-200);
  min-width: 0;
}

#state-toggles legend {
  padding: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: none;
  line-height: 1.4;
  color: var(--ec-slate-600);
}

/* State toggle rows and the Unit 66 VPP pill row stay small pill rows. */
#state-toggles-body .check-row, #vpp-question .check-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--ec-slate-900);
  background: var(--ec-card);
  border: 1px solid var(--ec-slate-300);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 150ms ease-out, border-color 150ms ease-out;
}

#state-toggles-body .check-row input, #vpp-question .check-row input { width: 1.125rem; height: 1.125rem; margin: 0; accent-color: var(--ec-emerald-600); }

/* Unit 63: the VPP row is hidden unless a battery is ticked (EC.drawer.syncVpp sets [hidden]).
   Unit 66: the row moved to the main form (#vpp-question) — both containers need the explicit
   [hidden] rule because .check-row sets display:flex below, so the attribute alone would be
   overridden — the same trap as the timing labels in Unit 33 M7. display:none also removes it
   from the tab order. */
#state-toggles-body .check-row[hidden], #vpp-question .check-row[hidden] { display: none; }

#state-toggles-body .check-row:has(input:checked), #vpp-question .check-row:has(input:checked) { border-color: var(--ec-emerald-500); background: var(--ec-emerald-50); }

#state-toggles-body .check-row:has(input:focus-visible), #vpp-question .check-row:has(input:focus-visible) { outline: 2px solid var(--ec-emerald-600); outline-offset: 2px; }

/* Unit 66: the VPP container itself carries no box of its own — when it holds no rows it is
   [hidden] (plain div, so the attribute needs no extra rule) and the form's space-y margins skip
   hidden siblings, so it never adds layout. */

/* Unit 71 A (owner report: the VPP (i) panel opened INSIDE the pill — the pill measured 316x259
   with the panel as a flex item): drawer.js now wraps the row + its (i) button in div.vpp-row-wrap
   and the button lives OUTSIDE the <label> (no click forwarding to the checkbox), the same pattern
   as the upgrade cards. The wrapper is the panel host info.js placeVppPanel anchors to (position:
   relative -> the panel sits BELOW the row at full row width, results-extras.css .ec-info-panel-row),
   the pill keeps its 44px height, and the button rides below-right of the pill like .upgrade-wrap's. */
#vpp-question .vpp-row-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
#vpp-question .vpp-row-wrap .check-row { align-self: stretch; }
#vpp-question .vpp-row-wrap .ec-info-btn { margin-top: 0.25rem; }
/* The whole wrapper — the (i) button included — leaves the page and the tab order when its only row
   is hidden (Unit 63 syncVpp hides the row, Unit 68 hides the container): :has mirrors both rules,
   so no orphan (i) button ever rides a hidden row. */
#vpp-question .vpp-row-wrap:not(:has(.check-row:not([hidden]))) { display: none; }

@media (prefers-reduced-motion: reduce) {
  #state-toggles-body .check-row, #vpp-question .check-row { transition: none; }
}
