:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --ink: #1b1f24;
  --muted: #5b6470;
  --line: #dfe2e6;
  --brand: #3b3355;
  --brand-ink: #ffffff;
  --accent: #b91c1c;
  --ok: #1e6b3a;
  --ok-bg: #e6f3ea;
  --bad: #9b1c1c;
  --bad-bg: #fbeaea;
  --note-bg: #fff7e0;
  --note-line: #e9cf7a;
  --focus: #2f6fd1;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151a; --surface: #1b2027; --ink: #e8eaed; --muted: #a2abb6; --line: #2e353f;
    --brand: #c4b5fd; --brand-ink: #1b1530; --accent: #f19a9a;
    --ok: #7fd39b; --ok-bg: #16301f; --bad: #f2a3a3; --bad-bg: #3a1a1a;
    --note-bg: #2d2714; --note-line: #6b5a22; --focus: #8fb3e3;
  }
}
:root[data-theme="dark"] {
  --bg: #12151a; --surface: #1b2027; --ink: #e8eaed; --muted: #a2abb6; --line: #2e353f;
  --brand: #c4b5fd; --brand-ink: #1b1530; --accent: #f19a9a;
  --ok: #7fd39b; --ok-bg: #16301f; --bad: #f2a3a3; --bad-bg: #3a1a1a;
  --note-bg: #2d2714; --note-line: #6b5a22; --focus: #8fb3e3;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--brand); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
header.site { border-bottom: 1px solid var(--line); background: var(--surface); }
header.site .wrap { display: flex; align-items: center; gap: 10px; min-height: 56px; }
.logo { width: 28px; height: 28px; flex: none; }
.site-name { font-weight: 700; color: var(--ink); text-decoration: none; font-size: 15px; }
.disclaimer {
  background: var(--note-bg); border: 1px solid var(--note-line); border-radius: var(--radius);
  padding: 10px 14px; font-size: 14px; margin: 16px 0;
}
h1 { font-size: clamp(26px, 6vw, 36px); line-height: 1.2; margin: 28px 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 21px; margin: 32px 0 12px; }
.lede { color: var(--muted); margin: 0 0 8px; font-size: 17px; }
.cards { display: grid; gap: 12px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: grid; gap: 6px;
}
.card .code { font-weight: 800; color: var(--accent); font-size: 14px; letter-spacing: .04em; }
.card h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.card .meta { color: var(--muted); font-size: 14px; }
.card .row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 6px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--brand);
  background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.btn.secondary { background: transparent; color: var(--brand); }
.btn.buy { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn[disabled] { opacity: .55; cursor: default; }
.facts { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px; }
.facts dl { margin: 0; }
.facts .fact { padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts .fact:last-child { border-bottom: 0; }
.facts dt { font-weight: 600; }
.facts dd { margin: 2px 0 0; color: var(--ink); }
.cite { font-size: 13px; color: var(--muted); }
.cite a { color: var(--muted); }
table.examtable { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.examtable th, table.examtable td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
table.examtable th { font-weight: 600; color: var(--muted); }
footer.site { color: var(--muted); font-size: 13px; padding: 32px 0 48px; border-top: 1px solid var(--line); margin-top: 40px; }

/* quiz */
.qhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 20px 0 8px; color: var(--muted); font-size: 14px; }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-bottom: 16px; }
.progress > span { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s; }
.qtext { font-size: 19px; font-weight: 600; line-height: 1.4; margin: 0 0 14px; }
.opts { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.opt {
  width: 100%; text-align: left; min-height: 48px; padding: 12px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer;
  display: flex; gap: 10px; align-items: flex-start;
}
.opt .k { font-weight: 700; color: var(--muted); flex: none; width: 1.3em; }
.opt:hover:not([disabled]) { border-color: var(--brand); }
.opt[disabled] { cursor: default; }
.opt.correct { border-color: var(--ok); background: var(--ok-bg); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt.picked { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.feedback { margin-top: 14px; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.feedback .verdict { font-weight: 700; }
.feedback .verdict.ok { color: var(--ok); }
.feedback .verdict.bad { color: var(--bad); }
.feedback blockquote { margin: 8px 0 0; padding: 6px 10px; border-left: 3px solid var(--line); color: var(--muted); font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 20px 0; }
.score { font-size: 40px; font-weight: 800; line-height: 1; margin: 4px 0 6px; }
.gate h2 { margin-top: 0; }
.gate form { display: grid; gap: 10px; margin-top: 12px; }
.gate input[type=email] {
  min-height: 46px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font: inherit; width: 100%;
}
.small { font-size: 13px; color: var(--muted); }
.msg { font-size: 14px; }
.msg.err { color: var(--bad); }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.timer.low { color: var(--bad); }
.review li { margin-bottom: 14px; }
.review .verdict { font-weight: 600; }
.review .verdict.ok { color: var(--ok); }
.review .verdict.bad { color: var(--bad); }
.review blockquote { margin: 6px 0 0; padding: 4px 10px; border-left: 3px solid var(--line); color: var(--muted); font-size: 14px; }
.qtopic { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px; }
.qtext, .opt, .feedback, .review li, .facts dd { overflow-wrap: anywhere; }
.coverage { font-size: 14px; }
.coverage li { margin: 2px 0; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.stat b { display: block; font-size: 24px; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); }
.hidden { display: none !important; }
@media (min-width: 640px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .gate form { grid-template-columns: 1fr auto; }
}
.panel > h2:first-child { margin-top: 0; }
