/* Life in the UK Test Free — site styles (no build step)
   Light, airy and illustrated: thin lines, soft shadows, one colour per topic.
   Colour always means something: topic, chapter, right/wrong, or status. */

@font-face { font-family: "Atkinson Next"; src: url(/fonts/ahn-400-normal.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url(/fonts/ahn-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url(/fonts/ahn-600-normal.woff2) format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url(/fonts/ahn-700-normal.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url(/fonts/ahn-800-normal.woff2) format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }

:root {
  --paper: #f6f7fc;
  --surface: #ffffff;
  --ink: #161c3f;
  --muted: #5a6285;
  --line: #e3e6f2;
  --line-strong: #cdd2e8;

  --royal: #2d4bd8;
  --royal-press: #2440c0;
  --royal-tint: #ebefff;
  --sun: #ffc53d;
  --sun-tint: #fff5d9;
  --link: #2440c4;

  --band: #2d4bd8;
  --band-2: #5b78ff;
  --band-text: #eef1ff;

  --coral: #e5484d;   --coral-tint: #fdecec;
  --violet: #7650dc;  --violet-tint: #f1ecff;
  --mint: #12a26f;    --mint-tint: #e1f6ee;
  --teal: #0c96a8;    --teal-tint: #def4f7;
  --amber: #df8a00;   --amber-tint: #fff2db;

  --ok: #0f8a5f;  --ok-bg: #e3f6ee;  --ok-line: #12a26f;
  --bad: #c62a33; --bad-bg: #fdeaeb; --bad-line: #e5484d;

  --btn-bg: var(--royal);
  --btn-fg: #ffffff;
  --btn-hover: var(--royal-press);
  --focus: #ffb000;

  --shadow-sm: 0 1px 2px rgba(22, 28, 63, .06);
  --shadow-md: 0 1px 2px rgba(22, 28, 63, .04), 0 6px 20px -8px rgba(22, 28, 63, .14);
  --shadow-lg: 0 2px 4px rgba(22, 28, 63, .04), 0 20px 40px -16px rgba(22, 28, 63, .22);
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 18px;
  --font: "Atkinson Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --paper: #0d1130; --surface: #161c45; --ink: #eef0ff; --muted: #a9b0d6; --line: #283063; --line-strong: #3a4380;
    --royal: #8098ff; --royal-press: #9aaeff; --royal-tint: #1f2862; --link: #a4b5ff;
    --sun: #ffcf5a; --sun-tint: #3a3112; --band: #1c2670; --band-2: #2c3a9a; --band-text: #dfe4ff;
    --coral: #ff7a7f; --coral-tint: #3d1a24; --violet: #a98cff; --violet-tint: #2a1f57;
    --mint: #4fd6a3; --mint-tint: #11362f; --teal: #44c9da; --teal-tint: #0f3240; --amber: #ffb547; --amber-tint: #3a2a10;
    --ok: #63e0ad; --ok-bg: #0f3a2c; --ok-line: #4fd6a3; --bad: #ff8f93; --bad-bg: #42161f; --bad-line: #ff7a7f;
    --btn-bg: #8098ff; --btn-fg: #0d1130; --btn-hover: #9aaeff;
    --shadow-md: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -10px rgba(0,0,0,.6); --shadow-lg: 0 20px 40px -16px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1130; --surface: #161c45; --ink: #eef0ff; --muted: #a9b0d6; --line: #283063; --line-strong: #3a4380;
  --royal: #8098ff; --royal-press: #9aaeff; --royal-tint: #1f2862; --link: #a4b5ff;
  --sun: #ffcf5a; --sun-tint: #3a3112; --band: #1c2670; --band-2: #2c3a9a; --band-text: #dfe4ff;
  --coral: #ff7a7f; --coral-tint: #3d1a24; --violet: #a98cff; --violet-tint: #2a1f57;
  --mint: #4fd6a3; --mint-tint: #11362f; --teal: #44c9da; --teal-tint: #0f3240; --amber: #ffb547; --amber-tint: #3a2a10;
  --ok: #63e0ad; --ok-bg: #0f3a2c; --ok-line: #4fd6a3; --bad: #ff8f93; --bad-bg: #42161f; --bad-line: #ff7a7f;
  --btn-bg: #8098ff; --btn-fg: #0d1130; --btn-hover: #9aaeff;
  --shadow-md: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -10px rgba(0,0,0,.6); --shadow-lg: 0 20px 40px -16px rgba(0,0,0,.7);
  color-scheme: dark;
}

/* Topic & chapter colours: --tc strong, --tt tint */
.tc-british-history, .ch-history { --tc: var(--coral); --tt: var(--coral-tint); }
.tc-government-politics, .ch-government-and-law { --tc: var(--royal); --tt: var(--royal-tint); }
.tc-law-civic-life, .ch-values-and-principles { --tc: var(--violet); --tt: var(--violet-tint); }
.tc-uk-culture-society, .ch-modern-society { --tc: var(--amber); --tt: var(--amber-tint); }
.tc-everyday-life, .tc-everyday-life-in-the-uk { --tc: var(--teal); --tt: var(--teal-tint); }
.tc-geography-nations, .ch-what-is-the-uk { --tc: var(--mint); --tt: var(--mint-tint); }

*, *::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: 1.125rem; line-height: 1.6; text-rendering: optimizeLegibility; }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { line-height: 1.18; margin: 0 0 .5em; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(2.05rem, 1.4rem + 2.6vw, 3.25rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: clamp(1.45rem, 1.2rem + .9vw, 1.85rem); font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1.18rem; font-weight: 700; }
strong, b { font-weight: 700; }
p { margin: 0 0 1em; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.muted { color: var(--muted); }
.small { font-size: .94rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Icons */
.ic { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.2em; }
.ic-box { --s: 44px; width: var(--s); height: var(--s); border-radius: 12px; display: inline-grid; place-items: center; background: var(--tt, var(--royal-tint)); color: var(--tc, var(--royal)); flex: none; }
.ic-box .ic { width: 22px; height: 22px; }
.ic-box.lg { --s: 56px; border-radius: 16px; }
.ic-box.lg .ic { width: 28px; height: 28px; }
.ic-box.solid { background: var(--tc, var(--royal)); color: #fff; }

/* ---------- Header ---------- */
.site-header { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.site-header::before { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--royal) 0 50%, var(--coral) 50% 75%, var(--sun) 75%); }
.header-row { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { display: block; }
.brand-name { font-size: 1.04rem; line-height: 1.1; }
.brand-name strong { font-weight: 800; }
.brand-name span { color: var(--royal); font-weight: 600; }
.top-nav { display: none; margin-left: auto; gap: 2px; }
.top-nav a { color: var(--ink); text-decoration: none; padding: 7px 13px; border-radius: 999px; font-weight: 600; font-size: .98rem; }
.top-nav a:hover { background: var(--royal-tint); }
.top-nav a.is-current { background: var(--royal-tint); color: var(--royal); }
.menu-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 600; font-size: .98rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.menu-btn:hover { border-color: var(--royal); color: var(--royal); }
@media (min-width: 920px) { .top-nav { display: flex; } .menu-btn { margin-left: 8px; } }

/* ---------- Drawer ---------- */
.drawer-scrim { position: fixed; inset: 0; background: rgba(13, 17, 48, .45); z-index: 60; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(380px, 88vw); background: var(--surface); z-index: 70; display: flex; flex-direction: column; box-shadow: 12px 0 40px rgba(13, 17, 48, .2); transform: translateX(-100%); transition: transform .22s ease; }
.drawer.is-open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.icon-btn { background: transparent; border: 0; color: var(--ink); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--royal-tint); }
.drawer-nav { overflow-y: auto; padding: 6px 12px 20px; flex: 1; }
.drawer-nav h2 { font-size: .88rem; color: var(--muted); font-weight: 700; margin: 18px 10px 4px; }
.drawer-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-s); color: var(--ink); text-decoration: none; font-size: 1rem; }
.drawer-nav a .ic { color: var(--tc, var(--royal)); }
.drawer-nav a.sub { font-size: .95rem; color: var(--muted); padding-left: 14px; }
.drawer-nav a:hover { background: var(--royal-tint); }
.drawer-foot { border-top: 1px solid var(--line); padding: 14px 20px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .95rem; }
.seg { display: inline-flex; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { font: inherit; font-size: .9rem; border: 0; background: transparent; color: var(--ink); padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--royal); color: #fff; }
@media (prefers-reduced-motion: reduce) { .drawer { transition: none; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2; text-decoration: none; padding: 12px 20px; border-radius: 12px; border: 1px solid transparent; background: var(--btn-bg); color: var(--btn-fg); cursor: pointer; min-height: 48px; box-shadow: var(--shadow-sm); transition: background-color .15s, border-color .15s, color .15s; }
.btn:hover { background: var(--btn-hover); color: var(--btn-fg); }
.btn .ic { width: 1.1em; height: 1.1em; }
.btn-quiet { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-quiet:hover { background: var(--royal-tint); border-color: var(--royal); color: var(--royal); }
.btn-sun { background: var(--sun); color: #1b1640; }
.btn-sun:hover { background: #ffd261; color: #1b1640; }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.5); box-shadow: none; }
.btn-ghost:hover { background: rgba(255,255,255,.22); color: #fff; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.link-arrow { font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.link-arrow:hover { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* ---------- 24-cell pass meter ---------- */
.meter { --cells: 24; position: relative; display: grid; grid-template-columns: repeat(var(--cells), 1fr); gap: 4px; max-width: 520px; padding-top: 26px; }
.meter i { display: block; height: 20px; border-radius: 4px; background: var(--royal-tint); }
.meter i.on { background: var(--royal); }
.meter i.ok { background: var(--ok-line); }
.meter i.bad { background: var(--bad-line); }
.meter i.skip { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.meter .line { position: absolute; top: 0; bottom: -5px; left: calc(75% - 1px); width: 2px; border-radius: 2px; background: var(--ink); }
.meter .line span { position: absolute; top: -2px; left: 8px; white-space: nowrap; font-size: .84rem; font-weight: 700; color: var(--ink); }
.meter.animate i.on { animation: fill .45s ease both; animation-delay: calc(var(--i) * 40ms); }
@keyframes fill { from { opacity: .25; transform: scaleY(.6); } }
@media (prefers-reduced-motion: reduce) { .meter.animate i.on { animation: none; } }

/* ---------- Home hero ---------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--band) 0%, var(--band-2) 120%); color: #fff; padding: 56px 0 250px; }
.hero > .wrap { position: relative; z-index: 2; }
.hero-art { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: clamp(190px, 20.9vw, 440px); z-index: 1; }
.hero-grid { display: grid; gap: 36px; align-items: center; }
.hero h1 { color: #fff; max-width: 12em; }
.hero .lead { font-size: 1.2rem; color: var(--band-text); max-width: 33em; }
.hero .meter { margin: 28px 0 8px; }
.hero .meter i { background: rgba(255,255,255,.24); }
.hero .meter i.on { background: var(--sun); }
.hero .meter .line { background: #fff; }
.hero .meter .line span { color: #fff; }
.hero .meter-caption { font-size: .95rem; color: var(--band-text); max-width: 32em; margin: 0; }
@media (min-width: 940px) { .hero-grid { grid-template-columns: 1.1fr .9fr; gap: 56px; } .hero { padding: 64px 0 calc(clamp(190px, 20.9vw, 440px) + 12px); } }
@media (max-width: 939px) { .hero { padding-bottom: 150px; } .hero-art { height: 200px; } }

.try-card { background: var(--surface); color: var(--ink); border-radius: var(--radius-l); padding: 22px; box-shadow: var(--shadow-lg); }
.try-card .try-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; color: var(--muted); font-size: .94rem; margin-bottom: 12px; }
.try-card .try-head .label { font-weight: 700; color: var(--royal); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.try-card .stem { font-size: 1.16rem; font-weight: 700; margin-bottom: 14px; line-height: 1.38; }

/* ---------- Bands ---------- */
.band { padding: 56px 0; }
.band.white { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 24px; margin-bottom: 26px; }
.band-head h2 { margin: 0; }
.band-head p { margin: 0; color: var(--muted); max-width: 36em; }

/* Features (icon + text) */
.features { display: grid; gap: 22px 28px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); list-style: none; padding: 0; margin: 0; }
.features li { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: start; }
.features .ic-box { grid-row: span 2; }
.features strong { font-size: 1.06rem; }
.features span.d { color: var(--muted); font-size: .98rem; line-height: 1.5; }

/* Facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 0; }
.facts div { --tc: var(--royal); --tt: var(--royal-tint); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px 18px 14px; border-top: 4px solid var(--tc); }
.facts div:nth-child(5n+2) { --tc: var(--coral); }
.facts div:nth-child(5n+3) { --tc: var(--mint); }
.facts div:nth-child(5n+4) { --tc: var(--amber); }
.facts div:nth-child(5n+5) { --tc: var(--violet); }
.facts dt { color: var(--muted); font-size: .94rem; }
.facts dd { margin: 2px 0 0; font-size: 1.55rem; font-weight: 800; color: var(--ink); line-height: 1.2; }
.facts dd small { display: block; font-size: .9rem; font-weight: 400; color: var(--muted); }

/* Topic tiles */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; list-style: none; padding: 0; margin: 0; }
.topic-card { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px 18px; box-shadow: var(--shadow-sm); height: 100%; transition: border-color .15s, box-shadow .15s; }
.topic-card:hover { border-color: var(--tc, var(--royal)); box-shadow: var(--shadow-md); }
.topic-card .ic-box { grid-row: span 3; }
.topic-card h3 { margin: 0; font-size: 1.08rem; }
.topic-card p { margin: 0; color: var(--muted); font-size: .96rem; line-height: 1.45; }
.topic-card .links { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .96rem; margin-top: 4px; }
.topic-card .links a { font-weight: 700; text-decoration: none; color: var(--tc, var(--link)); }
.topic-card .links a:hover { text-decoration: underline; }
.topic-card .count { font-size: .86rem; color: var(--muted); }

/* Mode cards (practice hub) */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.mode-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 22px; box-shadow: var(--shadow-md); display: flex; flex-direction: column; gap: 10px; }
.mode-card h3 { margin: 4px 0 0; font-size: 1.2rem; }
.mode-card p { margin: 0; color: var(--muted); }
.mode-card .btn { margin-top: auto; align-self: flex-start; }

/* Chapters */
.chapter-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 760px) { .chapter-list.two { grid-template-columns: 1fr 1fr; } }
.chapter-list a { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; align-items: start; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px 18px; height: 100%; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.chapter-list a:hover { border-color: var(--tc, var(--royal)); box-shadow: var(--shadow-md); }
.chapter-list .ic-box { grid-row: span 2; }
.chapter-list .num { font-size: .86rem; color: var(--tc, var(--royal)); font-weight: 700; }
.chapter-list strong { font-size: 1.08rem; display: block; }
.chapter-list span.d { color: var(--muted); font-size: .96rem; line-height: 1.45; }
.prose .chapter-list { padding-left: 0; margin: 1.4em 0 1.8em; }
.prose .chapter-list li { margin: 0; }
.prose .chapter-list li::marker { content: none; }
.prose .chapter-list a { text-decoration: none; }
.prose .chapter-list strong { text-align: left; }

/* Guide links */
.link-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; list-style: none; padding: 0; margin: 0; }
.link-list a { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; text-decoration: none; color: var(--ink); height: 100%; transition: border-color .15s, box-shadow .15s; }
.link-list a:hover { border-color: var(--royal); box-shadow: var(--shadow-md); }
.link-list .ic-box { --s: 38px; grid-row: span 2; border-radius: 10px; }
.link-list .ic-box .ic { width: 19px; height: 19px; }
.link-list strong { font-size: 1.02rem; color: var(--ink); }
.link-list span.d { color: var(--muted); font-size: .94rem; line-height: 1.45; }

/* Progress strip (seen questions) */
.seen-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 18px; margin-top: 18px; }
.seen-strip .bar { flex: 1 1 200px; }
.seen-strip strong { white-space: nowrap; }

.test-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.test-table th, .test-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 1rem; }
.test-table tr:last-child td { border-bottom: 0; }
.test-table th { font-size: .9rem; color: var(--muted); font-weight: 700; background: var(--paper); }
@media (max-width: 700px) { .test-table .mix-col { display: none; } }

/* Chip */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 700; line-height: 1; padding: 6px 10px; border-radius: 999px; background: var(--tt, var(--royal-tint)); color: var(--tc, var(--royal)); white-space: nowrap; }
.chip .ic { width: 14px; height: 14px; }

/* ---------- Reading pages ---------- */
.page-band { background: var(--tt, var(--royal-tint)); border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.page-band::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: var(--tc, var(--royal)); opacity: .07; }
.page-head { padding-top: 34px; padding-bottom: 30px; position: relative; z-index: 1; }
.page-head .head-row { display: flex; gap: 18px; align-items: center; }
.crumbs { font-size: .94rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--ink); }
.page-head h1 { max-width: 20em; margin-bottom: .35em; }
.page-head .lead { font-size: 1.18rem; color: var(--ink); opacity: .82; max-width: 40em; margin: 0; }
.page-band .chip { background: var(--surface); margin-bottom: 12px; }
.layout { display: grid; gap: 40px; padding: 36px 0 60px; }
@media (min-width: 1000px) { .layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 56px; } }
.layout > *, .hero-grid > * { min-width: 0; }
.prose { max-width: 70ch; }
.prose > :first-child, .prose > .keyfacts:first-child h2 { margin-top: 0; }
.prose h2 { margin-top: 1.8em; }
.prose h2::after { content: ""; display: block; width: 40px; height: 3px; border-radius: 2px; background: var(--tc, var(--royal)); margin-top: 10px; }
.prose h3 { margin-top: 1.5em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--tc, var(--royal)); font-weight: 700; }
.prose table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 0 0 1.4em; font-size: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.prose th { background: var(--tt, var(--royal-tint)); font-weight: 700; }
.prose .table-scroll { overflow-x: auto; margin: 0 0 1.4em; }
.prose .table-scroll table { margin: 0; }
.note { border-left: 4px solid var(--royal); background: var(--royal-tint); padding: 14px 18px; border-radius: 0 var(--radius-s) var(--radius-s) 0; margin: 0 0 1.4em; }
.note p:last-child { margin: 0; }
.note.warn { border-left-color: var(--coral); background: var(--coral-tint); }
.updated { font-size: .92rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 2em; }
.aside-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px 18px 20px; position: sticky; top: 90px; box-shadow: var(--shadow-sm); }
.aside-box h2 { font-size: .95rem; margin-bottom: 8px; color: var(--muted); }
.aside-box ul { list-style: none; padding: 0; margin: 0 0 16px; }
.aside-box li a { display: flex; gap: 8px; align-items: center; padding: 6px 8px; font-size: .98rem; text-decoration: none; border-radius: 6px; color: var(--ink); }
.aside-box li a .ic { color: var(--tc, var(--royal)); width: 18px; height: 18px; }
.aside-box li a:hover { background: var(--royal-tint); }
.aside-box li a[aria-current="page"] { font-weight: 700; background: var(--tt, var(--royal-tint)); }
.aside-box .btn { width: 100%; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 36px; flex-wrap: wrap; }
.pager a { display: block; max-width: 48%; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 16px; }
.pager a:hover { border-color: var(--royal); }
.pager span { display: block; font-size: .88rem; color: var(--muted); }
.pager strong { color: var(--link); }
.pager .next { text-align: right; margin-left: auto; }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 28px 0 0; }
.pagination a, .pagination span { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-weight: 700; color: var(--ink); }
.pagination a:hover { border-color: var(--royal); color: var(--royal); }
.pagination [aria-current="page"] { background: var(--royal); border-color: var(--royal); color: #fff; }
.cta-box { margin: 2em 0; background: linear-gradient(160deg, var(--band), var(--band-2) 140%); color: #fff; border-radius: var(--radius-l); padding: 24px; position: relative; overflow: hidden; }
.cta-box::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.08); }
.cta-box h2, .cta-box h3 { margin-top: 0; color: #fff; }
.cta-box h2::after { display: none; }
.cta-box p { color: var(--band-text); position: relative; }
.cta-box a:not(.btn) { color: #fff; }
.cta-box .btn { background: var(--sun); color: #1b1640; position: relative; z-index: 1; }
.cta-box .btn.btn-quiet { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.5); }
.keyfacts { background: var(--sun-tint); border-radius: var(--radius-m); padding: 18px 22px 8px; margin: 0 0 1.8em; border: 1px solid #f4d27a; }
.keyfacts h2 { font-size: 1.1rem; margin: 0 0 .6em; display: flex; gap: 8px; align-items: center; }
.keyfacts h2::after { display: none; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0 0 1.6em; border-left: 3px solid var(--tt, var(--royal-tint)); }
.timeline li { position: relative; padding: 4px 0 16px 24px; margin: 0; }
.timeline li::before { content: ""; position: absolute; left: -9px; top: 10px; width: 15px; height: 15px; border-radius: 50%; background: var(--surface); border: 3px solid var(--tc, var(--royal)); }
.timeline .when { display: inline-block; font-weight: 700; color: var(--tc, var(--royal)); margin-right: 8px; min-width: 4.2em; }
.era { --tc: var(--royal); --tt: var(--royal-tint); }
.era:nth-of-type(5n+2) { --tc: var(--coral); --tt: var(--coral-tint); }
.era:nth-of-type(5n+3) { --tc: var(--violet); --tt: var(--violet-tint); }
.era:nth-of-type(5n+4) { --tc: var(--mint); --tt: var(--mint-tint); }
.era:nth-of-type(5n+5) { --tc: var(--amber); --tt: var(--amber-tint); }

/* FAQ */
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 2px 18px; margin-bottom: 10px; }
.faq details[open] { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.faq summary { cursor: pointer; font-weight: 700; font-size: 1.06rem; padding: 14px 36px 14px 0; position: relative; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 12px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--royal-tint); color: var(--royal); font-size: 1.1rem; font-weight: 700; }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 0 12px; }

/* Forms */
.form { display: grid; gap: 16px; max-width: 560px; }
.form label { display: block; font-weight: 700; margin-bottom: 4px; }
.form input[type=text], .form input[type=email], .form input[type=password], .form textarea, .form select { width: 100%; font: inherit; font-size: 1.05rem; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); }
.form textarea { min-height: 170px; resize: vertical; }
.form input:focus, .form textarea:focus, .form select:focus { border-color: var(--royal); outline: none; box-shadow: 0 0 0 4px var(--royal-tint); }
.form .err { color: var(--bad); font-size: .96rem; margin-top: 4px; font-weight: 600; }
.form .hp { position: absolute; left: -5000px; }
.alert { padding: 14px 18px; border-radius: var(--radius-s); margin: 0 0 18px; max-width: 560px; font-weight: 600; }
.alert.ok { background: var(--ok-bg); color: var(--ok); border-left: 4px solid var(--ok-line); }
.alert.bad { background: var(--bad-bg); color: var(--bad); border-left: 4px solid var(--bad-line); }

/* ---------- Question bank lists ---------- */
.qa { list-style: none; padding: 0; margin: 0; }
.qa > li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px 20px; margin: 0 0 12px; box-shadow: var(--shadow-sm); }
.qa .qnum { font-size: .9rem; color: var(--muted); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.qa .stem { font-weight: 700; font-size: 1.1rem; margin-bottom: 12px; }
.qa ul { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.qa ul li { padding: 8px 12px; border-radius: var(--radius-s); border: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; }
.qa ul li.right { background: var(--ok-bg); border-color: var(--ok-line); font-weight: 700; }
.qa ul li .k { color: var(--muted); font-weight: 700; min-width: 1.2em; }
.qa ul li.right .k { color: var(--ok); }
.qa ul li .tag { margin-left: auto; color: var(--ok); font-size: .86rem; white-space: nowrap; display: inline-flex; gap: 4px; align-items: center; }
.qa .why { font-size: 1rem; margin: 12px 0 0; padding: 12px 14px; background: var(--paper); border-radius: var(--radius-s); }
.qa .why strong { color: var(--royal); }

/* ---------- Quiz player ---------- */
.quiz-page { padding: 28px 0 60px; }
.quiz-shell { max-width: 760px; margin: 0 auto; }
.quiz-intro { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 26px; box-shadow: var(--shadow-md); }
.quiz-intro .intro-head { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.quiz-intro h1 { font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.4rem); margin: 0; }
.fresh-note { display: flex; gap: 10px; align-items: flex-start; background: var(--mint-tint); border-radius: var(--radius-s); padding: 10px 14px; font-size: .98rem; margin: 14px 0 0; }
.fresh-note .ic { color: var(--mint); margin-top: 3px; }
.modes { display: grid; gap: 12px; margin: 20px 0 22px; border: 0; padding: 0; }
@media (min-width: 640px) { .modes { grid-template-columns: 1fr 1fr; } }
.mode { position: relative; display: block; border: 1px solid var(--line-strong); border-radius: var(--radius-m); padding: 14px 16px 14px 48px; cursor: pointer; background: var(--surface); }
.mode input { position: absolute; left: 16px; top: 17px; width: 20px; height: 20px; accent-color: var(--royal); }
.mode strong { display: flex; gap: 6px; align-items: center; font-size: 1.06rem; }
.mode span { color: var(--muted); font-size: .96rem; line-height: 1.45; display: block; }
.mode:has(input:checked) { border-color: var(--royal); background: var(--royal-tint); box-shadow: 0 0 0 1px var(--royal) inset; }

.quiz-bar { position: sticky; top: 67px; z-index: 10; background: color-mix(in srgb, var(--paper) 94%, transparent); padding: 12px 0; }
.quiz-bar .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .96rem; }
.quiz-bar .count { font-weight: 700; }
.quiz-bar .timer { font-variant-numeric: tabular-nums; font-weight: 700; padding: 3px 12px; border-radius: 999px; background: var(--royal-tint); color: var(--royal); display: inline-flex; gap: 6px; align-items: center; }
.quiz-bar .timer.low { background: var(--coral-tint); color: var(--coral); }
.progress { display: grid; grid-template-columns: repeat(var(--n, 24), 1fr); gap: 3px; margin-top: 10px; }
.progress button { height: 8px; padding: 0; border: 0; border-radius: 3px; background: var(--line-strong); cursor: pointer; opacity: .6; }
.progress button.answered { background: var(--royal); opacity: 1; }
.progress button.ok { background: var(--ok-line); opacity: 1; }
.progress button.bad { background: var(--bad-line); opacity: 1; }
.progress button.current { outline: 2px solid var(--ink); outline-offset: 2px; opacity: 1; }
.progress button.flagged { box-shadow: 0 -4px 0 var(--sun); }

.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 22px; margin: 0 0 16px; box-shadow: var(--shadow-md); position: relative; overflow: hidden; }
.qcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--tc, var(--royal)); }
.qcard legend { padding: 0; margin-bottom: 4px; width: 100%; }
.qcard .qnum { color: var(--muted); font-size: .94rem; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.qcard .stem { font-size: clamp(1.16rem, 1.04rem + .45vw, 1.36rem); font-weight: 700; line-height: 1.4; display: block; }
.qcard .hint { display: inline-block; margin-top: 10px; font-size: .92rem; font-weight: 700; color: var(--royal); background: var(--royal-tint); padding: 4px 10px; border-radius: 999px; }
.qcard fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.opts { display: grid; gap: 10px; margin-top: 18px; }
.opt { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-m); cursor: pointer; background: var(--surface); font-size: 1.06rem; line-height: 1.4; min-height: 54px; transition: border-color .12s, background-color .12s; }
.opt:hover { border-color: var(--royal); background: var(--royal-tint); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .k { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: .92rem; background: var(--paper); border: 1px solid var(--line-strong); color: var(--muted); }
.opt .fb { margin-left: auto; font-size: .9rem; font-weight: 700; white-space: nowrap; }
.opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.opt:has(input:checked) { border-color: var(--royal); background: var(--royal); color: #fff; }
.opt:has(input:checked) .k { background: rgba(255,255,255,.2); border-color: transparent; color: #fff; }
.locked .opt { cursor: default; }
.locked .opt:hover { border-color: var(--line-strong); background: var(--surface); }
.opt.is-right, .locked .opt.is-right:hover { border-color: var(--ok-line) !important; background: var(--ok-bg) !important; color: var(--ink) !important; }
.opt.is-right .k { background: var(--ok-line) !important; border-color: transparent !important; color: #fff !important; }
.opt.is-right .fb { color: var(--ok); }
.opt.is-wrong, .locked .opt.is-wrong:hover { border-color: var(--bad-line) !important; background: var(--bad-bg) !important; color: var(--ink) !important; }
.opt.is-wrong .k { background: var(--bad-line) !important; border-color: transparent !important; color: #fff !important; }
.opt.is-wrong .fb { color: var(--bad); }
.explain { margin-top: 16px; padding: 14px 16px 14px 54px; border-radius: var(--radius-m); background: var(--paper); font-size: 1rem; position: relative; }
.explain::before { position: absolute; left: 14px; top: 13px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; }
.explain:has(.verdict.ok) { background: var(--ok-bg); }
.explain:has(.verdict.ok)::before { content: "✓"; background: var(--ok-line); }
.explain:has(.verdict.bad) { background: var(--bad-bg); }
.explain:has(.verdict.bad)::before { content: "✕"; background: var(--bad-line); }
.explain .verdict { display: block; font-weight: 700; margin-bottom: 2px; font-size: 1.04rem; }
.explain .verdict.ok { color: var(--ok); }
.explain .verdict.bad { color: var(--bad); }
.explain p { margin: 0; }
.quiz-nav { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.quiz-nav .spacer { flex: 1; }
.flag-btn { font: inherit; font-size: .94rem; font-weight: 600; background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 6px 4px; display: inline-flex; gap: 6px; align-items: center; }
.flag-btn[aria-pressed="true"] { color: var(--amber); }
.static-note { color: var(--muted); font-size: .96rem; }

/* Results */
.result-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 28px 24px 24px; box-shadow: var(--shadow-md); position: relative; overflow: hidden; }
.result-card .badge-art { position: absolute; right: 20px; top: 20px; width: 92px; height: 92px; }
.result-top { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; padding-right: 100px; }
.result-score { font-size: clamp(3rem, 2rem + 4vw, 4.4rem); font-weight: 800; line-height: 1; letter-spacing: -.03em; color: var(--royal); }
.result-score small { font-size: .36em; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.verdict-pill { display: inline-block; font-weight: 700; padding: 6px 14px; border-radius: 999px; font-size: 1rem; }
.verdict-pill.ok { background: var(--ok-bg); color: var(--ok); }
.verdict-pill.bad { background: var(--sun-tint); color: #7a5300; }
.result-card .meter { margin: 22px 0 8px; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 14px; font-size: .96rem; }
.stats span { background: var(--paper); padding: 6px 12px; border-radius: 999px; color: var(--muted); }
.stats b { color: var(--ink); }
.save-note { font-size: .95rem; color: var(--muted); background: var(--paper); border-radius: var(--radius-s); padding: 10px 14px; margin: 0 0 14px; }
.bars { display: grid; gap: 12px; margin: 8px 0 0; }
.bar-row { display: grid; grid-template-columns: minmax(130px, 1fr) 2fr auto; gap: 12px; align-items: center; font-size: .98rem; }
.bar-row > span:first-child { display: inline-flex; gap: 8px; align-items: center; }
.bar { height: 10px; background: var(--tt, var(--royal-tint)); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--tc, var(--royal)); border-radius: 999px; }
.review-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.review-list li { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; background: var(--surface); border-left: 4px solid var(--bad-line); }
.review-list .stem { font-weight: 700; margin-bottom: 6px; }
.review-list .yours { color: var(--bad); }
.review-list .right { color: var(--ok); font-weight: 700; }
.review-list .why { margin: 8px 0 0; font-size: .98rem; }

/* Empty states */
.empty { text-align: center; padding: 40px 20px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-l); }
.empty svg.art { width: 140px; height: 110px; margin-bottom: 10px; }

/* ---------- Cookie notice ---------- */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 80; max-width: 560px; margin-left: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-l); box-shadow: var(--shadow-lg); padding: 20px 20px 18px; }
.consent h2 { font-size: 1.08rem; margin: 0 0 6px; display: flex; gap: 8px; align-items: center; }
.consent h2 .ic { color: var(--amber); }
.consent p { font-size: .96rem; color: var(--muted); margin: 0 0 12px; }
.consent .btn { min-height: 42px; padding: 9px 16px; font-size: .96rem; }
.consent .choices { display: grid; gap: 10px; margin: 0 0 14px; }
.consent .choice { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: start; font-size: .95rem; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); }
.consent .choice input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--royal); grid-row: span 2; }
.consent .choice strong { font-size: .98rem; }
.consent .choice span { color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); color: var(--muted); border-top: 1px solid var(--line); padding: 48px 0 30px; margin-top: 32px; font-size: .98rem; position: relative; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 24px; }
.footer-grid h2 { font-size: .9rem; color: var(--ink); font-weight: 700; margin-bottom: 8px; }
.footer-grid a, .footer-grid button { display: block; color: var(--muted); text-decoration: none; padding: 3px 0; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.footer-grid a:hover, .footer-grid button:hover { color: var(--royal); text-decoration: underline; }
.footer-note { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .92rem; }
.footer-note p { max-width: 74ch; }

/* ---------- Admin ---------- */
.admin table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .98rem; }
.admin th, .admin td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.admin .optrow { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; margin-bottom: 8px; }
.admin .inactive { opacity: .55; }

@media (max-width: 520px) {
  body { font-size: 1.06rem; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .brand-name { font-size: .96rem; }
  .menu-btn span { display: none; }
  .menu-btn { padding: 9px; }
  .hero { padding-top: 36px; }
  .qcard, .quiz-intro, .result-card, .try-card, .mode-card { padding: 18px 16px; border-radius: var(--radius-m); }
  .opt { padding: 10px 12px; gap: 10px; font-size: 1.02rem; }
  .bar-row { grid-template-columns: 1fr auto; }
  .bar-row .bar { grid-column: 1 / -1; grid-row: 2; }
  .prose th, .prose td { padding: 7px 8px; font-size: .95rem; }
  .facts dd { font-size: 1.35rem; }
  .result-card .badge-art { width: 64px; height: 64px; right: 14px; top: 14px; }
  .result-top { padding-right: 70px; }
  .consent { left: 10px; right: 10px; bottom: 10px; padding: 14px 14px 12px; }
  .consent p { font-size: .9rem; margin-bottom: 10px; }
  .consent .btn-row { flex-wrap: nowrap; gap: 8px; }
  .consent .btn { flex: 1 1 auto; min-height: 40px; padding: 8px 10px; font-size: .9rem; }
  .consent .choice { padding: 8px 10px; font-size: .9rem; }
}
@media print {
  .site-header, .site-footer, .drawer, .drawer-scrim, .ad-slot, .aside-box, .btn, .consent { display: none !important; }
  body { background: #fff; }
}
