:root {
  color-scheme: light;
  --surface-1:      #fcfcfb;
  --page-plane:     #f9f9f7;
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #898781;
  --gridline:       #e1e0d9;
  --border:         rgba(11,11,11,0.10);
  --brand:          #2a78d6;
  --brand-dark:     #184f95;
  --brand-100:      #cde2fb;
  --violet:         #4a3aa7;
  --good:           #0ca30c;
  --good-text:      #006300;
  --warning:        #fab219;
  --critical:       #d03b3b;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 2px rgba(11,11,11,0.06), 0 4px 16px rgba(11,11,11,0.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface-1:      #1a1a19;
    --page-plane:     #0d0d0d;
    --text-primary:   #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted:     #898781;
    --gridline:       #2c2c2a;
    --border:         rgba(255,255,255,0.10);
    --brand:          #3987e5;
    --brand-dark:     #184f95;
    --brand-100:      #16324f;
    --good-text:      #0ca30c;
    --critical:       #e66767;
    --shadow-card: 0 1px 2px rgba(0,0,0,0.3), 0 4px 20px rgba(0,0,0,0.4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1:      #1a1a19;
  --page-plane:     #0d0d0d;
  --text-primary:   #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted:     #898781;
  --gridline:       #2c2c2a;
  --border:         rgba(255,255,255,0.10);
  --brand:          #3987e5;
  --brand-dark:     #184f95;
  --brand-100:      #16324f;
  --good-text:      #0ca30c;
  --critical:       #e66767;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.3), 0 4px 20px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.courseversity {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page-plane);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.courseversity a { color: var(--brand); }
body.courseversity button { font-family: inherit; cursor: pointer; }

/* ---------- Header ---------- */
header.cv-site {
  position: sticky; top: 0; z-index: 40;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
}
.cv-site-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  padding: 14px 24px;
}
.cv-brand-mark { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.cv-brand-mark .cv-logo-badge {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--violet));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 15px; flex: none;
}
.cv-brand-mark .cv-name { font-weight: 800; font-size: 19px; letter-spacing: 0.2px; color: var(--text-primary); }
nav.cv-site-nav { display: flex; gap: 4px; margin-left: auto; }
nav.cv-site-nav a {
  background: none; border: none; color: var(--text-secondary); text-decoration: none;
  font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: var(--radius-sm);
}
nav.cv-site-nav a:hover { background: var(--gridline); color: var(--text-primary); }

main.cv-main { max-width: 1180px; margin: 0 auto; padding: 32px 24px 100px; }

/* ---------- Home / hero ---------- */
.cv-hero { text-align: center; padding: 56px 12px 12px; }
.cv-hero .cv-eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--brand); background: var(--brand-100);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.cv-hero h1 { font-size: 40px; font-weight: 800; margin: 0 0 12px; }
.cv-hero p.cv-sub { font-size: 17px; color: var(--text-secondary); max-width: 640px; margin: 0 auto 28px; }

.cv-section-title { font-size: 20px; font-weight: 800; margin: 48px 0 4px; }
.cv-section-sub { font-size: 14px; color: var(--text-muted); margin: 0 0 18px; }

.cv-subject-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 16px;
}
.cv-subject-card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 10px;
  transition: transform .12s ease; position: relative; overflow: hidden; text-decoration: none;
}
.cv-subject-card:hover { transform: translateY(-2px); }
.cv-subject-card .cv-rail { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--maj-acc, transparent); }
.cv-subject-card .cv-icon {
  width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 19px; background: var(--maj-tint, var(--brand-100)); color: var(--maj-acc, var(--brand-dark));
}
.cv-subject-card h3 { font-size: 16px; margin: 2px 0 0; color: var(--text-primary); }
.cv-subject-card p { font-size: 13px; color: var(--text-muted); margin: 0; flex: 1; }
.cv-badge-pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; align-self: flex-start; }
.cv-badge-pill.cv-count { background: var(--gridline); color: var(--text-muted); font-weight: 600; }
.cv-subject-card[data-major="ai"] { --maj-acc: #5b3fd1; --maj-tint: #ece7fb; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cv-subject-card[data-major="ai"] { --maj-acc: #9b82e8; --maj-tint: #241c47; }
}
:root[data-theme="dark"] .cv-subject-card[data-major="ai"] { --maj-acc: #9b82e8; --maj-tint: #241c47; }

/* ---------- Subject overview ---------- */
.cv-subject-header { display:flex; align-items:flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cv-subject-header h1 { font-size: 30px; margin: 4px 0 6px; }
.cv-subject-header p { color: var(--text-secondary); max-width: 560px; margin: 0; font-size: 14px;}

.cv-level-tabs { display: flex; gap: 8px; margin: 28px 0 20px; border-bottom: 1px solid var(--gridline); flex-wrap: wrap; }
.cv-level-tab {
  background: none; border: none; padding: 10px 4px; margin-right: 18px; font-size: 14px; font-weight: 700;
  color: var(--text-muted); border-bottom: 2px solid transparent; cursor: pointer;
}
.cv-level-tab.active { color: var(--text-primary); border-bottom-color: var(--maj-acc, var(--brand)); }
.cv-level-panel { display: none; }
.cv-level-panel.active { display: block; }

.cv-module-list { display: flex; flex-direction: column; gap: 12px; }
.cv-module-card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 20px; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow-card);
  text-decoration: none; color: inherit;
}
.cv-module-card:hover { border-color: var(--maj-acc, var(--brand)); }
.cv-module-num {
  width: 38px; height:38px; border-radius: 50%; background: var(--maj-tint, var(--brand-100)); color: var(--maj-acc, var(--brand-dark));
  display:flex; align-items:center; justify-content:center; font-weight: 800; font-size: 14px; flex: none;
}
.cv-module-body { flex: 1; min-width: 0; }
.cv-module-body h4 { margin: 0 0 3px; font-size: 15px; color: var(--text-primary); }
.cv-module-body p { margin: 0; font-size: 13px; color: var(--text-muted); }
.cv-chev { color: var(--text-muted); flex: none; }

/* ---------- Lesson screen ---------- */
.cv-lesson-layout { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: flex-start; }
@media (max-width: 860px) { .cv-lesson-layout { grid-template-columns: 1fr; } }
.cv-lesson-nav {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px; position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto;
}
.cv-lesson-nav h5 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: 14px 0 8px; }
.cv-lesson-nav h5:first-child { margin-top: 0; }
.cv-nav-lesson {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: none;
  font-size: 13px; padding: 7px 8px; border-radius: 6px; color: var(--text-secondary); text-decoration: none;
}
.cv-nav-lesson:hover { background: var(--gridline); }
.cv-nav-quiz-link {
  width: 100%; text-align: left; background: none; border: none; font-size: 13px; padding: 7px 8px;
  color: var(--violet); font-weight: 700; border-radius: 6px; text-decoration: none; display:block;
}
.cv-nav-quiz-link:hover { background: var(--gridline); }

.cv-lesson-main {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 30px 34px; box-shadow: var(--shadow-card);
}
.cv-lesson-crumbs { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.cv-lesson-crumbs a { color: var(--text-muted); text-decoration: none; }
.cv-lesson-main h2 { font-size: 24px; margin: 24px 0 4px; }
.cv-lesson-main h2:first-child { margin-top: 0; }
.cv-lesson-meta-row { display:flex; gap:14px; align-items:center; font-size:12px; color: var(--text-muted); margin-bottom: 22px; }
.cv-lesson-body p { font-size: 15px; color: var(--text-primary); margin: 0 0 14px; }
.cv-essential-question { font-style: italic; color: var(--text-secondary); background: var(--page-plane); border-left: 3px solid var(--maj-acc, var(--brand)); padding: 14px 18px; border-radius: var(--radius-md); margin: 0 0 24px; }
.cv-sources-box {
  margin-top: 24px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--page-plane); padding: 14px 16px;
}
.cv-sources-box .cv-lbl { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 8px; }
.cv-sources-box ul { margin: 0; padding-left: 18px; }
.cv-sources-box li { font-size: 13px; margin-bottom: 5px; }
.cv-sources-box a { text-decoration: none; font-weight: 600; }
.cv-sources-box a:hover { text-decoration: underline; }

/* ---------- Practice card ---------- */
.cv-practice-section { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--gridline); }
.cv-practice-eyebrow {
  display:inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: var(--maj-acc, var(--brand)); background: var(--maj-tint, var(--brand-100)); padding: 5px 13px; border-radius: 999px; margin-bottom: 12px;
}
.cv-practice-pearls { margin: 0 0 26px; padding: 0; list-style: none; }
.cv-practice-pearls li {
  font-size: 13.5px; color: var(--text-primary); padding: 10px 14px 10px 34px; margin-bottom: 8px; position: relative;
  background: var(--page-plane); border: 1px solid var(--border); border-radius: var(--radius-md);
}
.cv-practice-pearls li::before { content: "\1F4A1"; position: absolute; left: 10px; top: 9px; font-size: 13px; }
.cv-glossary-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:10px; margin:0 0 26px; padding: 0; }
.cv-glossary-term { background: var(--page-plane); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 14px; }
.cv-glossary-term dt { font-size: 12.5px; font-weight: 800; color: var(--text-primary); margin-bottom: 3px; }
.cv-glossary-term dd { font-size: 12px; color: var(--text-muted); margin: 0; }
.cv-recall-prompts { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.cv-recall-card {
  border: 1.5px solid var(--maj-acc, var(--brand)); background: var(--maj-tint, var(--brand-100)); border-radius: var(--radius-md);
  padding: 16px 18px; cursor: pointer;
}
.cv-recall-card.revealed { background: rgba(12,163,12,0.08); border-color: var(--good); }
.cv-recall-card .cv-recall-label {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--maj-acc, var(--brand-dark));
  display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom: 8px;
}
.cv-recall-card .cv-recall-q { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.cv-recall-card .cv-recall-a {
  font-size: 13.5px; color: var(--text-secondary); margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--border); display:none;
}
.cv-recall-card.revealed .cv-recall-a { display:block; }

/* ---------- Quiz + results ---------- */
.cv-quiz-cta {
  margin-top: 28px; padding: 22px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--maj-tint, var(--brand-100)), var(--surface-1));
  border: 1px solid var(--border); display:flex; align-items:center; gap:18px; flex-wrap: wrap;
}
.cv-quiz-cta .cv-txt { flex: 1; min-width: 220px; }
.cv-quiz-cta h4 { margin: 0 0 4px; font-size: 16px; }
.cv-quiz-cta p { margin: 0; font-size: 13px; color: var(--text-secondary); }
.cv-btn-primary {
  background: var(--maj-acc, var(--brand)); color: #fff; border: none; border-radius: 999px;
  padding: 11px 22px; font-weight: 700; font-size: 14px; text-decoration: none; display: inline-block;
}
.cv-btn-secondary {
  background: none; color: var(--text-primary); border: 1.5px solid var(--border); border-radius: 999px;
  padding: 10px 20px; font-weight: 700; font-size: 14px; text-decoration: none; display: inline-block;
}

.cv-quiz-card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 30px 34px; box-shadow: var(--shadow-card); max-width: 760px; margin: 0 auto;
}
.cv-quiz-card h2 { margin: 0 0 4px; font-size: 22px; }
.cv-quiz-desc { color: var(--text-muted); font-size: 13px; margin: 0 0 24px; }
.cv-quiz-head-row { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; flex-wrap:wrap; }
.cv-stopwatch-chip {
  display:flex; align-items:center; gap:7px; background: var(--page-plane); border:1.5px solid var(--border);
  border-radius: 999px; padding: 7px 15px; font-size:15px; font-weight:800; color: var(--text-primary); flex:none;
  font-variant-numeric: tabular-nums;
}
.cv-quiz-progress { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.cv-qbar-track { height: 5px; border-radius: 4px; background: var(--gridline); margin-bottom: 26px; overflow:hidden;}
.cv-qbar-fill { height: 100%; background: var(--violet); border-radius: 4px; transition: width .2s; }
.cv-q-text { font-size: 17px; font-weight: 700; margin-bottom: 16px; }
.cv-q-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.cv-q-option {
  text-align: left; padding: 13px 16px; border: 1.5px solid var(--border); border-radius: var(--radius-md);
  background: var(--page-plane); font-size: 14px; color: var(--text-primary); width: 100%; cursor: pointer;
}
.cv-q-option:hover { border-color: var(--maj-acc, var(--brand)); }
.cv-q-option.selected { border-color: var(--maj-acc, var(--brand)); background: var(--maj-tint, var(--brand-100)); font-weight: 700; }
.cv-q-option.correct { border-color: var(--good); background: rgba(12,163,12,0.10); }
.cv-q-option.incorrect { border-color: var(--critical); background: rgba(208,59,59,0.08); }
.cv-q-option:disabled { cursor: default; }
.cv-q-explain { font-size: 13px; color: var(--text-secondary); background: var(--page-plane); border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 20px; border: 1px solid var(--border); display: none; }
.cv-q-explain.show { display: block; }
.cv-quiz-actions { display: flex; justify-content: flex-end; gap: 10px; }

.cv-results-card {
  max-width: 620px; margin: 20px auto 0; background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 42px 36px; text-align: center; box-shadow: var(--shadow-card);
}
.cv-grade-ring { width: 150px; height: 150px; border-radius: 50%; margin: 0 auto 20px; display:flex; align-items:center; justify-content:center; position: relative; }
.cv-grade-ring .cv-inner { width: 118px; height: 118px; border-radius: 50%; background: var(--surface-1); display:flex; flex-direction:column; align-items:center; justify-content:center; }
.cv-grade-ring .cv-pct { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cv-grade-ring .cv-of { font-size: 11px; color: var(--text-muted); }
.cv-grade-label {
  display:inline-block; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing:.05em;
  padding: 6px 16px; border-radius: 999px; margin-bottom: 14px;
}
.cv-results-card h2 { margin: 4px 0 10px; font-size: 22px; }
.cv-results-card p.cv-detail { color: var(--text-secondary); font-size: 14px; max-width: 440px; margin: 0 auto 22px; }
.cv-results-actions { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }

.cv-hidden { display: none !important; }
