/* CGPA Calculator. One stylesheet; every colour, radius and duration is a token below.
   GCUF-led palette (indigo #36348e, brick maroon), each university page swaps --accent. */

@font-face { font-family: 'DM Sans'; src: url('/assets/fonts/dm-sans.woff2') format('woff2'); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'DM Serif Display'; src: url('/assets/fonts/dm-serif-display.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
/* Urdu: Jameel Noori Nastaleeq when the visitor has it installed, otherwise the bundled Noto Nastaliq Urdu (OFL). */
@font-face { font-family: 'Nastaliq fallback'; src: url('/assets/fonts/noto-nastaliq-urdu.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'DM Serif Display'; src: url('/assets/fonts/dm-serif-display-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  color-scheme: light;
  --urdu: 'Jameel Noori Nastaleeq', 'Jameel Noori Nastaliq', 'Nastaliq fallback', serif;
  --serif: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --bg: #f6f5f1;
  --bg-tint: #efeef7;
  --surface: #ffffff;
  --surface-2: #f7f6fb;
  --ink: #1c1a33;
  --ink-2: #413e5c;
  --muted: #625f7c;
  --line: #e2e0eb;
  --line-strong: #c9c6db;

  --brand: #36348e;
  --brand-strong: #27256f;
  --maroon: #8c2f2b;
  --maroon-soft: #f6e7e4;
  --accent: var(--brand);
  --accent-strong: var(--brand-strong);
  --on-accent: #ffffff;
  --mark-ink: #ffffff;
  --focus: #2f6fe4;

  --good: #17673f; --good-bg: #e5f3eb;
  --warn: #8a5a00; --warn-bg: #fbf0d9;
  --bad: #a32a2a; --bad-bg: #f9e4e2;

  /* Grade colours follow the printed university tables: A dark green, B brown, C green, D blue. */
  --g-a: #0f6b3a; --g-a-bg: #e1f2e7;
  --g-b: #84520d; --g-b-bg: #f6ead6;
  --g-c: #4a7612; --g-c-bg: #ecf4dc;
  --g-d: #23497a; --g-d-bg: #e2e9f5;
  --g-f: #a32a2a; --g-f-bg: #f8e2df;

  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 26px;
  --shadow-sm: 0 1px 2px rgb(28 26 51 / 0.06);
  --shadow-md: 0 1px 2px rgb(28 26 51 / 0.05), 0 8px 24px -10px rgb(28 26 51 / 0.18);
  --shadow-lg: 0 2px 4px rgb(28 26 51 / 0.04), 0 24px 60px -24px rgb(38 36 109 / 0.35);
  --t-fast: 140ms; --t-med: 240ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --header-h: 68px;
}

html[data-uni="uaf"] { --accent: #005c45; --accent-strong: #00412f; }
html[data-uni="gcwuf"] { --accent: #800080; --accent-strong: #5e005e; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #100f1b; --bg-tint: #16152a; --surface: #1a1929; --surface-2: #211f34;
    --ink: #edebf7; --ink-2: #cbc8df; --muted: #a29fbd; --line: #2e2c46; --line-strong: #44415f;
    --brand: #aeabff; --brand-strong: #c9c7ff; --maroon: #f0928a; --maroon-soft: #3a2024;
    --accent: var(--brand); --accent-strong: var(--brand-strong); --on-accent: #15142a; --mark-ink: #15142a; --focus: #8fb4ff;
    --good: #7dd9a6; --good-bg: #173326; --warn: #f2c66d; --warn-bg: #3a2d10; --bad: #ff9c94; --bad-bg: #3d1c1d;
    --g-a: #8be3b0; --g-a-bg: #18382a; --g-b: #f1c27e; --g-b-bg: #3b2c14; --g-c: #c3e58a; --g-c-bg: #2a3815;
    --g-d: #a9c6f5; --g-d-bg: #1d2b45; --g-f: #ff9c94; --g-f-bg: #3d1c1d;
    --shadow-md: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px -12px rgb(0 0 0 / 0.6);
    --shadow-lg: 0 24px 60px -24px rgb(0 0 0 / 0.7);
  }
  html[data-uni="uaf"]:not([data-theme="light"]) { --accent: #5fd6ad; --accent-strong: #8ee6c7; }
  html[data-uni="gcwuf"]:not([data-theme="light"]) { --accent: #e59be5; --accent-strong: #f1c0f1; }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #100f1b; --bg-tint: #16152a; --surface: #1a1929; --surface-2: #211f34;
  --ink: #edebf7; --ink-2: #cbc8df; --muted: #a29fbd; --line: #2e2c46; --line-strong: #44415f;
  --brand: #aeabff; --brand-strong: #c9c7ff; --maroon: #f0928a; --maroon-soft: #3a2024;
  --accent: var(--brand); --accent-strong: var(--brand-strong); --on-accent: #15142a; --mark-ink: #15142a; --focus: #8fb4ff;
  --good: #7dd9a6; --good-bg: #173326; --warn: #f2c66d; --warn-bg: #3a2d10; --bad: #ff9c94; --bad-bg: #3d1c1d;
  --g-a: #8be3b0; --g-a-bg: #18382a; --g-b: #f1c27e; --g-b-bg: #3b2c14; --g-c: #c3e58a; --g-c-bg: #2a3815;
  --g-d: #a9c6f5; --g-d-bg: #1d2b45; --g-f: #ff9c94; --g-f-bg: #3d1c1d;
  --shadow-md: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px -12px rgb(0 0 0 / 0.6);
  --shadow-lg: 0 24px 60px -24px rgb(0 0 0 / 0.7);
}
:root[data-theme="dark"][data-uni="uaf"] { --accent: #5fd6ad; --accent-strong: #8ee6c7; }
:root[data-theme="dark"][data-uni="gcwuf"] { --accent: #e59be5; --accent-strong: #f1c0f1; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--sans); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3 { margin: 0 0 0.5em; line-height: 1.15; text-wrap: balance; }
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.35rem); }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-strong); }
img { max-width: 100%; height: auto; display: block; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--surface); padding: 10px 14px; border-radius: var(--r-sm); box-shadow: var(--shadow-md); }
.skip:focus { top: 12px; }
main:focus { outline: none; }
.wrap { width: min(100% - 32px, 1200px); margin-inline: auto; }
.wrap.narrow { width: min(100% - 32px, 820px); }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--maroon); margin-bottom: 0.9em; }
.lead { font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem); color: var(--ink-2); max-width: 62ch; }

/* ---------- Urdu ---------- */
[lang="ur"] { font-family: var(--urdu); font-weight: 400; line-height: 2.25; word-spacing: 0.06em; }
.ur { margin: 0.4em 0 1em; font-size: 1.16rem; color: var(--ink-2); text-align: right; }
.section-head .ur, .tool-grid + .ur { margin-top: -0.2em; }
.ur-hero { display: block; width: fit-content; max-width: 100%; margin: 18px 0 0; padding: 2px 18px 8px; font-size: clamp(1.15rem, 1rem + 0.5vw, 1.4rem); color: var(--maroon); background: var(--maroon-soft); border-radius: var(--r-lg) var(--r-lg) var(--r-lg) 4px; text-align: right; }
.ur-note { margin: 14px 0 0; padding: 6px 18px 10px; border-radius: var(--r-md); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); color: var(--ink-2); font-size: 1.08rem; }
.ur-step { margin: -0.2em 0 0.8em; color: var(--maroon); font-size: 1.12rem; }
.ur-footer { color: #f2c66d; font-size: 1.05rem; text-align: left; margin: 10px 0 0; }
.hero-copy .ur, .page-hero .ur-note { max-width: 62ch; }
.feature-row h3 + .ur { font-size: 1.05rem; margin: -0.3em 0 0.6em; text-align: left; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5em; min-height: 44px; padding: 0.6em 1.15em; border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: 0.95rem; text-decoration: none; cursor: pointer; transition: background var(--t-fast) var(--ease), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast) var(--ease), box-shadow var(--t-fast); white-space: nowrap; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-lg { min-height: 52px; padding: 0.75em 1.5em; font-size: 1rem; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-strong); color: var(--on-accent); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-soft { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.btn-soft:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 15%, var(--surface)); color: var(--accent-strong); }
.btn-quiet { background: transparent; color: var(--ink-2); padding-inline: 0.8em; }
.btn-quiet:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.btn-light { background: #fff; color: #27256f; }
.btn-light:hover { background: #f1f0ff; color: #27256f; }
.btn .icon { width: 1.05em; height: 1.05em; }
.btn-primary .icon:last-child, .text-link .icon { transition: transform var(--t-fast) var(--ease); }
.btn-primary:hover .icon:last-child, .text-link:hover .icon { transform: translateX(3px); }
.text-link { display: inline-flex; align-items: center; gap: 0.4em; font-weight: 600; text-decoration: none; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast); }
.icon-btn:hover:not(:disabled) { color: var(--ink); border-color: var(--line-strong); }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; transition: border-color var(--t-med), box-shadow var(--t-med); }
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.site-header::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--brand) 0 70%, var(--maroon) 70% 100%); }
.header-row { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand .mark { width: 38px; height: 38px; flex: none; transition: transform var(--t-med) var(--ease); }
.brand:hover .mark { transform: rotate(-8deg); }
.brand-text { font-family: var(--serif); font-size: 1.32rem; line-height: 1; display: flex; flex-direction: column; }
.brand-text span { font-family: var(--sans); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a { position: relative; padding: 8px 12px; border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: 0.94rem; text-decoration: none; transition: color var(--t-fast), background var(--t-fast); }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.nav a[data-uni-link="uaf"] { --dot: #005c45; } .nav a[data-uni-link="gcuf"] { --dot: #36348e; } .nav a[data-uni-link="gcwuf"] { --dot: #800080; }
.nav a[data-uni-link]::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--dot); margin-right: 7px; vertical-align: 1px; }
:root[data-theme="dark"] .nav a[data-uni-link]::before { box-shadow: 0 0 0 1.5px rgb(255 255 255 / 0.5); }
.header-actions { display: flex; gap: 8px; }
.when-dark, .when-open { display: none; }
html.is-dark .when-dark { display: block; } html.is-dark .when-light { display: none; }
.menu-btn { display: none; }
.menu-btn[aria-expanded="true"] .when-open { display: block; } .menu-btn[aria-expanded="true"] .when-closed { display: none; }
@media (max-width: 880px) {
  .menu-btn { display: inline-grid; }
  .header-row { gap: 12px; }
  .header-actions { margin-left: auto; }
  .nav { position: absolute; left: 0; right: 0; top: var(--header-h); margin: 0; flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 16px 18px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md); opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease), visibility 0s linear var(--t-med); }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .nav a { padding: 12px 14px; font-size: 1rem; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(56px, 7vw, 96px); }
.section.first { padding-top: clamp(28px, 4vw, 48px); }
.section.tint { background: var(--bg-tint); }
.section-head { max-width: 680px; margin-bottom: clamp(28px, 4vw, 44px); }
.section-head p:last-child { color: var(--ink-2); }

/* ---------- Home hero ---------- */
.hero { position: relative; padding-block: clamp(40px, 7vw, 96px) clamp(56px, 7vw, 100px); overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background-image: repeating-linear-gradient(0deg, transparent 0 39px, color-mix(in srgb, var(--brand) 8%, transparent) 39px 40px); mask-image: radial-gradient(ellipse 70% 80% at 75% 40%, #000 20%, transparent 75%); pointer-events: none; }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 em { font-style: italic; color: var(--accent); background: linear-gradient(transparent 82%, color-mix(in srgb, var(--maroon) 30%, transparent) 82% 94%, transparent 94%); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-actions.center { justify-content: center; }
.hero-points { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; padding: 0; margin: 26px 0 0; color: var(--ink-2); font-size: 0.93rem; font-weight: 500; }
.hero-points li { display: inline-flex; align-items: center; gap: 7px; }
.hero-points .icon { color: var(--good); }
.demo-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); padding: 22px; }
.demo-card::after { content: ''; position: absolute; inset: auto 28px -14px; height: 14px; border-radius: 0 0 var(--r-lg) var(--r-lg); background: color-mix(in srgb, var(--brand) 14%, var(--surface)); z-index: -1; }
.demo-head { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink-2); margin-bottom: 14px; }
.demo-live { margin-left: auto; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--good); display: inline-flex; align-items: center; gap: 6px; }
.demo-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px var(--good-bg); }
.demo-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.demo-rows li { display: grid; grid-template-columns: 1fr auto auto auto 56px; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--r-md); background: var(--surface-2); font-size: 0.92rem; }
.demo-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-ch, .demo-m { color: var(--muted); font-variant-numeric: tabular-nums; }
.demo-p { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.demo-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-strong); }
.demo-label { display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.demo-gpa { font-family: var(--serif); font-size: 3.4rem; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.demo-meta { display: grid; text-align: right; font-size: 0.86rem; color: var(--muted); }
.monogram { display: inline-grid; place-items: center; min-width: 46px; height: 46px; padding: 0 8px; border-radius: 14px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 0.82rem; letter-spacing: 0.04em; }
.monogram.sm { min-width: 40px; height: 30px; border-radius: 9px; font-size: 0.72rem; }
@media (max-width: 920px) { .hero-grid { grid-template-columns: 1fr; } .hero-demo { max-width: 520px; } }
@media (max-width: 480px) { .demo-rows li { grid-template-columns: 1fr auto auto 48px; } .demo-m { display: none; } .demo-gpa { font-size: 2.7rem; } }

/* ---------- University seals (logos on a white plate) ---------- */
.seal { display: inline-grid; place-items: center; flex: none; width: 52px; height: 52px; padding: 5px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.seal img { width: 100%; height: 100%; object-fit: contain; }
.seal-xs { width: 26px; height: 26px; padding: 2px; box-shadow: none; }
.seal-sm { width: 34px; height: 34px; padding: 3px; }
.seal-md { width: 60px; height: 60px; padding: 6px; }
.seal-lg { width: 72px; height: 72px; padding: 7px; box-shadow: 0 0 0 1px var(--line), 0 0 0 5px color-mix(in srgb, var(--accent) 12%, transparent), var(--shadow-md); }
.title-row { display: flex; align-items: center; gap: 18px; margin-bottom: 0.3em; }
.title-row h1 { margin: 0; }
.uni-short { display: block; font-weight: 700; font-size: 1.02rem; color: var(--accent); letter-spacing: 0.02em; }
.kicker-logo { display: inline-block; width: 22px; height: 22px; object-fit: contain; vertical-align: -6px; margin-right: 8px; border-radius: 50%; background: #fff; padding: 1px; }
@media (max-width: 560px) { .seal-lg { width: 56px; height: 56px; padding: 5px; } .title-row { gap: 12px; } }

/* ---------- University cards ---------- */
.uni-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.uni-grid.two { grid-template-columns: repeat(2, 1fr); max-width: 860px; margin: 28px auto 0; }
.uni-card { position: relative; display: flex; flex-direction: column; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); transition: transform var(--t-med) var(--ease), box-shadow var(--t-med), border-color var(--t-med); }
.uni-card[data-uni="gcuf"] { --accent: #36348e; --accent-strong: #27256f; }
.uni-card[data-uni="uaf"] { --accent: #005c45; --accent-strong: #00412f; }
.uni-card[data-uni="gcwuf"] { --accent: #800080; --accent-strong: #5e005e; }
html.is-dark .uni-card[data-uni="gcuf"] { --accent: #aeabff; --accent-strong: #c9c7ff; }
html.is-dark .uni-card[data-uni="uaf"] { --accent: #5fd6ad; --accent-strong: #8ee6c7; }
html.is-dark .uni-card[data-uni="gcwuf"] { --accent: #e59be5; --accent-strong: #f1c0f1; }
.uni-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.uni-card-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.uni-city { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.uni-card h3 { font-family: var(--serif); font-weight: 400; font-size: 1.45rem; line-height: 1.2; }
.uni-card h3 a { color: var(--ink); text-decoration: none; }
.uni-card h3 a::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.uni-card p { color: var(--muted); font-size: 0.93rem; flex: 1; }
.uni-card-links { position: relative; z-index: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin-top: 8px; }
@media (max-width: 900px) { .uni-grid, .uni-grid.two { grid-template-columns: 1fr; } }

/* ---------- Tools, why, features ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.tool { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.tool-icon, .feature-icon { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); color: var(--accent); margin-bottom: 16px; stroke-width: 1.6; }
.tool p, .feature-row p { color: var(--muted); font-size: 0.94rem; margin: 0; }
@media (max-width: 980px) { .tool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tool-grid { grid-template-columns: 1fr; } }
.why-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.why-copy p { color: var(--ink-2); }
.compare { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-md); }
.compare th, .compare td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--line); }
.compare thead th { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
.compare tbody tr:last-child > * { border-bottom: 0; }
.compare td.num { font-family: var(--serif); font-size: 1.6rem; text-align: right; }
.compare .muted-row { color: var(--muted); }
.compare .muted-row td.num { text-decoration: line-through; text-decoration-color: var(--bad); text-decoration-thickness: 2px; }
@media (max-width: 820px) { .why-grid { grid-template-columns: 1fr; } }
.feature-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
@media (max-width: 820px) { .feature-row { grid-template-columns: 1fr; } }
.cta-band { background: var(--brand); color: #fff; }
:root[data-theme="dark"] .cta-band, html.is-dark .cta-band { background: #26246d; }
.cta-inner { text-align: center; }
.cta-inner h2 { color: #fff; }
.cta-inner p { color: rgb(255 255 255 / 0.82); }

/* ---------- Page hero, crumbs, facts ---------- */
.page-hero { padding-block: clamp(24px, 4vw, 44px) clamp(20px, 3vw, 32px); }
.page-hero h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); margin-bottom: 0.3em; }
.page-hero .lead { margin-bottom: 0; }
.page-hero-row { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: end; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; list-style: none; padding: 0; margin: 0 0 18px; font-size: 0.86rem; color: var(--muted); }
.crumbs li { display: inline-flex; align-items: center; gap: 4px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs .icon { width: 14px; height: 14px; }
.crumbs [aria-current] { color: var(--ink-2); font-weight: 600; }
.facts { display: grid; grid-template-columns: repeat(4, auto); gap: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.facts div { padding: 10px 18px; border-left: 1px solid var(--line); }
.facts div:first-child { border-left: 0; }
.facts dt { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.facts dd { margin: 0; font-family: var(--serif); font-size: 1.35rem; color: var(--accent); white-space: nowrap; }
@media (max-width: 960px) { .page-hero-row { grid-template-columns: 1fr; align-items: start; } }
@media (max-width: 560px) { .facts { grid-template-columns: repeat(2, 1fr); } .facts div:nth-child(3) { border-left: 0; } .facts div:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* ---------- Calculator ---------- */
.calc-section { padding-bottom: clamp(40px, 6vw, 72px); }
.calc { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); }
.tabs { position: relative; display: flex; gap: 2px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 14px 18px 16px; border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 0.96rem; cursor: pointer; border-radius: var(--r-sm) var(--r-sm) 0 0; transition: color var(--t-fast); }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--accent); }
.tab-ink { position: absolute; left: 0; bottom: -1px; height: 3px; width: 0; border-radius: 3px 3px 0 0; background: var(--accent); transition: transform var(--t-med) var(--ease), width var(--t-med) var(--ease); }
@media (max-width: 560px) {
  .tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 10px; }
  .tab { padding: 10px 8px; border-radius: var(--r-sm); background: var(--surface-2); text-align: center; }
  .tab[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
  .tab-ink { display: none; }
}
.panel { padding: clamp(16px, 3vw, 28px); }
.panel:focus-visible { outline-offset: -4px; }
.loading { color: var(--muted); }
.noscript { padding: 20px 28px; margin: 0; }
.panel-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; align-items: start; }
@media (max-width: 1040px) { .panel-grid { grid-template-columns: 1fr; } }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 20px; margin-bottom: 18px; }

.seg { border: 0; padding: 0; margin: 0; min-width: 0; }
.seg legend { padding: 0; margin-bottom: 7px; font-size: 0.8rem; font-weight: 700; color: var(--ink-2); }
.seg-track { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.seg-opt { position: relative; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-opt span { display: block; padding: 8px 14px; border-radius: 10px; font-size: 0.9rem; font-weight: 600; color: var(--ink-2); transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
.seg-opt input:checked + span { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
.seg-opt:hover span { color: var(--ink); }

.field { display: grid; gap: 6px; min-width: 0; }
.field-label, .cell-label { font-size: 0.8rem; font-weight: 700; color: var(--ink-2); }
.field-hint { font-size: 0.8rem; color: var(--muted); }
.field-error { font-size: 0.8rem; font-weight: 600; color: var(--bad); }
input[type="text"], select { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-size: 1rem; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
input[type="text"]::placeholder { color: var(--muted); opacity: 1; }
input[type="text"]:hover, select:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line-strong)); }
input[type="text"]:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 14%, transparent); }
select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
.input-wrap { position: relative; display: block; }
.input-wrap.has-unit input { padding-right: 34px; }
.unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.level-field { width: min(100%, 300px); }

.course-list { display: grid; gap: 8px; }
.course-head, .course-row { display: grid; grid-template-columns: 26px minmax(120px, 1.25fr) 96px minmax(150px, 1.15fr) 128px 42px; gap: 10px; align-items: center; }
.course-head { padding: 0 10px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.course-row { position: relative; padding: 10px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid transparent; transition: border-color var(--t-fast), background var(--t-fast); }
.course-row:focus-within { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); background: color-mix(in srgb, var(--accent) 4%, var(--surface-2)); }
.course-row.has-error { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.row-num { font-weight: 700; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.cell { display: grid; gap: 4px; min-width: 0; }
.cell-label { display: none; }
.marks-pair { display: grid; grid-template-columns: 1fr auto 72px; align-items: center; gap: 6px; }
.of { color: var(--muted); font-weight: 600; }
.total-input { color: var(--ink-2) !important; background: transparent !important; }
.cell-out { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-variant-numeric: tabular-nums; min-height: 44px; }
.out-pts { font-weight: 700; min-width: 44px; text-align: right; }
.out-pct { display: none; }
.out-empty { color: var(--muted); }
.out-error { color: var(--bad); font-weight: 700; font-size: 0.85rem; }
.row-remove { width: 38px; height: 38px; justify-self: end; background: transparent; border-color: transparent; }
.row-remove:hover:not(:disabled) { color: var(--bad); background: var(--bad-bg); }
.row-error { grid-column: 2 / -1; margin: 0; font-size: 0.84rem; font-weight: 600; color: var(--bad); }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
@media (max-width: 720px) {
  .course-head { display: none; }
  .course-row { grid-template-columns: 1fr 1fr; gap: 10px 10px; padding: 14px 14px 12px; }
  .row-num { position: absolute; top: 12px; right: 52px; font-size: 0.8rem; }
  .cell-label { display: block; }
  .cell-name { grid-column: 1 / -1; padding-right: 64px; }
  .cell-ch { grid-column: 1; }
  .cell-marks { grid-column: 2; }
  .cell-out { grid-column: 1 / -1; justify-content: flex-start; min-height: 0; padding-top: 2px; }
  .out-pct { display: inline; color: var(--muted); font-size: 0.86rem; }
  .row-remove { position: absolute; top: 8px; right: 8px; }
  .row-error { grid-column: 1 / -1; }
  .marks-pair { grid-template-columns: 1fr auto 1fr; }
}

.grade-chip { display: inline-grid; place-items: center; min-width: 32px; height: 26px; padding: 0 7px; border-radius: 7px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em; background: var(--g-d-bg); color: var(--g-d); font-variant-numeric: tabular-nums; }
.grade-chip[data-grade="A"] { background: var(--g-a-bg); color: var(--g-a); }
.grade-chip[data-grade="B"] { background: var(--g-b-bg); color: var(--g-b); }
.grade-chip[data-grade="C"] { background: var(--g-c-bg); color: var(--g-c); }
.grade-chip[data-grade="D"] { background: var(--g-d-bg); color: var(--g-d); }
.grade-chip[data-grade="F"] { background: var(--g-f-bg); color: var(--g-f); }

/* Result card */
.result-card { position: sticky; top: calc(var(--header-h) + 16px); padding: 22px; border-radius: var(--r-lg); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--surface)), var(--surface) 70%); border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line)); }
@media (max-width: 1040px) { .result-card { position: static; } }
.result-kicker { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--maroon); margin-bottom: 6px; }
.dial { position: relative; max-width: 260px; margin: 4px auto 6px; }
.dial svg { display: block; width: 100%; overflow: visible; }
.dial-track, .dial-fill { fill: none; stroke-width: 7; stroke-linecap: round; }
.dial-track { stroke: color-mix(in srgb, var(--accent) 14%, var(--line)); }
.dial-fill { stroke: var(--accent); transition: stroke-dashoffset 520ms var(--ease); }
.dial.is-empty .dial-fill { stroke: transparent; }
.dial.is-range .dial-fill { stroke: color-mix(in srgb, var(--accent) 55%, transparent); stroke-dasharray: 3 4 !important; }
.dial-text { position: absolute; inset: auto 0 0; display: grid; justify-items: center; text-align: center; }
.dial-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.dial-value { font-family: var(--serif); font-size: 3.2rem; line-height: 1.02; color: var(--ink); font-variant-numeric: tabular-nums; }
.dial.is-range .dial-value { font-size: 2.1rem; padding-block: 0.25em 0.1em; }
.dial.is-empty .dial-value { color: var(--line-strong); }
.dial-sub { font-size: 0.84rem; color: var(--muted); }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 16px 0 0; border-top: 1px solid var(--line); }
.result-stats div { padding: 12px 4px 0; text-align: center; }
.result-stats dt { font-size: 0.72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.result-stats dd { margin: 2px 0 0; font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.result-note { margin: 14px 0 0; font-size: 0.87rem; color: var(--ink-2); }
.result-lead { margin: 14px 0 0; text-align: center; color: var(--ink-2); }
.standing { margin: 16px 0 0; padding: 11px 14px; border-radius: var(--r-sm); font-size: 0.88rem; font-weight: 500; background: var(--surface-2); color: var(--ink-2); }
.standing[data-tone="good"] { background: var(--good-bg); color: var(--good); }
.standing[data-tone="warn"] { background: var(--warn-bg); color: var(--warn); }
.standing[data-tone="bad"] { background: var(--bad-bg); color: var(--bad); }
.result-actions { display: grid; gap: 8px; margin-top: 18px; }
.result-actions > .btn { width: 100%; }
.result-mini { display: flex; justify-content: center; gap: 4px; }
.whatif { width: 100%; margin-top: 16px; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.whatif caption { text-align: left; font-size: 0.82rem; font-weight: 700; color: var(--ink-2); padding-bottom: 6px; }
.whatif th, .whatif td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.whatif th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.whatif td:last-child, .whatif th:last-child { text-align: right; }
.whatif tr.meets td { color: var(--good); font-weight: 700; }

.sem-list { display: grid; gap: 8px; }
.sem-head, .sem-row { display: grid; grid-template-columns: 110px 1fr 1fr 42px; gap: 10px; align-items: center; }
.sem-head { padding: 0 10px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.sem-row { position: relative; padding: 10px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid transparent; }
.sem-row.has-error { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.sem-name { font-weight: 700; color: var(--ink-2); }
@media (max-width: 560px) {
  .sem-head { display: none; }
  .sem-row { grid-template-columns: 1fr 1fr; padding: 12px 14px; }
  .sem-name { grid-column: 1 / -1; }
  .sem-row .cell-label { display: block; }
  .sem-row .row-remove { position: absolute; top: 6px; right: 6px; }
}
.quick-grid, .one-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.one-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.one-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .quick-grid, .one-grid, .one-grid.two { grid-template-columns: 1fr; } }
.target-grid { display: grid; gap: 18px; }
.group { border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px 18px; margin: 0; display: grid; gap: 14px; min-width: 0; }
.group legend { padding: 0 6px; margin-left: -6px; font-weight: 700; font-size: 0.95rem; }
.group-note { margin: 0; font-size: 0.86rem; color: var(--muted); }
.planner { margin-top: 18px; }
.quick-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn, .chip-tab { min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 0.88rem; cursor: pointer; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast); }
.chip-btn:hover, .chip-tab:hover { border-color: var(--accent); color: var(--accent); }
.chip-btn[aria-pressed="true"], .chip-tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.needs { margin-top: 18px; }
.needs-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.needs-table caption { text-align: left; font-weight: 700; padding-bottom: 8px; }
.needs-table th, .needs-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.needs-table th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.needs-table tr.is-current td { background: color-mix(in srgb, var(--accent) 8%, transparent); font-weight: 700; }
.final-table { margin-top: 4px; }
.final-table tr[data-state="done"] td:last-child { color: var(--good); font-weight: 700; }
.final-table tr[data-state="no"] td:last-child { color: var(--muted); }
.final-table tr[data-state="need"] td:last-child { font-weight: 700; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; padding: 11px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 0.92rem; box-shadow: var(--shadow-md); transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.print-slip { display: none; }

/* ---------- Prose, links, FAQ ---------- */
.prose { font-size: 1.04rem; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 0.55em; }
.prose li::marker { color: var(--maroon); }
.prose h2 { margin-top: 1.4em; }
.prose section:first-child h2 { margin-top: 0; }
.link-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 28px; }
.link-card { display: flex; gap: 12px; padding: 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color var(--t-fast), transform var(--t-fast) var(--ease); }
.link-card:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--ink); }
.link-card > .icon { width: 22px; height: 22px; color: var(--accent); margin-top: 2px; }
.link-card strong { display: block; }
.link-card span span { display: block; font-size: 0.86rem; color: var(--muted); }
@media (max-width: 760px) { .link-cards { grid-template-columns: 1fr; } }
.faq-list { display: grid; gap: 10px; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); transition: border-color var(--t-fast); }
.faq-item[open] { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.faq-item summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; font-weight: 700; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .icon { color: var(--accent); transition: transform var(--t-med) var(--ease); }
.faq-item[open] summary .icon { transform: rotate(45deg); }
.faq-answer { padding: 0 20px 18px; color: var(--ink-2); }
.faq-answer p { margin: 0; }

/* ---------- Grading tables ---------- */
.grading-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.grading-side { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 18px; }
.grading-side h2, .grading-main h2 { font-size: 1.6rem; margin-bottom: 0; }
.grading-main { display: grid; gap: 16px; min-width: 0; }
@media (max-width: 960px) { .grading-grid { grid-template-columns: 1fr; } .grading-side { position: static; } }
.grade-table, .qp-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; font-variant-numeric: tabular-nums; }
.grade-table caption, .qp-table caption { text-align: left; font-weight: 700; font-size: 0.9rem; color: var(--ink-2); padding-bottom: 8px; }
.grade-table th, .grade-table td, .qp-table th, .qp-table td { padding: 9px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.grade-table thead th, .qp-table thead th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--surface-2); }
.qp-table thead th { position: sticky; top: var(--header-h); z-index: 1; }
.grade-table tbody tr:last-child > *, .qp-table tbody tr:last-child > * { border-bottom: 0; }
.qp-table td.num, .grade-table td.num, .qp-table th.num { text-align: right; }
.qp-table tbody tr:hover td { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.qp-table tr[data-grade="F"] td { color: var(--muted); }
.notes { margin: 0; padding-left: 1.1em; color: var(--muted); font-size: 0.92rem; }
.notes li { margin-bottom: 0.4em; }
.qp-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 560px) {
  .qp-panel { overflow-x: auto; }
  .grade-table th, .grade-table td, .qp-table th, .qp-table td { padding: 8px 9px; font-size: 0.9rem; }
  .qp-table thead th { position: static; }
}

/* ---------- Rules and docs ---------- */
.rules-grid, .docs-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + 16px); font-size: 0.92rem; }
.toc p { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--accent); border-left-color: var(--accent); }
.rules-body section { padding-bottom: 8px; }
.cta-line { margin-top: 32px; }
@media (max-width: 860px) { .rules-grid, .docs-grid { grid-template-columns: minmax(0, 1fr); } .toc { position: static; } }
.doc-step { padding-bottom: 40px; margin-bottom: 40px; border-bottom: 1px solid var(--line); }
.doc-step:last-child { border-bottom: 0; }
.step-label { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--maroon); margin-bottom: 4px; }
.doc-step h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.doc-step h3 { margin-top: 1.4em; }
.doc-step p { color: var(--ink-2); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 10px; }
.steps li { counter-increment: s; position: relative; padding-left: 40px; color: var(--ink-2); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); font-weight: 700; font-size: 0.85rem; }
.shot { margin: 0; }
.shot img { border-radius: var(--r-md); border: 1px solid var(--line); box-shadow: var(--shadow-md); background: var(--surface); }
.shot.phone img { max-width: min(100%, 390px); margin-inline: auto; }
.shot-placeholder { display: grid; place-items: center; aspect-ratio: 16 / 9; border: 1px dashed var(--line-strong); border-radius: var(--r-md); color: var(--muted); }
.callout-key { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 0.92rem; color: var(--ink-2); }
.callout-key li { display: inline-flex; align-items: center; gap: 8px; }
.callout-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #b3261e; color: #fff; font-weight: 700; font-size: 0.8rem; flex: none; }

/* ---------- 404 ---------- */
.notfound { padding-block: clamp(64px, 10vw, 140px); }

/* ---------- Footer ---------- */
.site-footer { background: #17163a; color: #d9d7f0; padding-top: 56px; margin-top: 0; }
.site-footer .brand { color: #fff; }
.site-footer .brand-text span { color: #a9a6c9; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; padding-bottom: 40px; }
.footer-grid h2 { font-family: var(--sans); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #a9a6c9; margin-bottom: 14px; }
.footer-grid a:not(.brand) { display: block; color: #e6e4f7; text-decoration: none; padding: 4px 0; font-size: 0.94rem; }
.footer-grid a:not(.brand):hover { color: #fff; text-decoration: underline; }
.footer-brand p { color: #a9a6c9; font-size: 0.92rem; margin-top: 14px; max-width: 34ch; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding: 20px 0 28px; border-top: 1px solid rgb(255 255 255 / 0.1); font-size: 0.88rem; color: #a9a6c9; }
.footer-dev strong { color: #fff; }
.footer-dev a { color: #f2c66d; text-decoration: none; font-weight: 600; }
.footer-dev a:hover { color: #ffd98f; text-decoration: underline; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- Print: the result slip only ---------- */
@media print {
  @page { margin: 16mm; }
  body { background: #fff; color: #000; }
  /* Calculator pages print the result slip only; every other page prints as it reads. */
  body:has(.calc-section) > *:not(main), body:has(.calc-section) main > *:not(.calc-section), .calc > *:not(.print-slip) { display: none !important; }
  .calc-section .wrap, .calc { width: auto; border: 0; box-shadow: none; padding: 0; }
  .site-header, .site-footer, .skip, .toc, .hero-demo, .icon-btn, .qp-tabs { display: none !important; }
  .qp-panel[hidden] { display: block !important; }
  .qp-panel { break-inside: auto; margin-bottom: 12pt; }
  .qp-table thead th { position: static; }
  .grading-side, .result-card { position: static; }
  [data-reveal], [data-hero] { opacity: 1 !important; transform: none !important; }
  .print-slip { display: block; font-family: var(--sans); }
  .print-slip h2 { font-family: var(--serif); font-size: 22pt; margin-bottom: 4pt; }
  .print-slip table { width: 100%; border-collapse: collapse; margin: 14pt 0; }
  .print-slip th, .print-slip td { border-bottom: 1px solid #bbb; padding: 6pt 8pt; text-align: left; }
  .print-total { font-size: 14pt; }
  .print-src { color: #555; font-size: 9pt; }
}
