/* Blog pages, feature pages and 404.html share this sheet. Tokens mirror
   THEME_COLORS in src/constants.js. The look is deliberately a reading site
   with quiet reading areas and stronger invitations for signed-out readers. */

:root {
  --page-width: 1280px;
  color-scheme: light;
  --bg: #f5f4f2;
  --surface: #ffffff;
  --surface-2: #faf9f7;
  --border: #e2e0dc;
  --ink: #1d1b20;
  --muted: #6b6772;
  --primary: #67155e;
  --primary-fill: #67155e;
  --primary-hover: #8d1c80;
  --primary-soft: rgba(103, 21, 94, 0.1);
  --on-primary: #ffffff;
  --hover: rgba(29, 27, 32, 0.045);
  --varc: #d14e22;
  --varc-soft: #f7e1d9;
  --dilr: #1d7a52;
  --dilr-soft: #cdeee1;
  --quant: #3e6fbf;
  --quant-soft: #d6e3f5;
  --good: #3f8f5f;
  --shadow-card: 0 1px 2px rgba(29, 27, 32, 0.04), 0 2px 6px -2px rgba(29, 27, 32, 0.05);
  --shadow-floating: 0 12px 32px -8px rgba(29, 27, 32, 0.22), 0 2px 6px rgba(29, 27, 32, 0.06);
  --brand-gradient: linear-gradient(140deg, #4a0f43 0%, #67155e 55%, #8d1c80 100%);
  --font-body: "Inter", sans-serif;
  --font-display: "Space Grotesk", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121212;
  --surface: #1e1e1e;
  --surface-2: #262626;
  --border: #3a3a3a;
  --ink: #f2f2f2;
  --muted: #a3a3a3;
  --primary: #c77dba;
  --primary-soft: rgba(199, 125, 186, 0.14);
  --hover: rgba(255, 255, 255, 0.06);
  --varc: #f19a7d;
  --varc-soft: #4c3529;
  --dilr: #57cf9b;
  --dilr-soft: #214432;
  --quant: #94b2e3;
  --quant-soft: #242b36;
  --good: #70cb94;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.02);
  --shadow-floating: 0 12px 32px -6px rgba(0, 0, 0, 0.65);
}

/* Same density as the app (src/index.css). */
@media (min-width: 1024px) { html { zoom: 0.9; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-wrap: break-word;
}
a { color: inherit; }
img, svg { max-width: 100%; flex-shrink: 0; }
a:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(135, 72, 127, 0.5); border-radius: 8px; }

/* Signed-in state comes from blog.js. */
html:not([data-auth="in"]) .signed-in,
html[data-auth="in"] .signed-out { display: none !important; }

.shell { width: min(100% - 32px, var(--page-width)); margin: 0 auto; }

/* ---- Header: compact sticky top bar ---- */
body > header.shell, .public-mock-tracker > header.shell { position: sticky; top: 0; z-index: 10; width: 100%; padding: 0 max(16px, calc((100% - var(--page-width)) / 2)); border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
html { scroll-padding-top: 88px; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
.nav .nav-link { min-height: 36px; padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.nav .nav-link:hover, .nav .nav-link:focus-visible { color: var(--primary); background: transparent; }
.nav .nav-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.nav .nav-link[aria-current="page"] { color: var(--primary); font-weight: 600; }
.nav .nav-app { margin-left: 10px; border: 1px solid var(--border); color: var(--ink); font-weight: 600; }
.nav .nav-signin { margin-left: 8px; }
.nav .nav-app.signed-out { min-height: 40px; margin-left: 2px; padding: 9px 18px; border-color: transparent; border-radius: 10px; color: var(--on-primary); background: var(--primary-fill); }
.nav .nav-app.signed-out:hover, .nav .nav-app.signed-out:focus-visible { color: var(--on-primary); background: var(--primary-hover); }
.brand { display: flex; min-width: 0; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.brand-name { display: block; font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; }
.brand-subtitle { display: block; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 12px; }
.nav-link, .nav-button {
  display: inline-flex; min-height: 44px; align-items: center; gap: 8px;
  border-radius: 12px; padding: 10px 14px;
  font-size: 14px; font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.nav-link { color: var(--ink); }
.nav-link:hover { background: var(--hover); }
.nav-button, .article-body a.nav-button { color: var(--on-primary); background: var(--primary-fill); text-decoration: none; }
.nav-button:hover { background: var(--primary-hover); }
.arrow { width: 16px; height: 16px; }

/* ---- Shared type ---- */
.eyebrow { margin: 0; color: var(--primary); font-size: 12px; font-weight: 700; letter-spacing: 0.16em; line-height: 1.4; text-transform: uppercase; }
h1, h2, h3 { color: var(--ink); font-family: var(--font-display); letter-spacing: -0.025em; }
.accent { color: var(--primary); }
.lede { margin: 24px 0 0; color: var(--muted); font-size: 18px; line-height: 1.75; }

/* ---- Blog index ---- */
.blog-hero { max-width: 720px; padding: 56px 0 56px; }
.blog-hero h1 { margin: 12px 0 0; font-size: clamp(2.25rem, 6vw, 3.75rem); font-weight: 700; line-height: 1.08; }

.section { border-top: 1px solid var(--border); padding: 56px 0; }
.section-title { margin: 12px 0 0; font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.2; }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }

.card { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-card); }
.guide-card {
  display: flex; min-height: 240px; flex-direction: column; padding: 24px;
  text-decoration: none;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms ease;
}
.guide-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-floating); }
.guide-card.featured { grid-column: span 2; }
.guide-card h3 { margin: 16px 0 0; font-size: 22px; line-height: 1.25; }
.guide-card p { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.guide-card .card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 24px; color: var(--muted); font-size: 13px; }
.guide-card .card-link { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-size: 14px; font-weight: 600; }

.tile { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; color: var(--primary); background: var(--primary-soft); }
.tile svg { width: 20px; height: 20px; }

.upcoming { grid-column: 1 / -1; padding: 24px; }
.upcoming ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); column-gap: 24px; }
.upcoming li:nth-child(-n+3) { border-top: 0; }
.upcoming h3 { margin: 12px 0 0; font-size: 17px; }
.upcoming ul { margin: 12px 0 0; padding: 0; list-style: none; }
.upcoming li { display: flex; gap: 10px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; line-height: 1.45; }
.upcoming li:first-child { border-top: 0; }
.upcoming li::before { content: ""; width: 6px; height: 6px; flex: 0 0 auto; border-radius: 999px; background: var(--primary); opacity: 0.5; transform: translateY(-2px); }

/* Section tone chips, as in the app (VARC / DILR / Quant). */
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; color: var(--primary); background: var(--primary-soft); font-size: 12px; font-weight: 600; line-height: 1.4; }
.chip.varc { color: var(--varc); background: var(--varc-soft); }
.chip.dilr { color: var(--dilr); background: var(--dilr-soft); }
.chip.quant { color: var(--quant); background: var(--quant-soft); }

/* ---- Article ---- */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--primary); }

.article-head { max-width: 920px; padding: 24px 0 40px; }
.article-head h1 { margin: 16px 0 0; font-size: clamp(2.1rem, 5vw, 3.25rem); font-weight: 700; line-height: 1.1; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 24px; color: var(--muted); font-size: 13px; }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 56px; align-items: start; border-top: 1px solid var(--border); padding-top: 40px; }
.article-body { max-width: 880px; min-width: 0; font-size: 17px; line-height: 1.8; }
.article-body > :first-child { margin-top: 0; }
.article-body p, .article-body li { color: var(--ink); }
.article-body h2 { margin: 64px 0 12px; font-size: clamp(1.5rem, 3vw, 1.9rem); line-height: 1.2; }
.article-body h3 { margin: 36px 0 8px; font-size: 1.15rem; line-height: 1.35; }
.article-body ul { padding-left: 22px; }
.article-body li { margin: 6px 0; }
.article-body a { color: var(--primary); text-decoration-color: color-mix(in srgb, var(--primary) 35%, transparent); text-underline-offset: 3px; }
.article-body strong { font-weight: 600; }

.step { display: flex; align-items: center; gap: 12px; }
.step-num { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border-radius: 999px; color: var(--on-primary); background: var(--primary-fill); font-size: 14px; font-weight: 700; }
.article-body h3 .chip { margin-right: 6px; vertical-align: 2px; }

.callout { margin: 32px 0; border-radius: 16px; padding: 20px 24px; font-size: 16px; line-height: 1.7; }
.callout p { margin: 0; }
.callout ul { margin: 10px 0 0; }
.callout-title { display: block; margin-bottom: 4px; font-family: var(--font-display); font-weight: 700; }
.callout.key { border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); background: var(--primary-soft); }
.callout.good { border: 1px solid color-mix(in srgb, var(--dilr) 25%, transparent); background: var(--dilr-soft); }
.callout.note { border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 14px; }
.callout.note p { color: var(--muted); }

/* Template: label / description rows. */
.template { margin: 28px 0; overflow: hidden; padding: 0; }
.template-title { margin: 0; padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-family: var(--font-display); font-weight: 700; }
.template ul { margin: 0; padding: 0; list-style: none; }
.template li { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; margin: 0; padding: 12px 20px; border-top: 1px solid var(--border); font-size: 15px; line-height: 1.6; }
.template li:first-child { border-top: 0; }
.template li strong { color: var(--muted); font-size: 13px; font-weight: 600; }

.faq { margin-top: 64px; }
.faq h2 { margin-top: 0; }
.faq-item { padding: 20px 0; border-top: 1px solid var(--border); }
.faq-item h3 { margin: 0; font-size: 1.05rem; }
.faq-item p { margin: 8px 0 0; color: var(--muted); font-size: 16px; }

/* Sticky sidebar (desktop) — sits above the body on phones. */
.article-aside { position: sticky; top: 88px; grid-column: 2; grid-row: 1; display: grid; min-width: 0; gap: 28px; }
.toc { min-width: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.toc .eyebrow { color: var(--muted); font-size: 11px; letter-spacing: 0.1em; }
.toc ol { margin: 16px 0 0; padding: 0; border-left: 1px solid var(--border); list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: flex; align-items: baseline; gap: 12px; border-left: 2px solid transparent; padding: 9px 0 9px 16px; margin-left: -1px; color: var(--muted); font-size: 13px; line-height: 1.5; text-decoration: none; transition: color 160ms ease, border-color 160ms ease; }
.toc a::before { content: counter(toc, decimal-leading-zero); min-width: 18px; color: var(--muted); font-size: 10px; font-weight: 500; font-variant-numeric: tabular-nums; }
.toc a:hover, .toc a:focus-visible { border-left-color: var(--primary); color: var(--primary); }
.toc a:hover::before, .toc a:focus-visible::before { color: var(--primary); }
.toc a[aria-current="location"] { border-left-color: var(--primary); color: var(--ink); font-weight: 600; }
.toc a[aria-current="location"]::before { color: var(--primary); }
.side-cta { padding: 24px 0 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; box-shadow: none; }
.side-cta .eyebrow { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--ink); font-family: var(--font-display); font-size: 15px; letter-spacing: -0.02em; text-transform: none; }
.side-cta .eyebrow::before { content: ""; width: 22px; height: 22px; background: url('/newicon/favicon.svg') center / contain no-repeat; }
.side-cta p { margin: 12px 0 16px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.side-cta .nav-button { min-height: 38px; border-radius: 8px; padding: 9px 14px; font-size: 13px; }
.side-cta .nav-button .arrow { width: 14px; height: 14px; }

/* ---- Closing invitation: shared design, account-aware actions ---- */
.cta-copy { position: relative; z-index: 1; min-width: 0; }
.cta .cta-button::after { content: "→"; color: inherit; transition: transform 160ms ease; }
.cta .cta-button:hover::after { transform: translateX(3px); }
.cta {
  position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) 280px; margin: 56px 0;
  align-items: center; gap: 40px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px; padding: 48px; color: #fff;
  background: radial-gradient(ellipse at 100% 0%, rgba(239, 181, 224, 0.18), transparent 60%), var(--brand-gradient);
  box-shadow: 0 16px 40px -24px rgba(74, 15, 67, 0.5);
}
.cta-kicker { display: block; margin-bottom: 16px; color: #edc6e6; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.cta h2 { max-width: 640px; margin: 0; color: #fff; font-size: clamp(1.7rem, 3.2vw, 2.5rem); line-height: 1.12; text-wrap: balance; }
.cta p { max-width: 560px; margin: 16px 0 0; color: #f0daec; font-size: 15px; line-height: 1.7; }
.cta .cta-button { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; margin-top: 24px; padding: 12px 20px; border: 1px solid transparent; border-radius: 10px; color: #67155e; background: #fff; box-shadow: 0 4px 14px rgba(31, 7, 28, 0.16); font-size: 14px; font-weight: 600; text-decoration: none; transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease; }
.cta .cta-button:hover { background: #faedf7; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(31, 7, 28, 0.22); }
.cta .cta-button:focus-visible, .cta .cta-secondary:focus-visible { outline: 2px solid #fff; outline-offset: 4px; box-shadow: none; }
.cta-secondary { display: inline-flex; align-items: center; gap: 8px; margin: 18px 0 0 16px; padding: 8px 0; color: #f0daec; font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; }
.cta-secondary:hover { color: #fff; }
.cta-perks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 18px; color: #edc6e6; font-size: 12px; }
.cta-perks span { display: inline-flex; align-items: center; gap: 6px; }
.cta-perks span::before { content: "✓"; color: #fff; }
.cta-art { position: relative; width: 280px; height: 250px; justify-self: center; pointer-events: none; }
.cta-orbit, .cta-orbit::before, .cta-orbit::after { position: absolute; inset: 20px 35px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 50%; }
.cta-orbit::before { content: ""; inset: 28px; }
.cta-orbit::after { content: ""; inset: -30px; border-style: dashed; opacity: 0.45; }
.cta-core { position: absolute; top: 84px; left: 99px; display: grid; width: 82px; height: 82px; place-items: center; border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 24px; background: rgba(255, 255, 255, 0.12); box-shadow: 0 8px 32px rgba(31, 7, 28, 0.12); transform: rotate(-8deg); }
.cta-core img { transform: rotate(8deg); }
.cta-node { position: absolute; display: inline-flex; align-items: center; gap: 9px; border: 1px solid rgba(255, 255, 255, 0.24); border-radius: 12px; padding: 10px 13px; color: #fff; background: #702264; box-shadow: 0 8px 24px rgba(31, 7, 28, 0.16); font-size: 12px; font-weight: 500; white-space: nowrap; }
.cta-node > span { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 7px; color: #fff; background: rgba(255, 255, 255, 0.12); font-size: 15px; }
.cta-node-mocks { top: 15px; left: 5px; transform: rotate(-5deg); }
.cta-node-practice { top: 150px; right: -14px; transform: rotate(5deg); }
.cta-node-progress { bottom: 2px; left: 15px; transform: rotate(-4deg); }

/* ---- Footer: one brand line, a useful description, and compact links ---- */
.site-footer { width: min(100% - 32px, var(--page-width)); margin: 0 auto; padding: 28px 0 24px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; line-height: 1.65; }
.footer-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; }
.footer-about { max-width: 460px; }
.footer-heading { display: flex; align-items: center; gap: 16px; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -0.025em; text-decoration: none; }
.footer-year { color: var(--muted); font-size: 11px; }
.footer-summary { margin: 14px 0 4px; color: var(--ink); font-size: 15px; font-weight: 500; }
.footer-description { margin: 0; font-size: 13px; line-height: 1.7; }
.footer-links { display: grid; grid-template-columns: repeat(2, auto); align-items: start; gap: 10px 32px; padding-top: 3px; font-size: 13px; }
.footer-links a, .footer-legal a { padding: 4px 0; text-decoration: none; transition: color 160ms ease; }
.footer-links a:hover, .footer-legal a:hover, .footer-brand:hover { color: var(--primary); }
.footer-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.footer-meta p { margin: 0; font-size: 11px; }
.footer-legal { display: flex; flex-shrink: 0; gap: 20px; font-size: 11px; }
.site-footer .footer-disclaimer { max-width: 720px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }

[hidden] { display: none !important; }
.tool h3 { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Interactive pieces (calculator, chart, data tables) ---- */
:root { --s1: #a8548f; --s2: #2a78d6; --s3: #eb6834; }
[data-theme="dark"] { --s1: #c46fab; --s2: #3987e5; --s3: #d95926; }

.tool { margin: 32px 0; padding: 24px; font-size: 15px; line-height: 1.6; }
.tool-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.tool-head h3 { margin: 0; font-size: 1.15rem; }
.tool-note { margin: 16px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

/* Same toggle as the app's .segmented. */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.segmented button { min-height: 32px; border: 0; border-radius: 9px; padding: 5px 12px; color: var(--muted); background: transparent; font: 600 13px var(--font-body); cursor: pointer; }
.segmented button:hover { color: var(--ink); background: var(--hover); }
.segmented button[aria-pressed="true"] { color: var(--ink); background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 0 0 1px var(--border); }
[data-theme="dark"] .segmented button[aria-pressed="true"] { background: #353535; }
.segmented button:focus-visible, .field input:focus-visible, .field select:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(135, 72, 127, 0.5); }

.calc-grid { display: grid; gap: 10px; margin-top: 20px; }
.calc-row { display: grid; grid-template-columns: 110px repeat(2, minmax(0, 1fr)) 90px; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.calc-row.marks-mode { grid-template-columns: 110px minmax(0, 1fr) 90px; }
.calc-row .chip { justify-self: start; align-self: center; }
.field { display: grid; gap: 4px; min-width: 0; }
.field span { color: var(--muted); font-size: 12px; font-weight: 600; }
.field input, .field select { width: 100%; min-height: 40px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; color: var(--ink); background: var(--surface); font: 500 15px var(--font-body); }
.row-result { align-self: center; text-align: right; }
.row-result b { display: block; font-family: var(--font-display); font-size: 17px; font-variant-numeric: tabular-nums; }
.row-result small { color: var(--muted); font-size: 12px; }

.result { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 28px; align-items: center; margin-top: 16px; border-radius: 16px; padding: 20px 24px; background: var(--primary-soft); }
.result-big { font-family: var(--font-display); font-size: clamp(2.4rem, 7vw, 3.4rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--primary); }
.result-big small { display: block; margin-top: 6px; color: var(--muted); font: 600 12px var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; }
.result p { margin: 0; font-size: 14px; line-height: 1.6; }
.result .compare { margin-top: 6px; color: var(--muted); }
.warn { margin: 12px 0 0; color: var(--varc); font-size: 13px; font-weight: 600; }

.target-out { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.stat { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface-2); }
.stat small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.stat b { display: block; margin-top: 4px; font-family: var(--font-display); font-size: 24px; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.5; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 16px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.legend li { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.legend i { width: 14px; height: 3px; border-radius: 2px; }
.chart-wrap { position: relative; margin-top: 8px; }
.chart { display: block; width: 100%; height: auto; touch-action: pan-y; }
.chart text { fill: var(--muted); font: 500 11px var(--font-body); }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .you { stroke: var(--primary); stroke-width: 2; }
.chart .you-label { fill: var(--primary); font-weight: 700; }
.tip { position: absolute; top: 8px; z-index: 1; min-width: 150px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface); box-shadow: var(--shadow-floating); font-size: 13px; line-height: 1.5; pointer-events: none; }
.tip b { font-family: var(--font-display); }
.tip div { display: flex; align-items: center; gap: 6px; }
.tip i { width: 8px; height: 8px; border-radius: 999px; }

.table-scroll { margin-top: 16px; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 10px 14px; border-top: 1px solid var(--border); text-align: right; white-space: nowrap; }
.data-table thead th { border-top: 0; color: var(--muted); background: var(--surface-2); font-size: 12px; font-weight: 600; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table tbody th { font-weight: 600; }
.data-table td.na { color: var(--muted); }

@media (max-width: 760px) {
  .tool { padding: 18px; }
  .calc-row, .calc-row.marks-mode { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-row .chip { grid-column: 1 / -1; }
  .calc-row .row-result { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; text-align: left; }
  .result { grid-template-columns: 1fr; }
  .target-out { grid-template-columns: 1fr; }
}

@media (max-width: 1023px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .article-aside { position: static; grid-column: auto; grid-row: auto; margin-bottom: 32px; }
  .side-cta { display: none; }
}

@media (max-width: 760px) {
  .nav { gap: 8px; padding: 8px 0; }
  .nav-links { gap: 2px; }
  .nav .nav-link { padding: 8px; font-size: 13px; }
  .nav .nav-signin { margin-left: 0; }
  .nav .nav-app.signed-out { padding: 9px 12px; }
  .nav .nav-link.wide { display: none; }
  .nav .nav-app { margin-left: 4px; }
  .blog-hero { padding: 24px 0 40px; }
  .guide-grid { grid-template-columns: 1fr; }
  .guide-card.featured { grid-column: auto; }
  .article-body { font-size: 16px; }
  .template li { grid-template-columns: 1fr; gap: 2px; }
  .footer-row { flex-direction: column; gap: 20px; }
  .footer-links { gap: 6px 28px; }
  .footer-meta { align-items: flex-start; flex-direction: column; gap: 12px; margin-top: 20px; }
  .cta { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 32px 24px; border-radius: 20px; }
  .cta-art { display: none; }
  .cta-secondary { margin-left: 0; margin-right: 16px; }
}

@media (max-width: 400px) {
  .brand-subtitle { display: none; }
  .nav-button { padding: 10px 12px; }
  .nav .nav-signin { display: none; }
  .nav .nav-app.signed-out { padding: 9px 10px; }
  .nav .nav-app.signed-in { padding: 9px 10px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .guide-card { transition: none; }
  .guide-card:hover { transform: none; }
  .nav-link, .nav-button, .toc a, .footer-links a, .footer-legal a, .cta .cta-button, .cta .cta-button::after { transition: none; }
  .cta .cta-button:hover, .cta .cta-button:hover::after { transform: none; }
}

/* "Keep reading" links between guides at the end of each article. */
.related { margin-top: 64px; }
.related h2 { margin-top: 0; }
.related li { margin: 0; }
.related ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.related a { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; }
.related a:hover { background: var(--hover); }
.related span { color: var(--muted); font-size: 14px; }
.views { margin: 48px 0 0; color: var(--muted); font-size: 13px; }

/* ---- Feature pages (/cat-mock-tracker/, /free-cat-sectionals/) ----
   Visuals are drawn in markup with the tokens above, like Homepage.jsx's
   previews, so they follow the theme and never go stale like screenshots. */
.f-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; padding: 32px 0 72px; }
.f-hero h1 { margin: 14px 0 0; font-size: clamp(2.25rem, 5.5vw, 3.6rem); font-weight: 700; line-height: 1.06; }
/* Returning readers keep text actions; signup gets a filled accent button. */
.f-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-top: 28px; }
.f-actions .nav-button, .f-actions .nav-link { min-height: 0; border-radius: 4px; padding: 2px 0; background: none; font-size: 16px; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 5px; }
.f-actions .nav-button { color: var(--primary); }
.f-actions .nav-button:hover { background: none; text-decoration-color: currentColor; }
.f-actions .nav-link { color: var(--muted); }
.f-actions .nav-link:hover { background: none; color: var(--ink); }
.f-actions .nav-button.signed-out { min-height: 46px; border-radius: 10px; padding: 12px 18px; color: var(--on-primary); background: var(--primary-fill); box-shadow: 0 4px 12px rgba(103, 21, 94, 0.16); text-decoration: none; }
.f-actions .nav-button.signed-out:hover { background: var(--primary-hover); box-shadow: 0 6px 18px rgba(103, 21, 94, 0.24); }
.f-ticks { display: flex; flex-wrap: wrap; gap: 6px 0; margin: 22px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 14px; }
.f-ticks li + li::before { content: "·"; margin: 0 10px; }

.f-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; border-top: 1px solid var(--border); padding: 64px 0; }
.f-row.flip > .f-copy { order: 2; }
.f-copy h2 { margin: 12px 0 0; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.15; }
.f-copy p { margin: 16px 0 0; color: var(--muted); font-size: 17px; line-height: 1.75; }
.f-copy ul { margin: 18px 0 0; padding-left: 20px; }
.f-copy li { margin: 6px 0; }

/* A miniature app card. */
.mini { padding: 18px; box-shadow: var(--shadow-floating); font-size: 13px; line-height: 1.45; }
.mini-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.mini-head b { font-family: var(--font-display); font-size: 15px; }
.mini-head span { color: var(--muted); font-size: 12px; }
.mini-label { margin: 16px 0 8px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.num { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
.mini-table { width: 100%; margin-top: 12px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.mini-table th, .mini-table td { padding: 9px 6px; border-top: 1px solid var(--border); text-align: right; white-space: nowrap; }
.mini-table thead th { border-top: 0; color: var(--muted); font-size: 11px; font-weight: 600; }
.mini-table th:first-child, .mini-table td:first-child { text-align: left; }
.mini-table td:first-child span { display: block; color: var(--muted); font-size: 11px; }
.c-varc { color: var(--varc); } .c-dilr { color: var(--dilr); } .c-quant { color: var(--quant); }
.bar { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.bar > span:first-child { width: 44px; font-weight: 600; }
.bar i { position: relative; height: 6px; flex: 1; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.bar i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 999px; background: var(--c); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.pill i { width: 7px; height: 7px; border-radius: 999px; background: var(--c); }
.qgrid { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 5px; }
.qgrid span { display: grid; aspect-ratio: 1; place-items: center; border-radius: 6px; font-size: 10px; font-weight: 600; color: var(--muted); background: var(--surface-2); }
.qgrid .r { color: var(--dilr); background: var(--dilr-soft); }
.qgrid .w { color: var(--varc); background: var(--varc-soft); }
.mini-chart { display: block; width: 100%; height: auto; margin-top: 8px; }
.mini-chart line { stroke: var(--border); }
.mini-chart polyline { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.mini-chart text { fill: var(--muted); font: 500 10px var(--font-body); }
.stack { display: grid; gap: 14px; }
.stack .mini:nth-child(2) { margin-left: 32px; }
.mini-note { margin-top: 12px; border-radius: 10px; padding: 10px 12px; background: var(--primary-soft); font-size: 12px; }
.mini-note b { color: var(--primary); }

/* CAT-style test window miniature. */
.exam-bar { display: flex; align-items: center; justify-content: space-between; margin: -18px -18px 14px; border-radius: 16px 16px 0 0; padding: 10px 18px; color: #fff; background: var(--brand-gradient); font-size: 12px; font-weight: 600; }
.exam-bar .num { font-size: 15px; }
.passage { border-radius: 10px; padding: 12px; background: var(--surface-2); color: var(--muted); font-size: 12px; line-height: 1.6; }
.opt { display: flex; gap: 8px; align-items: center; margin-top: 7px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.opt::before { content: ""; width: 12px; height: 12px; flex: 0 0 auto; border: 1.5px solid var(--border); border-radius: 999px; }
.opt.on { border-color: var(--primary); background: var(--primary-soft); }
.opt.on::before { border: 4px solid var(--primary); }
.board li { display: flex; align-items: center; gap: 10px; margin-top: 6px; border-radius: 10px; padding: 8px 10px; background: var(--surface-2); }
.board li.me { background: var(--primary-soft); }
.board ol { margin: 0; padding: 0; list-style: none; }
.board .rank { width: 14px; color: var(--muted); font-weight: 700; }
.board .who { flex: 1; font-weight: 600; }

.f-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
.f-card { padding: 22px; text-decoration: none; }
.f-card h3 { margin: 14px 0 0; font-size: 18px; }
.f-card p { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
a.f-card { transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms ease; }
a.f-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-floating); }
.f-steps { counter-reset: s; }
.f-steps .f-card h3::before { counter-increment: s; content: counter(s); display: grid; width: 32px; height: 32px; margin-bottom: 14px; place-items: center; border-radius: 999px; color: var(--on-primary); background: var(--primary-fill); font-size: 14px; }

@media (max-width: 900px) {
  .f-hero, .f-row { grid-template-columns: 1fr; gap: 32px; }
  .f-row.flip > .f-copy { order: 0; }
  .f-grid { grid-template-columns: 1fr; }
  .stack .mini:nth-child(2) { margin-left: 0; }
  .f-row { padding: 48px 0; }
  .f-hero { padding: 16px 0 48px; }
}
@media (prefers-reduced-motion: reduce) { a.f-card { transition: none; } a.f-card:hover { transform: none; } }


/* ---- Ad slots (future) ----
   Empty slots take no space, so pages look the same until an ad unit
   (e.g. an AdSense <ins>) is dropped inside. Add ?adslots to a URL to see
   where they sit. Kept small: one banner-height row, labelled. */
.ad-slot { display: block; margin: 40px 0; text-align: center; }
.ad-slot:empty { display: none; }
.ad-slot:not(:empty)::before, html[data-ads="preview"] .ad-slot::before { content: "Advertisement"; display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.ad-slot > * { max-width: 100%; max-height: 280px; overflow: hidden; }
.ad-slot.side { margin: 0; }
html[data-ads="preview"] .ad-slot { display: block; }
html[data-ads="preview"] .ad-slot::after { content: attr(data-ad); display: grid; min-height: 90px; place-items: center; border: 1px dashed var(--border); border-radius: 12px; color: var(--muted); font-size: 12px; }
html[data-ads="preview"] .ad-slot.side::after { min-height: 250px; }
@media (max-width: 1023px) { .ad-slot.side { display: none !important; } }

/* Screenshots, downloads and visible table captions inside posts. */
.shot { margin: 24px 0; }
.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 12px; }
.shot figcaption { margin-top: 8px; color: var(--muted); font-size: 13px; }
a.download { font-weight: 600; }
a.download::before { content: "↓ "; }
.data-table caption:not(.sr-only) { caption-side: top; padding-bottom: 8px; color: var(--muted); font-size: 13px; text-align: left; }

/* Phones: the contents list becomes one scrollable row so the quick answer
   stays in the first screen. */
@media (max-width: 1023px) {
  .article-aside { margin-bottom: 24px; }
  .toc { padding: 0 0 12px; }
  .toc ol { display: flex; gap: 6px; overflow-x: auto; margin-top: 10px; border-left: 0; scrollbar-width: none; }
  .toc a { margin: 0; white-space: nowrap; border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
}

/* A live ad keeps its height from the start, so filling it never pushes the
   text down (CLS). */
.ad-slot:not(:empty) { min-height: 280px; }
.ad-slot.side:not(:empty) { min-height: 250px; }

/* ---- Score calculator (/tools/cat-score-calculator/) ----
   Leak colours match ScoreLeakPanel.jsx (good / danger / warn / muted). */
:root { --danger: #b8433d; --warn: #e8bd63; }
[data-theme="dark"] { --danger: #f48a80; }
.calc-row.four { grid-template-columns: 90px repeat(4, minmax(0, 1fr)) 80px; }
.field input::placeholder { color: var(--muted); opacity: 0.7; }
.leak { display: grid; gap: 12px; margin-top: 16px; }
.leak-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 13px; }
.leak-row small { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.leak-bar { display: flex; height: 10px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.leak-bar i { height: 100%; }
.leak-line { margin: 14px 0 0; font-size: 14px; }
.calc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 20px; }
.calc-actions .nav-button[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.link-button { border: 0; padding: 0; color: var(--muted); background: none; font: 600 14px var(--font-body); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.link-button:hover { color: var(--ink); }
.data-table.plain td, .data-table.plain th { white-space: normal; text-align: left; }
.data-table.comparison-table { min-width: 560px; }
.status { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status.yes { color: var(--good); background: var(--dilr-soft); }
.status.exp { color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); }
@media (max-width: 760px) {
  .calc-row.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .leak-row { grid-template-columns: 56px minmax(0, 1fr); }
  .leak-row small { grid-column: 2; }
}
