/* ===== Design tokens ===== */
:root {
  --bg: #f6f7f9;
  --bg-elev: #ffffff;
  --bg-sunk: #eef1f5;
  --ink: #0f1b2d;
  --ink-2: #3c4a5e;
  --ink-3: #66758a;
  --line: #dde3ea;
  --line-strong: #c4ccd7;
  --primary: #2447b8;
  --primary-ink: #ffffff;
  --primary-soft: #e7ecfb;
  --primary-strong: #1a3591;
  --accent: #0f8a7e;
  --warn-bg: #fff6e5;
  --warn-ink: #7a4b00;
  --warn-line: #f0d39a;
  --ok: #157a4a;
  --bad: #b3261e;
  --paper: #ffffff;
  --chart-area: #eef1f5;
  --shadow-1: 0 1px 2px rgba(15, 27, 45, .06), 0 1px 1px rgba(15, 27, 45, .04);
  --shadow-2: 0 6px 24px rgba(15, 27, 45, .08), 0 2px 6px rgba(15, 27, 45, .05);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --maxw: 1080px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1420; --bg-elev: #141d2c; --bg-sunk: #0a101a;
    --ink: #e8edf5; --ink-2: #b7c2d3; --ink-3: #8a98ad;
    --line: #253247; --line-strong: #34445e;
    --primary: #7d9cff; --primary-ink: #0b1220; --primary-soft: #1b2847; --primary-strong: #a9bdff;
    --accent: #4cc4b6; --chart-area: #1d2940;
    --warn-bg: #2c2210; --warn-ink: #f2c879; --warn-line: #5a4519;
    --ok: #5fd39a; --bad: #ff8a80;
    --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 8px 28px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1420; --bg-elev: #141d2c; --bg-sunk: #0a101a;
  --ink: #e8edf5; --ink-2: #b7c2d3; --ink-3: #8a98ad;
  --line: #253247; --line-strong: #34445e;
  --primary: #7d9cff; --primary-ink: #0b1220; --primary-soft: #1b2847; --primary-strong: #a9bdff;
  --accent: #4cc4b6; --chart-area: #1d2940;
  --warn-bg: #2c2210; --warn-ink: #f2c879; --warn-line: #5a4519;
  --ok: #5fd39a; --bad: #ff8a80;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 8px 28px rgba(0,0,0,.45);
  color-scheme: dark;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 5.2vw, 3rem); font-weight: 750; }
h2 { font-size: clamp(1.4rem, 3.4vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.08rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--primary); text-underline-offset: 3px; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: .5rem } .mt-2 { margin-top: 1rem } .mt-3 { margin-top: 1.5rem } .mt-4 { margin-top: 2.5rem }
.hidden { display: none !important; }

/* ===== Header ===== */
.topbar {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; letter-spacing: -.01em; font-size: 1.08rem; }
.brand svg { width: 28px; height: 28px; flex: none; }
.topbar .spacer { flex: 1; }
.nav-links { display: flex; gap: 18px; }
.nav-links a { color: var(--ink-2); text-decoration: none; font-size: .93rem; }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 760px) { .nav-links { display: none; } }
.lang-select {
  appearance: none; -webkit-appearance: none; background: var(--bg-elev); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 28px 6px 12px; font: inherit; font-size: .88rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border-radius: 12px; border: 1px solid transparent; font-weight: 650; font-size: 1rem; cursor: pointer;
  text-decoration: none; transition: transform .08s ease, background-color .15s ease, box-shadow .15s ease, opacity .15s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, var(--shadow-1); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-primary[disabled] { opacity: .38; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--bg-sunk); }
.btn-link { background: none; border: 0; color: var(--primary); padding: 0; min-height: 0; font-weight: 600; cursor: pointer; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ===== Cards ===== */
.card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 22px; }
.card + .card { margin-top: 16px; }
.grid-2 > .card, .grid-3 > .card, .grid-4 > .card, .result-hero > .card { margin-top: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-strong); font-size: .8rem; font-weight: 600; }
.notice { border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--radius-sm); padding: 12px 14px; font-size: .92rem; }
.notice strong { color: inherit; }
.info-box { border: 1px solid var(--line); background: var(--bg-sunk); border-radius: var(--radius-sm); padding: 14px 16px; font-size: .92rem; color: var(--ink-2); }

/* ===== Landing ===== */
.hero { padding: 56px 0 28px; }
.hero .eyebrow { margin-bottom: 14px; }
.hero h1 { max-width: 15ch; }
.hero .lead { font-size: clamp(1.05rem, 2.4vw, 1.22rem); color: var(--ink-2); max-width: 56ch; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 28px; } .hero { padding-top: 32px; } }
.hero-art { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-2); padding: 18px; }
.hero-art svg { display: block; width: 100%; height: auto; border-radius: 10px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 26px 0 0; padding: 0; list-style: none; }
.facts li { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.facts b { display: block; font-size: 1.15rem; letter-spacing: -.01em; }
.facts span { font-size: .82rem; color: var(--ink-3); }
@media (max-width: 600px) { .facts { grid-template-columns: repeat(2, 1fr); } }
.resume-banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 18px; border: 1px solid var(--primary); background: var(--primary-soft); border-radius: 12px; padding: 12px 14px; }

.section { padding: 48px 0; border-top: 1px solid var(--line); }
.section h2 { margin-bottom: .35em; }
.section .sub { color: var(--ink-2); max-width: 62ch; margin-bottom: 26px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 860px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .grid-2, .grid-4 { grid-template-columns: 1fr; } }
.step-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-strong); font-weight: 700; font-size: .9rem; margin-bottom: 10px; }
.type-card .thumb { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; height: 112px; display: grid; place-items: center; margin-bottom: 12px; overflow: hidden; }
.type-card .thumb svg { height: 96px; width: auto; }
.type-card .thumb .series-thumb { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: #1f2933; font-weight: 650; font-size: .98rem; white-space: nowrap; display: flex; gap: 5px; }
.type-card .thumb .series-thumb span { background: #f1f4f8; border: 1px solid #d9e0e8; border-radius: 6px; padding: 5px 6px; }
.type-card .thumb .series-thumb span.q { background: #e7ecfb; border: 1.5px dashed #2447b8; color: #1a3591; }
.type-card p { color: var(--ink-2); font-size: .93rem; margin: 0; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checklist li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; color: var(--ink-2); }
.checklist li::before { content: ""; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; background: var(--primary-soft) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M5 10.5l3 3 7-7" fill="none" stroke="%232447b8" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>') center/14px no-repeat; }
.checklist.no li::before { background: var(--bg-sunk) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M6 6l8 8M14 6l-8 8" fill="none" stroke="%2366758a" stroke-width="2.2" stroke-linecap="round"/></svg>') center/12px no-repeat; }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; list-style: none; padding: 14px 32px 14px 0; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-size: 1.4rem; font-weight: 400; color: var(--ink-3); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); margin: 0 0 14px; }
.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--ink-3); font-size: .85rem; }
.footer .wrap { display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; }

/* ===== Forms ===== */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: .95rem; }
.field select, .field input[type=text] {
  font: inherit; color: var(--ink); background: var(--bg-elev); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 12px 12px; min-height: 48px; width: 100%;
}
.check { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; cursor: pointer; font-size: .95rem; color: var(--ink-2); }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--primary); }

/* ===== Test screen ===== */
.test-shell { min-height: 100dvh; display: flex; flex-direction: column; }
.test-head { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.test-head .wrap { display: flex; align-items: center; gap: 12px; height: 56px; max-width: 760px; }
.test-head .count { font-weight: 650; font-size: .95rem; }
.test-head .count span { color: var(--ink-3); font-weight: 500; }
.timer { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 650; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--bg-sunk); font-size: .92rem; }
.timer.low { background: var(--warn-bg); color: var(--warn-ink); }
.progress { height: 3px; background: var(--line); }
.progress > i { display: block; height: 100%; background: var(--primary); width: 0; transition: width .4s ease; }
.test-body { flex: 1; max-width: 760px; width: 100%; margin: 0 auto; padding: 18px 16px 120px; }
.q-prompt { font-weight: 650; font-size: 1.06rem; margin: 2px 0 14px; }
.stem { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; place-items: center; margin-bottom: 16px; box-shadow: var(--shadow-1); }
.stem svg { display: block; width: 100%; height: auto; }
.stem.matrix svg { max-width: 330px; }
.stem.rotation svg { max-width: 180px; }
.stem-label { justify-self: start; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: #66758a; font-weight: 700; margin-bottom: 2px; }
.stem.text { display: block; color: var(--ink); background: var(--bg-elev); white-space: pre-line; font-size: 1.04rem; line-height: 1.65; padding: 18px; }
.series { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 6px 0; }
.series .t { min-width: 46px; height: 50px; padding: 0 10px; display: grid; place-items: center; border-radius: 10px; background: #f1f4f8; border: 1px solid #d9e0e8; color: #0f1b2d; font: 650 1.2rem/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.series .t.q { background: var(--primary-soft); border: 2px dashed var(--primary); color: var(--primary-strong); }
.options { display: grid; gap: 10px; }
.options.cols-4 { grid-template-columns: repeat(4, 1fr); }
.options.cols-3 { grid-template-columns: repeat(3, 1fr); }
.options.cols-1 { grid-template-columns: 1fr; }
@media (max-width: 380px) { .options.cols-4 { gap: 7px; } }
.opt {
  position: relative; background: var(--paper); border: 2px solid var(--line); border-radius: 12px; padding: 6px; cursor: pointer;
  transition: border-color .12s, box-shadow .12s, transform .08s; -webkit-tap-highlight-color: transparent; color: #0f1b2d; text-align: center;
}
.opt:hover { border-color: var(--line-strong); }
.opt:active { transform: scale(.985); }
.opt svg { display: block; width: 100%; height: auto; border-radius: 6px; }
.opt .lbl { position: absolute; top: 5px; left: 7px; font-size: .68rem; font-weight: 700; color: #8592a3; }
.opt.text { background: var(--bg-elev); color: var(--ink); padding: 14px 14px 14px 46px; text-align: left; font-size: 1rem; min-height: 54px; display: flex; align-items: center; }
.opt.text .lbl { top: 50%; transform: translateY(-50%); left: 12px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-sunk); color: var(--ink-3); font-size: .78rem; }
.opt.mono { justify-content: center; padding: 14px 6px; font: 650 1.2rem/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.opt.mono .lbl { left: 7px; top: 6px; transform: none; width: auto; height: auto; background: none; }
.opt[aria-pressed="true"] { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.opt[aria-pressed="true"] .lbl { color: var(--primary); }
.opt.text[aria-pressed="true"] .lbl { background: var(--primary); color: var(--primary-ink); }
.opt.correct { border-color: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.opt.wrong { border-color: var(--bad); }
.test-foot { position: fixed; left: 0; right: 0; bottom: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); z-index: 10; }
.test-foot .inner { max-width: 728px; margin: 0 auto; display: flex; gap: 12px; align-items: center; }
.test-foot .hint { flex: 1; color: var(--ink-3); font-size: .85rem; }
.test-foot .btn { min-width: 150px; }
@media (max-width: 480px) { .test-foot .hint { display: none; } .test-foot .btn { flex: 1; } }
.fade-in { animation: fadeIn .28s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade-in { animation: none; } * { transition: none !important; } }
.feedback { margin-top: 14px; border-radius: 12px; padding: 12px 14px; font-size: .95rem; }
.feedback.ok { background: color-mix(in srgb, var(--ok) 12%, var(--bg-elev)); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); }
.feedback.no { background: color-mix(in srgb, var(--bad) 10%, var(--bg-elev)); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }

/* ===== Results ===== */
.result-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: stretch; }
@media (max-width: 760px) { .result-hero { grid-template-columns: 1fr; } }
.score-card { text-align: left; }
.score-label { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; }
.score-num { font-size: clamp(3.6rem, 13vw, 5.2rem); font-weight: 780; letter-spacing: -.04em; line-height: 1; margin: 6px 0 6px; font-variant-numeric: tabular-nums; }
.score-range { font-size: 1.05rem; color: var(--ink-2); }
.score-range b { color: var(--ink); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.stat { background: var(--bg-sunk); border-radius: 10px; padding: 10px 12px; }
.stat b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: .78rem; color: var(--ink-3); }
.chart-card h3 { margin-bottom: 2px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.chart .axis line, .chart .gridline { stroke: var(--line); }
.chart .curve { fill: none; stroke: var(--ink-3); stroke-width: 2; }
.chart .area { fill: var(--chart-area); }
.chart .band { fill: var(--primary); opacity: .22; }
.chart .marker { stroke: var(--primary); stroke-width: 2.5; }
.chart .marker-dot { fill: var(--primary); stroke: var(--bg-elev); stroke-width: 2; }
.chart .lbl { fill: var(--ink); font-size: 12px; font-weight: 650; font-family: var(--font); }
.chart .lbl-muted { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.chart .dom-range { stroke: var(--primary); stroke-width: 8; stroke-linecap: round; opacity: .28; }
.chart .dom-dot { fill: var(--primary); stroke: var(--bg-elev); stroke-width: 2; }
.chart .ref100 { stroke: var(--line-strong); stroke-dasharray: 3 4; }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: .8rem; padding: 5px 8px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -120%); opacity: 0; transition: opacity .1s; }
.chart { position: relative; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-3); margin-top: 6px; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }
.dom-table { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: 10px; }
.dom-table th, .dom-table td { text-align: left; padding: 7px 4px; border-bottom: 1px solid var(--line); }
.dom-table td.num, .dom-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.disclaimer h3 { margin-top: 0; }
.disclaimer ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: .93rem; }
.disclaimer li { margin-bottom: 6px; }
.locked-wrap { position: relative; }
.locked-wrap .blurred { filter: blur(9px); pointer-events: none; user-select: none; }
.paywall { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; }
.paywall .card { max-width: 420px; text-align: center; box-shadow: var(--shadow-2); }

/* ===== Certificate ===== */
.cert-tools { display: grid; gap: 12px; margin-bottom: 18px; }
.cert-scroller { overflow-x: auto; padding-bottom: 8px; }
.cert {
  --c-ink: #0f1b2d; --c-ink-2: #44526a; --c-line: #c9d2de; --c-accent: #2447b8;
  width: 1000px; aspect-ratio: 297 / 210; background: #fffefb; color: var(--c-ink); margin: 0 auto; position: relative;
  border-radius: 6px; box-shadow: var(--shadow-2); padding: 56px 70px; font-family: var(--serif); overflow: hidden;
  transform-origin: top left;
}
.cert::before { content: ""; position: absolute; inset: 16px; border: 1.5px solid var(--c-line); border-radius: 3px; pointer-events: none; }
.cert::after { content: ""; position: absolute; inset: 22px; border: .5px solid var(--c-line); border-radius: 2px; pointer-events: none; }
.cert .c-top { display: flex; justify-content: space-between; align-items: center; font-family: var(--font); }
.cert .c-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.cert .c-brand svg { width: 30px; height: 30px; }
.cert .c-tag { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--c-ink-2); font-weight: 600; }
.cert .c-title { text-align: center; margin-top: 34px; font-size: 40px; font-weight: 600; letter-spacing: -.01em; }
.cert .c-estimate { text-align: center; margin-top: 4px; font-family: var(--font); font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--c-accent); font-weight: 700; }
.cert .c-pre { text-align: center; margin-top: 26px; font-size: 17px; color: var(--c-ink-2); font-style: italic; }
.cert .c-name { text-align: center; font-size: 44px; margin: 8px auto 0; padding-bottom: 8px; border-bottom: 1px solid var(--c-line); max-width: 640px; font-weight: 600; min-height: 62px; }
.cert .c-body { text-align: center; font-size: 18px; margin: 18px auto 0; max-width: 720px; line-height: 1.55; color: var(--c-ink); }
.cert .c-score { font-family: var(--font); font-weight: 750; font-size: 22px; }
.cert .c-foot { position: absolute; left: 70px; right: 70px; bottom: 50px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; font-family: var(--font); font-size: 11.5px; color: var(--c-ink-2); align-items: end; }
.cert .c-foot b { display: block; color: var(--c-ink); font-size: 13px; margin-bottom: 2px; }
.cert .c-disc { grid-column: 1 / -1; font-size: 10.5px; line-height: 1.45; border-top: 1px solid var(--c-line); padding-top: 10px; }
.cert .c-seal { position: absolute; right: 64px; bottom: 150px; width: 96px; height: 96px; opacity: .9; }

#print-root { display: none; }
@media print {
  @page { size: A4 landscape; margin: 0; }
  html, body { background: #fff !important; margin: 0; padding: 0; }
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing #print-root { display: block; width: 297mm; height: 209mm; overflow: hidden; }
  #print-root .cert { width: 1000px; height: 707px; aspect-ratio: auto; margin: 0; border-radius: 0; box-shadow: none;
    transform: scale(1.1225) !important; transform-origin: top left; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ===== Misc ===== */
.center-screen { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 24px 16px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--primary); animation: spin .8s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.kbd { font: 600 .75rem ui-monospace, Menlo, monospace; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; color: var(--ink-2); }
.page-head { padding-top: 34px; padding-bottom: 10px; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .9rem; z-index: 50; box-shadow: var(--shadow-2); }
.modal-back { position: fixed; inset: 0; background: rgba(8, 12, 20, .5); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal-back .card { max-width: 440px; width: 100%; }
.prose p, .prose li { color: var(--ink-2); }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.3em; }

/* ===== Ajustes telefono ===== */
@media (max-width: 480px) {
  .hero .btn-row .btn { flex: 1 1 100%; }
  .test-head .count span { display: none; }
  .series { gap: 6px; }
  .series { gap: 4px; }
  .series .t { min-width: 0; height: 42px; padding: 0 7px; font-size: .98rem; border-radius: 8px; }
  .card { padding: 18px; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .checklist li::before { background: var(--primary-soft) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M5 10.5l3 3 7-7" fill="none" stroke="%237d9cff" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>') center/14px no-repeat; }
  :root:not([data-theme="light"]) .checklist.no li::before { background: var(--bg-sunk) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M6 6l8 8M14 6l-8 8" fill="none" stroke="%238a98ad" stroke-width="2.2" stroke-linecap="round"/></svg>') center/12px no-repeat; }
}
.chart svg { margin: 0 auto; }

/* ---- clasificacion descriptiva ---- */
.score-class { margin-top: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.score-class span { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.score-class b { font-size: 1.12rem; color: var(--primary-strong); line-height: 1.3; }
.score-class small { font-size: .75rem; color: var(--ink-3); max-width: 30ch; line-height: 1.4; margin-top: 2px; }
.class-table { width: 100%; max-width: 560px; border-collapse: collapse; font-size: .9rem; margin-top: 6px; }
.class-table th { text-align: left; font-size: .75rem; color: var(--ink-3); font-weight: 600; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.class-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); }
.class-table .num { text-align: right; font-variant-numeric: tabular-nums; width: 5.5em; white-space: nowrap; }
.class-table .tag { text-align: right; white-space: nowrap; }
.class-table tr.in-range td { background: var(--primary-soft); }
.class-table tr.is-you td { background: var(--primary-soft); font-weight: 700; }
.class-table tr.is-you td:first-child, .class-table tr.in-range td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.class-table .pill.soft { background: transparent; border: 1px solid var(--primary); padding: 2px 8px; }
.class-table .pill { padding: 2px 8px; font-size: .72rem; }
.chart .bound { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 4; opacity: .55; }
.legend i.lg-bound { width: 0; height: 12px; border-left: 1.5px dashed var(--ink-3); border-radius: 0; opacity: .7; }
.cert .c-class { text-align: center; font-family: var(--font); font-size: 15px; margin-top: 10px; color: var(--c-ink); }
.cert .c-class b { color: var(--c-accent); font-weight: 700; }
