:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --text: #13213d;
  --muted: #5f6b85;
  --line: #e1e6f0;
  --navy: #14294f;
  --navy-2: #1d3b6e;
  --gold: #ff6b00;
  --gold-2: #ff9636;
  --gold-soft: #fff0e5;
  --primary: #1d3b6e;
  --primary-ink: #ffffff;
  --primary-soft: #e8eefb;
  --good: #128a5c;
  --good-soft: #e2f6ec;
  --bad: #d2403b;
  --bad-soft: #fdeaea;
  --warn: #b26a00;
  --warn-soft: #fff3dc;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(20, 41, 79, .05), 0 8px 24px rgba(20, 41, 79, .07);
  --shadow-lg: 0 18px 40px rgba(20, 41, 79, .16);
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5; font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1, h2 { font-family: var(--serif); font-weight: 700; }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); letter-spacing: -.02em; }
h2 { font-size: 1.35rem; letter-spacing: -.01em; }
h3 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 820px; }

/* Header */
.site-header { background: var(--navy); position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 12px rgba(10, 20, 45, .25); }
.site-header .container { display: flex; align-items: center; gap: 16px; min-height: 68px; flex-wrap: wrap; }
.brand { font-family: var(--serif); font-weight: 800; font-size: 1.6rem; color: #fff; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 10px; }
.brand b { color: var(--gold); font-weight: inherit; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #fff; display: grid; place-items: center; font-size: 1.15rem; font-weight: 800; font-family: var(--serif); }
.nav { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.nav a.navlink { color: rgba(255,255,255,.78); padding: 8px 12px; border-radius: 10px; font-weight: 500; }
.nav a.navlink:hover, .nav a.navlink.active { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.nav a.navlink.admin { color: #fff; background: var(--gold); font-weight: 600; }
.user-chip { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: .92rem; color: #fff; padding-left: 6px; }
.user-chip img { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--gold); }
.site-header .btn.ghost { color: rgba(255,255,255,.8); border: 1px solid rgba(255,255,255,.25); }
.site-header .btn.ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.admin-bar .brand { color: var(--navy); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600;
  cursor: pointer; background: var(--primary); color: var(--primary-ink); transition: filter .15s, background .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--bad); }
.btn.good { background: var(--good); }
.btn.sm { padding: 6px 12px; font-size: .875rem; border-radius: 8px; }
.btn.block { width: 100%; }

/* Cards & layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.section { margin: 36px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.primary { background: var(--primary-soft); color: var(--primary); }

/* Hero */
.hero { padding: 44px 0 12px; }
.hero p.lead { font-size: 1.1rem; color: var(--muted); max-width: 640px; margin: 0 0 18px; }
.notice { border-radius: 12px; padding: 12px 16px; background: var(--primary-soft); color: #173a99; font-size: .95rem; }
.notice.warn { background: var(--warn-soft); color: #7a4a00; }
.notice.good { background: var(--good-soft); color: #0b5c3e; }
.notice.bad { background: var(--bad-soft); color: #8f2020; }

/* Topic / mock cards */
.test-card { display: flex; flex-direction: column; gap: 10px; }
.test-card h3 { margin: 0; }
.test-card .desc { color: var(--muted); font-size: .92rem; flex: 1; }
.test-card .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); grid-column: 1 / -1; }
.empty-state { grid-column: 1 / -1; display: flex; gap: 22px; align-items: center; padding: 28px; border-radius: var(--radius);
  background: linear-gradient(135deg, #ffffff 0%, #f6f8fd 100%); border: 1px solid var(--line); box-shadow: var(--shadow); flex-wrap: wrap; }
.empty-state .ic { width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; font-size: 2.1rem; background: var(--gold-soft); flex: 0 0 auto; }
.empty-state h3 { margin: 0 0 4px; font-size: 1.15rem; }
.empty-state p { margin: 0; color: var(--muted); }

/* Stats */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .v { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: .85rem; }

/* Test page */
.test-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 20px 0 12px; }
.test-top h1 { font-size: 1.25rem; margin: 0; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; background: var(--surface); border: 1px solid var(--line); padding: 6px 12px; border-radius: 10px; }
.timer.low { color: var(--bad); border-color: var(--bad); background: var(--bad-soft); }
.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-bottom: 16px; }
.progress > div { height: 100%; background: var(--primary); transition: width .2s; }
.q-number { color: var(--muted); font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
.q-text { white-space: pre-line; font-size: 1.08rem; margin-bottom: 18px; overflow-wrap: anywhere; }
.options { display: grid; gap: 10px; }
.option {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; font: inherit; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer;
  transition: border-color .12s, background .12s; overflow-wrap: anywhere;
}
.option:hover { border-color: #b7c4dd; }
.option .L { flex: 0 0 30px; height: 30px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; }
.option .t { padding-top: 3px; white-space: pre-line; }
.option.selected { border-color: var(--primary); background: var(--primary-soft); }
.option.selected .L { background: var(--primary); color: #fff; }
.option.correct { border-color: var(--good); background: var(--good-soft); }
.option.correct .L { background: var(--good); color: #fff; }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); }
.option.wrong .L { background: var(--bad); color: #fff; }
.review .option { cursor: default; }
.q-nav-buttons { display: flex; gap: 10px; margin-top: 18px; }
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.q-grid button { height: 38px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-weight: 600; cursor: pointer; color: var(--text); }
.q-grid button.answered { background: var(--primary-soft); border-color: #b9caff; color: var(--primary); }
.q-grid button.current { outline: 2px solid var(--primary); outline-offset: 1px; }
.test-layout { display: grid; grid-template-columns: 1fr 260px; gap: 18px; align-items: start; }
.test-side { position: sticky; top: 76px; }
@media (max-width: 820px) {
  .test-layout { grid-template-columns: 1fr; }
  .test-side { position: static; }
}

/* Result */
.score-hero { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.ring { --p: 0; width: 128px; height: 128px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--ring-color, var(--primary)) calc(var(--p) * 1%), var(--surface-2) 0); flex: 0 0 auto; }
.ring > div { width: 100px; height: 100px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; }
.ring b { font-size: 1.6rem; display: block; line-height: 1.1; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0; }
.tabs button { border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; color: var(--muted); }
.tabs button.active { background: var(--text); color: #fff; border-color: var(--text); }
.review-item { margin-bottom: 14px; }
.review-item .head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.explain { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: .95rem; white-space: pre-line; }
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > div { height: 100%; border-radius: 999px; }
.topic-row { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr 60px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.topic-row:last-child { border-bottom: 0; }

/* Lists & tables */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; color: var(--text); flex-wrap: wrap; }
a.list-item:hover { border-color: #b7c4dd; text-decoration: none; }
.list-item .title { font-weight: 600; }
.score-pill { min-width: 64px; text-align: center; font-weight: 700; padding: 6px 10px; border-radius: 10px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

/* Forms */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.field { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }

/* Modal & toast */
.modal-back { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 16px; max-width: 520px; width: 100%; padding: 22px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); max-height: 90vh; overflow: auto; }
.modal.wide { max-width: 760px; }
.modal h2 { margin-bottom: 8px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 60; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.toast.bad { background: var(--bad); }

.site-footer { background: var(--navy); color: rgba(255,255,255,.65); font-size: .88rem; padding: 34px 0; margin-top: 56px; }
.site-footer .container { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.site-footer .brand { font-size: 1.25rem; }
.loading { text-align: center; padding: 50px 0; color: var(--muted); }
.hidden { display: none !important; }
#gbtn { min-height: 40px; }

/* ── Home page (v2 design) ───────────────────────────────── */
.hero-band { background: radial-gradient(1200px 500px at 85% -10%, rgba(255,107,0,.22), transparent 60%),
  radial-gradient(900px 500px at -10% 120%, rgba(80,130,255,.25), transparent 60%), linear-gradient(135deg, #0f2147 0%, #1d3b6e 100%);
  color: #fff; position: relative; overflow: hidden; }
.hero-band::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 22px 22px; pointer-events: none; mask-image: linear-gradient(to bottom, #000, transparent); }
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding: 56px 0 64px; position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(255,107,0,.18); color: #ffb072; font-weight: 600; font-size: .85rem; border: 1px solid rgba(255,107,0,.35); }
.hero-band h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); margin: 18px 0 14px; letter-spacing: -.01em; }
.hero-band h1 em { font-style: normal; color: var(--gold); }
.hero-band .lead { color: rgba(255,255,255,.8); font-size: 1.12rem; max-width: 560px; margin: 0 0 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn.gold { background: linear-gradient(135deg, #ff5a00, #ff8a1f); color: #fff; box-shadow: 0 10px 26px rgba(255,107,0,.45); font-weight: 700; }
.btn.gold:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn.lg { padding: 14px 24px; font-size: 1.02rem; border-radius: 14px; }
.btn.outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.btn.outline-light:hover { background: rgba(255,255,255,.08); }
.hero-points { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 26px; color: rgba(255,255,255,.85); font-size: .95rem; }
.hero-points span::before { content: "✓"; color: var(--gold); font-weight: 800; margin-right: 6px; }
.guest-pill { margin-top: 22px; display: inline-block; padding: 10px 16px; border-radius: 12px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.9); font-size: .93rem; }
.guest-pill b { color: var(--gold); }
/* Preview card in hero */
.preview { background: #fff; color: var(--text); border-radius: 22px; padding: 22px; box-shadow: var(--shadow-lg); transform: rotate(1.5deg); }
.preview .ph { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: .85rem; color: var(--muted); font-weight: 600; }
.preview .ph .t { background: var(--gold-soft); color: var(--warn); padding: 4px 10px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.preview .q { font-weight: 600; margin-bottom: 12px; }
.preview .o { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 11px; margin-bottom: 8px; font-size: .95rem; }
.preview .o b { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-2); font-size: .85rem; }
.preview .o.ok { border-color: var(--good); background: var(--good-soft); }
.preview .o.ok b { background: var(--good); color: #fff; }
.preview .ex { margin-top: 10px; font-size: .86rem; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; color: var(--muted); }
/* Stat strip (logged in) */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: -40px; position: relative; z-index: 2; }
.big-stat { background: #fff; border-radius: var(--radius); padding: 22px; text-align: center; box-shadow: var(--shadow); border: 1px solid var(--line); }
.big-stat .v { font-family: var(--serif); font-size: 2.4rem; font-weight: 800; color: var(--navy); line-height: 1.1; }
.big-stat .l { color: var(--muted); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; margin-top: 6px; font-weight: 600; }
.big-stat.dark { background: var(--navy); border-color: var(--navy); }
.big-stat.dark .v { color: var(--gold); }
.big-stat.dark .l { color: rgba(255,255,255,.75); }
/* Section titles */
.sec-title { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.sec-title .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-soft); font-size: 1.25rem; }
.sec-title h2 { margin: 0; font-size: 1.6rem; }
.sec-sub { color: var(--muted); margin: 0 0 18px 52px; font-size: .95rem; }
/* Subject cards */
.subject-card { position: relative; display: flex; flex-direction: column; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); color: var(--text); transition: transform .15s, box-shadow .15s, border-color .15s; overflow: hidden; }
.subject-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #cdd7ea; text-decoration: none; }
.subject-card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--accent, var(--gold)); }
.subject-card .tile { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 1.7rem; background: var(--tile, var(--gold-soft)); color: var(--navy); font-family: var(--serif); font-weight: 800; }
.subject-card h3 { font-size: 1.2rem; margin: 4px 0 0; }
.subject-card .desc { color: var(--muted); font-size: .93rem; flex: 1; }
.subject-card .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--surface-2); color: var(--navy-2); }
.chip.gold { background: var(--gold-soft); color: #c24e00; }
.subject-card .go { margin-left: auto; color: var(--navy-2); font-weight: 700; }
/* Mock cards */
.mock-card { position: relative; border-radius: var(--radius); padding: 24px; color: #fff; background: linear-gradient(140deg, #14294f, #22457f); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 12px; overflow: hidden; min-height: 210px; }
.mock-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,107,0,.16); }
.mock-card.featured { background: linear-gradient(140deg, #ff5a00, #ff9636); color: #fff; }
.mock-card.featured::after { background: rgba(255,255,255,.18); }
.mock-card .tile { width: 50px; height: 50px; border-radius: 14px; background: rgba(255,255,255,.14); display: grid; place-items: center; font-size: 1.5rem; position: relative; z-index: 1; }
.mock-card.featured .tile { background: rgba(255,255,255,.25); }
.mock-card h3 { margin: 0; font-size: 1.25rem; position: relative; z-index: 1; }
.mock-card .desc { opacity: .85; font-size: .93rem; flex: 1; position: relative; z-index: 1; }
.mock-card .meta { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.mock-card .chip { background: rgba(255,255,255,.14); color: #fff; }
.mock-card.featured .chip { background: rgba(255,255,255,.22); color: #fff; }
.mock-card .btn { align-self: flex-start; position: relative; z-index: 1; }
.mock-card .btn.light { background: #fff; color: var(--navy); }
.mock-card.featured .btn.light { background: var(--navy); color: #fff; }
/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.step .n { width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: var(--gold); display: grid; place-items: center; font-weight: 800; font-family: var(--serif); margin-bottom: 12px; }
.step h3 { margin: 0 0 6px; }
.step p { margin: 0; color: var(--muted); font-size: .95rem; }
.mistakes-card { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; background: linear-gradient(135deg, #fff0e5, #fff); border: 1px solid #ffc9a3; border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.mistakes-card .ic { width: 52px; height: 52px; border-radius: 14px; background: var(--gold); display: grid; place-items: center; font-size: 1.5rem; }
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; padding: 40px 0 56px; }
  .preview { display: none; }
  .steps { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .big-stat { padding: 16px 8px; }
  .big-stat .v { font-size: 1.7rem; }
  .big-stat .l { font-size: .68rem; }
  .sec-sub { margin-left: 0; }
}
.section { scroll-margin-top: 90px; }

/* ── Lessons ─────────────────────────────────────────────── */
.modal.xl { max-width: 1000px; }
.lesson-band { background: linear-gradient(135deg, #0f2147 0%, #1d3b6e 100%); color: #fff; padding: 34px 0 40px; }
.lesson-band a { color: rgba(255,255,255,.75); }
.lesson-band h1 { margin: 10px 0 0; font-size: clamp(1.7rem, 4vw, 2.5rem); }
.lesson-wrap { max-width: 860px; margin: -22px auto 0; padding: 0 16px; position: relative; }
.lesson-body { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(20px, 4vw, 44px); font-size: 1.06rem; line-height: 1.75; overflow-wrap: anywhere; }
.lesson-body h1, .lesson-body h2 { font-family: var(--serif); color: var(--navy); margin: 1.4em 0 .5em; }
.lesson-body h1 { font-size: 1.8rem; } .lesson-body h2 { font-size: 1.45rem; padding-bottom: 6px; border-bottom: 2px solid var(--gold-soft); }
.lesson-body h3 { font-size: 1.15rem; color: var(--navy-2); margin: 1.2em 0 .4em; }
.lesson-body > :first-child { margin-top: 0; }
.lesson-body p { margin: .6em 0; }
.lesson-body ul, .lesson-body ol { padding-left: 1.5em; }
.lesson-body li { margin: .25em 0; }
.lesson-body strong, .lesson-body b { color: var(--navy); }
.lesson-body mark { background: #ffe2c9; padding: 0 3px; border-radius: 3px; }
.lesson-body table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: .97rem; display: block; overflow-x: auto; }
.lesson-body th, .lesson-body td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
.lesson-body tr:first-child td, .lesson-body th { background: var(--navy); color: #fff; font-weight: 600; }
.lesson-body tr:first-child td strong, .lesson-body th strong { color: #fff; }
.lesson-body tr:nth-child(even) td { background: #f7f9fd; }
.lesson-body blockquote { margin: 1em 0; padding: 12px 18px; border-left: 4px solid var(--gold); background: var(--gold-soft); border-radius: 0 12px 12px 0; }
.lesson-body img { max-width: 100%; height: auto; border-radius: 10px; }
.lesson-body hr { border: 0; border-top: 1px solid var(--line); margin: 1.5em 0; }
.lesson-nav { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin: 20px 0; }
.lesson-cta { margin-top: 22px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: var(--navy); color: #fff; border-radius: var(--radius); padding: 22px; }
.lesson-cta h3 { margin: 0; }
.lesson-item { display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.lesson-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; }
.lesson-item .num { width: 40px; height: 40px; border-radius: 12px; background: var(--gold-soft); display: grid; place-items: center; font-size: 1.2rem; flex: 0 0 auto; }
/* Admin lesson editor */
.editor-bar { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--surface-2); }
.editor-bar button { border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 5px 9px; font: inherit; font-size: .88rem; cursor: pointer; color: var(--text); min-width: 32px; }
.editor-bar button:hover { background: #fff; border-color: var(--line); }
.editor { min-height: 320px; max-height: 55vh; overflow: auto; border: 1px solid var(--line); border-radius: 0 0 10px 10px; padding: 16px 20px; box-shadow: none; font-size: 1rem; }
.editor:focus { outline: 2px solid var(--primary-soft); }
.lesson-body th, .lesson-body td { overflow-wrap: normal; word-break: normal; }
@media (max-width: 600px) { .lesson-body { font-size: 1rem; } .lesson-body table { font-size: .9rem; } .lesson-body th, .lesson-body td { padding: 7px 8px; } }
.lesson-body .box { margin: 1em 0; padding: 14px 18px; border-left: 4px solid var(--gold); background: var(--gold-soft); border-radius: 0 12px 12px 0; }
.lesson-body .box p { margin: .3em 0; }

/* ── Mock carousel ───────────────────────────────────────── */
.see-all { font-weight: 700; color: var(--gold); white-space: nowrap; }
.carousel-wrap { position: relative; }
.carousel { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 48px) / 4); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: 8px 16px 30px; margin: -8px -16px -12px; scroll-padding: 0 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.carousel::-webkit-scrollbar { display: none; }
.carousel > * { scroll-snap-align: start; }
.carousel > .mock-card { min-height: 230px; box-shadow: 0 10px 18px -6px rgba(20,41,79,.35); }
.car-btn { position: absolute; top: 42%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: #fff; color: var(--navy); font-size: 1.8rem; line-height: 1; box-shadow: var(--shadow-lg); cursor: pointer; z-index: 3; display: none; }
.car-btn.show { display: grid; place-items: center; }
.car-btn:hover { background: var(--gold); color: #fff; }
.car-btn.prev { left: -22px; } .car-btn.next { right: -22px; }
.mock-card .done-badge { position: absolute; top: 14px; right: 14px; z-index: 2; background: var(--good); color: #fff; font-size: .8rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.mock-card.done { background: linear-gradient(140deg, #2a3a5c, #3a4f78); }
@media (max-width: 1000px) { .carousel { grid-auto-columns: calc((100% - 32px) / 3); } }
@media (max-width: 760px) { .carousel { grid-auto-columns: 78%; } .car-btn { display: none !important; } }
