:root {
  --ink: #1c2630;
  --muted: #5a6672;
  --line: #d6dce2;
  --bg: #f6f7f9;
  --card: #ffffff;
  --accent: #0d6b5e;
  --accent-ink: #ffffff;
  --warn-bg: #fff6e0;
  --warn-line: #e5b84c;
  --spon-bg: #f3f0fa;
  --spon-line: #9b8cc4;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent); }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 1.5rem 0 .5rem; }
h2 { font-size: 1.3rem; margin: 2rem 0 .6rem; }
code { background: #eef1f4; padding: 0 .25em; border-radius: 3px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 1rem; }
.narrow { max-width: 780px; }
.lede { font-size: 1.1rem; color: var(--muted); margin-top: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.site-header { background: var(--ink); color: #fff; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.5rem; padding-top: .8rem; padding-bottom: .8rem; }
.brand { color: #fff; font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.site-header nav a { color: #d8e1e8; text-decoration: none; margin-left: 1rem; }
.site-header nav a:first-child { margin-left: 0; }
.site-header nav a[aria-current="page"] { color: #fff; text-decoration: underline; text-underline-offset: 4px; }

.notice { background: var(--warn-bg); border: 1px solid var(--warn-line); border-left-width: 5px; padding: .8rem 1rem; border-radius: 6px; margin: 1rem 0 1.5rem; }
.warn { background: var(--warn-bg); border-left: 4px solid var(--warn-line); padding: .5rem .75rem; margin: .5rem 0 0; font-size: .92rem; }
.hint { color: var(--muted); font-size: .9rem; margin: .4rem 0; font-weight: 400; }
.muted { color: var(--muted); }
.detail { display: block; font-weight: 400; color: var(--muted); font-size: .82rem; }
[hidden] { display: none !important; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); } }

fieldset { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.1rem 1.1rem; margin: 0 0 1rem; min-width: 0; }
legend { font-weight: 700; padding: 0 .4rem; font-size: 1.05rem; }
.field { display: block; margin: .3rem 0 .6rem; font-weight: 600; font-size: .93rem; }
.field input, .field select, .field textarea { display: block; width: 100%; margin-top: .25rem; font-weight: 400; }
.label { display: block; font-weight: 600; font-size: .93rem; margin-bottom: .2rem; }
.choice { display: block; margin: .25rem 0; font-weight: 400; }
.field .choice input, .choice input { display: inline; width: auto; margin-top: 0; }
.choice input { margin-right: .4rem; }
.narrow-field { max-width: 260px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }

input, select, textarea, button { font: inherit; }
input[type="number"], input[type="text"], input[type="email"], input[type="search"], select, textarea {
  padding: .45rem .55rem; border: 1px solid #b9c2cb; border-radius: 5px; background: #fff; color: var(--ink);
}
input:disabled { background: #eef1f4; color: var(--muted); }
input:focus, select:focus, textarea:focus, button:focus, a:focus { outline: 3px solid #8fc9bf; outline-offset: 1px; }

button { cursor: pointer; border-radius: 5px; padding: .5rem .95rem; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); }
.btn-secondary { background: #fff; color: var(--accent); }
.btn-link { background: none; border: 0; color: var(--accent); text-decoration: underline; padding: .2rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin: .5rem 0; }

.table-scroll { overflow-x: auto; margin: .5rem 0; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: .85rem; color: var(--muted); font-weight: 600; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.lines td { padding: .3rem .3rem; }
table.lines input, table.lines select { width: 100%; min-width: 7rem; }
table.lines select { min-width: 15rem; }
table.lines .l-icv { min-width: 5rem; }

.more summary { cursor: pointer; color: var(--accent); margin-top: .6rem; }
.more ul { padding-left: 1.2rem; font-size: .92rem; }

.results { position: sticky; top: 1rem; }
@media (max-width: 900px) { .results { position: static; } }
.score-card { background: var(--ink); color: #fff; border-radius: 8px; padding: 1rem 1.1rem; }
.score-label { margin: 0; color: #c6d1da; font-size: .9rem; }
.score { margin: .1rem 0; font-size: 2.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.score-sub { margin: 0; color: #c6d1da; font-size: .88rem; }
.breakdown { background: var(--card); border: 1px solid var(--line); border-radius: 8px; margin-top: .8rem; font-size: .9rem; }
.breakdown th[scope="row"] { font-weight: 600; }
.example-flag { font-weight: 600; color: #8a5a00; }

.sponsored { background: var(--spon-bg); border: 1px dashed var(--spon-line); border-radius: 8px; padding: .8rem 1rem; margin: 1rem 0; font-size: .93rem; }
.sponsored p { margin: .3rem 0; }
.sponsored-label { display: inline-block; text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; font-weight: 700; color: #4b3d7a; background: #e4ddf4; padding: .1rem .5rem; border-radius: 3px; }

.newsletter, .submit { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.2rem; margin: 2rem 0; }
.newsletter h2, .submit h2 { margin-top: .2rem; }
.nl-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.nl-form input { flex: 1 1 240px; }
.form-msg { font-weight: 600; color: var(--accent); }
.hp { position: absolute; left: -9999px; }

.toolbar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: 1rem 0 .3rem; }
.toolbar label { font-weight: 600; }
.toolbar input { min-width: 240px; }
.directory { background: var(--card); }
.source { font-size: .92rem; }

.prose p, .prose li { max-width: 72ch; }
.formula { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: .7rem 1rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; }
table.spec { background: var(--card); margin: .5rem 0 1rem; font-size: .93rem; }

.test-results { padding-left: 1.2rem; font-size: .9rem; }
.test-results .fail { color: #b3261e; font-weight: 600; }
#summary.good { color: #1a7f37; font-weight: 700; }
#summary.bad { color: #b3261e; font-weight: 700; }

.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 1rem 0 2rem; color: var(--muted); font-size: .88rem; }
