/* mileage-deduction-calc — design brief: stepper-wizard layout, brutalist blocks, geometric sans, scale 1.414.
   Palette: #fbfaf9 (page) #f2f0ed (surface) #261f17 (ink) #bb6b1b (accent, borders/large text) #29a3a3 (active step). */
:root {
  --bg: #fbfaf9;
  --surface: #f2f0ed;
  --ink: #261f17;
  --accent: #bb6b1b;
  --teal: #29a3a3;
  --s1: 1rem;
  --s2: 1.414rem;
  --s3: 2rem;
  --s4: 2.828rem;
  --font: Futura, "Century Gothic", "Avenir Next", Avenir, "URW Gothic", "Trebuchet MS", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 100%; line-height: 1.55; }
body { margin: 0; }
a { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { background: var(--surface); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: .5rem; border: 3px solid var(--ink); }

.site-head { display: flex; flex-wrap: wrap; gap: .5rem 2rem; align-items: center; padding: 1rem 1.25rem; border-bottom: 4px solid var(--ink); background: var(--surface); }
.brand { font-weight: 800; font-size: var(--s2); text-decoration: none; letter-spacing: -.01em; }
.site-head nav, .site-foot nav { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.site-head nav a[aria-current="page"] { background: var(--teal); padding: 0 .3rem; text-decoration: none; }

main { max-width: 60rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
h1 { font-size: clamp(var(--s3), 4vw, var(--s4)); line-height: 1.15; margin: .5rem 0 1rem; letter-spacing: -.02em; }
h2 { font-size: var(--s2); line-height: 1.25; margin: 1.5rem 0 .75rem; }
.block h2:first-child, .block > h2 { margin-top: 0; }
.lede { font-size: 1.15rem; border-left: 8px solid var(--accent); padding-left: 1rem; }

.block { background: var(--surface); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--accent); padding: 1.25rem; margin: 1.5rem 0; }
.warn { background: var(--bg); }

/* stepper wizard */
.stepper { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0 0 1.25rem; padding: 0; border: 3px solid var(--ink); }
.stepper li { padding: .5rem; font-weight: 700; border-right: 3px solid var(--ink); background: var(--bg); }
.stepper li:last-child { border-right: 0; }
.stepper li span { display: inline-block; min-width: 1.6em; text-align: center; border: 2px solid var(--ink); margin-right: .25rem; }
.stepper li.done { background: var(--surface); }
.stepper li[aria-current="step"] { background: var(--teal); }
html:not(.js) .needs-js { display: none; }
fieldset.step { border: 0; padding: 0; margin: 0 0 1rem; }
legend, .step h2 { font-size: var(--s2); font-weight: 800; margin-bottom: .75rem; padding: 0; }

label { display: block; font-weight: 700; margin: .75rem 0 .25rem; }
label.choice { font-weight: 400; display: flex; gap: .6rem; align-items: center; padding: .6rem .75rem; margin: .4rem 0; border: 3px solid var(--ink); background: var(--bg); cursor: pointer; }
label.choice:has(input:checked) { background: var(--teal); font-weight: 700; }
input[type="number"], select { font: inherit; font-size: 1.15rem; width: 100%; max-width: 20rem; padding: .5rem; border: 3px solid var(--ink); background: #fff; color: var(--ink); border-radius: 0; }
input[type="radio"] { width: 1.2rem; height: 1.2rem; accent-color: var(--ink); }
.hint { font-size: .95rem; margin: .5rem 0 0; }
.buttons { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
button { font: inherit; font-weight: 800; font-size: 1.05rem; padding: .6rem 1.4rem; border: 3px solid var(--ink); background: var(--ink); color: var(--bg); cursor: pointer; border-radius: 0; box-shadow: 4px 4px 0 var(--accent); }
button:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--accent); }
#btn-back, #btn-again { background: var(--bg); color: var(--ink); }
.error { font-weight: 700; margin: .5rem 0 0; min-height: 1.5em; }
.big { font-size: var(--s3); font-weight: 800; margin: 0 0 1rem; }
.big-label { font-size: var(--s1); text-transform: uppercase; letter-spacing: .08em; display: block; }
output { font-variant-numeric: tabular-nums; }

/* tables */
.table-wrap { overflow-x: auto; padding: 0; }
table.grid { width: 100%; border-collapse: collapse; background: var(--bg); font-variant-numeric: tabular-nums; }
.grid caption { text-align: left; font-weight: 800; padding: .5rem .75rem; }
.grid th, .grid td { text-align: left; vertical-align: top; padding: .45rem .75rem; border: 2px solid var(--ink); }
.grid thead th { background: var(--ink); color: var(--bg); }
.grid tfoot th, .grid tfoot td { font-weight: 800; }
.fields td:nth-child(2) { font-weight: 700; word-break: break-word; }

.quote { margin: 1rem 0; padding: .75rem 1rem; border-left: 8px solid var(--accent); background: var(--bg); }
.quote p { margin: 0 0 .4rem; font-size: 1.1rem; }
.quote footer { font-size: .9rem; }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; background: var(--bg); border: 2px solid var(--ink); padding: .1rem .35rem; word-break: break-word; }
.disclaimers ul { margin: 0; padding-left: 1.25rem; }
.pager { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0; }
.pager a { border: 3px solid var(--ink); padding: .3rem .8rem; text-decoration: none; font-weight: 700; background: var(--surface); }

.site-foot { border-top: 4px solid var(--ink); padding: 1rem 1.25rem 2rem; background: var(--surface); }
.site-foot p { margin: 0 0 .5rem; }

@media (max-width: 40rem) {
  .stepper { grid-template-columns: repeat(2, 1fr); }
  .stepper li:nth-child(2) { border-right: 0; }
  .stepper li:nth-child(-n+2) { border-bottom: 3px solid var(--ink); }
  .block { box-shadow: 4px 4px 0 var(--accent); }
}
