/* VVDN AI Academy — design tokens + components */
:root {
  --bg: #f6f7fb;
  --bg-2: #eef0f7;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --border: #e3e6ef;
  --border-strong: #cfd4e2;
  --text: #171a2b;
  --text-2: #4a5068;
  --muted: #7a8099;
  --primary: #5b4bdb;
  --primary-2: #7a6cf0;
  --primary-soft: #eeebff;
  --primary-ink: #ffffff;
  --accent: #ff7a45;
  --accent-soft: #fff0e8;
  --ok: #15a35a;
  --ok-soft: #e6f7ee;
  --bad: #dc3b3b;
  --bad-soft: #fdeceb;
  --warn: #c97a06;
  --warn-soft: #fff6e0;
  --info: #2a7de1;
  --info-soft: #e8f2fe;
  --fun: #b04bd6;
  --fun-soft: #f7ebfc;
  --shadow: 0 1px 2px rgba(20, 24, 50, .05), 0 4px 16px rgba(20, 24, 50, .06);
  --shadow-lg: 0 8px 40px rgba(20, 24, 50, .14);
  --radius: 14px;
  --radius-sm: 9px;
  --term-bg: #15161e;
  --term-text: #e6e6ef;
  --term-dim: #8b8fa6;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1118; --bg-2: #151826; --surface: #181b27; --surface-2: #1d2130; --border: #2a2f42; --border-strong: #394058;
    --text: #eceef6; --text-2: #b7bcd0; --muted: #858ba3; --primary: #8b7dff; --primary-2: #a499ff; --primary-soft: #26224a;
    --primary-ink: #0f1118; --accent: #ff915f; --accent-soft: #3a2418; --ok: #37c77d; --ok-soft: #12301f; --bad: #ff6b6b; --bad-soft: #3a1c1c;
    --warn: #f0a83a; --warn-soft: #362a12; --info: #5aa2ff; --info-soft: #14263f; --fun: #d67cf5; --fun-soft: #2f1b3a;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 18px rgba(0,0,0,.35); --shadow-lg: 0 10px 40px rgba(0,0,0,.6); --term-bg: #0b0c12;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1118; --bg-2: #151826; --surface: #181b27; --surface-2: #1d2130; --border: #2a2f42; --border-strong: #394058;
  --text: #eceef6; --text-2: #b7bcd0; --muted: #858ba3; --primary: #8b7dff; --primary-2: #a499ff; --primary-soft: #26224a;
  --primary-ink: #0f1118; --accent: #ff915f; --accent-soft: #3a2418; --ok: #37c77d; --ok-soft: #12301f; --bad: #ff6b6b; --bad-soft: #3a1c1c;
  --warn: #f0a83a; --warn-soft: #362a12; --info: #5aa2ff; --info-soft: #14263f; --fun: #d67cf5; --fun-soft: #2f1b3a;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 18px rgba(0,0,0,.35); --shadow-lg: 0 10px 40px rgba(0,0,0,.6); --term-bg: #0b0c12;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.9rem; font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 750; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 .9em; }
code { font-family: var(--mono); font-size: .88em; background: var(--bg-2); border: 1px solid var(--border); padding: .08em .35em; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 16px; }
.grow { flex: 1; }
.center { text-align: center; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 0 20px; height: 62px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); font-size: 1.05rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), var(--accent)); display: grid; place-items: center; color: #fff; font-size: 18px; box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 40%, transparent); }
.brand small { display: block; font-size: .68rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.nav { display: flex; gap: 4px; margin-left: 12px; overflow-x: auto; }
.nav a { padding: 8px 12px; border-radius: 9px; color: var(--text-2); font-weight: 600; font-size: .92rem; white-space: nowrap; }
.nav a:hover { background: var(--bg-2); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary); }
.topbar .spacer { flex: 1; }
.usermenu { position: relative; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; border: 0; cursor: pointer; font-family: inherit; }
.menu { position: absolute; right: 0; top: 46px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 220px; padding: 6px; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--bg-2); text-decoration: none; }
.menu .menu-head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.burger { display: none; }

.banner { background: linear-gradient(90deg, var(--accent-soft), var(--primary-soft)); color: var(--text); font-size: .9rem; padding: 8px 20px; text-align: center; border-bottom: 1px solid var(--border); }

/* ---------- layout ---------- */
.page { max-width: 1240px; margin: 0 auto; padding: 28px 20px 80px; }
.page.narrow { max-width: 860px; }
.page-head { margin-bottom: 22px; }
.page-head p { color: var(--text-2); margin: 0; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card.flat { box-shadow: none; }
.card h3 { margin-bottom: .35em; }
.card-link { display: block; color: inherit; transition: transform .12s, box-shadow .12s, border-color .12s; }
.card-link:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 650; font-size: .93rem; cursor: pointer; transition: background .12s, transform .06s, box-shadow .12s; white-space: nowrap; }
.btn:hover { background: var(--bg-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 35%, transparent); }
.btn.primary:hover { background: var(--primary-2); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg-2); }
.btn.sm { padding: 6px 11px; font-size: .84rem; border-radius: 8px; }
.btn.lg { padding: 13px 24px; font-size: 1rem; border-radius: 12px; }
.btn.block { width: 100%; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 650; font-size: .86rem; margin-bottom: 6px; color: var(--text-2); }
.input, select.input, textarea.input { width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 10px; font: inherit; font-size: .95rem; }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.5; }
textarea.code { font-family: var(--mono); font-size: .85rem; }
.input:focus { outline: 2px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 1px; border-color: var(--primary); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--primary); }
.help { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.err { color: var(--bad); font-size: .88rem; margin: 8px 0; }

/* ---------- badges, pills, progress ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--bg-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.badge.primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.bar { height: 8px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 99px; transition: width .4s; }
.bar.ok > i { background: var(--ok); }
.bar.bad > i { background: var(--bad); }
.ring { --p: 0; --size: 120px; width: var(--size); height: var(--size); border-radius: 50%; background: conic-gradient(var(--ring-color, var(--primary)) calc(var(--p) * 1%), var(--bg-2) 0); display: grid; place-items: center; flex: none; }
.ring > div { width: calc(var(--size) - 22px); height: calc(var(--size) - 22px); border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; }
.ring b { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.ring span { font-size: .72rem; color: var(--muted); }
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi b { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; }
.kpi span { color: var(--muted); font-size: .85rem; font-weight: 600; }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { background: radial-gradient(1200px 600px at 10% 10%, color-mix(in srgb, var(--primary) 35%, transparent), transparent), radial-gradient(800px 500px at 90% 90%, color-mix(in srgb, var(--accent) 30%, transparent), transparent), var(--bg-2); padding: 56px; display: flex; flex-direction: column; justify-content: center; }
.auth-hero h1 { font-size: 2.6rem; max-width: 520px; }
.auth-hero p { font-size: 1.1rem; color: var(--text-2); max-width: 500px; }
.journey { display: grid; gap: 12px; margin-top: 26px; max-width: 460px; }
.journey div { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--border); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); }
.journey em { font-style: normal; font-size: 1.4rem; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-form .card { width: 100%; max-width: 440px; padding: 30px; }
.tabs { display: flex; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: 11px; margin-bottom: 20px; }
.tabs button, .tabs a { flex: 1; padding: 8px 10px; border: 0; background: transparent; border-radius: 8px; font: inherit; font-weight: 650; color: var(--text-2); cursor: pointer; text-align: center; }
.tabs .active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.track-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.track-pick label { border: 1px solid var(--border-strong); border-radius: 10px; padding: 9px 11px; cursor: pointer; display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; line-height: 1.3; }
.track-pick label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.track-pick input { margin-top: 2px; accent-color: var(--primary); }
.track-pick small { display: block; color: var(--muted); font-size: .75rem; }

/* ---------- dashboard ---------- */
.hero-card { background: linear-gradient(120deg, var(--primary), color-mix(in srgb, var(--primary) 55%, var(--accent))); color: #fff; border: 0; position: relative; overflow: hidden; }
.hero-card::after { content: '🚗'; position: absolute; right: 24px; bottom: -6px; font-size: 92px; opacity: .2; transform: scaleX(-1); }
.hero-card h1 { color: #fff; }
.hero-card p { color: rgba(255,255,255,.88); }
.hero-card .btn { background: #fff; color: var(--primary); border-color: #fff; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.step { padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.step b { display: block; font-size: .92rem; }
.step span { font-size: .8rem; color: var(--muted); }
.step.done { background: var(--ok-soft); border-color: transparent; }
.step.now { background: var(--primary-soft); border-color: var(--primary); }
.step i { font-style: normal; font-size: 1.3rem; }

/* ---------- learning ---------- */
.learn-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; }
.toc { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
.toc-head { padding: 0 4px 12px; }
.toc a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; color: var(--text); font-size: .9rem; line-height: 1.3; }
.toc a:hover { background: var(--bg-2); text-decoration: none; }
.toc a.active { background: var(--primary-soft); }
.toc .tick { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; flex: none; background: var(--bg-2); color: var(--muted); font-weight: 700; }
.toc a.done .tick { background: var(--ok); color: #fff; }
.toc .group { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 14px 10px 4px; }
.chapter-card { display: flex; gap: 16px; align-items: center; }
.chapter-card .icon { font-size: 30px; width: 54px; height: 54px; display: grid; place-items: center; background: var(--bg-2); border-radius: 14px; flex: none; }
.chapter-head { padding: 26px 30px; border-radius: var(--radius); background: linear-gradient(120deg, var(--primary-soft), var(--accent-soft)); border: 1px solid var(--border); margin-bottom: 26px; }
.chapter-head .icon { font-size: 42px; }
.chapter-head h1 { margin: 6px 0 4px; }
.chapter-head p { margin: 0; color: var(--text-2); font-size: 1.05rem; }

/* ---------- prose (markdown) ---------- */
.prose { font-size: 1.01rem; max-width: 780px; }
.prose h2 { margin-top: 2rem; padding-top: .3rem; }
.prose h3 { margin-top: 1.4rem; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }
.prose li { margin: .25em 0; }
.prose blockquote { margin: 1em 0; padding: 10px 16px; border-left: 4px solid var(--primary); background: var(--surface-2); border-radius: 0 10px 10px 0; color: var(--text-2); }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0 1.4em; font-size: .92rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 700; }
.prose pre { background: var(--term-bg); color: var(--term-text); padding: 14px 16px; border-radius: 12px; overflow-x: auto; font-size: .85rem; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; }
.prose img { border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.prose figure { margin: 1.2em 0; }
.prose figcaption { font-size: .82rem; color: var(--muted); text-align: center; margin-top: 6px; }
.callout { border-radius: 12px; padding: 14px 16px 6px; margin: 1.1em 0; border: 1px solid transparent; }
.callout .callout-title { font-weight: 750; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.callout.tip { background: var(--ok-soft); }
.callout.info { background: var(--info-soft); }
.callout.warn { background: var(--warn-soft); }
.callout.danger { background: var(--bad-soft); }
.callout.fun { background: var(--fun-soft); }
.dodont { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 1.1em 0; }
.dodont > div { border-radius: 12px; padding: 14px 16px; }
.dodont .do { background: var(--ok-soft); }
.dodont .dont { background: var(--bad-soft); }
.dodont h4 { margin: 0 0 8px; }
.dodont ul { list-style: none; padding: 0; margin: 0; }
.dodont li { padding-left: 26px; position: relative; margin: 7px 0; font-size: .94rem; }
.dodont .do li::before { content: '✓'; position: absolute; left: 4px; color: var(--ok); font-weight: 900; }
.dodont .dont li::before { content: '✕'; position: absolute; left: 4px; color: var(--bad); font-weight: 900; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 1.1em 0; }
.compare > div { border-radius: 12px; padding: 14px 16px; border: 1px solid var(--border); background: var(--surface-2); }
.compare > div:first-child { border-top: 4px solid var(--bad); }
.compare > div:last-child { border-top: 4px solid var(--ok); }
.compare h3 { font-size: 1rem; margin-top: 0; }
.lapse { border: 1px solid var(--border); border-radius: 14px; margin: 1.2em 0; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.lapse-head { padding: 16px 20px; background: linear-gradient(90deg, var(--bad-soft), var(--surface)); border-bottom: 1px solid var(--border); }
.lapse-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.lapse-tag { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--bad); }
.lapse-head h4 { margin: 0; font-size: 1.2rem; line-height: 1.35; }
.lapse-who { margin-top: 4px; font-size: .85rem; color: var(--muted); }
.lapse-body { padding: 6px 18px 14px; display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; font-size: .93rem; }
.lapse-body dt { font-weight: 700; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; padding-top: 3px; }
.lapse-body dd { margin: 0; }
.lapse-body dd.vvdn { background: var(--ok-soft); padding: 8px 10px; border-radius: 8px; }
.lapse-src { padding: 10px 18px; border-top: 1px solid var(--border); font-size: .8rem; background: var(--surface-2); }
.lapse-src a { margin-right: 10px; word-break: break-all; }
.video { position: relative; border-radius: 14px; overflow: hidden; margin: 1.2em 0 .4em; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--border); box-shadow: var(--shadow); }
.video iframe, .video img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.video button { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; cursor: pointer; padding: 0; }
.video .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 72px; height: 50px; border-radius: 14px; background: rgba(220, 30, 30, .92); display: grid; place-items: center; color: #fff; font-size: 22px; box-shadow: 0 6px 20px rgba(0,0,0,.4); transition: transform .12s; }
.video button:hover .play { transform: translate(-50%, -50%) scale(1.08); }
.video-cap { font-size: .84rem; color: var(--muted); margin-bottom: 1.2em; }

/* Claude Code mockup */
.cc { margin: 1.2em 0; border-radius: 12px; overflow: hidden; border: 1px solid #2b2d3a; box-shadow: var(--shadow-lg); background: var(--term-bg); font-family: var(--mono); font-size: .82rem; line-height: 1.55; }
.cc-bar { display: flex; align-items: center; gap: 7px; padding: 9px 12px; background: #23242f; color: #a7aac0; font-size: .75rem; }
.cc-bar i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.cc-bar i:nth-child(1) { background: #ff5f57; } .cc-bar i:nth-child(2) { background: #febc2e; } .cc-bar i:nth-child(3) { background: #28c840; }
.cc-bar span { margin-left: 8px; }
.cc-body { padding: 12px 16px 14px; color: var(--term-text); overflow-x: auto; }
.cc-line { white-space: pre-wrap; word-break: break-word; margin: 3px 0; }
.cc-user { color: #fff; background: #262838; padding: 6px 10px; border-radius: 8px; margin: 4px 0 8px; }
.cc-user::before { content: '> '; color: #c4a6ff; }
.cc-claude::before { content: '● '; color: #e8e8f0; }
.cc-tool { color: #9fe0b5; }
.cc-tool::before { content: '⏺ '; color: #3ccf7a; }
.cc-out { color: var(--term-dim); padding-left: 18px; }
.cc-out::before { content: '⎿  '; }
.cc-diff-add { color: #7ee2a0; background: rgba(46, 160, 67, .15); padding: 0 6px; border-radius: 4px; }
.cc-diff-del { color: #ff9b9b; background: rgba(248, 81, 73, .15); padding: 0 6px; border-radius: 4px; }
.cc-warn { color: #ff8f8f; }
.cc-warn::before { content: '⚠ '; }
.cc-note { color: var(--term-dim); font-style: italic; }
.cc-ask { border: 1px solid #5d5f7a; border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.cc-ask .t { color: #f2c94c; font-weight: 700; }
.cc-ask .a { color: #fff; margin: 4px 0 6px; }
.cc-ask .o { color: #c9cbe0; }
.cc-ask .o b { color: #c4a6ff; }
.cc-cap { padding: 7px 14px; font-family: var(--font); font-size: .78rem; color: #9c9fb6; background: #1b1c26; border-top: 1px solid #2b2d3a; }

/* quick check + questions */
.qcard { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; background: var(--surface); }
.qcard + .qcard { margin-top: 14px; }
.qstem { font-weight: 650; font-size: 1.02rem; margin-bottom: 12px; }
.qstem p:last-child { margin-bottom: 0; }
.opts { display: grid; gap: 9px; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 11px; cursor: pointer; background: var(--surface); transition: border-color .1s, background .1s; text-align: left; font: inherit; color: inherit; width: 100%; }
.opt:hover { border-color: var(--border-strong); background: var(--surface-2); }
.opt.sel { border-color: var(--primary); background: var(--primary-soft); }
.opt .key { width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--border-strong); display: grid; place-items: center; font-weight: 750; font-size: .8rem; flex: none; color: var(--text-2); }
.opt.sel .key { background: var(--primary); border-color: var(--primary); color: #fff; }
.opt.multi .key { border-radius: 6px; }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.right .key { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .key { background: var(--bad); border-color: var(--bad); color: #fff; }
.opt .why { display: block; font-size: .86rem; color: var(--text-2); margin-top: 5px; }
.opt.static { cursor: default; }
.feedback { margin-top: 12px; padding: 12px 14px; border-radius: 10px; font-size: .93rem; }
.feedback.ok { background: var(--ok-soft); }
.feedback.bad { background: var(--bad-soft); }
.material { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin: 6px 0 12px; }
.material-title { padding: 8px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: .82rem; font-weight: 700; color: var(--text-2); display: flex; gap: 8px; align-items: center; }
.mline { display: flex; font-family: var(--mono); font-size: .82rem; border: 0; background: var(--surface); width: 100%; text-align: left; padding: 0; cursor: pointer; color: var(--text); border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }
.mline:last-child { border-bottom: 0; }
.mline .n { width: 42px; text-align: right; padding: 6px 10px 6px 0; color: var(--muted); background: var(--surface-2); flex: none; user-select: none; }
.mline .c { padding: 6px 12px; white-space: pre-wrap; word-break: break-word; flex: 1; }
.mline:hover { background: var(--primary-soft); }
.mline.sel { background: var(--primary-soft); box-shadow: inset 4px 0 0 var(--primary); }
.mline.right { background: var(--ok-soft); box-shadow: inset 4px 0 0 var(--ok); }
.mline.wrong { background: var(--bad-soft); box-shadow: inset 4px 0 0 var(--bad); }
.mline.static { cursor: default; }
.mline.static:not(.right):not(.wrong):hover { background: var(--surface); }
.tier-label { font-weight: 750; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 16px 0 8px; }

/* ---------- exam runner ---------- */
.exam-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.exam-side { position: sticky; top: 84px; }
.timer { font-family: var(--mono); font-size: 1.7rem; font-weight: 800; letter-spacing: .02em; }
.timer.low { color: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.navgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 6px; margin: 10px 0; }
.navgrid button { height: 34px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; color: var(--text-2); position: relative; }
.navgrid button.ans { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.navgrid button.cur { outline: 2px solid var(--accent); outline-offset: 1px; }
.navgrid button.flag::after { content: ''; position: absolute; top: 2px; right: 2px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.sec-title { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 14px; }
.sec-link { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font: inherit; font-size: .88rem; font-weight: 650; cursor: pointer; margin-top: 6px; color: var(--text); }
.sec-link.cur { border-color: var(--accent); background: var(--accent-soft); }
.qhead { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }

/* simulation */
.sim-brief { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin-bottom: 16px; }
.sim-step { display: grid; grid-template-columns: 34px 1fr; gap: 12px; margin-bottom: 14px; }
.sim-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: .82rem; }
.sim-say { color: var(--text-2); margin-bottom: 6px; font-size: .95rem; }
.perm { border: 1.5px solid var(--border-strong); border-radius: 12px; overflow: hidden; background: var(--surface); }
.perm-h { padding: 8px 12px; background: var(--term-bg); color: #f2c94c; font-family: var(--mono); font-size: .76rem; font-weight: 700; }
.perm-a { padding: 10px 12px; font-family: var(--mono); font-size: .84rem; background: #1b1c26; color: #e6e6ef; white-space: pre-wrap; word-break: break-all; }
.perm-ctx { padding: 8px 12px; font-family: var(--mono); font-size: .78rem; background: #14151d; color: #9ea2b9; white-space: pre-wrap; border-top: 1px solid #2b2d3a; max-height: 220px; overflow: auto; }
.perm-btns { display: flex; gap: 8px; padding: 10px 12px; flex-wrap: wrap; }
.perm.allow { border-color: var(--ok); }
.perm.deny { border-color: var(--bad); }
.perm-btns .btn.on-allow { background: var(--ok); color: #fff; border-color: var(--ok); }
.perm-btns .btn.on-deny { background: var(--bad); color: #fff; border-color: var(--bad); }
.wordcount { font-size: .82rem; color: var(--muted); text-align: right; margin-top: 4px; }

/* results */
.result-hero { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.result-hero .verdict { font-size: 2rem; font-weight: 850; }
.rules li { list-style: none; margin: 6px 0; display: flex; gap: 8px; align-items: center; }
.rules { padding: 0; margin: 10px 0 0; }
.sec-bars { display: grid; gap: 12px; }
.sec-bars .lbl { display: flex; justify-content: space-between; font-size: .88rem; font-weight: 650; margin-bottom: 4px; }
.review-item { border-left: 4px solid var(--border); }
.review-item.ok { border-left-color: var(--ok); }
.review-item.bad { border-left-color: var(--bad); }
.explain { margin-top: 14px; padding: 12px 14px; background: var(--info-soft); border-radius: 10px; font-size: .93rem; }
.explain b { display: block; margin-bottom: 4px; }
.coach { background: linear-gradient(120deg, var(--primary-soft), var(--accent-soft)); border: 0; }

/* certificate */
.cert { max-width: 980px; margin: 0 auto; background: #fffdf7; color: #1f2233; border: 14px solid #fff; outline: 3px solid #d9b45a; box-shadow: var(--shadow-lg); padding: 56px 64px; text-align: center; position: relative; font-family: var(--font); }
.cert::before { content: ''; position: absolute; inset: 10px; border: 1px solid #e7cf8f; pointer-events: none; }
.cert .seal { width: 92px; height: 92px; margin: 0 auto 14px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #ffd978, #c9952b); display: grid; place-items: center; font-size: 40px; box-shadow: 0 6px 18px rgba(201,149,43,.4); }
.cert h1 { font-size: 2.3rem; color: #1f2233; margin: 6px 0; letter-spacing: .02em; }
.cert .name { font-size: 2.2rem; font-weight: 800; color: #5b4bdb; margin: 14px 0 4px; }
.cert .meta { display: flex; justify-content: center; gap: 40px; margin-top: 28px; font-size: .9rem; flex-wrap: wrap; }
.cert .meta b { display: block; font-size: 1rem; }
.cert p { color: #4a4f66; }

/* tables (admin) */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; padding: 11px 14px; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface-2); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { width: auto; min-width: 160px; }
.admin-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.admin-nav { position: sticky; top: 84px; display: grid; gap: 2px; }
.admin-nav a { padding: 9px 12px; border-radius: 10px; color: var(--text-2); font-weight: 650; font-size: .92rem; display: flex; gap: 10px; align-items: center; }
.admin-nav a:hover { background: var(--bg-2); text-decoration: none; }
.admin-nav a.active { background: var(--primary-soft); color: var(--primary); }
.admin-nav .count { margin-left: auto; }
.editor-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.editor-split .preview { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
.md-toolbar { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px; border: 1px solid var(--border-strong); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--surface-2); }
.md-toolbar + textarea { border-radius: 0 0 10px 10px; }
.opt-edit { display: grid; grid-template-columns: 34px 1fr; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--surface-2); }
.histo { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.histo div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.histo i { width: 100%; background: linear-gradient(180deg, var(--primary-2), var(--primary)); border-radius: 6px 6px 0 0; min-height: 2px; }
.histo i.fail { background: linear-gradient(180deg, color-mix(in srgb, var(--bad) 70%, white), var(--bad)); }
.histo span { font-size: .7rem; color: var(--muted); }

/* toast & modal */
.toasts { position: fixed; bottom: 22px; right: 22px; display: grid; gap: 10px; z-index: 300; }
.toast { background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: .92rem; max-width: 380px; animation: slidein .2s; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
@keyframes slidein { from { transform: translateY(10px); opacity: 0; } }
.modal-back { position: fixed; inset: 0; background: rgba(10, 12, 25, .55); display: grid; place-items: center; z-index: 200; padding: 16px; }
.modal { background: var(--surface); border-radius: 16px; max-width: 520px; width: 100%; padding: 26px; box-shadow: var(--shadow-lg); max-height: 90vh; overflow: auto; }
.modal.wide { max-width: 860px; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .big { font-size: 48px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learn-layout, .exam-shell, .admin-layout, .editor-split { grid-template-columns: minmax(0, 1fr); }
  .toc, .exam-side, .admin-nav, .editor-split .preview { position: static; max-height: none; }
  .admin-nav { display: flex; overflow-x: auto; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { padding: 36px 20px; }
  .auth-hero h1 { font-size: 2rem; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  body { font-size: 14.5px; }
  .page { padding: 20px 16px 70px; }
  .topbar-inner { padding: 0 16px; gap: 10px; }
  .nav { display: none; position: absolute; top: 62px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); flex-direction: column; padding: 8px 12px; margin: 0; }
  .nav.open { display: flex; }
  .burger { display: inline-flex; }
  .brand small { display: none; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .dodont, .compare { grid-template-columns: 1fr; }
  .lapse-body { grid-template-columns: 1fr; }
  .chapter-head { padding: 20px; }
  .cert { padding: 34px 20px; }
  .cert .name { font-size: 1.6rem; }
}
@media print {
  .topbar, .banner, .no-print, .toasts { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; }
  .cert { box-shadow: none; margin: 0; }
}
