/* ExamEdge Pro — main stylesheet (no frameworks, fast on mobile) */
:root {
  --brand: #3b2bd6;
  --brand-dark: #2a1fa3;
  --brand-soft: #eeecff;
  --accent: #ff8a1f;
  --accent-dark: #e8740a;
  --ink: #16142b;
  --ink-2: #4a4864;
  --muted: #6e6c86;
  --line: #e4e2f0;
  --bg: #ffffff;
  --bg-alt: #f7f6fc;
  --ok: #138a4b;
  --ok-soft: #e5f6ec;
  --bad: #c8312f;
  --bad-soft: #fde9e8;
  --review: #7b3fd1;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22, 20, 43, .05), 0 6px 20px rgba(22, 20, 43, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Nirmala UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.6; font-size: 16px; }
img { max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); margin-top: 1.4em; }
h3, .h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
code { background: var(--bg-alt); padding: .1em .35em; border-radius: 5px; font-size: .9em; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 820px; }
.section { padding: 40px 16px; }
.wrap.section { padding-left: 16px; padding-right: 16px; }
.section.alt { background: var(--bg-alt); }
.section-title { text-align: center; margin: 0 0 1.2em; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.mt { margin-top: 1.5em; }
.lead { font-size: 1.12rem; color: var(--ink-2); }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; border: 1px solid var(--brand); background: var(--brand); color: #fff; padding: .7em 1.2em; border-radius: 10px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s, transform .05s; line-height: 1.2; }
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: .5em .9em; font-size: .92rem; }
.btn-lg { padding: .9em 1.5em; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-soft); color: var(--brand-dark); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #1d1200; }
.btn-accent:hover { background: var(--accent-dark); color: #1d1200; }
.btn-review { background: var(--review); border-color: var(--review); }
.btn-review:hover { background: #6430b3; }
.btn-danger { background: var(--bad); border-color: var(--bad); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 1.2em 0; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .95); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 62px; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; }
.logo b { color: var(--accent); }
.logo-light { color: #fff; }
.site-nav { display: flex; align-items: center; gap: 18px; }
.site-nav > a { color: var(--ink-2); text-decoration: none; font-weight: 500; }
.site-nav > a:hover { color: var(--brand); }
.site-nav > a.btn { color: #fff; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; }
.lang-switch { position: relative; }
.lang-switch summary { list-style: none; cursor: pointer; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; white-space: nowrap; }
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch > div { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 150px; padding: 6px; z-index: 60; }
.lang-switch > div a { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); }
.lang-switch > div a:hover, .lang-switch > div a[aria-current] { background: var(--brand-soft); }
@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 62px; background: #fff; flex-direction: column; align-items: stretch; padding: 12px 16px 20px; gap: 6px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .site-nav.open { display: flex; }
  .site-nav > a { padding: 10px 4px; }
  .lang-switch > div { position: static; box-shadow: none; margin-top: 6px; }
}

/* Alerts */
.alert { padding: 12px 16px; border-radius: 10px; margin: 16px 0; border: 1px solid transparent; }
.alert-success { background: var(--ok-soft); border-color: #bfe6cf; color: #0d5c33; }
.alert-error { background: var(--bad-soft); border-color: #f6c6c3; color: #8f1f1d; }
.alert-info { background: var(--brand-soft); border-color: #d6d1ff; color: #2a1fa3; }

/* Cards & grids */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-2 > .card, .grid-3 > .card, .grid-4 > .card { margin-bottom: 0; }
.grid-2 + .card, .grid-3 + .card, .grid-4 + .grid-2, .grid-4 + .card { margin-top: 16px; }

/* Hero */
.hero { background: radial-gradient(1200px 400px at 80% -10%, #e2ddff 0, transparent 60%), linear-gradient(180deg, #f7f6ff, #fff); padding: 48px 0 32px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.eyebrow { display: inline-block; background: #fff3e6; color: #a04f00; font-weight: 700; font-size: .85rem; padding: 4px 10px; border-radius: 999px; margin-bottom: 14px; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); }
.hero-points { list-style: none; padding: 0; margin: 18px 0 0; color: var(--ink-2); }
.hero-points li { padding-left: 26px; position: relative; margin: 6px 0; }
.hero-points li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.hero-card { background: #fff; border-radius: 18px; box-shadow: 0 20px 60px rgba(59, 43, 214, .18); padding: 22px; border: 1px solid var(--line); transform: rotate(1deg); }
.mock-q-top, .mock-q-bottom { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--bad); }
.mock-opts { padding: 0; list-style: none; margin: 10px 0 14px; display: grid; gap: 8px; counter-reset: o; }
.mock-opts li { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; counter-increment: o; }
.mock-opts li::before { content: counter(o, upper-alpha) ". "; font-weight: 700; color: var(--muted); }
.mock-opts li.sel { border-color: var(--ok); background: var(--ok-soft); }
.ok { color: var(--ok); font-weight: 700; }
@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; } .hero-card { transform: none; } }

.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: -8px; }
.stats-strip > div { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 8px; }
.stats-strip b { display: block; font-size: 1.4rem; color: var(--brand); }
.stats-strip span { color: var(--muted); font-size: .9rem; }
@media (max-width: 640px) { .stats-strip { grid-template-columns: repeat(2, 1fr); } }

.feature-icon { font-size: 1.8rem; margin-bottom: 6px; }
.feature p { color: var(--ink-2); margin: 0; }
.subject-card { border-top: 4px solid var(--brand); }
.subject-physics { border-top-color: #3b82f6; }
.subject-chemistry { border-top-color: #10b981; }
.subject-mathematics { border-top-color: #f59e0b; }
.subject-card h2 a, .subject-card h3 a { color: var(--ink); text-decoration: none; }
.chip-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.chip-list a { display: inline-block; font-size: .85rem; padding: 4px 10px; border-radius: 999px; background: var(--bg-alt); color: var(--ink-2); text-decoration: none; border: 1px solid var(--line); }
.chip-list a:hover { border-color: var(--brand); color: var(--brand); }
.link-arrow { font-weight: 600; text-decoration: none; }
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; counter-reset: s; }
.steps li { counter-increment: s; background: var(--bg-alt); border-radius: var(--radius); padding: 20px 20px 20px 70px; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 20px; top: 18px; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.steps b { display: block; }
.steps span { color: var(--ink-2); }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 0 16px; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; }
.faq details p { color: var(--ink-2); }
.cta-band { text-align: center; background: linear-gradient(135deg, var(--brand), #6a4cff); color: #fff; border-radius: 20px; margin: 40px auto; padding: 40px 20px !important; }
.cta-band p { opacity: .9; }

/* Breadcrumbs, lists, tables */
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.list { list-style: none; padding: 0; margin: 0 0 14px; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list.compact li { padding: 5px 0; font-size: .95rem; }
.list a { text-decoration: none; }
.list-bullets { padding-left: 1.2em; }
.list-bullets li { margin: 6px 0; }
.table-wrap { overflow-x: auto; margin-bottom: 16px; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table thead th { background: var(--bg-alt); font-weight: 600; color: var(--ink-2); }
.row-muted { opacity: .55; }
.toc { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.toc a { padding: 6px 12px; border-radius: 999px; background: var(--brand-soft); text-decoration: none; font-weight: 600; }

/* Chips & badges */
.chip { display: inline-block; font-size: .78rem; padding: 2px 9px; border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; }
.chip-easy { background: var(--ok-soft); color: var(--ok); border-color: #c4ead4; }
.chip-medium { background: #fff6e5; color: #9a5b00; border-color: #fde2b5; }
.chip-hard { background: var(--bad-soft); color: var(--bad); border-color: #f6c6c3; }
.chip-state-correct { background: var(--ok-soft); color: var(--ok); }
.chip-state-wrong { background: var(--bad-soft); color: var(--bad); }
.badge { display: inline-block; font-size: .78rem; padding: 3px 10px; border-radius: 999px; background: var(--bg-alt); font-weight: 700; }
.badge-premium { background: linear-gradient(135deg, #ffcf6b, var(--accent)); color: #3b2200; }
.badge-free { background: var(--ok-soft); color: var(--ok); }

/* Forms */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
.form small { font-weight: 400; color: var(--muted); }
input, select, textarea { font: inherit; padding: .65em .8em; border: 1px solid #cfcce0; border-radius: 10px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
input[type=checkbox], input[type=radio] { width: auto; }
label.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; }
label.check input { margin-top: 4px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.inline-form label { display: grid; gap: 4px; font-weight: 600; }
.inline-form select, .inline-form input { width: auto; min-width: 140px; }
.inline-form.tight { gap: 4px; margin: 2px 0; }
.inline-form.tight select { min-width: 0; padding: .35em; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.auth { display: flex; justify-content: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-links { text-align: center; margin: 10px 0 0; font-size: .95rem; }
.lang-fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 12px; }
.lang-fieldset legend { font-weight: 700; padding: 0 6px; }

/* Dashboard */
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.kpis { margin-bottom: 16px; }
.kpi span { display: block; color: var(--muted); font-size: .88rem; font-weight: 600; }
.kpi b { display: block; font-size: 1.7rem; margin: 4px 0 2px; }
.kpi b small { font-size: 1rem; color: var(--muted); }
.kpi small { color: var(--muted); }
.kpi-main b { color: var(--brand); font-size: 2.2rem; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 48px; align-items: center; gap: 10px; margin: 10px 0; font-size: .95rem; }
.bar { height: 10px; background: var(--bg-alt); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #7c66ff); border-radius: 999px; }

/* Chapter page */
.chapter-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.side-list { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; }
@media (max-width: 960px) { .chapter-layout { grid-template-columns: 1fr; } .side-list { position: static; max-height: none; } }
.chapter-card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.chapter-card:hover { border-color: var(--brand); transform: translateY(-2px); color: var(--ink); }
.start-card { background: var(--brand-soft); border-color: #d9d4ff; }
.q-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.q-body { font-size: 1.05rem; margin-bottom: 12px; overflow-x: auto; }
.q-img { display: block; margin: 10px 0; border-radius: 8px; border: 1px solid var(--line); }
.opts-static { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.opts-static li { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.opts-static li.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.opts-static li.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt-key { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-alt); font-weight: 700; font-size: .85rem; border: 1px solid var(--line); }
.your { margin-left: auto; font-size: .8rem; color: var(--muted); }
.solution { background: var(--bg-alt); border-radius: 10px; padding: 10px 14px; }
.solution summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.solution[open] summary { margin-bottom: 8px; }
.review-correct { border-left: 4px solid var(--ok); }
.review-wrong { border-left: 4px solid var(--bad); }
.review-unattempted { border-left: 4px solid #b9b6cc; }
.filter-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-left: auto; }
.filter-tabs button { background: #fff; border: 0; padding: .5em .9em; font: inherit; cursor: pointer; color: var(--ink-2); }
.filter-tabs button.on { background: var(--brand); color: #fff; }

/* Mocks & pricing */
.mock-card-top { margin-bottom: 8px; }
.mock-facts { list-style: none; padding: 0; margin: 0 0 14px; color: var(--ink-2); }
.mock-facts li { margin: 4px 0; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 24px 0; align-items: stretch; }
.plan { display: flex; flex-direction: column; position: relative; margin: 0; }
.plan .ticks { flex: 1; }
.plan-featured { border: 2px solid var(--brand); box-shadow: 0 16px 40px rgba(59, 43, 214, .15); }
.plan-badge { position: absolute; top: -12px; left: 20px; background: var(--accent); color: #2b1600; font-weight: 800; font-size: .78rem; padding: 3px 10px; border-radius: 999px; }
.price { font-size: 2rem; font-weight: 800; }
.price small { font-size: .95rem; color: var(--muted); font-weight: 500; }
.ticks { list-style: none; padding: 0; margin: 14px 0 18px; }
.ticks li { padding-left: 24px; position: relative; margin: 8px 0; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }

/* Legal */
.legal h2 { font-size: 1.2rem; }
.legal ul { padding-left: 1.2em; }

/* Admin */
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.admin-nav a { padding: 6px 12px; border-radius: 8px; background: var(--bg-alt); text-decoration: none; font-weight: 600; font-size: .92rem; }
.admin-nav a[aria-current] { background: var(--brand); color: #fff; }
.pager { display: flex; flex-wrap: wrap; gap: 4px; }
.pager a { padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; }
.pager a[aria-current] { background: var(--brand); color: #fff; }

/* Footer */
.site-footer { background: #13112a; color: #c9c7dd; margin-top: 40px; padding: 40px 0 20px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.footer-grid h3 { color: #fff; font-size: 1rem; }
.footer-grid a { display: block; color: #c9c7dd; text-decoration: none; margin: 6px 0; font-size: .95rem; }
.footer-grid a:hover { color: #fff; }
.footer-grid .logo { margin-bottom: 8px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; border-top: 1px solid #2b2848; margin-top: 24px; padding-top: 16px; font-size: .85rem; color: #918eab; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div:first-child { grid-column: 1 / -1; } }

/* ===== Test (CBT) screen ===== */
.cbt-body { background: var(--bg-alt); }
.cbt { min-height: 100vh; display: flex; flex-direction: column; }
.cbt-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--brand); color: #fff; }
.cbt-title { display: flex; flex-direction: column; min-width: 0; }
.cbt-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cbt-title small { opacity: .85; }
.cbt-timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.25rem; background: rgba(255, 255, 255, .15); padding: 4px 12px; border-radius: 8px; }
.cbt-timer.low { background: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .7; } }
.cbt-bar-actions { display: flex; gap: 8px; align-items: center; }
.cbt-bar .lang-switch summary { border-color: rgba(255, 255, 255, .4); color: #fff; }
.cbt-main { flex: 1; display: grid; grid-template-columns: 1fr 320px; gap: 16px; padding: 16px; max-width: 1300px; width: 100%; margin: 0 auto; }
.cbt-area { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; min-height: 60vh; }
.cbt-q { flex: 1; }
.cbt-q-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 14px; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: border-color .12s, background .12s; }
.opt:hover { border-color: #b8b1f5; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.opt:has(input:checked) .opt-key { background: var(--brand); color: #fff; border-color: var(--brand); }
.opt:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.num-answer { display: grid; gap: 8px; max-width: 320px; font-weight: 600; }
.num-answer input { font-size: 1.2rem; }
.cbt-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 18px; }
.cbt-actions [data-act=prev] { margin-right: auto; }
.cbt-palette { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; align-self: start; position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; }
.cbt-palette h3 { font-size: .95rem; margin: 14px 0 8px; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: .8rem; color: var(--ink-2); }
.legend span { display: flex; align-items: center; gap: 6px; }
.st { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid #c9c6da; }
.st-answered { background: var(--ok); border-color: var(--ok); }
.st-notanswered { background: var(--bad); border-color: var(--bad); }
.st-notvisited { background: #fff; }
.st-review { background: var(--review); border-color: var(--review); border-radius: 50%; }
.pal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.pal { height: 38px; border-radius: 8px; border: 1px solid #c9c6da; background: #fff; font: inherit; font-weight: 700; cursor: pointer; position: relative; color: var(--ink); }
.pal.answered { background: var(--ok); border-color: var(--ok); color: #fff; }
.pal.notanswered { background: var(--bad); border-color: var(--bad); color: #fff; }
.pal.review { background: var(--review); border-color: var(--review); color: #fff; border-radius: 50%; }
.pal.review.answered::after { content: ""; position: absolute; right: 2px; bottom: 2px; width: 9px; height: 9px; border-radius: 50%; background: #2fe08a; border: 1px solid #fff; }
.pal.current { outline: 3px solid var(--accent); outline-offset: 1px; }
@media (max-width: 900px) {
  .cbt-main { grid-template-columns: 1fr; padding: 10px; }
  .cbt-palette { position: static; max-height: none; order: 2; }
  .cbt-title small { display: none; }
  .cbt-actions .btn { flex: 1 1 45%; }
  .cbt-actions [data-act=prev] { margin-right: 0; }
}

@media print { .site-header, .site-footer, .cta-row, .admin-nav { display: none; } }
.chip-pyq { background: #fff3e6; color: #a04f00; border-color: #fdd9b0; }

/* ===== Progress tracker ===== */
:root { --lv-strong: #138a4b; --lv-strong-bg: #e5f6ec; --lv-improving: #9a5b00; --lv-improving-bg: #fff4dc; --lv-weak: #c8312f; --lv-weak-bg: #fde9e8; --lv-new: #6e6c86; --lv-new-bg: #f3f2f8; }
.countdown { text-align: center; background: var(--brand); color: #fff; border-radius: 14px; padding: 10px 18px; }
.countdown b { display: block; font-size: 2rem; line-height: 1; }
.countdown span { font-size: .85rem; opacity: .9; }
.kpi .bar { margin-top: 8px; }
.up { color: var(--ok); font-style: normal; font-weight: 700; }
.down { color: var(--bad); font-style: normal; font-weight: 700; }
.plan-list { list-style: none; padding: 0; margin: 0; counter-reset: p; }
.plan-list li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 0 12px 40px; border-bottom: 1px solid var(--line); position: relative; counter-increment: p; }
.plan-list li:last-child { border-bottom: 0; }
.plan-list li::before { content: counter(p); position: absolute; left: 0; top: 14px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--brand-soft); color: var(--brand); }
.plan-list li.plan-tip::before { content: "💡"; background: #fff4dc; }
.plan-list p { margin: 2px 0 0; color: var(--ink-2); font-size: .92rem; }
.plan-list form { flex: none; }
.trend { width: 100%; height: auto; display: block; }
.trend .grid { stroke: var(--line); stroke-width: 1; }
.trend .axis { fill: var(--muted); font-size: 11px; }
.trend .label { fill: var(--ink); font-size: 12px; font-weight: 700; }
.trend .line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.trend .dot { fill: var(--brand); stroke: #fff; stroke-width: 2; }
.trend .dot.last { fill: var(--accent); }
.trend .hit { fill: transparent; cursor: pointer; outline: none; }
.table-view { margin-top: 8px; font-size: .9rem; }
.table-view summary { cursor: pointer; color: var(--brand); }
.tooltip { position: absolute; z-index: 100; display: none; background: var(--ink); color: #fff; font-size: .82rem; padding: 6px 10px; border-radius: 8px; pointer-events: none; max-width: 260px; box-shadow: var(--shadow); }
.mastery-legend { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.lv { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; padding: 3px 10px 3px 4px; border-radius: 999px; }
.lv i, .mtile-meta i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .72rem; font-weight: 800; color: #fff; }
.lv-strong { background: var(--lv-strong-bg); color: var(--lv-strong); } .lv-strong i { background: var(--lv-strong); }
.lv-improving { background: var(--lv-improving-bg); color: var(--lv-improving); } .lv-improving i { background: #d98a00; }
.lv-weak { background: var(--lv-weak-bg); color: var(--lv-weak); } .lv-weak i { background: var(--lv-weak); }
.lv-new { background: var(--lv-new-bg); color: var(--lv-new); } .lv-new i { background: #a9a7bd; }
.subject-mastery-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.subject-mastery-head h3 { margin: 0; }
.mastery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.mtile { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; padding: 10px 12px; border-radius: 10px; text-decoration: none; min-height: 72px; border: 1px solid transparent; transition: transform .12s; }
.mtile:hover { transform: translateY(-2px); border-color: currentColor; }
.mtile-name { font-size: .88rem; font-weight: 600; color: var(--ink); line-height: 1.3; }
.mtile-meta { font-size: .85rem; font-weight: 700; display: flex; align-items: center; gap: 4px; }

.product-of { font-size: .9rem; }
.footer-grid .product-of a { display: inline; margin: 0; }
.product-of a, .footer-bottom a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }

/* ===== PWA install banner & reminders ===== */
.pwa-banner { position: fixed; left: 50%; bottom: 16px; transform: translate(-50%, 140%); width: min(560px, calc(100% - 24px)); display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; box-shadow: 0 16px 40px rgba(22, 20, 43, .18); z-index: 90; transition: transform .25s ease; }
.pwa-banner.show { transform: translate(-50%, 0); }
.pwa-banner img { border-radius: 12px; flex: none; }
.pwa-banner-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .9rem; color: var(--ink-2); line-height: 1.35; }
.pwa-banner-text b { color: var(--ink); font-size: 1rem; }
.pwa-banner-actions { display: flex; gap: 6px; flex: none; }
@media (max-width: 520px) { .pwa-banner { flex-wrap: wrap; } .pwa-banner-actions { width: 100%; justify-content: flex-end; } }
.push-card { display: flex; gap: 14px; align-items: center; background: linear-gradient(135deg, #f4f2ff, #fff7ee); border-color: #e2ddff; }
.push-card-icon { font-size: 1.8rem; flex: none; }
.push-card-text { flex: 1; min-width: 0; }
.push-card-text p { margin: 2px 0 0; color: var(--ink-2); font-size: .92rem; }
.push-card-actions { display: flex; gap: 6px; flex: none; flex-wrap: wrap; }
@media (max-width: 640px) { .push-card { flex-wrap: wrap; } .push-card-actions { width: 100%; } }
.push-status:empty { display: none; }
.push-status.ok { color: var(--ok); font-weight: 600; }
.push-status.warn { color: #9a5b00; font-weight: 600; }
.tight-row { margin: 4px 0; }
