/* CrackIt.me — design system
   Light, calm, premium. One accent. System fonts (no downloads). */

:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --surface-2: #f5f5f3;
  --text: #16151a;
  --text-2: #57565e;
  --text-3: #8a8992;
  --line: #e9e8e4;
  --line-2: #dddcd6;
  --accent: #4338ca;
  --accent-hover: #3730a3;
  --accent-soft: #eef0fd;
  --accent-text: #3730a3;
  --good: #15803d;
  --good-soft: #e9f7ee;
  --bad: #c2410c;
  --bad-soft: #fdf0e8;
  --warn: #a16207;
  --warn-soft: #fdf6e3;
  --gold: #a16207;
  --shadow-sm: 0 1px 2px rgba(22, 21, 26, .05);
  --shadow: 0 1px 2px rgba(22, 21, 26, .04), 0 4px 16px rgba(22, 21, 26, .05);
  --shadow-lg: 0 2px 4px rgba(22, 21, 26, .04), 0 16px 40px rgba(22, 21, 26, .08);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans Bengali", "Noto Sans Devanagari", sans-serif;
  --font-display: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  --wrap: 1120px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #111114; --surface: #18181c; --surface-2: #1f1f24; --text: #f2f2f4; --text-2: #b0afb8; --text-3: #7d7c86;
  --line: #29292f; --line-2: #34343b; --accent: #8b8cf8; --accent-hover: #a5a6fb; --accent-soft: #23234a; --accent-text: #b4b5fc;
  --good: #4ade80; --good-soft: #14291c; --bad: #fb923c; --bad-soft: #2e1d12; --warn: #facc15; --warn-soft: #2a2410; --gold: #facc15;
  --shadow-sm: none; --shadow: 0 1px 0 rgba(255,255,255,.03); --shadow-lg: 0 20px 40px rgba(0,0,0,.4);
  color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.2; letter-spacing: -0.02em; font-weight: 650; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); color: var(--accent-text); }
.i { width: 18px; height: 18px; flex: none; }
.i-sm { width: 15px; height: 15px; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 99; }
.skip:focus { left: 8px; }

/* ── Layout ───────────────────────────────────────────────────────────── */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.wrap-sm { max-width: 760px; }
.wrap-xs { max-width: 440px; }
.section { padding: 72px 0; }
.section-sm { padding: 40px 0; }
.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.center { text-align: center; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; } .mt-12 { margin-top: 48px; }
.hide-sm { } @media (max-width: 720px) { .hide-sm { display: none !important; } }
.show-sm { display: none !important; } @media (max-width: 720px) { .show-sm { display: initial !important; } }
.show-md { display: none !important; } @media (max-width: 960px) { .show-md { display: inline-flex !important; } }

/* ── Type ─────────────────────────────────────────────────────────────── */
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--accent-text); }
.display { font-size: clamp(36px, 6vw, 60px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; }
.h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 680; letter-spacing: -0.03em; }
.h2 { font-size: clamp(22px, 3vw, 28px); font-weight: 650; }
.h3 { font-size: 18px; font-weight: 620; letter-spacing: -0.01em; }
.lead { font-size: clamp(17px, 2vw, 19px); color: var(--text-2); line-height: 1.55; }
.prose { color: var(--text); font-size: 17px; line-height: 1.75; }
.prose h2 { font-size: 24px; margin: 40px 0 12px; }
.prose h3 { font-size: 19px; margin: 32px 0 10px; }
.prose p, .prose ul, .prose ol, .prose table, .prose blockquote, .prose pre { margin: 0 0 18px; }
.prose a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.prose img { border-radius: var(--r); margin: 24px 0; }
.prose blockquote { border-left: 3px solid var(--accent); padding: 4px 0 4px 18px; color: var(--text-2); }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.prose th { color: var(--text-2); font-weight: 600; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px;
  border-radius: 10px; border: 1px solid transparent; font-size: 15px; font-weight: 560; cursor: pointer;
  white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .05s; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(67, 56, 202, .25), inset 0 1px 0 rgba(255,255,255,.12); }
:root[data-theme="dark"] .btn-primary { color: #0f0f1a; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); border-color: var(--line-2); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--text-3); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--surface); border-color: var(--line-2); color: var(--bad); }
.btn-danger:hover { border-color: var(--bad); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.link { color: var(--accent-text); font-weight: 560; display: inline-flex; align-items: center; gap: 6px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; color: var(--text-2); background: transparent; border: 0; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ── Header ───────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header .wrap { height: 64px; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--text); color: var(--bg); display: grid; place-items: center; font-size: 15px; font-weight: 800; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: 8px; font-size: 15px; color: var(--text-2); font-weight: 500; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--text); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; }
.mobile-nav { display: none; }
@media (max-width: 820px) {
  .nav, .header-actions .hide-m { display: none; }
  .menu-btn { display: inline-grid; }
  .mobile-nav.is-open { display: block; position: fixed; inset: 64px 0 0; background: var(--bg); z-index: 45; padding: 12px 20px 32px; overflow-y: auto; }
  .mobile-nav a { display: block; padding: 14px 4px; font-size: 18px; font-weight: 550; border-bottom: 1px solid var(--line); }
  .mobile-nav .btn { display: flex; margin-top: 16px; border-bottom: 0; font-size: 16px; }
}
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font-weight: 650; font-size: 14px; }
.badge-pro { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; padding: 2px 8px; border-radius: 99px; background: var(--warn-soft); color: var(--gold); }

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 40px; margin-top: 64px; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.footer-grid h4 { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 12px; letter-spacing: 0; }
.footer-grid a { display: block; color: var(--text-2); padding: 4px 0; }
.footer-grid a:hover { color: var(--text); }
.footer-base { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--text-3); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ── Cards ────────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-sm); }
.card-tight { padding: 16px 18px; }
.card-link { transition: border-color .15s, box-shadow .15s, transform .15s; }
a.card-link:not(.row):not(.row-between) { display: block; }
.card-link:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.panel-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.divided > * + * { border-top: 1px solid var(--line); }

/* Exam marks (logos / monograms) */
.mark { width: 44px; height: 44px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; flex: none; overflow: hidden; }
.mark img { width: 34px; height: 34px; object-fit: contain; }
.mark-lg { width: 64px; height: 64px; border-radius: 16px; }
.mark-lg img { width: 50px; height: 50px; }
.mark-mono { font-weight: 750; font-size: 14px; letter-spacing: -0.02em; color: var(--accent-text); background: var(--accent-soft); border-color: transparent; }
.mark-mono[data-cat="ssc"] { color: #1d4ed8; background: #eaf1fe; }
.mark-mono[data-cat="banking"] { color: #15803d; background: #e9f7ee; }
.mark-mono[data-cat="railways"] { color: #6d28d9; background: #f2edfd; }
.mark-mono[data-cat="police"] { color: #b91c1c; background: #fdeeee; }
.mark-mono[data-cat="teaching"] { color: #a16207; background: #fdf6e3; }

/* Pills, chips, tags */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 560; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.tag-free { background: var(--good-soft); color: var(--good); }
.tag-pro { background: var(--warn-soft); color: var(--gold); }
.tag-accent { background: var(--accent-soft); color: var(--accent-text); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line-2); font-size: 14px; font-weight: 520; color: var(--text-2); background: var(--surface); cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--text-3); }
.chip[aria-current="true"], .chip.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }

/* ── Forms ────────────────────────────────────────────────────────────── */
.field { display: block; }
.field + .field { margin-top: 16px; }
.label { display: block; font-size: 14px; font-weight: 560; margin-bottom: 6px; }
.hint { font-size: 13px; color: var(--text-3); margin-top: 6px; }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text); font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 120px; padding: 12px 14px; line-height: 1.55; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.search { position: relative; }
.search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 42px; height: 48px; border-radius: 12px; font-size: 16px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.otp { letter-spacing: .5em; text-align: center; font-family: var(--mono); font-size: 22px; height: 54px; }

/* ── Alerts / toasts ──────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 14.5px; border: 1px solid var(--line); background: var(--surface); display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: var(--good-soft); border-color: transparent; color: var(--good); }
.alert-error { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.alert-info { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.flash-stack { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(92vw, 460px); }
.flash-stack .alert { box-shadow: var(--shadow-lg); animation: drop .25s ease-out; }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }
.form-error { display: none; }
.form-error.is-visible { display: flex; }

/* ── Breadcrumb ───────────────────────────────────────────────────────── */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--text-3); }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--text); }
.crumbs span[aria-current] { color: var(--text); font-weight: 520; }

/* ── Home ─────────────────────────────────────────────────────────────── */
.hero { padding: 72px 0 40px; text-align: center; }
.hero .lead { max-width: 560px; margin: 20px auto 0; }
.hero-actions { margin-top: 32px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-proof { margin-top: 28px; display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; font-size: 14px; color: var(--text-2); }
.hero-proof span { display: inline-flex; gap: 7px; align-items: center; }
.hero-proof .i-sm { color: var(--good); }
.exam-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 200px), 1fr)); gap: 12px; }
.exam-tile { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, box-shadow .15s; }
.exam-tile:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.exam-tile b { display: block; font-weight: 600; font-size: 15px; line-height: 1.3; }
.exam-tile small { color: var(--text-3); font-size: 13px; }
@media (max-width: 520px) { .exam-tile { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; } }
.feature { display: flex; flex-direction: column; gap: 10px; }
.feature-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; }
.steps { counter-reset: s; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.step { counter-increment: s; }
.step::before { content: counter(s); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--text); color: var(--bg); font-size: 13px; font-weight: 700; margin-bottom: 14px; }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; font-weight: 580; font-size: 16.5px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-3); font-size: 22px; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin-top: 10px; color: var(--text-2); }
.cta-band { border-radius: 24px; background: var(--text); color: var(--bg); padding: 56px 32px; text-align: center; }
.cta-band .lead { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.cta-band .btn-primary { background: var(--bg); color: var(--text); box-shadow: none; }
.cta-band .btn-primary:hover { background: color-mix(in srgb, var(--bg) 88%, var(--text)); }

/* ── Test list rows ───────────────────────────────────────────────────── */
.test-row { display: flex; align-items: center; gap: 16px; padding: 18px 20px; }
.test-row:hover { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.test-row .meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13.5px; color: var(--text-3); margin-top: 4px; }
.test-row .meta span { display: inline-flex; align-items: center; gap: 5px; }
.test-row .grow { flex: 1; min-width: 0; }
.test-row .title { font-weight: 580; font-size: 16px; }
@media (max-width: 560px) { .test-row { flex-wrap: wrap; } .test-row .btn { width: 100%; } }

/* ── Stats ────────────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 88px), 1fr)); gap: 10px; flex-basis: 100%; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.stat b { display: block; font-size: 26px; font-weight: 680; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--text-3); }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: flex; }
.bar > i { display: block; height: 100%; }
.bar .g { background: var(--good); } .bar .b { background: var(--bad); } .bar .s { background: var(--line-2); }
.ring { --p: 0; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring > div { width: 110px; height: 110px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; }
.ring b { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; display: block; line-height: 1.1; }

/* ── Empty state ──────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 56px 24px; }
.empty .feature-icon { margin: 0 auto 16px; }

/* ── Pricing ──────────────────────────────────────────────────────────── */
.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); max-width: 940px; margin: 0 auto; }
.plan { position: relative; display: flex; flex-direction: column; }
.plan.is-best { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-lg); }
.plan .price { font-size: 40px; font-weight: 720; letter-spacing: -0.03em; }
.plan ul { list-style: none; padding: 0; margin: 20px 0 24px; display: grid; gap: 10px; font-size: 15px; flex: 1; }
.plan li { display: flex; gap: 10px; }
.plan li .i-sm { color: var(--good); margin-top: 4px; }
.plan-flag { position: absolute; top: -12px; left: 24px; }

/* ── Auth ─────────────────────────────────────────────────────────────── */
.auth { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 40px 20px; }
.auth .card { width: 100%; max-width: 420px; padding: 32px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 13px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ── Test-taking (focus layout) ───────────────────────────────────────── */
.focus-bar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.focus-bar .wrap { height: 60px; display: flex; align-items: center; gap: 16px; max-width: 1280px; }
.focus-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.timer { margin-left: auto; font-family: var(--mono); font-size: 17px; font-weight: 650; padding: 6px 12px; border-radius: 9px; background: var(--surface-2); font-variant-numeric: tabular-nums; display: inline-flex; gap: 8px; align-items: center; }
.timer.is-low { background: var(--bad-soft); color: var(--bad); }
.exam { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; max-width: 1280px; margin: 0 auto; padding: 24px 20px 120px; }
@media (max-width: 960px) { .exam { grid-template-columns: minmax(0, 1fr); } .palette-panel { display: none; } .palette-panel.is-open { display: block; position: fixed; inset: 60px 0 0; z-index: 35; background: var(--bg); padding: 20px; overflow-y: auto; } }
.q-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.q-text { font-size: 18px; line-height: 1.65; white-space: pre-line; }
.q-text img { margin: 12px 0; border-radius: 8px; }
.options { margin-top: 24px; display: grid; gap: 10px; }
.option { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; text-align: left; width: 100%; font-size: 16px; line-height: 1.5; transition: border-color .12s, background .12s; }
.option:hover { border-color: var(--text-3); }
.option .key { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 13px; font-weight: 650; color: var(--text-2); }
.option[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.option[aria-pressed="true"] .key { background: var(--accent); border-color: var(--accent); color: #fff; }
.option.is-correct { border-color: var(--good); background: var(--good-soft); }
.option.is-correct .key { background: var(--good); border-color: var(--good); color: #fff; }
.option.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.option.is-wrong .key { background: var(--bad); border-color: var(--bad); color: #fff; }
.exam-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); }
.exam-nav .wrap { max-width: 1280px; height: 72px; display: flex; align-items: center; gap: 10px; }
.exam-nav .spacer { flex: 1; }
@media (max-width: 560px) { .exam-nav .btn { padding: 0 12px; } .exam-nav .lbl { display: none; } }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 8px; }
.pal { height: 40px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); font-size: 14px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; position: relative; }
.pal.is-answered { background: var(--good); border-color: var(--good); color: #fff; }
.pal.is-marked { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.pal.is-marked.is-answered::after { content: ""; position: absolute; right: 3px; bottom: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--good); border: 1.5px solid #fff; }
.pal.is-visited:not(.is-answered):not(.is-marked) { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.pal.is-current { outline: 2px solid var(--text); outline-offset: 2px; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; font-size: 13px; color: var(--text-2); margin-top: 18px; }
.legend span { display: flex; gap: 8px; align-items: center; }
.legend i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line-2); flex: none; }
.modal { position: fixed; inset: 0; z-index: 70; display: none; place-items: center; padding: 20px; background: rgba(15, 15, 20, .45); }
.modal.is-open { display: grid; }
.modal .card { width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); }

/* ── Results / review ─────────────────────────────────────────────────── */
.result-hero { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
@media (max-width: 640px) { .result-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.review-q { padding: 22px 24px; }
.review-q .explain { margin-top: 16px; padding: 14px 16px; border-radius: 10px; background: var(--surface-2); font-size: 15px; color: var(--text-2); white-space: pre-line; }
.review-q .options { margin-top: 16px; }
.review-q .option { cursor: default; padding: 10px 14px; font-size: 15px; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-weight: 560; color: var(--text-3); font-size: 13px; padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

/* ── Admin ────────────────────────────────────────────────────────────── */
.admin { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.admin-side { border-right: 1px solid var(--line); padding: 20px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); }
.admin-side a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; color: var(--text-2); font-size: 14.5px; font-weight: 500; }
.admin-side a:hover { background: var(--surface-2); color: var(--text); }
.admin-side a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
.admin-main { padding: 28px 32px 64px; min-width: 0; }
.admin-top { display: none; }
@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .admin-side { display: none; position: fixed; inset: 0; z-index: 50; height: auto; }
  .admin-side.is-open { display: block; }
  .admin-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
  .admin-main { padding: 20px 16px 48px; }
}
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pager { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 14px 16px; font-size: 14px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer, .exam-nav, .focus-bar, .btn { display: none !important; } body { background: #fff; } }
.qfig { display: block; max-width: 100%; height: auto; margin: 10px 0; }
.option .qfig { margin: 0; max-height: 90px; }

/* Mock test cards (whole card is the link; the button is a visual cue) */
.mc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.mc { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s; }
.mc:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.mc:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.mc-top { display: flex; align-items: center; gap: 8px; }
.mc-stage { font-size: 12px; font-weight: 600; color: var(--text-2); padding: 2px 8px; border-radius: 99px; background: var(--surface-2); }
.mc-title { margin: 0; font-size: 16.5px; line-height: 1.3; font-weight: 650; }
.mc-link { color: var(--text); text-decoration: none; }
.mc-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }   /* stretched link: whole card clickable */
.mc-link:focus-visible { outline: none; }
.mc-basis { margin: -4px 0 0; font-size: 13px; color: var(--text-3); }
.mc-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--text-2); }
.mc-stats li { display: inline-flex; align-items: center; gap: 5px; }
.mc-foot { margin-top: auto; padding-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mc-done { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--good); }
.mc-cta { pointer-events: none; }
.mc-locked { opacity: .92; }
@media (prefers-reduced-motion: reduce) { .mc, .mc:hover { transition: none; transform: none; } }

/* 7-item main menu: one line, tighter on mid-size screens, menu button below 1080px */
.nav a { white-space: nowrap; }
@media (max-width: 1240px) { .nav { gap: 0; } .nav a { padding: 8px 9px; font-size: 14.5px; } }
@media (max-width: 1080px) { .site-header .nav { display: none; } .site-header .menu-btn { display: inline-grid; } }
@media (min-width: 821px) and (max-width: 1080px) {
  .mobile-nav.is-open { display: block; position: fixed; inset: 64px 0 0; background: var(--bg); z-index: 45; padding: 12px 20px 32px; overflow-y: auto; }
  .mobile-nav a { display: block; padding: 14px 4px; font-size: 18px; font-weight: 550; border-bottom: 1px solid var(--line); }
}
