/* SBI Clerk Prep — "Exam-hall ledger" */
:root {
  --jx-ink: #141a2e;
  --jx-ink-2: #3b4258;
  --jx-muted: #6b7186;
  --jx-paper: #f3f4ef;
  --jx-paper-2: #e9ebe4;
  --jx-surface: #ffffff;
  --jx-line: #dfe2da;
  --jx-line-2: #cdd1c7;
  --jx-accent: #2f4bdb;
  --jx-accent-ink: #1d2f9e;
  --jx-accent-soft: #e6eafc;
  --jx-ok: #0f8a5f;
  --jx-ok-soft: #e1f3eb;
  --jx-bad: #c2412d;
  --jx-bad-soft: #fbe7e2;
  --jx-mark: #7048c8;
  --jx-mark-soft: #efe8fb;
  --jx-gold: #d99a2b;
  --jx-gold-soft: #fbf0db;
  --jx-s1: #2f4bdb;
  --jx-s2: #0f8a5f;
  --jx-s3: #d99a2b;
  --jx-s4: #7048c8;
  --jx-s5: #c2412d;
  --jx-s6: #1f8fa6;
  --jx-s7: #8a6a3b;
  --jx-s8: #5b6278;
  --jx-shadow: 0 1px 2px rgba(20, 26, 46, .05), 0 12px 32px -12px rgba(20, 26, 46, .16);
  --jx-shadow-lg: 0 2px 4px rgba(20, 26, 46, .05), 0 24px 60px -20px rgba(20, 26, 46, .28);
  --jx-radius: 16px;
  --jx-radius-sm: 10px;
  --jx-display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --jx-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --jx-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --jx-ink: #eceef6; --jx-ink-2: #c3c7d6; --jx-muted: #9198ad; --jx-paper: #0f1320; --jx-paper-2: #161b2b;
    --jx-surface: #171c2c; --jx-line: #262c40; --jx-line-2: #333a51; --jx-accent: #6f86ff; --jx-accent-ink: #a9b6ff;
    --jx-accent-soft: #1d2647; --jx-ok: #3fc48f; --jx-ok-soft: #12302a; --jx-bad: #f07a63; --jx-bad-soft: #3a1d1a;
    --jx-mark: #a98bf0; --jx-mark-soft: #2a2145; --jx-gold: #f0b54c; --jx-gold-soft: #33280f;
    --jx-s1: #6f86ff; --jx-s2: #3fc48f; --jx-s3: #f0b54c; --jx-s4: #a98bf0; --jx-s5: #f07a63; --jx-s6: #4fc3d9; --jx-s7: #c9a46b; --jx-s8: #8e96ad;
    --jx-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .6);
    --jx-shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 60px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --jx-ink: #eceef6; --jx-ink-2: #c3c7d6; --jx-muted: #9198ad; --jx-paper: #0f1320; --jx-paper-2: #161b2b;
  --jx-surface: #171c2c; --jx-line: #262c40; --jx-line-2: #333a51; --jx-accent: #6f86ff; --jx-accent-ink: #a9b6ff;
  --jx-accent-soft: #1d2647; --jx-ok: #3fc48f; --jx-ok-soft: #12302a; --jx-bad: #f07a63; --jx-bad-soft: #3a1d1a;
  --jx-mark: #a98bf0; --jx-mark-soft: #2a2145; --jx-gold: #f0b54c; --jx-gold-soft: #33280f;
  --jx-s1: #6f86ff; --jx-s2: #3fc48f; --jx-s3: #f0b54c; --jx-s4: #a98bf0; --jx-s5: #f07a63; --jx-s6: #4fc3d9; --jx-s7: #c9a46b; --jx-s8: #8e96ad;
  --jx-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .6);
  --jx-shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 60px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--jx-paper); color: var(--jx-ink); font-family: var(--jx-body);
  font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--jx-accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--jx-accent-ink); }
h1, h2, h3, h4 { font-family: var(--jx-display); line-height: 1.15; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); font-weight: 700; }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.65rem); font-weight: 650; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--jx-accent); outline-offset: 2px; border-radius: 6px; }
.mono, .eyebrow, .kbd, .num { font-family: var(--jx-mono); }
.eyebrow { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--jx-muted); font-weight: 600; display: block; margin-bottom: .5rem; }
.muted { color: var(--jx-muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kbd { display: inline-block; font-size: .72rem; padding: .05rem .4rem; border: 1px solid var(--jx-line-2); border-bottom-width: 2px; border-radius: 5px; color: var(--jx-ink-2); background: var(--jx-surface); }

/* ---------- layout ---------- */
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.main { padding: 28px 0 96px; min-height: calc(100vh - 140px); }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .g2, .g3 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 16px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin: 0; }
.page-head p { margin: .35rem 0 0; color: var(--jx-muted); max-width: 62ch; }

/* ---------- nav capsule ---------- */
.topbar { position: sticky; top: 0; z-index: 40; padding: 12px 0; transition: padding .25s ease; }
.topbar.scrolled { padding: 6px 0; }
.capsule {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 16px; border-radius: 999px;
  background: color-mix(in srgb, var(--jx-surface) 82%, transparent); border: 1px solid var(--jx-line);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); box-shadow: var(--jx-shadow);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--jx-display); font-weight: 700; color: var(--jx-ink); text-decoration: none; white-space: nowrap; margin-right: auto; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--jx-ink); color: var(--jx-paper); }
.brand small { display: block; font-family: var(--jx-mono); font-weight: 500; font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--jx-muted); line-height: 1; }
.nav-links { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-links a, .nav-btn {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; color: var(--jx-ink-2);
  text-decoration: none; font-weight: 600; font-size: .92rem; border: 0; background: none; cursor: pointer; font-family: inherit;
}
.nav-links a:hover, .nav-btn:hover { background: var(--jx-paper-2); color: var(--jx-ink); }
.nav-links a.on { background: var(--jx-ink); color: var(--jx-paper); }
.dropdown { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px; padding: 8px; border-radius: 14px; background: var(--jx-surface);
  border: 1px solid var(--jx-line); box-shadow: var(--jx-shadow-lg); display: none;
}
.dropdown.open .menu { display: block; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 9px; color: var(--jx-ink); text-decoration: none; font: inherit; font-size: .92rem; background: none; border: 0; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--jx-paper-2); }
.menu hr { border: 0; border-top: 1px solid var(--jx-line); margin: 6px 0; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--jx-accent-soft); color: var(--jx-accent-ink); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.bottom-nav { display: none; }
@media (max-width: 900px) {
  .nav-links { display: none; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 50;
    background: color-mix(in srgb, var(--jx-surface) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--jx-line); border-radius: 18px; box-shadow: var(--jx-shadow-lg); padding: 6px;
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; min-height: 48px; font-size: .7rem; font-weight: 600; color: var(--jx-muted); text-decoration: none; border-radius: 12px; }
  .bottom-nav a.on { color: var(--jx-accent); background: var(--jx-accent-soft); }
  .bottom-nav svg { width: 20px; height: 20px; }
}

/* ---------- cards & surfaces ---------- */
.card { background: var(--jx-surface); border: 1px solid var(--jx-line); border-radius: var(--jx-radius); box-shadow: var(--jx-shadow); padding: 22px; }
.card.flat { box-shadow: none; }
.card.tight { padding: 16px; }
.card-link { display: block; color: inherit; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.card-link:hover { transform: translateY(-2px); box-shadow: var(--jx-shadow-lg); border-color: var(--jx-line-2); color: inherit; }
.band { background: var(--jx-ink); color: var(--jx-paper); border-radius: 22px; padding: 28px; position: relative; overflow: hidden; }
.band .eyebrow { color: color-mix(in srgb, var(--jx-paper) 60%, transparent); }
.band::after { content: ""; position: absolute; inset: auto -80px -120px auto; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--jx-accent) 55%, transparent), transparent 70%); pointer-events: none; }
:root[data-theme="dark"] .band, .band { --band-bg: #0b0f1b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .band { background: #1d2440; color: #eceef6; } }
:root[data-theme="dark"] .band { background: #1d2440; color: #eceef6; }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-family: var(--jx-display); font-size: 2rem; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; }
.stat > span { font-size: .85rem; color: var(--jx-muted); }
.stat b span { font: inherit; color: inherit; }
.band .stat span { color: color-mix(in srgb, currentColor 65%, transparent); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; font-family: var(--jx-mono); background: var(--jx-paper-2); color: var(--jx-ink-2); white-space: nowrap; }
.pill.high { background: var(--jx-bad-soft); color: var(--jx-bad); }
.pill.medium { background: var(--jx-gold-soft); color: color-mix(in srgb, var(--jx-gold) 70%, var(--jx-ink)); }
.pill.low { background: var(--jx-paper-2); color: var(--jx-muted); }
.pill.ok { background: var(--jx-ok-soft); color: var(--jx-ok); }
.pill.bad { background: var(--jx-bad-soft); color: var(--jx-bad); }
.pill.mark { background: var(--jx-mark-soft); color: var(--jx-mark); }
.pill.accent { background: var(--jx-accent-soft); color: var(--jx-accent-ink); }
.pill.easy { background: var(--jx-ok-soft); color: var(--jx-ok); }
.pill.hard { background: var(--jx-bad-soft); color: var(--jx-bad); }

.bar { height: 8px; border-radius: 99px; background: var(--jx-paper-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--jx-accent); width: 0; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.bar.ok > i { background: var(--jx-ok); }
.bar.gold > i { background: var(--jx-gold); }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer;
  text-decoration: none; transition: transform .12s ease, background .15s ease, box-shadow .15s ease; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--jx-accent); color: #fff; box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--jx-accent) 70%, transparent); position: relative; overflow: hidden; }
.btn-primary:hover { background: var(--jx-accent-ink); color: #fff; }
.btn-primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s ease; }
.btn-primary:hover::after { transform: translateX(120%); }
.btn-dark { background: var(--jx-ink); color: var(--jx-paper); }
.btn-dark:hover { color: var(--jx-paper); opacity: .92; }
.btn-ghost { background: var(--jx-surface); color: var(--jx-ink); border-color: var(--jx-line-2); }
.btn-ghost:hover { background: var(--jx-paper-2); color: var(--jx-ink); }
.btn-ok { background: var(--jx-ok); color: #fff; }
.btn-mark { background: var(--jx-mark); color: #fff; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .85rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn .arrow { transition: transform .2s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: .9rem; }
.field .help, .helptext { font-size: .8rem; color: var(--jx-muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--jx-line-2); background: var(--jx-surface);
  color: var(--jx-ink); font: inherit; transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--jx-accent); box-shadow: 0 0 0 4px var(--jx-accent-soft); }
.errorlist { list-style: none; padding: 0; margin: 4px 0 0; color: var(--jx-bad); font-size: .85rem; }
.form-errors { background: var(--jx-bad-soft); color: var(--jx-bad); padding: 10px 14px; border-radius: 12px; margin-bottom: 16px; font-size: .9rem; }
.helptext ul { margin: 4px 0 0; padding-left: 18px; }

.messages { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.messages li { padding: 12px 16px; border-radius: 12px; background: var(--jx-accent-soft); color: var(--jx-accent-ink); font-weight: 600; font-size: .92rem; }
.messages li.success { background: var(--jx-ok-soft); color: var(--jx-ok); }
.messages li.error { background: var(--jx-bad-soft); color: var(--jx-bad); }

.tabs { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--jx-paper-2); gap: 2px; flex-wrap: wrap; }
.tabs a, .tabs button { padding: 7px 14px; border-radius: 9px; font-weight: 600; font-size: .88rem; color: var(--jx-ink-2); text-decoration: none; border: 0; background: none; cursor: pointer; font-family: inherit; }
.tabs a.on, .tabs button.on { background: var(--jx-surface); color: var(--jx-ink); box-shadow: var(--jx-shadow); }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { background: var(--jx-ink); color: #eef0f7; padding: 48px clamp(24px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; position: relative; overflow: hidden; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth-side { background: #1a2140; } }
:root[data-theme="dark"] .auth-side { background: #1a2140; }
.auth-side .brand { color: #fff; }
.auth-side .brand-mark { background: #fff; color: #141a2e; }
.auth-side .brand small { color: #9aa1bb; }
.auth-side h1 { font-size: clamp(2rem, 3.6vw, 3.1rem); color: #fff; max-width: 16ch; }
.auth-side h1 em { font-style: normal; color: #9fb0ff; }
.auth-side p { color: #b9bfd4; max-width: 46ch; }
.auth-side::before { content: ""; position: absolute; width: 520px; height: 520px; right: -200px; top: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(111, 134, 255, .35), transparent 65%); }
.auth-main { display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: min(420px, 100%); }
.auth-card h2 { font-size: 1.8rem; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 520px; }
.facts div { border-top: 1px solid rgba(255, 255, 255, .15); padding-top: 10px; }
.facts b { font-family: var(--jx-display); font-size: 1.6rem; color: #fff; display: block; line-height: 1.2; }
.facts span { font-size: .8rem; color: #9aa1bb; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-side { padding: 28px 20px; } .auth-side .sheet { display: none; } }

/* ---------- signature: projected answer sheet ---------- */
.sheet { display: grid; gap: 10px; }
.sheet-sec { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; }
.sheet-sec > span { font-family: var(--jx-mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
.cells { display: grid; grid-template-columns: repeat(18, 1fr); gap: 4px; }
.cells i { aspect-ratio: 1; border-radius: 4px; background: color-mix(in srgb, currentColor 12%, transparent); transition: background .35s ease, transform .35s ease; }
.cells i.on { background: var(--sec, var(--jx-accent)); }
.cells i.on.pop { animation: pop .5s ease both; animation-delay: calc(var(--d, 0) * 18ms); }
.sheet-sec.s1 { --sec: var(--jx-s1); } .sheet-sec.s2 { --sec: var(--jx-s2); } .sheet-sec.s3 { --sec: var(--jx-s3); }
@keyframes pop { 0% { transform: scale(.4); opacity: .2; } 70% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
@media (max-width: 520px) { .sheet-sec { grid-template-columns: 1fr; gap: 4px; } .cells { grid-template-columns: repeat(12, 1fr); } }

/* ---------- dashboard ---------- */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; } }
.score-big { font-family: var(--jx-display); font-size: clamp(2.6rem, 6vw, 3.6rem); font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.score-big small { font-size: .4em; font-weight: 600; opacity: .6; }
.ring { --p: 0; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--jx-accent) calc(var(--p) * 1%), var(--jx-paper-2) 0); }
.ring span { width: 60px; height: 60px; border-radius: 50%; background: var(--jx-surface); display: grid; place-items: center; font-family: var(--jx-mono); font-weight: 700; font-size: .9rem; }
.subject-card h3 { margin: 0; }
.subject-card .meta { display: flex; justify-content: space-between; font-size: .85rem; color: var(--jx-muted); margin: 10px 0 8px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--jx-line); }
.list li:last-child { border-bottom: 0; }
.list a { font-weight: 600; text-decoration: none; color: var(--jx-ink); }
.list a:hover { color: var(--jx-accent); }

/* ---------- syllabus table ---------- */
.topic-table { width: 100%; border-collapse: collapse; }
.topic-table th, .topic-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--jx-line); vertical-align: middle; }
.topic-table th { font-family: var(--jx-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--jx-muted); font-weight: 600; }
.topic-table td a { font-weight: 650; color: var(--jx-ink); text-decoration: none; }
.topic-table td a:hover { color: var(--jx-accent); }
.topic-table tr:hover td { background: color-mix(in srgb, var(--jx-paper-2) 50%, transparent); }
@media (max-width: 720px) { .topic-table .hide-sm { display: none; } }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- notes (learn) ---------- */
.notes { font-size: 1.02rem; }
.notes h3 { margin-top: 1.6em; font-size: 1.2rem; }
.notes h4 { margin-top: 1.2em; font-size: 1.02rem; font-family: var(--jx-body); font-weight: 700; }
.notes ul, .notes ol { padding-left: 1.3em; }
.notes li { margin: .25em 0; }
.notes table, .rich table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .93rem; display: block; overflow-x: auto; }
.notes th, .notes td, .rich th, .rich td { border: 1px solid var(--jx-line); padding: 8px 10px; text-align: left; vertical-align: top; }
.notes th, .rich th { background: var(--jx-paper-2); font-weight: 700; }
.notes code, .rich code { font-family: var(--jx-mono); font-size: .88em; background: var(--jx-paper-2); padding: 1px 6px; border-radius: 5px; }
.tip { margin: 1em 0; padding: 12px 16px; border-radius: 12px; background: var(--jx-gold-soft); border-left: 4px solid var(--jx-gold); font-size: .95rem; }
.notes > :first-child { margin-top: 0; }
.toc-rail { position: sticky; top: 96px; }

/* ---------- practice question ---------- */
.qwrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; max-width: 900px; }
.qwrap.has-passage { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); max-width: none; }
@media (max-width: 1020px) { .qwrap, .qwrap.has-passage { grid-template-columns: 1fr; } }
.passage { max-height: calc(100vh - 140px); overflow: auto; position: sticky; top: 88px; }
.passage .rich { font-size: .98rem; }
.qhead { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.qtext { font-size: 1.08rem; line-height: 1.65; margin-bottom: 20px; }
.qtext .rich { overflow-wrap: anywhere; }
.options { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.opt {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left;
  padding: 12px 14px; min-height: 56px; border-radius: 14px; border: 1.5px solid var(--jx-line-2); background: var(--jx-surface);
  color: var(--jx-ink); font: inherit; cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.opt:hover:not([disabled]) { border-color: var(--jx-accent); background: var(--jx-accent-soft); }
.opt .l { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-family: var(--jx-mono); font-weight: 700; background: var(--jx-paper-2); color: var(--jx-ink-2); }
.opt.sel { border-color: var(--jx-accent); background: var(--jx-accent-soft); }
.opt.sel .l { background: var(--jx-accent); color: #fff; }
.opt.right { border-color: var(--jx-ok); background: var(--jx-ok-soft); }
.opt.right .l { background: var(--jx-ok); color: #fff; }
.opt.wrong { border-color: var(--jx-bad); background: var(--jx-bad-soft); }
.opt.wrong .l { background: var(--jx-bad); color: #fff; }
.opt[disabled] { cursor: default; }
.opt .tag { font-family: var(--jx-mono); font-size: .72rem; font-weight: 700; }
.typed { display: flex; gap: 10px; margin-top: 14px; }
.typed input { max-width: 260px; font-family: var(--jx-mono); }
.answer-bar { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.verdict { display: none; margin-top: 20px; border-radius: var(--jx-radius); padding: 18px 20px; border: 1px solid var(--jx-line); }
.verdict.show { display: block; animation: rise .35s ease both; }
.verdict.ok { background: var(--jx-ok-soft); border-color: color-mix(in srgb, var(--jx-ok) 40%, transparent); }
.verdict.bad { background: var(--jx-bad-soft); border-color: color-mix(in srgb, var(--jx-bad) 40%, transparent); }
.verdict h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.verdict.ok h3 { color: var(--jx-ok); } .verdict.bad h3 { color: var(--jx-bad); }
.explain { background: var(--jx-surface); border: 1px solid var(--jx-line); border-radius: 12px; padding: 14px 16px; margin-top: 12px; line-height: 1.75; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.timer { font-family: var(--jx-mono); font-weight: 700; font-size: .95rem; padding: 4px 10px; border-radius: 8px; background: var(--jx-paper-2); }

/* scratchpad */
.pad textarea { min-height: 160px; font-family: var(--jx-mono); font-size: .9rem; resize: vertical; line-height: 1.5; }
.pad canvas { width: 100%; height: 220px; border-radius: 12px; border: 1px dashed var(--jx-line-2); background: var(--jx-surface); touch-action: none; display: block; cursor: crosshair; }
.pad .tabs { margin-bottom: 10px; }

/* ---------- DI charts ---------- */
.di-table { min-width: 420px; }
.di-chart { width: 100%; height: auto; display: block; margin: 12px 0; font-family: var(--jx-body); }
.di-chart .grid { stroke: var(--jx-line); stroke-width: 1; }
.di-chart .axis { fill: var(--jx-muted); font-size: 12px; }
.di-chart .val { fill: var(--jx-ink); font-size: 11px; font-weight: 700; font-family: var(--jx-mono); }
.di-chart .bar.s1, .di-chart .dot.s1, .slice.s1, .sw.s1 { fill: var(--jx-s1); background: var(--jx-s1); }
.di-chart .bar.s2, .di-chart .dot.s2, .slice.s2, .sw.s2 { fill: var(--jx-s2); background: var(--jx-s2); }
.di-chart .bar.s3, .di-chart .dot.s3, .slice.s3, .sw.s3 { fill: var(--jx-s3); background: var(--jx-s3); }
.slice.s4, .sw.s4 { fill: var(--jx-s4); background: var(--jx-s4); }
.slice.s5, .sw.s5 { fill: var(--jx-s5); background: var(--jx-s5); }
.slice.s6, .sw.s6 { fill: var(--jx-s6); background: var(--jx-s6); }
.slice.s7, .sw.s7 { fill: var(--jx-s7); background: var(--jx-s7); }
.slice.s8, .sw.s8 { fill: var(--jx-s8); background: var(--jx-s8); }
.slice { stroke: var(--jx-surface); stroke-width: 2; }
.pie-val { fill: #fff; font-size: 13px; font-weight: 700; font-family: var(--jx-mono); }
.di-chart .line { fill: none; stroke-width: 2.5; }
.di-chart .line.s1 { stroke: var(--jx-s1); } .di-chart .line.s2 { stroke: var(--jx-s2); }
figure.pie { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
figure.pie svg { width: 240px; max-width: 100%; margin: 0; }
.pie-legend { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-size: .9rem; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.mono-line { font-family: var(--jx-mono); font-size: 1.02rem; letter-spacing: .08em; word-spacing: .1em; padding: 12px 14px; background: var(--jx-paper-2); border-radius: 10px; overflow-wrap: anywhere; }

/* ---------- mock exam UI ---------- */
.exam { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: auto auto 1fr auto; background: var(--jx-paper); }
.exam-top { display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: var(--jx-ink); color: #fff; flex-wrap: wrap; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .exam-top { background: #1d2440; } }
:root[data-theme="dark"] .exam-top { background: #1d2440; }
.exam-top .title { font-family: var(--jx-display); font-weight: 700; margin-right: auto; }
.clock { font-family: var(--jx-mono); font-weight: 700; font-size: 1.15rem; padding: 6px 14px; border-radius: 10px; background: rgba(255, 255, 255, .1); }
.clock.low { background: var(--jx-bad); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .65; } }
.sec-tabs { display: flex; gap: 6px; padding: 8px 18px; border-bottom: 1px solid var(--jx-line); background: var(--jx-surface); overflow-x: auto; }
.sec-tabs button { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--jx-line-2); background: var(--jx-surface); font: inherit; font-weight: 600; font-size: .86rem; cursor: pointer; white-space: nowrap; color: var(--jx-ink); }
.sec-tabs button.on { background: var(--jx-accent); border-color: var(--jx-accent); color: #fff; }
.sec-tabs button.locked { opacity: .45; cursor: not-allowed; }
.exam-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; overflow: hidden; }
.exam-q { overflow: auto; padding: 22px clamp(16px, 3vw, 36px); }
.exam-q .with-passage { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.exam-q .with-passage .passage { position: static; max-height: none; }
@media (max-width: 1100px) { .exam-q .with-passage { grid-template-columns: 1fr; } }
.exam-side { border-left: 1px solid var(--jx-line); background: var(--jx-surface); overflow: auto; padding: 16px; }
.palette { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 12px 0 16px; }
.palette button { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--jx-line-2); background: var(--jx-paper-2); font-family: var(--jx-mono); font-weight: 700; font-size: .85rem; cursor: pointer; color: var(--jx-ink); position: relative; }
.palette button.nv { background: var(--jx-paper-2); }
.palette button.na { background: var(--jx-bad); color: #fff; border-color: var(--jx-bad); clip-path: polygon(0 0, 100% 0, 100% 75%, 50% 100%, 0 75%); }
.palette button.an { background: var(--jx-ok); color: #fff; border-color: var(--jx-ok); clip-path: polygon(50% 0, 100% 25%, 100% 100%, 0 100%, 0 25%); }
.palette button.mk { background: var(--jx-mark); color: #fff; border-color: var(--jx-mark); border-radius: 50%; }
.palette button.am { background: var(--jx-mark); color: #fff; border-color: var(--jx-mark); border-radius: 50%; }
.palette button.am::after { content: ""; position: absolute; right: 2px; bottom: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--jx-ok); border: 2px solid var(--jx-surface); }
.palette button.cur { outline: 3px solid var(--jx-accent); outline-offset: 2px; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: .78rem; color: var(--jx-muted); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.exam-foot { display: flex; gap: 10px; padding: 10px 18px; border-top: 1px solid var(--jx-line); background: var(--jx-surface); flex-wrap: wrap; align-items: center; }
.exam-foot .spacer { flex: 1; }
.palette-toggle { display: none; }
@media (max-width: 860px) {
  .exam-body { grid-template-columns: 1fr; }
  .exam-side { position: fixed; right: 0; top: 0; bottom: 0; width: min(320px, 88vw); z-index: 70; transform: translateX(100%); transition: transform .25s ease; box-shadow: var(--jx-shadow-lg); }
  .exam-side.open { transform: none; }
  .palette-toggle { display: inline-flex; }
}
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(10, 13, 24, .55); display: none; place-items: center; padding: 16px; }
.modal.open { display: grid; }
.modal .card { width: min(520px, 100%); }
.summary-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 12px 0; }
.summary-table th, .summary-table td { padding: 8px; border-bottom: 1px solid var(--jx-line); text-align: center; }
.summary-table th:first-child, .summary-table td:first-child { text-align: left; }

/* ---------- results ---------- */
.result-hero { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
@media (max-width: 720px) { .result-hero { grid-template-columns: 1fr; } }
.sol { border-left: 4px solid var(--jx-line-2); }
.sol.right { border-left-color: var(--jx-ok); } .sol.wrong { border-left-color: var(--jx-bad); } .sol.blank { border-left-color: var(--jx-muted); }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--jx-muted); }
.empty svg { width: 64px; height: 64px; margin-bottom: 12px; opacity: .6; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--jx-line-2); background: var(--jx-surface); font-size: .85rem; font-weight: 600; color: var(--jx-ink-2); text-decoration: none; cursor: pointer; }
.chip:hover { border-color: var(--jx-accent); color: var(--jx-accent); }
.chip input { accent-color: var(--jx-accent); }
.chip.on { background: var(--jx-accent-soft); border-color: var(--jx-accent); color: var(--jx-accent-ink); }
.site-foot { border-top: 1px solid var(--jx-line); padding: 24px 0 110px; color: var(--jx-muted); font-size: .85rem; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.theme-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--jx-line); background: var(--jx-surface); color: var(--jx-ink); cursor: pointer; display: grid; place-items: center; }
details.acc { border: 1px solid var(--jx-line); border-radius: 14px; background: var(--jx-surface); padding: 0 18px; }
details.acc + details.acc { margin-top: 10px; }
details.acc summary { cursor: pointer; padding: 14px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary::after { content: "+"; font-family: var(--jx-mono); color: var(--jx-muted); }
details.acc[open] summary::after { content: "−"; }
details.acc > div { padding-bottom: 16px; }
.week { display: grid; grid-template-columns: 90px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--jx-line); }
.week:last-child { border-bottom: 0; }
.week b { font-family: var(--jx-mono); font-size: .8rem; color: var(--jx-accent); }

/* reveal on scroll (content stays visible without JS) */
.js .reveal { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; transition-delay: calc(var(--i, 0) * 60ms); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}
@media print { .topbar, .bottom-nav, .site-foot, .pad, .answer-bar { display: none !important; } body { background: #fff; } .card { box-shadow: none; } }
