/* The 50 — site styles */

:root {
  --ink: #1d1b2f;
  --ink-2: #545170;
  --ink-3: #8c89a6;
  --paper: #fbf9f4;
  --card: #ffffff;
  --soft: #f3f0fa;
  --lilac: #c9b8f6;
  --lilac-soft: #ece5ff;
  --violet: #5b3fd1;

  --set1: #c9b8f6;
  --set2: #9fd3ff;
  --set3: #ffd96b;
  --set4: #95e2b5;
  --set5: #ffb39e;

  --good: #12784a;
  --good-bg: #dcf5e6;
  --bad: #b8282e;
  --bad-bg: #fde5e5;

  --accent: var(--lilac);
  --diagram-accent: var(--violet);
  --r: 16px;
  --r-sm: 12px;
  --max: 1060px;
  --font: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body[data-set="1"] { --accent: var(--set1); }
body[data-set="2"] { --accent: var(--set2); }
body[data-set="3"] { --accent: var(--set3); }
body[data-set="4"] { --accent: var(--set4); }
body[data-set="5"] { --accent: var(--set5); }

h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 0.8em; }
a { color: var(--violet); text-underline-offset: 3px; }
img, svg { max-width: 100%; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 760px; }
main { flex: 1; padding-bottom: 56px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ── Header & footer ───────────────────────────────────── */

.site-header { padding: 18px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 20px; }
.brand-badge {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  background: var(--lilac); border: 2px solid var(--ink); border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 800; font-size: 18px; letter-spacing: -0.02em;
}

.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a {
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: 16px;
  padding: 8px 12px; border-radius: 10px;
}
.nav a:hover { background: var(--soft); }

.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px;
  padding: 8px 12px 8px 8px; border-radius: 10px;
}
.back-link:hover { background: var(--soft); }
.back-link svg { width: 20px; height: 20px; }

.site-footer { border-top: 2px solid var(--ink); background: var(--card); padding: 28px 0 36px; font-size: 15px; color: var(--ink-2); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer a { color: var(--ink); font-weight: 500; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ── Buttons ───────────────────────────────────────────── */

.btn {
  --shadow: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 22px;
  background: var(--card); color: var(--ink);
  border: 2px solid var(--ink); border-radius: var(--r-sm);
  box-shadow: 4px 4px 0 var(--shadow);
  font-weight: 600; font-size: 17px; line-height: 1.2; text-decoration: none; text-align: center;
  cursor: pointer; user-select: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--shadow); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--shadow); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: 4px 4px 0 var(--shadow); }

.btn-primary { background: var(--ink); color: #fff; }
.btn-small { min-height: 42px; padding: 8px 14px; font-size: 15px; box-shadow: 3px 3px 0 var(--shadow); }
.btn-small:hover { box-shadow: 4px 4px 0 var(--shadow); }
.btn-ghost { border-color: transparent; box-shadow: none; background: transparent; }
.btn-ghost:hover { background: var(--soft); box-shadow: none; transform: none; }
.btn-good { --shadow: var(--good); }
.btn-wide { width: 100%; }
.btn svg { width: 20px; height: 20px; flex: none; }

.kbd {
  display: inline-block; min-width: 22px; padding: 0 6px;
  border: 1.5px solid currentColor; border-radius: 6px; opacity: 0.6;
  font-size: 12px; font-weight: 600; line-height: 18px; text-align: center;
}

/* ── Home ──────────────────────────────────────────────── */

.hero { padding: 36px 0 28px; }
.hero h1 { font-size: clamp(64px, 14vw, 120px); font-weight: 800; letter-spacing: -0.04em; line-height: 0.95; }
.hero h1 .fifty { display: inline-block; background: var(--lilac); border: 3px solid var(--ink); border-radius: 22px; padding: 0 0.12em 0.04em; box-shadow: 8px 8px 0 var(--ink); margin-left: 0.05em; }
.eyebrow { font-size: 15px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 14px; }
.lead { font-size: clamp(19px, 2.6vw, 23px); color: var(--ink-2); max-width: 34em; margin: 22px 0 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 30px 0 0; padding: 0; list-style: none; max-width: 820px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; color: var(--ink-2); }
.steps b { color: var(--ink); display: block; font-size: 17px; }
.step-num { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-size: 16px; }

.section { padding-top: 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { font-size: 30px; font-weight: 700; }
.section-head p { margin: 0; color: var(--ink-2); font-size: 16px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }

.card {
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--r);
  box-shadow: 6px 6px 0 var(--accent);
}

.set-card { display: flex; flex-direction: column; padding: 20px; gap: 10px; }
.set-card .range {
  align-self: flex-start;
  font-weight: 700; font-size: 15px; padding: 4px 12px;
  background: var(--accent); border: 2px solid var(--ink); border-radius: 999px;
}
.set-card h3 { font-size: 24px; font-weight: 700; margin-top: 6px; }
.set-card p { color: var(--ink-2); font-size: 15px; margin: 0; flex: 1; }
.set-card .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }

.set-card.all { background: var(--ink); color: #fff; --accent: var(--lilac); }
.set-card.all .range { color: var(--ink); }
.set-card.all p { color: #c9c6dc; }
.set-card.all .btn { border-color: #fff; }
.set-card.all .btn-primary { background: var(--lilac); color: var(--ink); border-color: var(--ink); }

.maths-card { padding: 20px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); transition: transform 0.12s ease, box-shadow 0.12s ease; }
.maths-card:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--accent); }
.maths-card:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--accent); }
.maths-card .eq-preview { font-size: 22px; font-weight: 600; background: var(--soft); border-radius: 10px; padding: 12px 14px; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.maths-card h3 { font-size: 22px; }
.maths-card p { margin: 0; color: var(--ink-2); font-size: 15px; }
.maths-card .go { margin-top: 8px; font-weight: 600; font-size: 16px; display: inline-flex; align-items: center; gap: 6px; }
.maths-card .go svg { width: 18px; height: 18px; }

.print-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ── Page heading (learn / quiz / maths) ───────────────── */

.page-head { padding: 8px 0 20px; }
.page-head .range { display: inline-block; font-weight: 700; font-size: 15px; padding: 4px 12px; background: var(--accent); border: 2px solid var(--ink); border-radius: 999px; margin-bottom: 12px; }
.page-head h1 { font-size: clamp(30px, 5vw, 42px); font-weight: 700; }
.page-head p { color: var(--ink-2); margin: 10px 0 0; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }

.tabs { display: inline-flex; background: var(--card); border: 2px solid var(--ink); border-radius: 14px; padding: 4px; gap: 4px; }
.tabs button {
  border: 0; background: transparent; border-radius: 10px; padding: 9px 16px;
  font-weight: 600; font-size: 16px; cursor: pointer; color: var(--ink-2);
}
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; }
.tabs button:not([aria-selected="true"]):hover { background: var(--soft); color: var(--ink); }

.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 500; cursor: pointer; }
.toggle input { width: 22px; height: 22px; accent-color: var(--ink); }

/* ── Progress ──────────────────────────────────────────── */

.progress { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.progress-bar { flex: 1; height: 14px; background: var(--card); border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--accent); border-right: 2px solid var(--ink); transition: width 0.3s ease; }
.progress-bar span[style*="width: 0"] { border-right: 0; }

/* ── Flashcards ────────────────────────────────────────── */

.flashcard { padding: clamp(20px, 4vw, 34px); min-height: 320px; display: flex; flex-direction: column; }
.q-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; font-weight: 600; color: var(--ink-2); margin-bottom: 12px; }
.q-num { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px; border-radius: 12px; background: var(--accent); border: 2px solid var(--ink); color: var(--ink); font-weight: 700; font-size: 17px; }
.marks { padding: 3px 10px; border-radius: 999px; background: var(--soft); }
.q-text { font-size: clamp(22px, 3.4vw, 30px); font-weight: 600; line-height: 1.3; margin: 0; }

.reveal-area { margin-top: 24px; }
.answer-box { border-top: 2px dashed var(--ink-3); margin-top: 24px; padding-top: 22px; animation: rise 0.25s ease; }
.answer-label { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--good); margin-bottom: 10px; }

.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: auto; padding-top: 26px; }
.card-actions .btn { min-height: 58px; }
.btn-again { --shadow: #f2a65a; }
.btn-got { --shadow: var(--good); }

.done { text-align: center; padding: 40px 24px; }
.done .big { font-size: 64px; line-height: 1; margin-bottom: 8px; }
.done h2 { font-size: 32px; margin-bottom: 8px; }
.done p { color: var(--ink-2); }
.done .row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 22px; }

.hint { font-size: 14px; color: var(--ink-3); text-align: center; margin-top: 18px; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── List of questions (All answers view) ─────────────── */

.q-list { display: grid; gap: 18px; }
.list-set-title { font-size: 22px; margin-top: 18px; }
.list-set-title:first-child { margin-top: 0; }
.q-item { padding: 20px 22px; }
.q-item .q-text { font-size: 20px; }
.q-item details { margin-top: 14px; }
.q-item summary, .more summary {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  font-weight: 600; font-size: 16px; padding: 8px 14px; border: 2px solid var(--ink); border-radius: 10px;
  background: var(--card); box-shadow: 3px 3px 0 var(--accent); user-select: none;
}
.q-item summary::-webkit-details-marker, .more summary::-webkit-details-marker { display: none; }
.q-item summary::before { content: "Show answer"; }
.q-item details[open] summary::before { content: "Hide answer"; }
.more summary::before { content: attr(data-show); }
.more[open] summary::before { content: attr(data-hide); }
.q-item details[open] summary, .more[open] summary { background: var(--soft); }
.q-item details .answer-box { margin-top: 16px; }
.more { margin-top: 14px; }
.more .answer-box { margin-top: 14px; }

/* ── Answer content ────────────────────────────────────── */

.answer { font-size: 19px; }
.answer p { margin: 0 0 0.65em; }
.answer p:last-child { margin-bottom: 0; }
.answer ol, .answer ul { margin: 0 0 0.65em; padding-left: 1.4em; }
.answer li { margin-bottom: 0.35em; }
.answer li::marker { font-weight: 700; color: var(--ink-2); }
.answer b { font-weight: 700; background: linear-gradient(transparent 60%, var(--lilac-soft) 60%); }
.answer .note { font-size: 16px; color: var(--ink-2); background: var(--soft); border-radius: 10px; padding: 10px 14px; }
.answer .note b { background: none; }
.answer .eq { font-size: 20px; font-weight: 500; text-align: left; margin: 0.5em 0; }
.answer table { border-collapse: collapse; width: 100%; margin: 0 0 0.8em; font-size: 17px; }
.answer th, .answer td { border: 2px solid var(--ink); padding: 8px 12px; text-align: left; vertical-align: top; }
.answer th { background: var(--soft); font-weight: 700; }
.answer .formula { display: inline-block; margin-top: 2px; font-size: 15px; color: var(--ink-2); }
.answer .bonus { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 6px; border-radius: 6px; background: var(--set3); color: var(--ink); margin-left: 4px; vertical-align: 2px; }
.answer i { font-family: "Times New Roman", Georgia, serif; font-size: 1.1em; }
.answer .eq i, .eq-card i { font-family: "Times New Roman", Georgia, serif; }

.frac { white-space: nowrap; display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; margin: 0 0.15em; line-height: 1.2; }
.frac > span:first-child { border-bottom: 2px solid currentColor; padding: 0 0.25em 2px; }
.frac > span:last-child { padding: 2px 0.25em 0; }

.figure { margin: 0 0 18px; padding: 16px; background: #fff; border: 2px solid var(--soft); border-radius: 12px; text-align: center; overflow-x: auto; }

/* ── Diagrams ──────────────────────────────────────────── */

.diagram {
  width: 100%; height: auto; max-width: 600px;
  color: var(--ink); fill: none; stroke: currentColor; stroke-width: 2.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.diagram text { fill: currentColor; stroke: none; font-family: var(--font); font-size: 16px; }
.diagram .strong { font-weight: 600; }
.diagram .muted { fill: var(--ink-2); font-size: 15px; }
.diagram .meter { font-weight: 700; font-size: 18px; }
.diagram .head { fill: currentColor; stroke: none; }
.diagram .accent { stroke: var(--diagram-accent); }
.diagram .head.accent, .diagram .accent-text { fill: var(--diagram-accent); }
.diagram .particle { fill: var(--lilac-soft); }
.diagram .charge, .diagram .component { fill: #fff; }
.diagram .thin { stroke-width: 2; }
.diagram .thick { stroke-width: 6; stroke-linecap: butt; }
.diagram .thick-arrow { stroke-width: 3.5; }
.diagram .curve { stroke-width: 3.5; }
.diagram .dashed { stroke: var(--ink-3); stroke-width: 2; stroke-dasharray: 6 7; }

/* ── Quiz ──────────────────────────────────────────────── */

.quiz-card { padding: clamp(20px, 4vw, 34px); }
.from-q { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 10px; }
.options { display: grid; gap: 12px; margin-top: 24px; }
.option {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  min-height: 60px; padding: 12px 16px;
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--r-sm);
  box-shadow: 3px 3px 0 var(--ink-3);
  font-size: 18px; font-weight: 500; line-height: 1.35; cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.1s ease;
}
.option:hover:not([disabled]) { background: var(--soft); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--accent); }
.option:active:not([disabled]) { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink-3); }
.option .letter { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 2px solid var(--ink); font-weight: 700; font-size: 15px; background: var(--paper); }
.option .mark { margin-left: auto; flex: none; font-weight: 700; font-size: 15px; }
.option[disabled] { cursor: default; }
.option.is-correct { background: var(--good-bg); border-color: var(--good); box-shadow: 3px 3px 0 var(--good); }
.option.is-correct .letter { background: var(--good); border-color: var(--good); color: #fff; }
.option.is-wrong { background: var(--bad-bg); border-color: var(--bad); box-shadow: 3px 3px 0 var(--bad); }
.option.is-wrong .letter { background: var(--bad); border-color: var(--bad); color: #fff; }
.option.is-dim { opacity: 0.55; }

.feedback { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding: 14px 16px; border-radius: var(--r-sm); font-weight: 600; animation: rise 0.2s ease; }
.feedback.good { background: var(--good-bg); color: var(--good); }
.feedback.bad { background: var(--bad-bg); color: var(--bad); }
.feedback .icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; font-size: 18px; }
.feedback.good .icon { background: var(--good); }
.feedback.bad .icon { background: var(--bad); }
.feedback .text { color: var(--ink); font-weight: 500; }
.feedback .text strong { display: block; }

.next-row { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 20px; }

.start-card { padding: clamp(22px, 4vw, 36px); text-align: center; }
.start-card h2 { font-size: 28px; margin-bottom: 8px; }
.start-card p { color: var(--ink-2); }
.choice-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 22px 0 6px; }
.choice-row .btn[aria-pressed="true"] { background: var(--ink); color: #fff; }

.results { padding: clamp(22px, 4vw, 36px); }
.score { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.score-ring { --p: 0; flex: none; width: 128px; height: 128px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--good) calc(var(--p) * 1%), var(--soft) 0); border: 2px solid var(--ink); }
.score-ring span { display: grid; place-items: center; width: 98px; height: 98px; border-radius: 50%; background: var(--card); border: 2px solid var(--ink); font-size: 28px; font-weight: 800; }
.score h2 { font-size: 30px; margin-bottom: 6px; }
.score p { color: var(--ink-2); margin: 0; }
.review { margin-top: 26px; display: grid; gap: 12px; }
.review h3 { font-size: 20px; margin: 8px 0 2px; }
.review-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); background: var(--paper); border: 2px solid var(--soft); font-size: 16px; }
.review-item .tick { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 14px; font-weight: 700; margin-top: 1px; }
.review-item.good .tick { background: var(--good); }
.review-item.bad .tick { background: var(--bad); }
.review-item > div { flex: 1; min-width: 0; }
.review-item .muted { color: var(--ink-2); }
.review-item a { font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.review-item a svg { width: 16px; height: 16px; }
.toolbar-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.results .row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }

/* ── Maths ─────────────────────────────────────────────── */

.eq-card { background: #fff8de; border: 2px solid var(--ink); border-radius: var(--r-sm); padding: 16px 20px; margin-bottom: 20px; text-align: center; }
.eq-card .word { font-size: clamp(18px, 2.6vw, 22px); font-weight: 600; }
.eq-card .sym { font-size: clamp(22px, 3vw, 26px); margin-top: 6px; }
.eq-card .label { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }

.answer-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; margin-top: 24px; }
.answer-input { flex: 1 1 200px; display: flex; align-items: center; border: 2px solid var(--ink); border-radius: var(--r-sm); background: #fff; overflow: hidden; }
.answer-input:focus-within { outline: 3px solid var(--violet); outline-offset: 2px; }
.answer-input input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 12px 16px; font: inherit; font-size: 24px; font-weight: 600; background: transparent; }
.answer-input .unit { padding: 0 16px; font-size: 20px; font-weight: 600; color: var(--ink-2); border-left: 2px solid var(--soft); align-self: stretch; display: grid; place-items: center; background: var(--paper); white-space: nowrap; }
.answer-input.good { border-color: var(--good); background: var(--good-bg); }
.answer-input.bad { border-color: var(--bad); background: var(--bad-bg); }
.calc-note { font-size: 14px; color: var(--ink-3); margin-top: 10px; }

.working { margin-top: 18px; border: 2px solid var(--soft); border-radius: var(--r-sm); background: var(--paper); padding: 6px 18px; animation: rise 0.2s ease; }
.working ol { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.working li { counter-increment: step; display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--soft); }
.working li:last-child { border-bottom: 0; }
.working li::before { content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-size: 14px; }
.working .step-title { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.working .step-body { font-size: 19px; font-weight: 500; }

.select { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; flex-wrap: wrap; justify-content: center; }
.select select { font: inherit; font-weight: 500; padding: 10px 40px 10px 14px; border: 2px solid var(--ink); border-radius: 10px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 7l5 5 5-5' fill='none' stroke='%231d1b2f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center / 18px; appearance: none; -webkit-appearance: none; max-width: 100%; color: var(--ink); }

/* ── Prose (About / Privacy) ───────────────────────────── */

.prose { font-size: 18px; }
.prose h1 { font-size: clamp(34px, 6vw, 48px); font-weight: 800; margin-bottom: 10px; }
.prose h2 { font-size: 26px; margin: 40px 0 14px; }
.prose p, .prose li { color: #2d2b42; }
.prose ol, .prose ul { padding-left: 1.3em; }
.prose li { margin-bottom: 0.5em; }
.prose .byline { color: var(--ink-2); font-size: 16px; }
.prose .aside { font-size: 16px; color: var(--ink-2); background: var(--card); border-left: 4px solid var(--lilac); padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 0 0 1em; }
.cycle { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 22px 0; }
.cycle li { background: var(--card); border: 2px solid var(--ink); border-radius: var(--r-sm); box-shadow: 4px 4px 0 var(--lilac); padding: 14px; font-size: 16px; margin: 0; }
.cycle b { display: block; font-size: 28px; line-height: 1; margin-bottom: 6px; }

/* ── Ads ───────────────────────────────────────────────── */

.ad-slot:empty { display: none; }
.ad-slot { margin: 40px auto 0; max-width: var(--max); padding: 0 20px; text-align: center; }
.ad-slot .ad-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }

/* ── Small screens ─────────────────────────────────────── */

@media (max-width: 720px) {
  body { font-size: 17px; }
  .wrap { padding: 0 16px; }
  .steps { grid-template-columns: 1fr; }
  .hero { padding-top: 20px; }
  .card-grid { grid-template-columns: 1fr; gap: 18px; }
  .card { box-shadow: 5px 5px 0 var(--accent); }
  .answer { font-size: 18px; }
  .q-item { padding: 18px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .tabs { width: 100%; }
  .tabs button { flex: 1; }
  .card-actions { gap: 10px; }
  .hint { display: none; }
  .brand { white-space: nowrap; }
  .figure { padding: 8px 4px; margin-left: -8px; margin-right: -8px; }
  .diagram text { font-size: 21px; }
  .diagram .muted { font-size: 19px; }
  .diagram .meter { font-size: 21px; }
  .answer .eq { font-size: 17px; }
  .eq-card { padding: 14px 12px; }
  .eq-card .word { font-size: 16px; }
  .nav a:not(:last-child) { display: none; }
  .answer-row > .btn { width: 100%; }
  .score-ring { width: 104px; height: 104px; }
  .score-ring span { width: 78px; height: 78px; font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Printing ──────────────────────────────────────────── */

.print-page { background: #fff; }
.print-doc { max-width: 780px; margin: 0 auto; padding: 24px 20px 60px; }
.print-doc header { border-bottom: 3px solid var(--ink); padding-bottom: 14px; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.print-doc h1 { font-size: 34px; font-weight: 800; }
.print-doc header p { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }
.print-q { break-inside: avoid; padding: 12px 0 14px; border-bottom: 1px solid #ddd; }
.print-q .line { display: grid; grid-template-columns: 38px 1fr auto; gap: 8px; font-size: 16px; }
.print-q .n { font-weight: 700; }
.print-q .m { color: var(--ink-2); font-size: 14px; white-space: nowrap; }
.print-q .answer { font-size: 15px; margin: 10px 0 0 46px; padding: 10px 14px; border: 1.5px solid var(--ink); border-radius: 8px; }
.print-q .answer b { background: none; }
.print-q .answer .eq { font-size: 16px; }
.print-q .answer table { font-size: 14px; }
.print-q .answer th, .print-q .answer td { border-width: 1px; padding: 4px 8px; }
.print-q .figure { border: 0; padding: 0; margin: 0 0 8px; }
.print-q .diagram { max-width: 420px; }
.print-set-title { font-size: 18px; margin: 26px 0 4px; padding: 6px 12px; background: var(--soft); border-radius: 8px; break-after: avoid; }
.print-bar { position: sticky; top: 0; z-index: 2; background: var(--paper); border-bottom: 2px solid var(--ink); padding: 12px 0; }
.print-bar .wrap { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }

@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  body { background: #fff; font-size: 12pt; display: block; }
  .site-header, .site-footer, .print-bar, .ad-slot, .no-print { display: none !important; }
  .print-doc { padding: 0; max-width: none; }
  .card { box-shadow: none; }
  a { color: inherit; text-decoration: none; }
}

.btn-tab { border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: 15px; color: var(--ink-2); text-decoration: none; }
.btn-tab[aria-selected="true"] { background: var(--ink); color: #fff; }
.btn-tab:not([aria-selected="true"]):hover { background: var(--soft); color: var(--ink); }
