/* Allowance calculator (/kalkulator-elaun-anak/ and /en/allowance-calculator/). Loads after site.css
   and seasons.css. Native controls styled on the site tokens: choices are capsule chips around a real
   radio, fields are 48px with 16px text (no zoom on phones), the result is one grey tile with flat
   hairline rows inside. The form is hidden until assets/allowance-calculator.js runs. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.ac-grid { display: grid; gap: var(--s10); align-items: start; }
.ac-grid > * { min-width: 0; }
@media (min-width: 60rem) { .ac-grid { grid-template-columns: 1.1fr 1fr; gap: var(--s16); } .ac-result { position: sticky; top: 80px; } }

/* fields */
.ac-fields { display: grid; gap: var(--s8); }
.ac-fields fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.ac-fields legend, .ac-label { display: block; padding: 0; margin: 0 0 var(--s3); font-size: var(--t-small); font-weight: var(--wt-strong); color: var(--text); }
.ac-help { margin: var(--s2) 0 0; font-size: var(--t-meta); color: var(--muted); }
.ac-help[hidden], .ac-sub[hidden] { display: none; }

.ac-select, .ac-input { display: block; width: 100%; max-width: 20rem; min-height: 48px; padding: 0 var(--s4); border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--bg); color: var(--text); font-family: inherit; font-size: 1rem; font-weight: var(--wt-regular); line-height: 1.2; font-variant-numeric: tabular-nums; }
.ac-select { appearance: none; padding-right: var(--s10); background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.ac-select:hover, .ac-input:hover { border-color: var(--muted); }
.ac-select:focus-visible, .ac-input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-color: var(--focus); }
.ac-money { position: relative; max-width: 20rem; }
.ac-money span { position: absolute; left: var(--s4); top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ac-money .ac-input { padding-left: 3rem; }
.ac-pair { display: grid; gap: var(--s4); grid-template-columns: repeat(2, minmax(0, 10rem)); }
.ac-sub { margin-top: var(--s4); }

/* choice chips: the radio stays in the DOM for keyboard and screen readers */
.ac-opts { display: flex; flex-wrap: wrap; gap: var(--s2); }
.ac-opts label { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s5); border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--bg); font-size: var(--t-small); font-weight: var(--wt-medium); color: var(--text); cursor: pointer; transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease); }
.ac-opts input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.ac-opts label:hover { border-color: var(--muted); }
.ac-opts label:has(input:checked) { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.ac-opts label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }

/* result: one tile, flat rows inside */
.ac-result { background: var(--tile); border-radius: var(--radius-card); padding: var(--s8) var(--pad-card); }
.ac-kicker { margin: 0 0 var(--s2); font-size: var(--t-meta); font-weight: var(--wt-strong); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ac-range { margin: 0; }
.ac-range b { display: block; font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem); line-height: 1.1; font-weight: var(--wt-strong); letter-spacing: -.02em; }
.ac-range span { color: var(--muted); }
.ac-used { margin: var(--s5) 0 0; font-size: var(--t-small); color: var(--muted); }
.ac-split { margin: var(--s4) 0 0; max-width: none; }
.ac-split div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s4); padding: var(--s3) 0; border-top: 1px solid var(--border); }
.ac-split dt { font-size: var(--t-body); color: var(--text); }
.ac-split dd { margin: 0; font-size: var(--t-lead); font-weight: var(--wt-strong); }
.ac-goal { margin: var(--s4) 0 0; padding-top: var(--s4); border-top: 1px solid var(--border); font-weight: var(--wt-medium); }
.ac-kantin { margin: var(--s4) 0 0; font-size: var(--t-small); color: var(--muted); }
.ac-kantin[hidden], .ac-result [hidden] { display: none; }
.ac-young { margin: var(--s4) 0 0; color: var(--muted); }
.ac-rule { margin-top: var(--s6); padding-top: var(--s5); border-top: 1px solid var(--border); }
.ac-rule-h { margin: 0 0 var(--s2); font-size: var(--t-meta); font-weight: var(--wt-strong); color: var(--muted); }
.ac-rule ul { margin: 0; padding-left: 1.1rem; font-size: var(--t-meta); line-height: 1.5; color: var(--muted); }
.ac-rule li + li { margin-top: var(--s1); }
.ac-err { margin: var(--s2) 0 0; font-size: var(--t-meta); color: var(--warn); }
.ac-err[hidden] { display: none; }

/* no-script note and the static tables */
.ac-nojs { background: var(--tile); border-radius: var(--radius-card); padding: var(--s6); color: var(--muted); max-width: 62ch; }
.ac-nojs[hidden], .ac-form[hidden] { display: none; }
.ac-table { margin-top: var(--s8); }
.ac-table caption { text-align: left; font-size: var(--t-small); font-weight: var(--wt-strong); color: var(--text); padding-bottom: var(--s3); }
.ac-table td, .ac-table th { white-space: nowrap; }
.ac-table td.wrap-ok, .ac-table th.wrap-ok { white-space: normal; min-width: 14rem; }

@media (prefers-reduced-motion: reduce) { .ac-opts label { transition: none; } }
