/* HealthAndLife 1.35.227 — common calculator form rhythm.
   Bespoke calculator layouts remain intact; this layer normalizes the controls
   that users compare visually from one calculator to another. */
#main-content form[action*="/calculators/"][action$="/calculate"] {
  --calc-ui-control-height: 50px;
  --calc-ui-control-radius: 13px;
}

/* Grid labels must pack from the top. Without this, CSS Grid can distribute
   free height between rows: a field with a help line then pulls the neighbouring
   field's input downward (notably pregnancy LMP vs cycle length). */
#main-content form[action*="/calculators/"][action$="/calculate"] label {
  align-content: start;
}

/* One touch target and typography baseline for dates, numbers and selects.
   Border/background styling is deliberately left to each calculator theme. */
#main-content form[action*="/calculators/"][action$="/calculate"] :is(
  input:not([type="hidden"]):not([type="radio"]):not([type="checkbox"]):not([type="range"]),
  select
) {
  box-sizing: border-box;
  height: var(--calc-ui-control-height);
  min-height: var(--calc-ui-control-height);
  max-height: var(--calc-ui-control-height);
  min-width: 0;
  font-size: 16px;
  line-height: 1.25;
  border-radius: var(--calc-ui-control-radius);
}

#main-content form[action*="/calculators/"][action$="/calculate"] textarea {
  box-sizing: border-box;
  min-height: 112px;
  min-width: 0;
  font-size: 16px;
  line-height: 1.45;
}

/* The primary action should not appear smaller simply because a calculator was
   authored in an older component family. Secondary compact actions may remain
   smaller when that is part of their role. */
#main-content form[action*="/calculators/"][action$="/calculate"] button[type="submit"] {
  box-sizing: border-box;
  min-height: 50px;
  border-radius: 12px;
}

/* Native date controls vary between Chromium/WebKit. Keep them on the same
   baseline as number/select controls without hiding the calendar affordance. */
#main-content form[action*="/calculators/"][action$="/calculate"] input[type="date"] {
  padding-block: 0;
}

@media (max-width: 767px) {
  #main-content form[action*="/calculators/"][action$="/calculate"] {
    --calc-ui-control-height: 50px;
  }
}
