:root {
  --bg: #f4f2ec; --paper: #ffffff; --tint: #e9ecf3; --fg: #1b2233; --mute: #5b6475; --soft: #8d95a3;
  --cover: #1e3a5f; --cover-hi: #284b78; --on-cover: #f5f7fb; --ok: #1f7048; --ok-bg: #dff0e5; --guide: #2d6fb5; --badge: #e3c27a; --on-badge: #2a2108; --hl: #d9e3f2;
  --warn: #8a5a00; --warn-bg: #fbefd6; --bad: #a3322a; --bad-bg: #f8e1de; --photo-bg: #fdfcf9;
  --shadow: 0 1px 2px rgba(27, 34, 51, .06), 0 12px 32px -12px rgba(27, 34, 51, .18);
  --f-ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif; --f-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --r-lg: 22px; --r-md: 14px; --r-sm: 10px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f1420; --paper: #171e2d; --tint: #1e2738; --fg: #e7ebf3; --mute: #9ea8ba; --soft: #6f7a8e;
  --cover: #3b6aa8; --cover-hi: #4a7cbd; --on-cover: #f5f7fb; --ok: #6fd39c; --ok-bg: #1d3a2b; --guide: #7fb0ec; --badge: #e3c27a; --on-badge: #2a2108; --hl: #24365a;
  --warn: #f0c060; --warn-bg: #3a2f17; --bad: #f08a80; --bad-bg: #3d1f1c; --photo-bg: #eceae4;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .6); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0f1420; --paper: #171e2d; --tint: #1e2738; --fg: #e7ebf3; --mute: #9ea8ba; --soft: #6f7a8e;
  --cover: #3b6aa8; --cover-hi: #4a7cbd; --on-cover: #f5f7fb; --ok: #6fd39c; --ok-bg: #1d3a2b; --guide: #7fb0ec; --badge: #e3c27a; --on-badge: #2a2108; --hl: #24365a;
  --warn: #f0c060; --warn-bg: #3a2f17; --bad: #f08a80; --bad-bg: #3d1f1c; --photo-bg: #eceae4;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .6); color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.55 var(--f-ui); -webkit-font-smoothing: antialiased; }
img, canvas, svg { max-width: 100%; }
[hidden] { display: none !important; }
.gut { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.in { max-width: 1100px; margin: 0 auto; }
.narrow { max-width: 760px; }
a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--soft); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--cover-hi); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; border-radius: 8px; z-index: 20; }
.skip:focus { left: 12px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
header.site { display: flex; align-items: center; gap: 16px; padding-block: 18px; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 19px; font-weight: 640; letter-spacing: -0.02em; text-decoration: none; }
.brand svg { width: 34px; height: 34px; flex: none; }
header.site nav { margin-left: auto; display: flex; gap: 6px; align-items: center; }
header.site nav a { text-decoration: none; font-size: 15px; color: var(--mute); padding: 8px 12px; border-radius: 999px; transition: background .2s, color .2s; }
header.site nav a:hover, header.site nav a[aria-current] { background: var(--tint); color: var(--fg); }
.theme { margin-left: 4px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; color: var(--mute); display: grid; place-items: center; cursor: pointer; transition: background .2s, color .2s; }
.theme:hover { background: var(--tint); color: var(--fg); }
.theme svg { width: 19px; height: 19px; }
@media (max-width: 640px) { header.site nav a { display: none; } header.site nav { margin-left: auto; } }

/* Type */
h1 { font-size: clamp(40px, 6vw, 70px); line-height: .98; font-weight: 600; letter-spacing: -0.04em; font-stretch: 88%; margin: 0; text-wrap: balance; }
h1 span { display: block; }
h1 em { font-style: normal; color: var(--cover); padding: 0 .06em; margin: 0 -.06em; border-radius: .14em;
  background: linear-gradient(var(--hl), var(--hl)) no-repeat 0 88% / 0% 34%; transition: background-size .9s cubic-bezier(.2, .7, .2, 1) .35s; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.seen h1 em, h1 em.seen { background-size: 100% 34%; }
.tool-head h1 { font-size: clamp(32px, 4.6vw, 52px); line-height: 1.02; }
h2 { font-size: 24px; font-weight: 620; letter-spacing: -0.02em; margin: 0 0 14px; text-wrap: balance; }
h3 { font-size: 17px; font-weight: 620; letter-spacing: -0.01em; margin: 0 0 8px; }
.lede { font-size: 18px; color: var(--mute); max-width: 52ch; margin: 16px 0 0; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--mute); margin: 0 0 10px; }
.crumbs { font-size: 14px; color: var(--mute); margin: 4px 0 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--mute); }
.mono { font-family: var(--f-mono); font-size: .92em; }

/* Home hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; padding-block: 32px 56px; }
@media (max-width: 880px) { .hero { grid-template-columns: 1fr; gap: 32px; padding-block: 16px 40px; } }
.pick { margin-top: 28px; background: var(--paper); border-radius: var(--r-lg); padding: 8px; box-shadow: var(--shadow); max-width: 460px; display: grid; gap: 6px; }
.pick label { font-size: 13px; color: var(--mute); padding: 8px 12px 0; }
.select { position: relative; }
.select select { appearance: none; width: 100%; font: 500 16px var(--f-ui); color: var(--fg); background: var(--tint); border: 0; border-radius: var(--r-md); padding: 14px 44px 14px 14px; cursor: pointer; transition: background .2s; }
.select svg { position: absolute; right: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); pointer-events: none; color: var(--mute); }
.privacy { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--mute); margin: 14px 0 0; padding-left: 4px; }
.privacy svg { width: 16px; height: 16px; flex: none; color: var(--ok); }

/* Buttons */
.cta, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 20px; border: 0; border-radius: var(--r-md); font: 600 16px var(--f-ui); cursor: pointer; text-decoration: none; transition: background .2s, transform .15s, opacity .2s; }
.cta { width: 100%; background: var(--cover); color: var(--on-cover); }
.cta:hover, .btn.primary:hover { background: var(--cover-hi); transform: translateY(-1px); }
.cta:active, .btn:active { transform: translateY(0) scale(.99); }
.cta svg, .btn svg { width: 20px; height: 20px; flex: none; }
.btn { background: var(--tint); color: var(--fg); padding: 12px 16px; font-size: 15px; }
.btn:hover { background: color-mix(in srgb, var(--tint) 85%, var(--cover) 15%); }
.btn.primary { background: var(--cover); color: var(--on-cover); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* Demo data page (home) */
.page { background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.page-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 22px 0; }
.page-top b { font-weight: 600; font-size: 15px; }
.status { font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--tint); color: var(--mute); transition: background .3s, color .3s; white-space: nowrap; }
.status.done, .status[data-state="ok"] { background: var(--ok-bg); color: var(--ok); }
.status[data-state="warn"] { background: var(--warn-bg); color: var(--warn); }
.status[data-state="bad"] { background: var(--bad-bg); color: var(--bad); }
.page-body { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; padding: 18px 22px 22px; align-items: start; }
@media (max-width: 480px) { .page-body { grid-template-columns: 1fr; } .page-body .photo { width: 180px; } }
.photo { border-radius: var(--r-md); overflow: hidden; background: var(--photo-bg); aspect-ratio: 1; align-self: start; }
.photo svg { display: block; width: 100%; height: 100%; }
.photo .guides line, .photo .guides path { stroke-dasharray: 120; stroke-dashoffset: 120; }
.photo .guides text { opacity: 0; }
.run .photo .guides line, .run .photo .guides path { animation: draw .7s ease-out forwards; animation-delay: var(--d, .3s); }
.run .photo .guides text { animation: fade .4s ease-out forwards; animation-delay: var(--d, .6s); }
.photo .face { opacity: 0; transform: scale(1.04); transform-origin: 50% 60%; }
.run .photo .face { animation: settle .6s cubic-bezier(.2, .7, .2, 1) forwards; }
.mrz { background: var(--tint); padding: 14px 22px 16px; font: 400 clamp(10.5px, 1.45vw, 12.5px)/1.7 var(--f-mono); letter-spacing: .08em; color: var(--mute); white-space: pre; overflow: hidden; min-height: 64px; }
.mrz .caret { display: inline-block; width: .6em; height: 1.1em; vertical-align: -2px; background: var(--soft); animation: blink 1s steps(1) infinite; }
.source { display: flex; gap: 10px; align-items: center; margin-top: 14px; font-size: 14px; color: var(--mute); padding-inline: 6px; }
.source svg { width: 16px; height: 16px; flex: none; }
.source a { color: var(--fg); }

/* Rule list (demo and live checks) */
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rules li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--r-sm); opacity: .35; transition: opacity .35s, background .35s; }
.rules li.ok, .rules li[data-state="ok"], .rules li[data-state="warn"], .rules li[data-state="bad"], .rules li[data-state="info"] { opacity: 1; }
.rules li.now, .rules li[data-state="now"] { background: var(--tint); opacity: 1; }
.rules .tick { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: transparent; transition: background .3s, color .3s; }
.rules li.ok .tick, .rules li[data-state="ok"] .tick { background: var(--ok-bg); color: var(--ok); }
.rules li[data-state="warn"] .tick { background: var(--warn-bg); color: var(--warn); }
.rules li[data-state="bad"] .tick { background: var(--bad-bg); color: var(--bad); }
.rules li[data-state="info"] .tick { background: var(--tint); color: var(--mute); }
.rules .tick svg { width: 13px; height: 13px; }
.rules li.ok .tick svg path, .rules li[data-state="ok"] .tick svg path { stroke-dasharray: 20; stroke-dashoffset: 20; animation: draw .35s ease-out forwards; }
.rules span { font-size: 14.5px; min-width: 0; }
.rules span small { display: block; color: var(--mute); font-size: 13px; line-height: 1.4; margin-top: 2px; }
.rules b { font-weight: 600; font-size: 14.5px; font-variant-numeric: tabular-nums; text-align: right; }

/* Form list (home) */
.forms { padding-block: 8px 64px; }
.groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 880px) { .groups { grid-template-columns: 1fr; } }
.group { background: var(--paper); border-radius: var(--r-lg); padding: 10px; box-shadow: var(--shadow); }
.group h3 { font-size: 14px; font-weight: 600; color: var(--mute); margin: 8px 12px 6px; }
.group a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-md); text-decoration: none; transition: background .2s; }
.group a:hover { background: var(--tint); }
.group a span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.group a small { color: var(--mute); font-size: 13.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.group a .go { width: 16px; height: 16px; color: var(--soft); transition: transform .2s, color .2s; flex: none; }
.group a:hover .go { transform: translateX(3px); color: var(--fg); }

/* Tool pages */
.tool-head { padding-block: 12px 24px; }
.tool { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; padding-bottom: 48px; }
@media (max-width: 900px) { .tool { grid-template-columns: 1fr; } }
.card { background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card + .card { margin-top: 16px; }
.card h2 { font-size: 18px; margin-bottom: 10px; }
.drop { display: grid; place-items: center; text-align: center; gap: 10px; min-height: 260px; border-radius: var(--r-md); background: var(--tint); padding: 28px 18px; cursor: pointer; transition: background .2s, box-shadow .2s; }
.drop:hover, .drop.over { background: color-mix(in srgb, var(--tint) 82%, var(--cover) 18%); }
.drop.over { box-shadow: inset 0 0 0 2px var(--cover-hi); }
.drop svg { width: 40px; height: 40px; color: var(--cover); }
.drop b { font-size: 17px; font-weight: 620; }
.drop small { color: var(--mute); font-size: 14px; max-width: 34ch; }
.drop .cta { width: auto; pointer-events: none; }
.stage { position: relative; border-radius: var(--r-md); overflow: hidden; background: var(--photo-bg); touch-action: none; user-select: none; -webkit-user-select: none; }
.stage canvas { display: block; width: 100%; height: auto; }
.stage .line { position: absolute; left: 0; right: 0; height: 32px; margin-top: -16px; cursor: ns-resize; display: flex; align-items: center; touch-action: none; }
.stage .line::before { content: ""; position: absolute; left: 0; right: 0; top: 15px; height: 2px; background: var(--c, var(--guide)); box-shadow: 0 0 0 1px rgba(255, 255, 255, .7); }
.stage .line.v { top: 0; bottom: 0; left: auto; right: auto; width: 32px; height: auto; margin: 0 0 0 -16px; cursor: ew-resize; justify-content: center; }
.stage .line.v::before { left: 15px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
.stage .line i { position: relative; margin-left: 8px; font: 600 12px var(--f-ui); font-style: normal; color: #fff; background: var(--c, var(--guide)); padding: 3px 8px; border-radius: 999px; white-space: nowrap; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.stage .line.v i { margin: 0; position: absolute; top: 8px; }
.stage .line:focus-visible { outline: none; }
.stage .line:focus-visible i { outline: 2px solid #fff; outline-offset: 1px; }
.steps { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14.5px; color: var(--mute); }
.steps li { position: relative; padding-left: 32px; }
.steps li::before { content: attr(data-n); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--tint); color: var(--fg); font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.out { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 460px) { .out { grid-template-columns: 1fr; } }
.out img { width: 100%; border-radius: var(--r-sm); background: var(--photo-bg); box-shadow: 0 0 0 1px var(--tint); }
.meta { font-size: 14px; color: var(--mute); margin: 10px 0 0; }
.msg { border-radius: var(--r-md); padding: 12px 14px; font-size: 14.5px; margin: 12px 0 0; background: var(--tint); }
.msg[data-state="warn"] { background: var(--warn-bg); color: var(--warn); }
.msg[data-state="bad"] { background: var(--bad-bg); color: var(--bad); }
.msg[data-state="ok"] { background: var(--ok-bg); color: var(--ok); }
.field { display: grid; gap: 6px; font-size: 14px; color: var(--mute); }
.field input, .field select { font: 500 16px var(--f-ui); color: var(--fg); background: var(--tint); border: 0; border-radius: var(--r-sm); padding: 11px 12px; width: 100%; min-width: 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chips button, .chips a { font: 500 14px var(--f-ui); border: 0; background: var(--tint); color: var(--fg); padding: 7px 12px; border-radius: 999px; cursor: pointer; text-decoration: none; transition: background .2s; }
.chips button:hover, .chips a:hover { background: color-mix(in srgb, var(--tint) 80%, var(--cover) 20%); }
.chips [aria-pressed="true"], .chips [aria-current] { background: var(--cover); color: var(--on-cover); }
.selfcheck { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.selfcheck label { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: var(--r-sm); font-size: 14.5px; cursor: pointer; }
.selfcheck label:hover { background: var(--tint); }
.selfcheck input { width: 18px; height: 18px; accent-color: var(--cover); margin: 2px 0 0; flex: none; }
.progress { height: 6px; border-radius: 999px; background: var(--tint); overflow: hidden; margin-top: 12px; }
.progress i { display: block; height: 100%; width: 0; background: var(--cover); transition: width .25s; }

/* Article content under tools */
.prose { padding-block: 8px 56px; display: grid; gap: 16px; }
.prose .card p, .prose .card li { max-width: 68ch; }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.spec { width: 100%; border-collapse: collapse; font-size: 15px; }
.spec th, .spec td { text-align: left; padding: 10px 12px; vertical-align: top; }
.spec th { color: var(--mute); font-weight: 500; width: 40%; }
.spec tr:nth-child(odd) { background: color-mix(in srgb, var(--tint) 55%, transparent); }
.spec tr td:first-child, .spec tr th:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.spec tr td:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.table-wrap { overflow-x: auto; }
.sources { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.sources li { display: flex; gap: 10px; align-items: baseline; font-size: 14.5px; }
.sources li svg { width: 16px; height: 16px; flex: none; color: var(--mute); transform: translateY(3px); }
.sources small { color: var(--mute); display: block; }
details.faq { border-radius: var(--r-md); transition: background .2s; }
details.faq + details.faq { margin-top: 4px; }
details.faq summary { cursor: pointer; list-style: none; padding: 12px 14px; font-weight: 600; display: flex; justify-content: space-between; gap: 12px; border-radius: var(--r-md); }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--mute); font-weight: 400; font-size: 20px; line-height: 1; }
details.faq[open] summary::after { content: "–"; }
details.faq summary:hover { background: var(--tint); }
details.faq > div { padding: 0 14px 12px; color: var(--mute); }
.honest { background: var(--warn-bg); color: var(--warn); border-radius: var(--r-md); padding: 14px 16px; font-size: 15px; }
.honest b { color: inherit; }
.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.related a { display: block; background: var(--tint); border-radius: var(--r-md); padding: 12px 14px; text-decoration: none; transition: background .2s; }
.related a:hover { background: color-mix(in srgb, var(--tint) 80%, var(--cover) 20%); }
.related small { display: block; color: var(--mute); font-size: 13.5px; }
.log { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.log time { font: 500 13px var(--f-mono); color: var(--mute); }

/* Footer */
footer.site { padding-block: 40px 48px; color: var(--mute); font-size: 14px; }
footer.site .cols { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 760px) { footer.site .cols { grid-template-columns: 1fr 1fr; } }
footer.site h3 { font-size: 13px; color: var(--fg); margin-bottom: 8px; }
footer.site ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
footer.site a { color: var(--mute); text-decoration: none; }
footer.site a:hover { color: var(--fg); }
footer.site .fine { margin-top: 28px; font-size: 13px; color: var(--soft); max-width: 80ch; }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease-out, transform .6s cubic-bezier(.2, .7, .2, 1); }
.reveal.seen { opacity: 1; transform: none; }
.pop { animation: settle .45s cubic-bezier(.2, .7, .2, 1) both; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes settle { from { opacity: 0; transform: translateY(6px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Photos-to-PDF page list */
.thumbs { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; }
.thumbs:empty { display: none; }
.thumbs li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; background: var(--tint); border-radius: var(--r-sm); padding: 6px; }
.thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.thumbs .btn { padding: 8px 12px; }

/* Guides */
.answer { background: var(--hl); }
.answer p { font-size: 17px; }
.grid { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 520px; }
.grid th, .grid td { text-align: left; padding: 9px 10px; vertical-align: top; border-bottom: 1px solid color-mix(in srgb, var(--soft) 30%, transparent); }
.grid thead th { color: var(--mute); font-weight: 500; font-size: 13.5px; }
.grid tbody th { font-weight: 600; }
.guide-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.guide-list a { font-weight: 600; font-size: 16.5px; }
.guide-list p { margin: 4px 0 0; color: var(--mute); font-size: 15px; }
