:root {
  font-size: 18px;
  --navy: #1e3a5f;
  --yellow: #eab308;
  --green: #16a34a;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --muted: #475569;
  --line: #64748b;
  --soft: #edf2f7;
  --good: #166534;
  --bad: #9f1239;
  --toolbar-height: 5rem;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--toolbar-height) + 1rem); }
body {
  margin: 0;
  padding-top: var(--toolbar-height);
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2.2rem, 6vw, 4.6rem); line-height: 1.08; letter-spacing: -.045em; }
h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.2; letter-spacing: -.025em; }
h3 { font-size: 1.15rem; line-height: 1.4; }
a { color: var(--navy); text-underline-offset: .2em; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: .15em; }
button, input, select, textarea { font: inherit; }
button, .button {
  min-height: 48px;
  padding: .65rem 1rem;
  border: 2px solid var(--navy);
  border-radius: .65rem;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
}
.button { display: inline-flex; align-items: center; text-decoration: none; }
button:hover, .button:hover { text-decoration: underline; text-underline-offset: .2em; }
button:disabled { cursor: not-allowed; opacity: .7; }
:focus-visible {
  outline: 3px solid #111;
  outline-offset: 4px;
  box-shadow: 0 0 0 7px #facc15;
}
input, select, textarea {
  max-width: 100%;
  min-height: 48px;
  border: 2px solid var(--line);
  border-radius: .45rem;
  padding: .6rem .75rem;
  color: var(--text);
  background: var(--surface);
}
input[type="range"] { width: 100%; padding: 0; accent-color: var(--navy); }
input[type="checkbox"] {
  width: 1.3rem;
  height: 1.3rem;
  min-height: auto;
  padding: 0;
  flex-shrink: 0;
  accent-color: var(--navy);
}
input[type="color"] { width: 4rem; padding: .25rem; flex-shrink: 0; }
textarea { width: 100%; resize: vertical; }
label { font-weight: 700; }
fieldset { min-width: 0; margin: 0 0 1.25rem; padding: 1rem; border: 1px solid var(--line); border-radius: .65rem; }
legend { padding: 0 .4rem; font-weight: 700; }
[hidden] { display: none !important; }
.wrap { width: min(1160px, 100% - 2rem); margin-inline: auto; }
.section { padding-block: 3.5rem; }
.eyebrow { color: var(--muted); font-size: .85rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .9rem; }
.field { display: grid; gap: .4rem; margin-bottom: 1.2rem; }
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: clamp(1rem, 3vw, 2rem);
}
.check {
  display: flex; gap: .6rem; align-items: center;
  min-height: 48px; font-weight: 500;
}
.checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem 1rem; }
.checks .check { border: 1px solid var(--line); border-radius: .5rem; padding: .5rem; }
.notice { padding: 1rem; background: var(--soft); border-left: 4px solid var(--navy); border-radius: .3rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; top: .5rem; left: 1rem; z-index: 100;
  padding: .8rem 1rem; background: #fff; color: #111;
  transform: translateY(-200%);
}
.skip:focus { transform: translateY(0); }
.toolbar {
  position: fixed; inset: 0 0 auto; z-index: 50;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.toolbar-inner { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding-block: .65rem; }
.toolbar-label { font-size: .85rem; font-weight: 700; }
.toolbar .row { gap: .4rem; }
.toolbar button { font-size: .85rem; padding: .5rem .7rem; background: var(--surface); color: var(--navy); }
.toolbar button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; padding-block: 1.3rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--navy); font-size: 1.35rem; font-weight: 850; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem;
  background: var(--yellow); color: #1e293b; border-radius: .7rem; font-size: 1.2rem;
}
nav ul { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; padding: 0; margin: 0; list-style: none; }
nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: .9rem; font-weight: 650; }
.hero { display: grid; grid-template-columns: 1.45fr 1fr; align-items: center; gap: 3rem; padding-block: 4rem; }
.hero h1 span { display: inline; box-shadow: inset 0 -.2em 0 var(--yellow); }
.hero p { max-width: 42rem; }
.hero-card { background: var(--navy); color: #fff; border-radius: 1.5rem; padding: 2rem; transform: rotate(2deg); }
.hero-card .number { font-size: 4rem; line-height: 1.1; color: #fde047; font-weight: 850; }
.hero-card ul { padding-left: 1.2rem; margin-bottom: 0; }
.hero-card li { margin-block: .5rem; }
.pill { display: inline-block; padding: .25rem .7rem; border: 1px solid var(--line); border-radius: 100px; font-size: .85rem; margin-bottom: 1rem; }
.tools-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.tools-heading p { margin-bottom: 0; }
.tool-nav ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.tool-nav a { display: block; height: 100%; background: var(--surface); color: var(--navy); text-align: left; }
.tool-nav a[aria-current="page"] { background: var(--navy); color: #fff; border-bottom: 5px solid var(--yellow); }
.tab-number { display: block; font-size: .75rem; opacity: .9; margin-bottom: .25rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; padding: clamp(1rem, 3vw, 2rem); }
.panel > p { max-width: 52rem; }
.result { background: var(--soft); padding: 1.4rem; border-radius: .8rem; }
.amount { display: block; font-size: clamp(2rem, 6vw, 3.5rem); font-weight: 850; line-height: 1.2; color: var(--navy); }
.score { font-size: 2rem; font-weight: 850; }
.preview { border: 2px solid var(--line); border-radius: .7rem; padding: 1.5rem; overflow-wrap: anywhere; }
.preview strong { display: block; font-size: 1.6rem; }
.rating { display: block; padding: .5rem .7rem; margin-block: .5rem; border: 2px solid currentColor; border-radius: .4rem; font-weight: 700; }
.pass { color: var(--good); }
.fail { color: var(--bad); }
.easy { border-left: 6px solid var(--green); }
.easy p { margin-bottom: .7rem; }
.support { background: var(--navy); color: #fff; border-color: var(--navy); }
.support .button { background: var(--yellow); color: #1e293b; border-color: var(--yellow); }
.support a:not(.button) { color: #fff; }
.support .hint { color: #fff; }
nav a[aria-current="page"] { text-decoration-thickness: .2em; }
.page-head { padding-block: 3rem 1.5rem; }
.page-head h1, .page-title { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: .75rem; }
.page-head p { max-width: 46rem; }
.tool-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; padding: 0; margin: 0; list-style: none; }
.tool-cards .card { display: flex; flex-direction: column; height: 100%; }
.tool-cards .card p { flex-grow: 1; }
.legal h2 { font-size: 1.3rem; margin-top: 2rem; }
.legal { max-width: 52rem; }
footer { border-top: 1px solid var(--line); padding-block: 2.5rem; }
footer p { font-size: .9rem; }
footer ul { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; padding: 0; margin: 0 0 1rem; list-style: none; }
footer a { display: inline-flex; align-items: center; min-height: 44px; }
.error { color: var(--bad); font-weight: 700; }
#statement-output { min-height: 24rem; }
body.high-contrast {
  --navy: #ffff00; --yellow: #ffff00; --green: #ffff00;
  --bg: #000; --surface: #000; --text: #fff; --muted: #fff;
  --line: #fff; --soft: #111; --good: #ffff00; --bad: #fff;
}
.high-contrast button, .high-contrast .button,
.high-contrast .tool-nav a[aria-current="page"],
.high-contrast .toolbar button[aria-pressed="true"] { background: #ffff00; color: #000; border-color: #ffff00; }
.high-contrast .toolbar button, .high-contrast .tool-nav a { background: #000; color: #ffff00; }
.high-contrast .hero-card, .high-contrast .support { background: #000; border: 2px solid #fff; }
.high-contrast .support a:not(.button) { color: #ffff00; }
.high-contrast .brand-mark { background: #ffff00; color: #000; }
.high-contrast h1 span { box-shadow: none; text-decoration: underline; text-decoration-color: #ffff00; }
.high-contrast :focus-visible { outline-color: #fff; box-shadow: 0 0 0 7px #000; }
.high-contrast input { accent-color: #ffff00; }
@media (max-width: 760px) {
  .hero, .grid, .tool-cards { grid-template-columns: 1fr; }
  .hero { gap: 1.5rem; padding-block: 2.5rem; }
  .hero-card { transform: none; }
  .tool-nav ul, .tool-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar-label { display: none; }
  .toolbar-inner, .toolbar-inner > .row { justify-content: center; }
  .section { padding-block: 2rem; }
}
@media (max-width: 400px) {
  .wrap { width: calc(100% - 1.25rem); }
  .checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-nav ul, .tool-cards { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
  button, .button, .card, .panel, .rating { border: 2px solid ButtonText; }
  :focus-visible { outline: 3px solid Highlight; box-shadow: none; }
}
@media print {
  body { padding: 0; }
  .toolbar, .skip, nav, .hero-card, #speech-status { display: none; }
  .hero, .grid { display: block; }
  .card, .panel { margin-bottom: 1rem; break-inside: avoid; }
  body, .support, .hero-card { background: #fff; color: #000; }
}
