/* Aeroclass LMS student site. Colours follow the certificate: navy, gold, warm paper. */
:root {
  --navy: #0b2e4f;
  --navy-2: #16426b;
  --gold: #b8892f;
  --gold-soft: #f3e7c9;
  --bg: #f6f4ee;
  --card: #ffffff;
  --ink: #1f2933;
  --muted: #5b6670;
  --line: #e3dfd3;
  --ok: #1f7a4d;
  --ok-soft: #e3f3ea;
  --bad: #b3261e;
  --bad-soft: #fbe9e7;
  --info-soft: #e8f0f8;
  --focus: #2b6cb0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11, 46, 79, .06), 0 4px 16px rgba(11, 46, 79, .06);
}
:root { color-scheme: light; }
/* Dark only when the student chooses it (🌙 in the header); light is the default on every device. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --navy: #9cc2ec;
  --navy-2: #bcd5f0;
  --gold: #e3b866;
  --gold-soft: #45392a;
  --bg: #1b2531;
  --card: #243241;
  --ink: #edf1f5;
  --muted: #a9b6c3;
  --line: #34465a;
  --ok: #6fd6a0;
  --ok-soft: #1f3d30;
  --bad: #ff9a90;
  --bad-soft: #472826;
  --info-soft: #2a3b4e;
  --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: 76px; /* room for the phone tab bar */
}
@media (min-width: 900px) { body { padding-bottom: 0; } }
a { color: var(--navy-2); }
img, iframe { max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

/* ---------- top bar ---------- */
.topbar { background: #0b2e4f; color: #fff; position: sticky; top: 0; z-index: 20; }
.topbar .wrap { display: flex; align-items: center; gap: 16px; height: 56px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .2px; display: flex; gap: 8px; align-items: center; white-space: nowrap; flex: none; }
.brand .logo { color: #e0b25a; font-size: 20px; }
.brand small { font-weight: 500; opacity: .75; }
.topnav { display: none; gap: 4px; margin-left: 12px; }
.topnav a { color: #dbe6f1; text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: 15px; white-space: nowrap; }
.topnav a.on, .topnav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 14px; color: #dbe6f1; display: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.topbar form { margin: 0; flex: none; }
.topbar .admin-link { text-decoration: none; white-space: nowrap; flex: none; border-color: #e0b25a; color: #e0b25a; }
/* Small phones: the header must never be wider than the screen */
@media (max-width: 480px) {
  .topbar .wrap { gap: 8px; }
  .brand small, .topbar .admin-link .label { display: none; }
  .linkbtn { padding: 6px 10px; }
}
.linkbtn { background: none; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; }
@media (min-width: 900px) { .topnav { display: flex; } }
@media (min-width: 1280px) { .topbar .who { display: block; } }
@media (min-width: 900px) and (max-width: 1100px) { .topnav a { padding: 8px 7px; font-size: 14px; } .brand small { display: none; } }

/* ---------- phone tab bar ---------- */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { text-decoration: none; color: var(--muted); font-size: 11px; display: flex; flex-direction: column; align-items: center; padding: 8px 2px 6px; gap: 2px; }
.tabbar a .i { font-size: 20px; line-height: 1; }
.tabbar a.on { color: var(--navy); font-weight: 600; }
@media (min-width: 900px) { .tabbar { display: none; } }

/* ---------- layout ---------- */
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 20px; padding-bottom: 32px; }
h1 { font-size: 26px; line-height: 1.25; margin: 4px 0 6px; color: var(--navy); }
h2 { font-size: 19px; margin: 28px 0 10px; color: var(--navy); }
h3 { font-size: 16px; margin: 0 0 4px; }
.lead { color: var(--muted); margin: 0 0 18px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }
.grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.hero { background: linear-gradient(135deg, #0b2e4f, #16426b); color: #fff; border: 0; }
.card.hero h2, .card.hero h3 { color: #fff; margin-top: 0; }
.card.hero .muted { color: #c9d8e8; }
a.card { display: block; text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--gold); }
.row { display: flex; align-items: center; gap: 12px; }
.row .grow { flex: 1; min-width: 0; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--gold); color: #1b1404; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.navy { background: #0b2e4f; color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--gold); }
.btn.block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.actions.split { justify-content: space-between; }

/* ---------- badges, chips, progress ---------- */
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--info-soft); color: var(--navy); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.gold { background: var(--gold-soft); color: #7a5a17; }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
:root[data-theme="dark"] .chip.gold { color: var(--gold); }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.bar > span { display: block; height: 100%; background: var(--gold); border-radius: 99px; }
.stat { font-size: 26px; font-weight: 700; color: var(--navy); line-height: 1.1; }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list li + li { border-top: 1px solid var(--line); }
.list a, .list .item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none; color: inherit; min-height: 56px; }
.list a:hover { background: var(--bg); }
.list .code { font-weight: 700; color: var(--navy); min-width: 64px; }
.list .title { flex: 1; min-width: 0; }
.list .locked { color: var(--muted); }
.mark { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; flex: none; border: 2px solid var(--line); color: var(--muted); }
.mark.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.mark.now { border-color: var(--gold); color: var(--gold); }
details.section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
details.section > summary { cursor: pointer; padding: 14px 16px; font-weight: 600; list-style: none; display: flex; gap: 10px; align-items: center; }
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary::after { content: "▾"; margin-left: auto; color: var(--muted); }
details.section[open] > summary::after { content: "▴"; }
details.section .list { border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- lesson ---------- */
.lesson { font-size: 17px; line-height: 1.7; }
.lesson p { margin: 0 0 1em; }
.video { position: relative; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden; background: #000; margin: 18px 0; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- questions ---------- */
.qhead { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.qtext { font-size: 18px; font-weight: 600; margin: 0 0 16px; white-space: pre-line; }
.options { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; }
.option { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; }
.option:hover { border-color: var(--gold); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option .letter { flex: none; width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; background: var(--info-soft); color: var(--navy); }
.option:has(input:checked) { border-color: var(--navy); background: var(--info-soft); }
.option:has(input:checked) .letter { background: #0b2e4f; color: #fff; }
.option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.answer { padding: 12px 14px; border-radius: 12px; margin: 8px 0; }
.answer.ok { background: var(--ok-soft); }
.answer.bad { background: var(--bad-soft); }

/* ---------- final exam ---------- */
.examtop { position: sticky; top: 56px; z-index: 10; background: var(--bg); padding: 10px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 18px; color: var(--navy); background: var(--card); border: 1px solid var(--line); padding: 6px 12px; border-radius: 10px; }
.timer.low { color: var(--bad); border-color: var(--bad); }
.navgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; margin-top: 10px; }
.navgrid button { min-height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.navgrid button.ans { background: var(--info-soft); border-color: var(--navy-2); color: var(--navy); font-weight: 600; }
.navgrid button.here { outline: 3px solid var(--gold); outline-offset: 1px; }

.navgrid button.flagged { position: relative; border-color: var(--gold); }
.navgrid button.flagged::after { content: "🚩"; position: absolute; top: -8px; right: -6px; font-size: 12px; }
.flagbox { display: inline-flex; gap: 8px; align-items: center; margin-top: 14px; cursor: pointer; font-size: 15px; }
.flagbox input[type=checkbox] { width: 18px; height: 18px; }
/* During a final exam: no menus to tap away from the exam */
body.exam-mode { padding-bottom: 0; }
.exam-mode .tabbar, .exam-mode .topnav, .exam-mode .topbar form, .exam-mode .topbar .who, .exam-mode footer.site { display: none !important; }
.exam-mode .brand { pointer-events: none; }
.exam-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(8, 20, 33, .92); display: flex;
  align-items: center; justify-content: center; padding: 16px; }
.exam-overlay[hidden] { display: none; }
.exam-overlay .card { max-width: 420px; text-align: center; }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 14px; }
label.field span { display: block; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=tel], select { width: 100%; min-height: 46px; padding: 10px 12px; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.error { color: var(--bad); font-size: 14px; margin-top: 4px; }

/* ---------- flash ---------- */
.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; background: var(--info-soft); }
.flash.success { background: var(--ok-soft); }
.flash.error { background: var(--bad-soft); }

/* ---------- sign in / sign up ---------- */
.authcard { max-width: 460px; margin: 10px auto; }
.authbuttons { display: grid; gap: 10px; margin: 18px 0 6px; justify-items: stretch; }
.authbtn.google { background: #fff; color: #1f1f1f; border-color: #dadce0; font-weight: 600; }
.authbtn.google:hover { border-color: #b8892f; }
.glogo { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); }
.tgwidget { display: flex; justify-content: center; min-height: 44px; }
.authbtn.telegram { background: #2aabee; border-color: #2aabee; color: #fff; font-weight: 600; }
.authbtn.telegram:hover { background: #229ed9; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.codebox { font: 700 26px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 2px;
  background: var(--gold-soft); border-radius: 12px; padding: 14px; margin: 16px 0; }
input[type=email], input[type=password] { width: 100%; min-height: 46px; padding: 10px 12px; font: inherit; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
details summary { cursor: pointer; color: var(--navy-2); }

.qrbox { background: #fff; padding: 10px; border-radius: 12px; width: 220px; margin: 12px auto; }
.qrbox svg { display: block; width: 200px; height: 200px; }
.setupkey { font-size: 15px; letter-spacing: 1px; word-break: break-all; }
.linkish { background: none; border: 0; padding: 0; color: var(--navy-2); text-decoration: underline; font: inherit; cursor: pointer; }

/* ---------- landing page ---------- */
body.landing-page main.wrap { padding-top: 0; padding-bottom: 0; }
.lp-hero { background: radial-gradient(1200px 500px at 85% -10%, #1d5a8f 0%, transparent 60%),
  linear-gradient(160deg, #0b2e4f 0%, #0e3a63 60%, #0b2e4f 100%); color: #fff; padding: 56px 0 64px; overflow: hidden; }
.lp-hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .lp-hero-grid { grid-template-columns: 1.15fr .85fr; } .lp-hero { padding: 84px 0 92px; } }
.lp-eyebrow { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .4px; color: #f3d38e;
  background: rgba(224, 178, 90, .14); border: 1px solid rgba(224, 178, 90, .35); padding: 6px 12px; border-radius: 999px; }
.lp-hero h1 { color: #fff; font-size: clamp(30px, 6vw, 50px); line-height: 1.1; letter-spacing: -.5px; margin: 18px 0 16px; max-width: 640px; }
.lp-lead { color: #cfdcea; font-size: clamp(16px, 2.2vw, 19px); max-width: 580px; margin: 0; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.lp-btn-lg { min-height: 52px; padding: 12px 24px; font-size: 16px; border-radius: 12px; }
.lp-btn-outline { background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, .45); }
.lp-btn-outline:hover { border-color: #e0b25a; color: #f3d38e; }
.lp-note { color: #9fb5cc; font-size: 14px; margin: 14px 0 0; }

.lp-phone { justify-self: center; width: 280px; border-radius: 36px; padding: 12px; background: #06192b;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .35), inset 0 0 0 2px rgba(255, 255, 255, .08); transform: rotate(-3deg); }
.lp-phone-screen { background: #f6f4ee; color: #1f2933; border-radius: 26px; padding: 22px 16px 18px; font-size: 14px; }
.lp-q-head { display: flex; justify-content: space-between; font-size: 12px; color: #5b6670; font-weight: 600; }
.lp-q-bar { height: 6px; background: #e3dfd3; border-radius: 99px; margin: 8px 0 14px; overflow: hidden; }
.lp-q-bar span { display: block; height: 100%; background: #b8892f; }
.lp-q-text { font-weight: 700; margin: 0 0 12px; line-height: 1.35; }
.lp-opt { display: flex; gap: 10px; align-items: center; background: #fff; border: 2px solid #e3dfd3; border-radius: 10px;
  padding: 9px 10px; margin-bottom: 8px; }
.lp-opt b { width: 24px; height: 24px; border-radius: 6px; background: #e8f0f8; color: #0b2e4f; display: inline-flex;
  align-items: center; justify-content: center; font-size: 12px; flex: none; }
.lp-opt-on { border-color: #0b2e4f; background: #e8f0f8; }
.lp-opt-on b { background: #0b2e4f; color: #fff; }
.lp-q-btn { background: #b8892f; color: #1b1404; font-weight: 700; text-align: center; border-radius: 10px; padding: 10px; margin-top: 12px; }
.lp-streak { text-align: center; font-size: 12px; color: #5b6670; margin-top: 12px; }
@media (max-width: 899px) { .lp-phone { transform: none; width: 260px; } }

.lp-stats { background: var(--card); border-bottom: 1px solid var(--line); }
.lp-stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); text-align: center; padding: 26px 16px; gap: 18px; }
@media (min-width: 720px) { .lp-stats-grid { grid-template-columns: repeat(4, 1fr); } }
.lp-stats strong { display: block; font-size: clamp(24px, 4vw, 34px); color: var(--navy); line-height: 1.1; }
.lp-stats span { color: var(--muted); font-size: 14px; }

.lp-section { padding: 64px 0; }
.lp-tint { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lp-head { text-align: center; max-width: 680px; margin: 0 auto 36px; }
.lp-head h2, .lp-split h2, .lp-final h2 { font-size: clamp(24px, 4vw, 34px); line-height: 1.2; margin: 8px 0 10px; letter-spacing: -.3px; }
.lp-head p { color: var(--muted); margin: 0; }
.lp-kicker { font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); }
.lp-features { display: grid; gap: 16px; }
@media (min-width: 640px) { .lp-features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .lp-features { grid-template-columns: repeat(3, 1fr); } }
.lp-feature { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.lp-tint .lp-feature { background: var(--bg); }
.lp-feature h3 { color: var(--navy); font-size: 18px; margin: 12px 0 6px; }
.lp-feature p { color: var(--muted); margin: 0; font-size: 15px; }
.lp-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--gold-soft); display: inline-flex;
  align-items: center; justify-content: center; font-size: 22px; }

.lp-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; counter-reset: none; }
@media (min-width: 760px) { .lp-steps { grid-template-columns: repeat(3, 1fr); } }
.lp-steps li { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.lp-steps h3 { color: var(--navy); margin: 12px 0 6px; font-size: 18px; }
.lp-steps p { color: var(--muted); margin: 0; font-size: 15px; }
.lp-step-no { width: 36px; height: 36px; border-radius: 50%; background: #0b2e4f; color: #fff; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; }

.lp-split { display: grid; gap: 28px; align-items: center; }
@media (min-width: 880px) { .lp-split { grid-template-columns: 1fr 1fr; gap: 48px; } }
.lp-lead-dark { color: var(--muted); font-size: 17px; margin: 0; }
.lp-channels { display: grid; gap: 12px; }
.lp-channel { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px; }
.lp-channel > span { font-size: 26px; line-height: 1; }
.lp-channel h3 { margin: 0 0 2px; color: var(--navy); font-size: 17px; }
.lp-channel p { margin: 0; color: var(--muted); font-size: 15px; }

.lp-modules { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.lp-module { display: flex; gap: 10px; align-items: center; background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; font-size: 15px; min-width: 0; }
.lp-module b { color: var(--navy); min-width: 40px; }
.lp-module span { min-width: 0; overflow-wrap: anywhere; }

.lp-narrow { max-width: 760px; }
.lp-faq { background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; }
.lp-faq summary { cursor: pointer; padding: 16px 18px; font-weight: 600; color: var(--ink); list-style: none;
  display: flex; justify-content: space-between; gap: 12px; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after { content: "+"; color: var(--gold); font-weight: 700; font-size: 20px; line-height: 1; }
.lp-faq[open] summary::after { content: "−"; }
.lp-faq p { margin: 0; padding: 0 18px 16px; color: var(--muted); }

.lp-final { background: linear-gradient(160deg, #0b2e4f, #16426b); color: #fff; padding: 64px 0; }
.lp-final h2 { color: #fff; }
.lp-final p { color: #cfdcea; }
.lp-final-grid { display: grid; gap: 28px; align-items: center; }
@media (min-width: 880px) { .lp-final-grid { grid-template-columns: 1.2fr 1fr; gap: 48px; } }
.lp-verify { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .15); border-radius: 16px; padding: 22px; }
.lp-verify h3 { margin: 0 0 4px; color: #fff; }
.lp-verify p { margin: 0 0 14px; font-size: 14px; }
.lp-verify input { background: #fff; color: #1f2933; border-color: transparent; }
.lp-verify .row { flex-wrap: wrap; }
.lp-verify .row .grow { min-width: 160px; }
body.landing-page footer.site { padding-top: 28px; }

/* ---------- public home ---------- */
.landing { background: linear-gradient(160deg, #0b2e4f 0%, #16426b 70%); color: #fff; padding: 48px 0 56px; }
.landing h1 { color: #fff; font-size: 34px; max-width: 640px; }
.landing p { color: #d3e0ee; max-width: 600px; font-size: 18px; }
.landing .btn.ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.features .card h3 { color: var(--navy); }
.modchips { display: flex; flex-wrap: wrap; gap: 8px; }
.modchips span { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.modchips b { color: var(--navy); }
footer.site { color: var(--muted); font-size: 14px; padding: 24px 0 32px; text-align: center; }
table.plain { width: 100%; border-collapse: collapse; font-size: 15px; }
table.plain th, table.plain td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.scroll { overflow-x: auto; }

/* ---------- course pages: contents sidebar (module → chapters → topics, quiz → final exam) ---------- */
body.course-page .wrap { max-width: 1320px; }
.course { display: grid; gap: 18px; }
.course-main { min-width: 0; }
@media (min-width: 900px) {
  .course { grid-template-columns: 320px minmax(0, 1fr); gap: 32px; align-items: start; }
  .outline { position: sticky; top: 72px; }
}
.outline-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.outline-head { list-style: none; cursor: pointer; padding: 12px 14px; font-weight: 700; color: var(--navy); display: flex; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); }
.outline-head::-webkit-details-marker { display: none; }
.outline-head::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.outline-box:not([open]) .outline-head { border-bottom: 0; }
.outline-box:not([open]) .outline-head::after { transform: rotate(-90deg); }
@media (min-width: 900px) { .outline-head { cursor: default; pointer-events: none; } .outline-head::after { display: none; } }
.outline-module { padding: 10px 14px 12px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.outline-module select { width: 100%; font: inherit; font-size: 14px; padding: 7px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.outline-progress { margin-top: 2px; }
.outline-list { position: relative; max-height: 60vh; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 6px; }
@media (min-width: 900px) { .outline-list { max-height: calc(100vh - 230px); } }
.oc { border-bottom: 1px solid var(--line); }
.oc > summary { list-style: none; cursor: pointer; display: flex; gap: 8px; align-items: flex-start; padding: 10px 14px; font-size: 14px; font-weight: 600; line-height: 1.35; }
.oc > summary::-webkit-details-marker { display: none; }
.oc > summary:hover { background: var(--info-soft); }
.oc.here > summary { color: var(--navy); }
.oc-code { color: var(--gold); flex: none; min-width: 34px; }
.oc-title { flex: 1; min-width: 0; }
.oc-count { flex: none; font-size: 12px; color: var(--muted); font-weight: 600; padding-top: 1px; }
.oc-count.ok { color: var(--ok); }
.oc ul { list-style: none; margin: 0; padding: 0 0 6px; }
.ot { display: flex; gap: 10px; align-items: flex-start; padding: 8px 14px 8px 18px; font-size: 14px; line-height: 1.35; color: var(--ink); text-decoration: none; border-left: 3px solid transparent; }
a.ot:hover { background: var(--info-soft); }
.ot .om { flex: none; width: 18px; text-align: center; color: var(--muted); }
.ot.done .om { color: var(--ok); font-weight: 700; }
.ot.here { background: var(--info-soft); border-left-color: var(--gold); font-weight: 600; }
.ot.locked { color: var(--muted); opacity: .75; }
.ot-no { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.ot.ot-chapter { color: var(--muted); font-size: 13px; padding-top: 4px; padding-bottom: 4px; }
.ot.quiz b, .ot.exam b { font-weight: 600; }
.ot.exam { margin: 8px 8px 4px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }

/* ---------- push-to-talk tutor (topic page) ---------- */
.tutor { margin-top: 22px; display: grid; gap: 12px; }
.tutor-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; justify-content: space-between; }
.tutor-log { display: grid; gap: 8px; max-height: 420px; overflow-y: auto; padding: 2px; }
.tb { padding: 10px 14px; border-radius: 14px; max-width: 88%; line-height: 1.5; font-size: 15px; white-space: pre-wrap; }
.tb-q, .tb-live { justify-self: end; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.tb-live { opacity: .7; font-style: italic; }
.tb-live:empty::before { content: "…"; }
.tb-a { justify-self: start; background: var(--info-soft); color: var(--ink); border-bottom-left-radius: 4px; }
.tb-wait { justify-self: start; color: var(--muted); font-style: italic; }
.tb-err { justify-self: start; background: var(--bad-soft); color: var(--bad); }
.tb-replay { display: block; margin-top: 6px; background: none; border: 0; padding: 0; color: var(--navy); font: inherit; font-size: 13px; cursor: pointer; }
:root[data-theme="dark"] .tb-q, :root[data-theme="dark"] .tb-live { background: #2f5680; }
.tutor-mic { justify-self: center; display: inline-flex; align-items: center; gap: 10px; padding: 16px 28px; border-radius: 999px; border: 0;
  background: var(--gold); color: #1f1606; font: inherit; font-weight: 700; font-size: 17px; cursor: pointer;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; transition: transform .1s, box-shadow .2s; }
.tutor-mic:disabled { opacity: .5; cursor: wait; }
.tutor-mic-icon { font-size: 22px; }
.tutor-mic.on { transform: scale(1.06); box-shadow: 0 0 0 8px rgba(224, 178, 90, .25), 0 0 0 16px rgba(224, 178, 90, .12); animation: tutor-pulse 1.2s infinite; }
@keyframes tutor-pulse { 50% { box-shadow: 0 0 0 12px rgba(224, 178, 90, .3), 0 0 0 22px rgba(224, 178, 90, .08); } }
@media (prefers-reduced-motion: reduce) { .tutor-mic.on { animation: none; } }
.tutor-hint { text-align: center; margin: -4px 0 0; }
.tutor-type { gap: 8px; }
.tutor-type input { min-width: 0; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.tutor-stop { justify-self: center; }
.tutor-note { margin: 0; font-size: 13px; }

/* ---------- report a lesson video ---------- */
.report-video { margin: -8px 0 18px; font-size: 14px; }
.report-video > summary { cursor: pointer; color: var(--muted); display: inline-block; padding: 4px 0; }
.report-video > summary:hover { color: var(--bad); }
.report-video form { margin-top: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; }
.report-video fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; }
.report-video legend { padding: 0; margin-bottom: 4px; }
.report-reason { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.report-video textarea { font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); resize: vertical; }
.report-video button { justify-self: start; }

/* ---------- lesson video: our own control bar (play, volume, speed, full screen) ---------- */
.player { margin: 18px 0; border-radius: var(--radius); overflow: hidden; background: #000; }
.player .video { margin: 0; border-radius: 0; }
.player .video iframe, .player #yt-player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-bar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: #0b2e4f; color: #fff; }
.player-bar[hidden] { display: none; }
.player-bar button { background: none; border: 0; color: #fff; font-size: 18px; line-height: 1; min-width: 40px; min-height: 40px; border-radius: 8px; cursor: pointer; }
.player-bar button:hover { background: rgba(255,255,255,.12); }
.player-bar input[type=range] { width: 110px; accent-color: #e0b25a; }
.player-bar .grow { flex: 1; }
.player-speed { font-size: 13px; color: #c9d6e3; display: flex; align-items: center; gap: 6px; }
.player-speed select { font: inherit; font-size: 13px; background: #17212c; color: #fff; border: 1px solid #2b3a4a; border-radius: 6px; padding: 4px 6px; }
@media (max-width: 420px) { .player-bar input[type=range] { width: 70px; } .player-speed { font-size: 0; gap: 0; } .player-speed select { font-size: 13px; } }
.player:fullscreen, .player:-webkit-full-screen, .player.pseudo-fs { display: flex; flex-direction: column; border-radius: 0; margin: 0; }
.player.pseudo-fs { position: fixed; inset: 0; z-index: 100; }
.player:fullscreen .video, .player:-webkit-full-screen .video, .player.pseudo-fs .video { flex: 1; padding-top: 0; }
body.no-scroll { overflow: hidden; }
.player + .report-video { margin-top: -8px; }

/* ---------- theme button (🌙 / ☀️) ---------- */
.theme-btn { padding: 6px 9px; line-height: 1; flex: none; }
@media (max-width: 480px) { .theme-btn { padding: 6px 7px; } }

/* ---------- sign-in pop-up (Sign in / Create an account / Forgot password) ---------- */
html.auth-modal-open { overflow: hidden; }
.auth-modal { border: 0; padding: 0; background: transparent; width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 32px);
  overflow: visible; color: var(--ink); }
.auth-modal::backdrop { background: rgba(11, 46, 79, .35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.auth-modal-body { max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; border-radius: var(--radius); }
.auth-modal-body .authcard { margin: 0; max-width: none; box-shadow: 0 20px 60px rgba(11, 46, 79, .35); }
.auth-modal-body > .flash, .auth-modal-body > .error { margin: 0 0 10px; }
.auth-modal-close { position: absolute; top: 10px; right: 10px; z-index: 1; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: var(--bg); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; }
.auth-modal-close:hover { background: var(--line); }
.auth-modal[open] { animation: auth-modal-in .18s ease-out; }
@keyframes auth-modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 520px) {
  .auth-modal { width: 100vw; max-width: 100vw; margin: auto 0 0; max-height: 92dvh; }
  .auth-modal-body { max-height: 92dvh; border-radius: 18px 18px 0 0; }
  .auth-modal-body .authcard { border-radius: 18px 18px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .auth-modal[open] { animation-name: auth-modal-up; }
  @keyframes auth-modal-up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) { .auth-modal[open] { animation: none; } }

/* Telegram sign-in: the QR code is for computers (scan it with the phone); hidden on phones */
.tg-qr { margin-top: 14px; }
@media (hover: none) and (pointer: coarse) { .tg-qr .qrbox { display: none; } }
