/* Structural layer shared by the five fold concepts. Each page sets the tokens and the look. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 1rem; line-height: 1.5; -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent); color: var(--on-accent, #fff); }
input, select, button { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 3px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
img { max-width: 100%; display: block; }
main > *, .fold > *, .side > *, .fold > * > * { min-width: 0; }
.num, table td, .ins-big, .rise-big { font-variant-numeric: tabular-nums lining-nums; }

/* salary field reads as type */
input[data-fit] { border: 0; background: none; padding: 0; min-width: 2ch; caret-color: var(--accent); }
input[data-fit]:focus { outline: none; }

/* period pills */
.periods { display: flex; flex-wrap: wrap; gap: .25rem; }
.periods button { border: 0; background: none; padding: .35em .8em; }

/* option chips: a single row that scrolls sideways on phones */
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.chips button { display: inline-flex; align-items: baseline; gap: .4em; white-space: nowrap; }
.chip-v:empty { display: none; }
@media (max-width: 720px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
  .chips::-webkit-scrollbar { display: none; }
}

/* inline options panel */
[data-panel][hidden] { display: none; }
.panel-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.panel-t { margin: 0; font-size: 1.05rem; }
.panel-x { border: 0; background: none; padding: .4rem; display: grid; place-items: center; border-radius: 50%; }
.f { display: grid; gap: .3rem; margin: 0 0 .9rem; }
.f-l { font-weight: 600; font-size: .9rem; padding: 0; }
.f-h { font-size: .85rem; color: var(--muted); }
.f-h.is-err { color: var(--err, #c4002b); }
.f input:not([type=radio]):not([type=checkbox]), .f select { width: 100%; max-width: 22rem; padding: .6rem .75rem; border: var(--field-border, 1px solid var(--line)); background: var(--field-bg, transparent); border-radius: var(--radius, 6px); }
.f .f-short { max-width: 8rem; }
.f-code { text-transform: uppercase; letter-spacing: .04em; }
.f-money { display: flex; align-items: center; gap: .4rem; max-width: 22rem; }
.f-money input { flex: 1; }
.f-suf { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.f-row { display: flex; flex-wrap: wrap; gap: 0 1.25rem; align-items: end; }
fieldset { border: 0; margin: 0 0 .9rem; padding: 0; min-width: 0; }
legend { margin-bottom: .4rem; }
.seg > label, .checks > label { display: inline-flex; }
.seg { display: flex; flex-wrap: wrap; gap: .3rem; }
.seg legend { width: 100%; }
.seg input, .checks input { position: absolute; opacity: 0; pointer-events: none; }
.seg span, .checks span { padding: .45rem .8rem; border: var(--field-border, 1px solid var(--line)); border-radius: var(--radius, 6px); cursor: pointer; }
.seg input:checked + span, .checks input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg input:focus-visible + span, .checks input:focus-visible + span { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
.checks { display: flex; flex-wrap: wrap; gap: .35rem; }
.checks legend { width: 100%; }
@media (min-width: 900px) { .panel-in { columns: 1; } }

/* results table */
[data-table] table { width: 100%; border-collapse: collapse; }
[data-table] th, [data-table] td { padding: .5rem .6rem; text-align: right; white-space: nowrap; }
[data-table] tbody th { text-align: left; font-weight: 500; white-space: normal; }
.t-link { font-size: .72em; margin-left: .3em; color: inherit; opacity: .7; }
@media (max-width: 720px) {
  [data-table] th:not(.is-primary):not([scope=row]), [data-table] tbody td:not(.is-primary) { display: none; }
}

/* tax band breakdown */
.bands { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.band { position: relative; display: grid; grid-template-columns: 1fr 3.5rem 7rem 7rem; gap: .5rem; padding: .7rem .8rem; align-items: baseline; isolation: isolate; }
.band i { position: absolute; inset: 0 auto 0 0; width: calc(var(--w) * 100%); z-index: -1; }
.band-r, .band-w, .band-t { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .band { grid-template-columns: 1fr 3rem 6rem; } .band-w { display: none; } }

.ins-list { list-style: none; margin: 0; padding: 0; }
[data-share-preview][hidden] { display: none; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
