:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #1d4ed8;
  --brand-ink: #ffffff;
  --brand-soft: #e8eefc;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --bad: #b91c1c;
  --bad-soft: #fdecec;
  --mid: #b45309;
  --mid-soft: #fdf3e2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120; --card: #111a2e; --ink: #e5e9f2; --muted: #94a3b8; --line: #23304a;
    --brand: #5b8cff; --brand-ink: #0b1120; --brand-soft: #18264a;
    --ok: #4ade80; --ok-soft: #10301f; --bad: #f87171; --bad-soft: #3a1717; --mid: #fbbf24; --mid-soft: #33270d;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
table { border-collapse: collapse; }
code { background: var(--brand-soft); padding: 0 .3em; border-radius: 4px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 24px; padding-bottom: 48px; min-height: 70vh; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.center { text-align: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; font-weight: 700; color: var(--brand); margin-bottom: .4em; }
.lead { font-size: 1.1rem; color: var(--muted); }
.hl { color: var(--brand); }

/* header & footer */
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink); text-decoration: none; }
.logo { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--brand); color: var(--brand-ink); font-weight: 800; }
.nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: .95rem; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover { color: var(--brand); }
.foot { border-top: 1px solid var(--line); padding: 24px 0; background: var(--card); }
body.focus .top { position: static; }

/* buttons */
.btn { display: inline-block; border: 0; cursor: pointer; background: var(--brand); color: var(--brand-ink) !important; text-decoration: none; padding: .6em 1.1em; border-radius: 10px; font: inherit; font-weight: 650; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: transparent; color: var(--brand) !important; box-shadow: inset 0 0 0 1.5px var(--brand); }
.btn-sm { padding: .35em .8em; font-size: .9rem; }
.btn-lg { padding: .8em 1.4em; font-size: 1.05rem; }
.btn-block { display: block; width: 100%; text-align: center; }

/* cards & blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 550; }
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--bad-soft); color: var(--bad); }
.flash-info { background: var(--brand-soft); color: var(--brand); }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: .05em .55em; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
.tag-free { background: var(--ok-soft); color: var(--ok); }
.bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 6px 0 10px; }
.bar span { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .3s; }
.bar-sm { height: 6px; margin: 6px 0 0; }
.bar-bad span { background: var(--bad); }
.bar-mid span { background: var(--mid); }
.section-title { margin-top: 32px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.page-head { margin-bottom: 18px; }

/* home */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: center; padding: 24px 0 8px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.facts li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.facts b { display: block; font-size: 1.6rem; color: var(--brand); }
.facts span { font-size: .88rem; color: var(--muted); }
.progress-card { margin-top: 24px; }
.steps { list-style: none; counter-reset: s; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.steps li { counter-increment: s; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; margin-bottom: 6px; }
.steps b { display: block; }
.steps span { font-size: .9rem; color: var(--muted); }
.modules { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.module-card { display: flex; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--ink); text-decoration: none; transition: border-color .15s; }
.module-card:hover { border-color: var(--brand); }
.module-card h3 { margin-bottom: .2em; }
.module-card p { margin: 0 0 .3em; }
.module-card > div { flex: 1; min-width: 0; }
.num { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.test-card .num { background: var(--ok-soft); color: var(--ok); }
.cta { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 32px; background: var(--brand-soft); border-color: transparent; }

/* module & lesson */
.lesson-list { list-style: none; padding: 0; margin: 16px 0; }
.lesson-item a { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; color: var(--ink); text-decoration: none; }
.lesson-item a:hover { border-color: var(--brand); }
.lnum { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.st-done .lnum { background: var(--ok-soft); color: var(--ok); }
.st-retry .lnum { background: var(--mid-soft); color: var(--mid); }
.ltitle { flex: 1; font-weight: 600; }
.ltitle small { display: block; font-weight: 400; }
.locked a { opacity: .75; }
.goals ul, .formulas ul, .mistakes ul { margin: 0; padding-left: 1.2em; }
.goals li, .formulas li, .mistakes li { margin-bottom: .35em; }
.formulas { background: var(--brand-soft); border-color: transparent; }
.mistakes { background: var(--mid-soft); border-color: transparent; }
.toc { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; position: sticky; top: 60px; background: var(--bg); padding: 8px 0; z-index: 10; }
.prose { font-size: 1.04rem; }
.prose table, .q-text table, .explain table { border: 1px solid var(--line); margin: 10px 0; display: block; overflow-x: auto; max-width: 100%; }
.prose th, .prose td, .q-text th, .q-text td, .explain td, .explain th { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.prose th { background: var(--brand-soft); }
.example .ex-title { margin-bottom: .4em; }
details summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.ex-steps { margin: 10px 0; padding-left: 1.3em; }
.ex-steps li { margin-bottom: .3em; }
.ex-answer { background: var(--ok-soft); padding: 8px 12px; border-radius: 8px; }
.locked-box { text-align: center; padding: 32px 20px; }
.pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }

/* video */
.video-card { padding: 10px; }
.video-card video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; background: #0b1120; }
.video-card p { margin: 8px 6px 2px; }

/* questions */
.question { scroll-margin-top: 130px; }
.q-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.q-num { font-weight: 800; color: var(--brand); }
.q-type { font-size: .8rem; color: var(--muted); }
.q-text { margin-bottom: 10px; }
.options { display: grid; gap: 8px; }
.opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; }
.opt:hover { border-color: var(--brand); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .ol { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: .85rem; }
.opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.opt:has(input:checked) .ol { background: var(--brand); color: var(--brand-ink); }
.opt:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.opt-ok { border-color: var(--ok) !important; background: var(--ok-soft) !important; }
.opt-bad { border-color: var(--bad) !important; background: var(--bad-soft) !important; }
.match-opts { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 10px 12px; background: var(--brand-soft); border-radius: 10px; margin-bottom: 10px; }
.match-row, .part { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.part { flex-wrap: wrap; }
.part span { flex: 1 1 260px; }
input[type=text], input[type=tel], input[type=password], input[type=number], input[type=search], select, textarea {
  font: inherit; color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; padding: .55em .75em; max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
.part input { width: 160px; }
.in-ok { border-color: var(--ok) !important; background: var(--ok-soft) !important; }
.in-bad { border-color: var(--bad) !important; background: var(--bad-soft) !important; }
.hint { margin: 6px 0 0; }
.q-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.feedback { margin-top: 12px; padding: 12px 14px; border-radius: 10px; }
.fb-ok { background: var(--ok-soft); }
.fb-bad { background: var(--bad-soft); }
.fb-info { background: var(--brand-soft); }
.verdict { font-weight: 800; }
.explain { margin-top: 6px; }
.was-right { border-left: 4px solid var(--ok); }
.was-wrong { border-left: 4px solid var(--bad); }
.practice-status form.inline { display: inline; }

/* attempt */
.attempt-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: space-between; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.3rem; }
.timer.low { color: var(--bad); }
.qnav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.qnav a { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-size: .85rem; font-weight: 600; }
.qnav a.done { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* result */
.result-head { display: flex; gap: 22px; align-items: center; }
.score-ring { flex: none; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; align-content: center; background: var(--brand-soft); border: 6px solid var(--brand); }
.score-ring b { font-size: 2rem; line-height: 1; }
.score-ring span { font-size: .85rem; color: var(--muted); }
.topic-row { display: grid; grid-template-columns: minmax(140px, 1.3fr) 2fr 48px auto; align-items: center; gap: 12px; padding: 6px 0; }
.topic-row .bar { margin: 0; }
.tpct { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.review.ok { border-left: 4px solid var(--ok); }
.review.bad { border-left: 4px solid var(--bad); }
.review.part { border-left: 4px solid var(--mid); }

/* forms & tables */
.auth { max-width: 440px; margin: 20px auto; }
.form label { display: block; margin-bottom: 12px; font-weight: 600; font-size: .95rem; }
.form label input, .form label textarea { display: block; width: 100%; margin-top: 4px; font-weight: 400; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { margin: 0; }
.inline-form label input { width: 110px; }
.table { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: block; overflow-x: auto; }
.table th, .table td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.table th { font-size: .85rem; color: var(--muted); }
.kv { list-style: none; padding: 0; margin: 0 0 16px; }
.kv li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
.card-number { font-size: 1.5rem; font-weight: 800; letter-spacing: .06em; font-variant-numeric: tabular-nums; margin: 8px 0 0; }

/* admin */
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-nav a { padding: .35em .8em; border-radius: 8px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .9rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: var(--ink); text-decoration: none; }
.stat b { display: block; font-size: 1.5rem; }
.stat span { font-size: .85rem; color: var(--muted); }
.stat-alert { border-color: var(--mid); background: var(--mid-soft); }
.tabs { display: flex; gap: 6px; }
.tabs a { padding: .3em .8em; border-radius: 999px; text-decoration: none; background: var(--card); border: 1px solid var(--line); }
.tabs a.active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.pay-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.pay-actions { display: flex; gap: 6px; flex: none; }
.search { display: flex; gap: 8px; margin-bottom: 12px; }
.rate { display: inline-block; margin: 0 6px 4px 0; padding: 0 .4em; border-radius: 6px; background: var(--brand-soft); font-variant-numeric: tabular-nums; }
.rate-bad { background: var(--bad-soft); color: var(--bad); }

@media (max-width: 760px) {
  .hero, .grid2 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .modules { grid-template-columns: 1fr; }
  .cta, .pay-row, .result-head { flex-direction: column; align-items: stretch; }
  .score-ring { margin: 0 auto; }
  .topic-row { grid-template-columns: 1fr 48px; }
  .topic-row .bar { grid-column: 1 / -1; grid-row: 2; }
  .topic-row a { display: none; }
  .match-row { flex-direction: column; align-items: stretch; }
  .part input { width: 100%; }
  .nav { gap: 10px; font-size: .9rem; }
  .toc { top: 0; position: static; }
}

/* ---------------------------------------------------------------- course offer on results */
.offer { border: 2px solid var(--brand); background: linear-gradient(180deg, var(--brand-soft), var(--card) 70%); }
.offer h2 { margin: .1em 0 .4em; }
.offer-good { border-color: var(--ok); background: linear-gradient(180deg, var(--ok-soft), var(--card) 70%); }
.offer-good .eyebrow { color: var(--ok); }
.offer-weak { margin: .2em 0 .8em; }
.offer-list { list-style: none; padding: 0; margin: .8em 0 1em; display: grid; gap: .35em; }
.offer-list li::before { content: "✓"; color: var(--ok); font-weight: 700; margin-right: .5em; }
.offer-cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.guest-note { border-style: dashed; }
@media (max-width: 640px) { .offer-cta .btn { width: 100%; text-align: center; } }

/* ---------------------------------------------------------------- phones and tablets */
.math-scroll { display: inline-block; max-width: 100%; overflow-x: auto; overflow-y: hidden; vertical-align: middle; padding: 2px 0; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
@media (pointer: coarse) {
  .nav a:not(.btn), .toc a, .crumbs a { display: inline-block; padding: 9px 4px; }
  .nav { gap: 6px 10px; }
  details summary { padding: 8px 0; }
  .fig-slider { min-height: 44px; }
  .fig-slider input[type=range] { height: 32px; }
}

/* ---------------------------------------------------------------- faq, lesson preview */
.faq details.card { padding: 12px 18px; }
.faq summary { list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { display: inline; font-size: 1.02rem; color: var(--ink); }
.faq summary::before { content: "＋"; color: var(--brand); font-weight: 800; margin-right: .5em; }
.faq details[open] summary::before { content: "－"; }
.faq details p { margin: .6em 0 .2em; }
.lesson-preview { position: relative; max-height: none; }
.lesson-outline ul { margin: .3em 0 0; }

/* ---------------------------------------------------------------- telegram */
.tg-btn { background: #229ed9; border-color: #229ed9; color: #fff; margin: 6px 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn-row form { margin: 0; }

/* ---------------------------------------------------------------- waiting animations */
@keyframes sa-spin { to { transform: rotate(360deg); } }
@keyframes sa-pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes sa-bar { 0% { left: -40%; } 100% { left: 100%; } }
.spinner { width: 40px; height: 40px; border: 4px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: sa-spin .8s linear infinite; }
.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 40px 16px; color: var(--muted); text-align: center; }
.loading p { margin: 0; animation: sa-pulse 1.6s ease-in-out infinite; }
.loading-bar { position: relative; width: min(260px, 70%); height: 4px; border-radius: 4px; background: var(--brand-soft); overflow: hidden; }
.loading-bar::after { content: ""; position: absolute; top: 0; left: -40%; width: 40%; height: 100%; border-radius: 4px; background: var(--brand); animation: sa-bar 1.3s ease-in-out infinite; }
.video-wrap { position: relative; }
.video-wait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; border-radius: 10px; background: rgba(11, 17, 32, .78); color: #fff; text-align: center; z-index: 2; }
.video-wait[hidden] { display: none; }
.video-wait .spinner { border-color: rgba(255, 255, 255, .25); border-top-color: #fff; }
.video-wait p { margin: 0; font-weight: 600; animation: sa-pulse 1.6s ease-in-out infinite; }
.video-wait small { opacity: .8; }
.video-wait .loading-bar { background: rgba(255, 255, 255, .2); }
.video-wait .loading-bar::after { background: #fff; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border: 3px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: sa-spin .7s linear infinite; }
.btn-ghost.is-loading::after { border-color: var(--brand-soft); border-top-color: var(--brand); }
@media (prefers-reduced-motion: reduce) { .spinner, .btn.is-loading::after { animation-duration: 2.4s; } .loading p, .video-wait p { animation: none; } .loading-bar::after { animation-duration: 3s; } }

/* ---------------------------------------------------------------- figures */
.fig { color: #0f172a; margin: 1.2rem auto; max-width: 560px; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: .8rem .9rem; }
.fig-stage { position: relative; }
.fig-stage > svg { display: block; width: 100%; height: auto; }
.fig-labels { position: absolute; inset: 0; pointer-events: none; }
.fig-label { position: absolute; white-space: nowrap; font-size: 15px; font-weight: 600; color: #0f172a; line-height: 1; }
.fig-label.fig-tick { font-size: 12px; font-weight: 400; color: #64748b; }
.fig-label.fig-axis { font-style: italic; font-size: 15px; color: #334155; }
.fig-label.fig-count { font-size: 20px; font-weight: 700; }
.fig-label.fig-set { font-size: 20px; font-weight: 700; }
.fig-label.fig-num { font-size: 13px; }
.fig-label.fig-sign { font-size: 22px; font-weight: 800; }
.fig-controls { display: grid; gap: .35rem; margin-top: .6rem; padding-top: .6rem; border-top: 1px dashed #e2e8f0; }
.fig-slider { display: grid; grid-template-columns: 3.2em 1fr 3.4em; align-items: center; gap: .6rem; font-size: .95rem; }
.fig-slider input { width: 100%; accent-color: #1d4ed8; }
.fig-slider output { font-variant-numeric: tabular-nums; font-weight: 700; color: #1d4ed8; text-align: right; }
.fig-readout { margin-top: .5rem; padding: .45rem .7rem; background: #eff6ff; border-radius: 10px; font-size: 1rem; }
.fig-caption { margin-top: .5rem; font-size: .9rem; color: #64748b; text-align: center; }
.example .fig { margin: .8rem 0; }

/* ---------------------------------------------------------------- content protection */
/* Learners cannot select, copy, drag or print the course material (admins can). */
body.protect .main { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.protect .main input, body.protect .main textarea, body.protect .main select, body.protect .main [contenteditable] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
body.protect img, body.protect svg, body.protect video { -webkit-user-drag: none; }
.wm { position: absolute; z-index: 3; top: 8%; left: 6%; max-width: 88%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none;
  font: 600 13px/1.3 system-ui, sans-serif; color: rgba(128, 128, 128, .62); text-shadow: 0 0 2px rgba(255, 255, 255, .35); transition: top 2s ease, left 2s ease; }
.video-fs { position: absolute; z-index: 4; top: 8px; right: 8px; width: 38px; height: 38px; border: 0; border-radius: 8px; background: rgba(11, 17, 32, .6); color: #fff; font-size: 18px; line-height: 38px; cursor: pointer; opacity: .85; }
.video-fs:hover, .video-fs:focus-visible { opacity: 1; background: rgba(11, 17, 32, .85); }
.video-wrap:fullscreen { display: flex; align-items: center; justify-content: center; background: #000; }
.video-wrap:fullscreen video { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
.video-wrap:fullscreen .wm { font-size: 18px; }
.video-wrap:-webkit-full-screen { display: flex; align-items: center; justify-content: center; background: #000; width: 100%; height: 100%; }
.video-wrap:-webkit-full-screen video { width: 100%; height: 100%; border-radius: 0; }
@media print {
  body.protect .top, body.protect .main, body.protect .foot { display: none !important; }
  body.protect::before { content: "Kurs materiallarini chop etish yopiq — Sertifikat Akademiya"; display: block; padding: 40px; font: 600 18px/1.4 sans-serif; }
}

/* ---------------------------------------------------------------- admin: visitors */
.vhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.vhead h1 { margin: 0; }
.vperiods { display: flex; gap: 4px; flex-wrap: wrap; }
.vperiods a { padding: .3em .75em; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-size: .9rem; }
.vperiods a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.vbox { margin-top: 14px; }
.vbox h2 { font-size: 1.05rem; margin: 0 0 10px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 14px; }
.vrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; margin-bottom: 8px; font-size: .92rem; }
.vrow .bar { grid-column: 1 / -1; margin: 0; }
.vrow-k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vrow-n { color: var(--muted); white-space: nowrap; }
.vrow-n b { color: var(--ink); }
.vchart { display: flex; align-items: flex-end; gap: 2px; height: 180px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.vchart-sm { height: 120px; }
.vcol { position: relative; flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; }
.vcol span { display: block; width: 100%; max-width: 28px; background: var(--brand); border-radius: 4px 4px 0 0; }
.vcol:hover span, .vcol:focus span { filter: brightness(1.15); }
.vcol small { position: absolute; bottom: -18px; font-size: .7rem; color: var(--muted); white-space: nowrap; }
.vcol:hover::after, .vcol:focus::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); z-index: 5; padding: 5px 8px; border-radius: 6px; background: var(--ink); color: var(--card); font-size: .78rem; white-space: nowrap; pointer-events: none; }
.vcol:nth-child(-n+3):hover::after, .vcol:nth-child(-n+3):focus::after { left: 0; transform: none; }
.vcol:nth-last-child(-n+3):hover::after, .vcol:nth-last-child(-n+3):focus::after { left: auto; right: 0; transform: none; }

/* ---------------------------------------------------------------- course switch (payment) */
.course-switch { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.course-switch a { padding: .45em .9em; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-weight: 600; }
.course-switch a.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------------------------------------------------------------- English (CEFR) */
.en-format { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.en-format h3 { margin: 0 0 6px; font-size: 1.05rem; }
.en-format p { margin: 0; font-size: .92rem; color: var(--muted); }
.en-hero-stats { grid-template-columns: repeat(2, 1fr); }
.en-module { margin-bottom: 14px; }
.en-module h3 { margin-top: 0; }
.en-steps { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.en-steps span { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.en-steps span.now { background: var(--brand); border-color: var(--brand); color: #fff; }
.en-steps span.done { text-decoration: line-through; opacity: .6; }
.en-part { margin: 14px 0; }
.en-part-title { margin: 0 0 4px; }
.en-part-title small { color: var(--muted); font-weight: 500; }
.en-instr { font-style: italic; color: var(--muted); margin: 0 0 10px; }
.en-text-title { margin: 12px 0 6px; }
.en-text { margin: 10px 0; }
.en-summary { margin: 10px 0; background: var(--brand-soft); }
.en-num { display: inline-block; min-width: 1.6em; padding: 0 .35em; margin-right: .25em; border-radius: 6px; background: var(--brand); color: #fff; font-size: .8rem; text-align: center; }
.en-gapwrap { white-space: nowrap; }
.en-gap { width: 9.5em; max-width: 60vw; padding: .2em .45em; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); font: inherit; }
.en-sel { padding: .2em .4em; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); font: inherit; }
.en-opts { display: grid; gap: 6px; margin: 6px 0 10px; }
.en-opts label, .en-opts > div { display: block; padding: .45em .7em; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.en-opts label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.en-opts-review .ok { border-color: var(--good, #16a34a); }
.en-tfng { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: 4px; }
.en-tfng label { padding: .2em .6em; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: .9rem; }
.en-tfng label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.en-item { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.en-item:last-child { border-bottom: 0; }
.en-q { margin: 6px 0; }
.en-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin: 10px 0; }
.en-options-long { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.en-option { padding: .5em .7em; border: 1px solid var(--line); border-radius: 8px; font-size: .93rem; }
.en-option b { color: var(--brand); margin-right: .3em; }
.en-para { margin: 10px 0; }
.en-para-q { margin-bottom: 4px; }
.en-para p { margin: 0; }
.en-audio { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0 10px; padding: 8px 10px; border-radius: 10px; background: var(--brand-soft); }
.en-script { flex-basis: 100%; font-size: .9rem; }
.en-script p { margin: 4px 0; }
.en-map { display: block; width: 100%; max-width: 640px; margin: 8px auto; }
.en-map-bg { fill: var(--card); stroke: var(--line); stroke-width: 2; }
.en-map-path { stroke: var(--line); stroke-width: 10; stroke-linecap: round; }
.en-map-feat rect { fill: var(--brand-soft); stroke: var(--brand); stroke-width: 1.5; }
.en-map-feat text { font: 600 12px system-ui, sans-serif; fill: var(--ink); text-anchor: middle; }
.en-map-letter rect { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.en-map-letter text { font: 700 18px system-ui, sans-serif; fill: #111; text-anchor: middle; }
.en-map-title { font: 600 14px system-ui, sans-serif; fill: var(--muted); text-anchor: middle; }
.en-mark { display: inline-block; padding: 1px 8px; border-radius: 6px; font-weight: 600; }
.en-mark.ok { background: rgba(22, 163, 74, .15); color: #16a34a; }
.en-mark.bad { background: rgba(220, 38, 38, .12); color: #dc2626; }
.en-mark small { font-weight: 500; }
.is-ok .en-gap, .is-ok .en-sel { border-color: #16a34a; background: rgba(22, 163, 74, .1); }
.is-bad .en-gap, .is-bad .en-sel { border-color: #dc2626; background: rgba(220, 38, 38, .08); }
.en-item.is-ok { background: rgba(22, 163, 74, .06); }
.en-item.is-bad { background: rgba(220, 38, 38, .05); }
.en-right { margin-left: 6px; color: #16a34a; font-weight: 600; }
.en-explain { margin-top: 10px; }
.en-explain li { margin: 4px 0; font-size: .92rem; }
.en-stimulus { background: var(--brand-soft); }
.en-wtask textarea, .en-write { width: 100%; padding: .6em .7em; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; line-height: 1.5; resize: vertical; }
.en-wc.low span { color: #dc2626; }
.en-wc.high span { color: #d97706; }
.en-wc.ok span { color: #16a34a; }
.en-speak .en-sq { padding-top: 6px; }
.en-sq-state { margin: 12px 0 6px; font-size: 1.1rem; }
.en-sq-clock { font-variant-numeric: tabular-nums; font-size: 1.3rem; }
.en-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 8px 0; }
.en-photo { margin: 0; }
.en-photo img { width: 100%; border-radius: 10px; display: block; }
.en-photo-text { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border: 2px dashed var(--line); border-radius: 10px; min-height: 120px; color: var(--muted); font-size: .92rem; }
.en-photo-text span { font-size: 1.8rem; }
.en-forag h4 { margin: 0 0 4px; }
.en-score-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 16px; margin-bottom: 10px; }
.en-level { font-size: 2.6rem; line-height: 1; color: var(--brand); }
.en-mytext { padding: 10px; border-radius: 8px; background: var(--brand-soft); white-space: normal; }
.en-feedback { margin: 10px 0; padding: 10px 12px; border-left: 4px solid var(--brand); background: var(--card); }
.en-corr td, .en-corr th { white-space: normal; }
.en-sq-review { margin: 8px 0; }
.en-sq-review audio { width: 100%; max-width: 420px; }
.en-sq-practice audio { max-width: 100%; }
.en-ladder { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.en-ladder a { display: flex; flex-direction: column; align-items: center; min-width: 74px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; }
.en-ladder a b { font-size: 1.15rem; color: var(--brand); }
.en-ladder a small { color: var(--muted); font-size: .75rem; }
.en-ladder a.soon { opacity: .55; }
.en-track-title small { font-size: .85rem; font-weight: 500; }

/* ---------------------------------------------------------------- mock-exam certificate */
.cert-card { display: flex; gap: 20px; align-items: center; border: 2px solid var(--mid); background: linear-gradient(180deg, var(--mid-soft), var(--card) 75%); }
.cert-card .eyebrow { color: var(--mid); }
.cert-card h2 { margin: 4px 0 8px; }
.cert-thumb img { display: block; width: 124px; height: auto; border-radius: 4px; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.cert-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.cert-form input { flex: 1 1 240px; min-width: 0; padding: 10px 12px; font-size: 16px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.cert-page { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 16px; }
.cert-ok { color: var(--ok); font-weight: 600; margin: 0 0 6px; }
.cert-info h1 { margin: 0 0 12px; font-size: 1.5rem; }
.cert-dl { margin: 0 0 16px; }
.cert-dl div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.cert-dl dt { color: var(--muted); }
.cert-dl dd { margin: 0; text-align: right; }
.cert-actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.cert-cta { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--brand-soft); }
.cert-sheet { margin: 0; }
.cert-sheet img { display: block; width: 100%; height: auto; border-radius: 4px; box-shadow: 0 10px 34px rgba(15, 23, 42, .22); }
@media (max-width: 760px) {
  .cert-page { grid-template-columns: 1fr; }
  .cert-sheet { order: -1; }
  .cert-card { flex-direction: column; align-items: flex-start; }
}
@media print {
  @page { size: A4; margin: 0; }
  body:has(.cert-page) .top, body:has(.cert-page) .foot, body:has(.cert-page) .cert-info, body:has(.cert-page) .crumbs { display: none !important; }
  body:has(.cert-page) .main, body:has(.cert-page) .wrap { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .cert-page { display: block; margin: 0; }
  .cert-sheet img { width: 210mm; height: 297mm; box-shadow: none; border-radius: 0; }
}
