/* ---------- tokens ---------- */
:root {
  --ink: #16211b;
  --ink-2: #1f2c25;
  --ink-3: #2d3d35;
  --lime: #c8f04d;
  --lime-2: #b8e23a;
  --lime-shadow: #8fb126;
  --lime-soft: #eef9cf;
  --bg: #f4f1ea;
  --card: #fffdf8;
  --card-2: #f9f6ef;
  --line: #e5dfd2;
  --line-2: #d5ccbb;
  --text: #16211b;
  --muted: #6c7068;
  --good: #1d7f45;
  --good-bg: #d8f1e0;
  --mid: #8f5b00;
  --mid-bg: #fcebc1;
  --weak: #b4382f;
  --weak-bg: #f9d8d4;
  --info: #285ca3;
  --info-bg: #e2edfb;
  --radius: 18px;
  --radius-sm: 12px;
  --c-lime: #c8f04d;
  --c-mint: #9fe5c0;
  --c-sky: #a8d3ff;
  --c-violet: #c8b8ff;
  --c-peach: #ffc49c;
  --c-rose: #ffb2c0;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Montserrat", var(--font);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 800; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 32px; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.page { padding-top: 32px; padding-bottom: 56px; }

/* ---------- top bar ---------- */
.topbar { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 30; }
.topbar .container { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: #fff; white-space: nowrap; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: var(--lime); display: grid; place-items: center; flex: none; }
.brand-mark img { width: 29px; height: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font-family: var(--font-head); font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.brand-text small { font-size: 10.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--lime); margin-top: 3px; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav a { text-decoration: none; color: #cfd8d2; white-space: nowrap; padding: 8px 12px; border-radius: 10px; font-weight: 500; font-size: 14px; }
.nav a:hover { color: #fff; background: var(--ink-2); }
.nav a.active { color: var(--ink); background: var(--lime); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang-switch { display: flex; background: var(--ink-2); border-radius: 10px; padding: 3px; }
.lang-switch a { text-decoration: none; color: #b9c4bd; font-size: 12px; font-weight: 700; padding: 5px 9px; border-radius: 8px; letter-spacing: .03em; }
.lang-switch a.on { background: var(--ink-3); color: var(--lime); }
.user-chip { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #fff; font-size: 14px; padding: 4px 10px 4px 4px; border-radius: 12px; }
.user-chip:hover { background: var(--ink-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink-3); color: var(--lime); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; background: var(--ink); }
.menu-toggle { display: none; background: none; border: 0; color: #fff; padding: 8px; cursor: pointer; }

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--card); --btn-fg: var(--text); --btn-shadow: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: 14px; line-height: 1;
  padding: 12px 18px; border-radius: 12px; border: 1px solid var(--btn-shadow);
  background: var(--btn-bg); color: var(--btn-fg); text-decoration: none; cursor: pointer;
  box-shadow: 0 3px 0 var(--btn-shadow); transition: transform .06s, box-shadow .06s, filter .15s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(.98); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--btn-shadow); }
.btn:disabled, .btn.disabled { opacity: .55; pointer-events: none; }
.btn-primary { --btn-bg: var(--lime); --btn-fg: var(--ink); --btn-shadow: var(--lime-shadow); }
.btn-dark { --btn-bg: var(--ink); --btn-fg: #fff; --btn-shadow: #000; }
.btn-dark:hover { filter: brightness(1.2); }
.btn-danger { --btn-bg: #fff; --btn-fg: var(--weak); --btn-shadow: #e9b9b4; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:hover { background: var(--card-2); color: var(--text); }
.btn-ghost:active { transform: none; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn-xs { padding: 5px 8px; font-size: 12px; border-radius: 8px; box-shadow: 0 2px 0 var(--btn-shadow); }
.btn-lg { padding: 16px 24px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.icon { width: 18px; height: 18px; flex: none; }
.btn-sm .icon, .btn-xs .icon { width: 15px; height: 15px; }

/* ---------- cards & badges ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 0 var(--line); padding: 22px; }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card.flat { box-shadow: none; }
.card.dark { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 4px 0 #000; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--card-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.good, .badge.active { background: var(--good-bg); color: var(--good); border-color: transparent; }
.badge.mid, .badge.pending, .badge.expiring { background: var(--mid-bg); color: var(--mid); border-color: transparent; }
.badge.weak, .badge.closed, .badge.expired { background: var(--weak-bg); color: var(--weak); border-color: transparent; }
.badge.info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.badge.lime { background: var(--lime); color: var(--ink); border-color: transparent; }
.badge.dark { background: var(--ink); color: var(--lime); border-color: transparent; }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--lime); color: var(--ink); font-size: 11px; font-weight: 800; }

.score { font-weight: 800; font-variant-numeric: tabular-nums; }
.score.good { color: var(--good); }
.score.mid { color: var(--mid); }
.score.weak { color: var(--weak); }
.pill-score { display: inline-block; min-width: 46px; text-align: center; padding: 4px 8px; border-radius: 8px; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; }
.pill-score.good { background: var(--good-bg); color: var(--good); }
.pill-score.mid { background: var(--mid-bg); color: var(--mid); }
.pill-score.weak { background: var(--weak-bg); color: var(--weak); }
.pill-score.none { color: var(--line-2); }

.progress { height: 10px; border-radius: 999px; background: #ebe5d8; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--lime-2); border-radius: inherit; min-width: 0; }
.progress.dark { background: var(--ink-3); }
.progress.dark > span { background: var(--lime); }
.progress-line { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.progress-line .progress { flex: 1; }

/* ---------- messages ---------- */
.messages { display: grid; gap: 10px; margin-bottom: 20px; }
.alert { padding: 13px 16px; border-radius: 12px; font-weight: 500; background: var(--info-bg); color: var(--info); border: 1px solid transparent; }
.alert.success { background: var(--good-bg); color: var(--good); }
.alert.error { background: var(--weak-bg); color: var(--weak); }
.alert.warning { background: var(--mid-bg); color: var(--mid); }
.alert strong { font-weight: 800; }

/* ---------- forms ---------- */
.form { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row.three { grid-template-columns: repeat(3, 1fr); }
.field { display: grid; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: 13px; color: var(--ink-3); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.field .error, .errorlist { color: var(--weak); font-size: 13px; font-weight: 600; margin: 0; padding: 0; list-style: none; }
input[type=text], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=url], input[type=search], input:not([type]), select, textarea {
  font: inherit; color: var(--text); width: 100%;
  padding: 11px 14px; border: 1.5px solid var(--line-2); border-radius: 12px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--lime-soft); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--weak); }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.check small { display: block; color: var(--muted); font-size: 12.5px; }
.input-sm { padding: 7px 10px !important; font-size: 13px !important; border-radius: 9px !important; }
.inline-form { display: inline; }
.search-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.search-bar input[type=search] { flex: 1 1 240px; width: auto; }
.search-bar select { width: auto; flex: 0 1 220px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px 10px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--card-2); }
.table .person { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; }
.table .person .sub { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.table td.actions { white-space: nowrap; text-align: right; }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .big { font-size: 40px; line-height: 1; margin-bottom: 10px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a { text-decoration: none; padding: 9px 14px; border-radius: 11px; font-weight: 600; font-size: 14px; color: var(--muted); background: transparent; display: inline-flex; gap: 7px; align-items: center; }
.tabs a:hover { background: var(--card); color: var(--text); }
.tabs a.on { background: var(--ink); color: #fff; }
.tabs a .n { font-size: 12px; opacity: .7; }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 18px; align-items: center; }
.pagination a, .pagination span { padding: 7px 12px; border-radius: 9px; text-decoration: none; font-weight: 600; font-size: 14px; }
.pagination a { background: var(--card); border: 1px solid var(--line); }

/* ---------- hero / home ---------- */
.hero { background: var(--ink); color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: var(--ink-2); right: -160px; top: -200px; }
.hero .container { position: relative; z-index: 1; padding-top: 64px; padding-bottom: 72px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: center; }
.hero-tag { display: inline-block; background: var(--lime); color: var(--ink); font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; padding: 8px 16px; border-radius: 999px; margin-bottom: 22px; }
.hero h1 { font-size: clamp(34px, 5.4vw, 60px); line-height: 1.04; margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: var(--lime); }
.hero p.lead { font-size: 18px; color: #c5cfc9; max-width: 560px; margin-bottom: 28px; }
.hero-card { background: var(--bg); color: var(--text); border-radius: 22px; padding: 22px; box-shadow: 0 6px 0 #0b120e; transform: rotate(1.5deg); }
.hero-card .q-nums { display: flex; gap: 6px; margin: 12px 0 14px; flex-wrap: wrap; }
.hero-card .q-nums span { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 800; border: 1px solid var(--line-2); background: var(--card); }
.hero-card .q-nums span.done { background: var(--lime); border-color: var(--lime); }
.hero-card .q-nums span.now { background: var(--ink); color: var(--lime); border-color: var(--ink); }
.hero-card .opt { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); margin-top: 8px; font-size: 14px; }
.hero-card .opt b { width: 26px; height: 26px; border-radius: 7px; background: var(--card-2); display: grid; place-items: center; font-size: 12px; }
.hero-card .opt.on { border-color: var(--ink); background: var(--lime-soft); }
.hero-card .opt.on b { background: var(--ink); color: var(--lime); }
.features { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }
.features span { border: 1px solid var(--ink-3); background: var(--ink-2); color: #dfe7e2; padding: 9px 16px; border-radius: 999px; font-size: 14px; }

.section-title { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.section-title h2 { margin: 0; }

/* ---------- course cards ---------- */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.course-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: 0 4px 0 var(--line); text-decoration: none; transition: transform .12s; }
.course-card:hover { transform: translateY(-2px); }
.course-cover { --cc: var(--c-lime); background: var(--cc); padding: 20px 20px 18px; min-height: 128px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.course-cover::after { content: ""; position: absolute; width: 150px; height: 150px; border-radius: 50%; background: rgba(255,255,255,.28); right: -40px; bottom: -70px; }
.course-cover .subject { font-family: var(--font-head); font-weight: 800; font-size: 24px; line-height: 1.1; color: var(--ink); position: relative; z-index: 1; }
.course-cover .top { display: flex; justify-content: space-between; gap: 8px; position: relative; z-index: 1; }
.course-cover .top .badge { background: rgba(255,255,255,.65); color: var(--ink); border-color: transparent; }
.cc-lime { --cc: var(--c-lime); } .cc-mint { --cc: var(--c-mint); } .cc-sky { --cc: var(--c-sky); }
.cc-violet { --cc: var(--c-violet); } .cc-peach { --cc: var(--c-peach); } .cc-rose { --cc: var(--c-rose); }
.course-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.course-body h3 { margin: 0; font-size: 17px; }
.course-meta { display: flex; gap: 14px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.course-foot { margin-top: auto; padding-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.free-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.free-item { display: flex; gap: 12px; align-items: center; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px; box-shadow: 0 3px 0 var(--line); }
.free-item img { width: 112px; height: 64px; object-fit: cover; border-radius: 10px; background: var(--ink); flex: none; }
.free-item .t { font-weight: 700; font-size: 14px; line-height: 1.3; }
.free-item .s { font-size: 12.5px; color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.step .n { width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: var(--lime); font-weight: 800; display: grid; place-items: center; margin-bottom: 12px; font-family: var(--font-head); }
.step p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- course page ---------- */
.course-header { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; margin-bottom: 26px; }
.course-header .cover-band { border-radius: 22px; padding: 28px; }
.crumbs { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; margin-bottom: 14px; flex-wrap: wrap; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.access-box h3 { margin-bottom: 6px; }
.access-box .big-num { font-family: var(--font-head); font-weight: 800; font-size: 40px; line-height: 1; color: var(--lime); }
.section-block { margin-bottom: 22px; }
.section-block > h3 { display: flex; align-items: center; gap: 10px; font-size: 15px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 10px 4px; }
.lesson-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 4px 0 var(--line); }
.lesson-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); text-decoration: none; }
.lesson-row:last-child { border-bottom: 0; }
a.lesson-row:hover { background: var(--card-2); }
.lesson-row .num { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--card-2); border: 1px solid var(--line); }
.lesson-row.done .num { background: var(--lime); border-color: var(--lime); }
.lesson-row.locked { color: var(--muted); }
.lesson-row.locked .num { opacity: .6; }
.lesson-row .info { flex: 1; min-width: 0; }
.lesson-row .title { font-weight: 600; }
.lesson-row .sub { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.lesson-row .end { display: flex; align-items: center; gap: 8px; flex: none; }

/* ---------- lesson page ---------- */
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.video-box { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: 0 5px 0 #0b120e; }
.video-box iframe, .video-box > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-empty { display: grid; place-items: center; color: #9aa69f; background: var(--ink); text-align: center; padding: 20px; }
.lesson-title { margin: 22px 0 6px; }
.lesson-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0 22px; }
.test-cta { display: flex; align-items: center; gap: 18px; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 20px 22px; box-shadow: 0 4px 0 #000; flex-wrap: wrap; }
.test-cta .ico { width: 52px; height: 52px; border-radius: 14px; background: var(--lime); color: var(--ink); display: grid; place-items: center; flex: none; }
.test-cta .ico svg { width: 26px; height: 26px; }
.test-cta .txt { flex: 1; min-width: 180px; }
.test-cta .txt b { font-family: var(--font-head); font-size: 18px; display: block; }
.test-cta .txt span { color: #b9c4bd; font-size: 14px; }
.description { white-space: normal; }
.side-nav { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 0 var(--line); overflow: hidden; position: sticky; top: 84px; max-height: calc(100vh - 104px); display: flex; flex-direction: column; }
.side-nav .head { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.side-nav .head b { display: block; font-family: var(--font-head); margin-bottom: 8px; }
.side-nav .list { overflow-y: auto; padding: 6px 0; }
.side-nav .sec { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 12px 18px 6px; }
.side-nav a, .side-nav .item { display: flex; gap: 10px; align-items: center; padding: 8px 18px; text-decoration: none; font-size: 14px; line-height: 1.3; }
.side-nav a:hover { background: var(--card-2); }
.side-nav .item.locked { color: var(--muted); }
.side-nav .current { background: var(--lime-soft); font-weight: 700; box-shadow: inset 3px 0 0 var(--ink); }
.side-nav .dot { width: 22px; height: 22px; border-radius: 7px; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--card-2); border: 1px solid var(--line); }
.side-nav .done .dot { background: var(--lime); border-color: var(--lime); }
.attempt-list { display: grid; gap: 8px; }
.attempt-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--card-2); text-decoration: none; font-size: 14px; }
.attempt-item:hover { background: var(--lime-soft); }

/* ---------- test ---------- */
.test-top { position: sticky; top: 64px; z-index: 20; background: var(--bg); padding: 14px 0 10px; border-bottom: 1px solid var(--line); }
.test-top .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.test-top h2 { margin: 0; font-size: 18px; flex: 1; min-width: 160px; }
.timer { background: var(--ink); color: var(--lime); font-family: var(--font-head); font-weight: 800; font-variant-numeric: tabular-nums; padding: 10px 16px; border-radius: 12px; font-size: 16px; display: inline-flex; gap: 8px; align-items: center; }
.timer.warn { background: var(--weak); color: #fff; }
.q-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.q-nav button { width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid var(--line-2); background: var(--card); font: inherit; font-weight: 800; font-size: 13px; cursor: pointer; color: var(--text); }
.q-nav button.answered { background: var(--lime); border-color: var(--lime); }
.q-nav button.current { background: var(--ink); border-color: var(--ink); color: var(--lime); }
.question-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 26px; box-shadow: 0 4px 0 var(--line); margin-top: 20px; }
.question-card .qhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--muted); font-size: 13px; font-weight: 600; }
.question-text { font-size: 17px; line-height: 1.6; margin-bottom: 18px; font-weight: 500; }
.question-img { display: block; max-height: 360px; border-radius: 12px; margin: 0 0 18px; border: 1px solid var(--line); background: #fff; }
.options { display: grid; gap: 10px; }
.option { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; transition: border-color .12s, background .12s; font-size: 15.5px; user-select: none; }
.option:hover { border-color: var(--line-2); background: var(--card-2); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option .key { width: 32px; height: 32px; border-radius: 9px; background: var(--card-2); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.option.selected { border-color: var(--ink); background: var(--lime-soft); box-shadow: 0 3px 0 var(--ink); }
.option.selected .key { background: var(--ink); color: var(--lime); border-color: var(--ink); }
.option:focus-within { outline: 3px solid var(--lime); outline-offset: 2px; }
.test-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.save-state { font-size: 12.5px; color: var(--muted); }

.modal-back { position: fixed; inset: 0; background: rgba(22, 33, 27, .55); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { background: var(--card); border-radius: 20px; padding: 26px; max-width: 420px; width: 100%; box-shadow: 0 6px 0 #0b120e; }
.modal h3 { font-size: 20px; }

/* ---------- result ---------- */
.result-grid { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }
.score-card { background: var(--ink); color: #fff; border-radius: 22px; padding: 26px; text-align: center; box-shadow: 0 5px 0 #000; position: sticky; top: 84px; }
.score-card .lbl { color: #b9c4bd; font-size: 14px; }
.score-card .big { font-family: var(--font-head); font-size: 76px; font-weight: 800; color: var(--lime); line-height: 1; margin: 10px 0 4px; font-variant-numeric: tabular-nums; }
.score-card .of { color: #b9c4bd; font-size: 18px; margin-bottom: 16px; }
.score-card .progress { margin: 6px 0 18px; }
.score-card .verdict { display: inline-block; padding: 7px 14px; border-radius: 999px; font-weight: 800; font-size: 13px; margin-bottom: 18px; }
.score-card .verdict.pass { background: var(--lime); color: var(--ink); }
.score-card .verdict.fail { background: #3c2725; color: #ffb9b0; }
.score-split { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.score-split div { background: var(--ink-2); border-radius: 12px; padding: 10px 4px; }
.score-split b { display: block; font-size: 20px; font-family: var(--font-head); }
.score-split span { font-size: 11.5px; color: #b9c4bd; }
.review-item { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--line-2); border-radius: 16px; padding: 18px 20px; margin-bottom: 14px; }
.review-item.is-right { border-left-color: var(--good); }
.review-item.is-partial { border-left-color: #e0a526; }
.review-item.is-wrong { border-left-color: var(--weak); }
.review-item .qhead { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.review-item .qtext { font-weight: 500; margin-bottom: 12px; }
.review-opt { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px; margin-top: 6px; font-size: 14.5px; border: 1px solid transparent; }
.review-opt .key { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: var(--card-2); flex: none; }
.review-opt.correct { background: var(--good-bg); }
.review-opt.correct .key { background: var(--good); color: #fff; }
.review-opt.picked-wrong { background: var(--weak-bg); }
.review-opt.picked-wrong .key { background: var(--weak); color: #fff; }
.review-opt .tag { margin-left: auto; font-size: 12px; font-weight: 700; }
.explanation { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--info-bg); color: #1e3e6b; font-size: 14px; }
.explanation b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }

/* ---------- auth ---------- */
.auth-wrap { display: grid; place-items: center; padding: 48px 20px 64px; }
.auth-card { width: 100%; max-width: 460px; }
.auth-card h1 { font-size: 28px; }
.auth-card .switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }
.course-checks { display: grid; gap: 8px; }
.course-checks label { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff; font-size: 14px; }
.course-checks label:has(input:checked) { border-color: var(--ink); background: var(--lime-soft); }
.course-checks input { accent-color: var(--ink); width: 18px; height: 18px; }

/* ---------- panel ---------- */
.panel-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; padding-top: 28px; padding-bottom: 56px; align-items: start; }
.panel-side { position: sticky; top: 88px; display: grid; gap: 4px; }
.panel-side .ttl { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; padding: 0 12px 8px; }
.panel-side a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; text-decoration: none; font-weight: 600; font-size: 14.5px; color: var(--ink-3); }
.panel-side a:hover { background: var(--card); }
.panel-side a.on { background: var(--ink); color: #fff; }
.panel-side a.on .icon { color: var(--lime); }
.panel-side a .count { margin-left: auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 4px; font-size: 28px; }
.page-head p { margin: 0; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: 0 4px 0 var(--line); }
.stat .v { font-family: var(--font-head); font-size: 30px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .k { color: var(--muted); font-size: 13px; margin-top: 4px; }
.stat.dark { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 4px 0 #000; }
.stat.dark .v { color: var(--lime); }
.stat.dark .k { color: #b9c4bd; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.two-col > .card + .card { margin-top: 0; }
.mini-list { display: grid; }
.mini-list .it { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.mini-list .it:last-child { border-bottom: 0; }
.mini-list .it .grow { flex: 1; min-width: 0; }
.mini-list .it .sub { color: var(--muted); font-size: 12.5px; }
.bulk-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; background: var(--card-2); border-radius: 12px; margin-bottom: 14px; font-size: 14px; }

.struct-section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 0 var(--line); margin-bottom: 18px; overflow: hidden; }
.struct-section > .sh { display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: var(--card-2); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.struct-section > .sh h3 { margin: 0; flex: 1; font-size: 16px; }
.struct-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.struct-row:last-child { border-bottom: 0; }
.struct-row .grow { flex: 1; min-width: 200px; }
.struct-row .title { font-weight: 600; text-decoration: none; }
.struct-row .title:hover { text-decoration: underline; }
.struct-row .sub { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.struct-row img.thumb { width: 84px; height: 48px; object-fit: cover; border-radius: 8px; background: var(--ink); flex: none; }
.struct-row .thumb.none { width: 84px; height: 48px; border-radius: 8px; background: var(--card-2); border: 1px dashed var(--line-2); display: grid; place-items: center; color: var(--muted); font-size: 11px; flex: none; }
.icon-btns { display: flex; gap: 4px; align-items: center; }
.icon-btn { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink-3); text-decoration: none; padding: 0; }
.icon-btn:hover { background: var(--card-2); border-color: var(--line-2); }
.icon-btn.danger:hover { color: var(--weak); background: var(--weak-bg); }
.icon-btn svg { width: 16px; height: 16px; }
details.inline > summary { list-style: none; cursor: pointer; }
details.inline > summary::-webkit-details-marker { display: none; }
details.inline[open] > summary { margin-bottom: 10px; }

.q-item { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; margin-bottom: 14px; box-shadow: 0 3px 0 var(--line); scroll-margin-top: 90px; }
.q-item .qhead { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.q-item .qnum { width: 32px; height: 32px; border-radius: 9px; background: var(--ink); color: var(--lime); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.q-item .qtext { margin-bottom: 10px; }
.q-item .q-img { max-height: 180px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 10px; }
.q-item .opts { display: grid; gap: 4px; }
.q-item .opt { display: flex; gap: 8px; align-items: baseline; font-size: 14px; padding: 4px 8px; border-radius: 8px; }
.q-item .opt.correct { background: var(--good-bg); color: var(--good); font-weight: 600; }
.q-item .opt b { min-width: 18px; }

.choice-rows { display: grid; gap: 8px; }
.choice-row { display: flex; gap: 10px; align-items: center; }
.choice-row .key { width: 34px; height: 40px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 800; flex: none; }
.choice-row input[type=text] { flex: 1; }
.choice-row .correct-toggle { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 9px 12px; border-radius: 10px; border: 1.5px solid var(--line-2); cursor: pointer; white-space: nowrap; background: #fff; }
.choice-row .correct-toggle:has(input:checked) { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.choice-row .correct-toggle input { accent-color: var(--good); }

.yt-preview { margin-top: 10px; max-width: 420px; }
.yt-preview .video-box { box-shadow: none; border-radius: 12px; }

.matrix { border-collapse: separate; border-spacing: 0; font-size: 13px; }
.matrix th, .matrix td { padding: 8px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; background: var(--card); }
.matrix th { font-size: 11.5px; color: var(--muted); font-weight: 700; vertical-align: bottom; }
.matrix th.lt { max-width: 120px; white-space: normal; line-height: 1.25; text-align: center; min-width: 76px; }
.matrix .sticky { position: sticky; left: 0; z-index: 1; text-align: left; box-shadow: 1px 0 0 var(--line); }
.matrix tfoot td { font-weight: 700; background: var(--card-2); }

.bar-row { display: grid; grid-template-columns: 26px 1fr 52px; gap: 10px; align-items: center; font-size: 13.5px; margin-top: 6px; }
.bar-row .bar { height: 8px; background: #ebe5d8; border-radius: 999px; overflow: hidden; }
.bar-row .bar span { display: block; height: 100%; background: var(--line-2); }
.bar-row.correct .bar span { background: var(--good); }
.bar-row.correct { color: var(--good); font-weight: 700; }

.import-sample { background: var(--ink); color: #dfe7e2; border-radius: 14px; padding: 16px 18px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.6; white-space: pre-wrap; margin: 0; }
textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: 13.5px; min-height: 340px; }

footer.site-footer { border-top: 1px solid var(--line); padding: 22px 0; color: var(--muted); font-size: 13px; }
footer.site-footer .container { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .user-chip span:last-child { display: none; }
  .user-chip { padding-right: 4px; }
  .nav { margin-left: 0; }
  .nav a { padding: 8px 10px; }
  .hero .container { grid-template-columns: 1fr; padding-top: 44px; padding-bottom: 52px; }
  .hero-card { display: none; }
  .lesson-layout, .result-grid, .course-header { grid-template-columns: 1fr; }
  .side-nav, .score-card { position: static; max-height: none; }
  .panel-shell { grid-template-columns: 1fr; gap: 16px; padding-top: 16px; }
  .panel-side { position: static; display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .panel-side .ttl { display: none; }
  .panel-side a { white-space: nowrap; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .container { padding: 0 16px; }
  .page { padding-top: 22px; padding-bottom: 44px; }
  .menu-toggle { display: block; margin-left: auto; }
  .topbar .container { flex-wrap: wrap; gap: 10px; min-height: 58px; }
  .nav, .topbar-right { display: none; width: 100%; }
  .topbar.open .nav { display: flex; flex-direction: column; align-items: stretch; margin: 0; }
  .topbar.open .topbar-right { display: flex; margin: 0 0 12px; justify-content: space-between; flex-wrap: wrap; }
  .test-top { top: 58px; }
  .form-row, .form-row.three { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .table-wrap { margin: 0 -18px; padding: 0 18px; }
  .question-card { padding: 18px; }
  .question-text { font-size: 16px; }
  .q-nav button { width: 34px; height: 34px; }
  .lesson-row { padding: 12px 14px; gap: 10px; }
  .choice-row { flex-wrap: wrap; }
  .choice-row input[type=text] { min-width: 0; flex: 1 1 160px; }
  .struct-row img.thumb, .struct-row .thumb.none { display: none; }
  .stat .v { font-size: 24px; }
}

/* ---------- own video player (static/js/player.js) ---------- */
.player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: 0 5px 0 #0b120e; outline: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; color: #fff; }

.player-frame { position: absolute; inset: 0; overflow: hidden; }
/* The frame sticks out 80px above and below the box: YouTube keeps the video centred, while its
   title bar and logo, which sit at the frame's edges, stay out of sight. */
.player-frame iframe { position: absolute; left: 0; top: -80px; width: 100%; height: calc(100% + 160px); border: 0; }
/* Before the first play only the middle of the frame (YouTube's play button) can be clicked;
   the top and bottom bands, where YouTube keeps its title and "Watch on YouTube" links, are covered. */
.player-guard { position: absolute; left: 0; right: 0; height: 30%; z-index: 1; cursor: pointer; }
.player-guard.top { top: 0; }
.player-guard.bottom { bottom: 0; }
.player.started .player-guard { display: none; }
.player.started .player-frame iframe { pointer-events: none; }
.player-shield { position: absolute; inset: 0; display: none; cursor: pointer; }
.player.started .player-shield { display: block; }
.player-poster { position: absolute; inset: 0; background: #000 center / cover no-repeat; display: grid; place-items: center; pointer-events: none; }
.player-poster::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(22, 33, 27, .1), rgba(22, 33, 27, .6)); }
.player-big { position: relative; width: 84px; height: 84px; border-radius: 50%; background: var(--lime); color: var(--ink); display: grid; place-items: center; box-shadow: 0 6px 0 var(--lime-shadow), 0 12px 32px rgba(0, 0, 0, .4); transition: transform .15s; }
.player:hover .player-big { transform: scale(1.06); }
.player-big svg { width: 34px; height: 34px; margin-left: 5px; }
.player.started .player-poster { display: none; }
.player-paused { position: absolute; inset: 0; margin: auto; display: none; pointer-events: none; z-index: 1; }
.player.started:not(.playing) .player-paused { display: grid; }
.player-mark { position: absolute; top: 14px; left: 16px; width: 40px; opacity: .6; pointer-events: none; z-index: 1; transition: opacity .25s; }
.player.started.idle .player-mark { opacity: .35; }

.player-controls { position: absolute; left: 0; right: 0; bottom: 0; padding: 34px 12px 8px; background: linear-gradient(transparent, rgba(0, 0, 0, .78)); display: none; transition: opacity .25s; z-index: 2; }
.player.started .player-controls { display: block; }
.player.idle .player-controls { opacity: 0; pointer-events: none; }
.player.idle, .player.idle .player-shield { cursor: none; }
.player-seek { position: relative; height: 18px; display: flex; align-items: center; margin: 0 6px; }
.player-buffer { position: absolute; left: 0; top: 50%; height: 4px; margin-top: -2px; width: 0; background: rgba(255, 255, 255, .35); border-radius: 4px; pointer-events: none; }
.player input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; margin: 0; padding: 0; border: 0; border-radius: 4px; cursor: pointer; position: relative; box-shadow: none;
  background: linear-gradient(to right, var(--lime) var(--p, 0%), rgba(255, 255, 255, .22) var(--p, 0%)); }
.player input[type=range]:focus { box-shadow: none; outline: none; }
.player input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--lime); border: 0; box-shadow: 0 0 0 4px rgba(200, 240, 77, .25); }
.player input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--lime); border: 0; }
.player-seek:hover input[type=range] { height: 6px; }
.player-bar { display: flex; align-items: center; gap: 2px; margin-top: 4px; }
.pbtn { background: none; border: 0; color: #fff; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; font: inherit; font-weight: 800; font-size: 13.5px; padding: 0; flex: none; }
.pbtn.wide { width: auto; min-width: 46px; padding: 0 8px; }
.pbtn:hover { background: rgba(255, 255, 255, .14); }
.pbtn svg { width: 22px; height: 22px; }
.player-time { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 0 8px; white-space: nowrap; }
.player-bar .grow { flex: 1; }
.player-volume { max-width: 84px; }
.player-speed { position: relative; }
.player-menu { position: absolute; bottom: 46px; right: 0; background: rgba(22, 33, 27, .97); border-radius: 12px; padding: 6px; min-width: 110px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.player-menu button { display: block; width: 100%; text-align: left; padding: 8px 12px; border-radius: 8px; background: none; border: 0; color: #fff; font: inherit; font-size: 14px; cursor: pointer; }
.player-menu button:hover { background: rgba(255, 255, 255, .1); }
.player-menu button.on { color: var(--lime); font-weight: 800; }
.player-spinner { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border: 4px solid rgba(255, 255, 255, .25); border-top-color: var(--lime); border-radius: 50%; animation: player-spin .8s linear infinite; pointer-events: none; z-index: 1; }
@keyframes player-spin { to { transform: rotate(360deg); } }
.player-toast { position: absolute; left: 14px; bottom: 78px; background: rgba(22, 33, 27, .94); padding: 10px 14px; border-radius: 12px; font-size: 13.5px; display: flex; gap: 14px; align-items: center; z-index: 3; max-width: calc(100% - 28px); }
.player-toast button { color: var(--lime); background: none; border: 0; font: inherit; font-weight: 700; cursor: pointer; padding: 0; white-space: nowrap; }
.player-end { position: absolute; inset: 0; background: rgba(22, 33, 27, .94); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 20px; z-index: 4; }
.player-end b { font-family: var(--font-head); font-size: 22px; }
.player-error { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; background: var(--ink); color: #c5cfc9; z-index: 5; }
.player.fs, .player.pseudo-fs { border-radius: 0; box-shadow: none; aspect-ratio: auto; width: 100vw; height: 100vh; }
.player.pseudo-fs { position: fixed; inset: 0; z-index: 1000; height: 100dvh; }
.player.fs .player-frame { inset: auto; left: 50%; top: 50%; width: min(100vw, 177.78vh); height: min(100vh, 56.25vw); transform: translate(-50%, -50%); }
@media (max-width: 760px) {
  .player-volume { display: none; }
  .player-guard { height: 35%; }
  .pbtn { width: 36px; height: 36px; }
  .pbtn svg { width: 20px; height: 20px; }
  .player-time { font-size: 12px; margin: 0 4px; }
  .player-big { width: 64px; height: 64px; }
  .player-big svg { width: 26px; height: 26px; }
  .player-mark { width: 30px; top: 10px; left: 12px; }
  .player-controls { padding: 26px 6px 4px; }
  .player-end b { font-size: 18px; }
}

/* ---------- Word import ---------- */
.word-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.word-step { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.word-step .n { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--lime); display: grid; place-items: center; font-weight: 800; font-family: var(--font-head); flex: none; }
.word-step b { display: block; margin-bottom: 2px; }
.word-step p { margin: 0 0 10px; }
.upload-btn { position: relative; overflow: hidden; }
.upload-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
@media (max-width: 980px) { .word-steps { grid-template-columns: 1fr; gap: 16px; } }

/* ---------- course header band, card description ---------- */
.course-band { --cc: var(--c-lime); background: var(--cc); border-radius: 22px; padding: 28px; min-height: 220px; position: relative; overflow: hidden; display: flex; }
.course-band::after { content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .28); right: -40px; bottom: -80px; }
.course-band-cover { display: none; }
.course-band-text { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 8px; }
.band-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.band-badges .badge { background: rgba(255, 255, 255, .65); color: var(--ink); border-color: transparent; }
.band-subject { font-size: 13px; font-weight: 700; opacity: .7; text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.course-band h1 { margin: 0; }
.band-desc { max-width: 640px; margin: 0; }
.course-band .course-meta { color: var(--ink-3); margin-top: 4px; }
.access-box .big-num { margin: 8px 0 12px; }
.access-box .ab-done { margin: 10px 0 18px; }
.course-desc { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-only { display: none; }

/* ---------- phone: shorter, list-like ---------- */
@media (max-width: 760px) {
  .m-only { display: inline-flex; }
  .d-only, .m-hide { display: none !important; }

  /* home */
  .hero::after { width: 260px; height: 260px; right: -110px; top: -120px; }
  .hero .container { padding-top: 26px; padding-bottom: 30px; gap: 0; }
  .hero-tag { font-size: 11px; padding: 6px 12px; margin-bottom: 12px; }
  .hero h1 { font-size: 30px; margin-bottom: 18px; }
  .hero p.lead, .features { display: none; }
  .hero .btn-lg { padding: 13px 18px; font-size: 15px; }
  .section-title { margin-bottom: 12px; }
  .section-title h2 { font-size: 19px; }
  .section-title .muted { display: none; }
  .mt-lg { margin-top: 26px; }
  .steps { gap: 8px; }
  .step { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; }
  .step .n { margin: 0; flex: none; width: 30px; height: 30px; }
  .step h3 { margin: 0; font-size: 15px; }
  .step p { display: none; }

  /* course cards → list: cover on the left, title and text on the right */
  .course-grid { grid-template-columns: 1fr; gap: 10px; }
  .course-card { flex-direction: row; align-items: stretch; border-radius: 16px; box-shadow: 0 3px 0 var(--line); position: relative; }
  .course-card:hover { transform: none; }
  .course-card .course-cover { width: 100px; min-height: 96px; flex: none; padding: 8px; justify-content: flex-end; border-radius: 0; }
  .course-card .course-cover::after { width: 70px; height: 70px; right: -24px; bottom: -30px; }
  .course-card .course-cover .top { display: none; }
  .course-card .course-cover .subject { font-size: 11.5px; line-height: 1.15; overflow-wrap: anywhere; }
  .course-card .course-body { padding: 11px 34px 11px 13px; gap: 4px; min-width: 0; }
  .course-card .course-body h3 { font-size: 15px; line-height: 1.25; }
  .course-card .course-desc { font-size: 13px; }
  .course-card .course-meta { font-size: 12px; gap: 4px 10px; }
  .course-card .course-meta .m-only + .m-only::before, .course-card .course-meta span + .m-only::before { content: none; }
  .course-card .course-foot { padding-top: 2px; }
  .course-card .course-foot:empty { display: none; }
  .course-card .course-foot .badge { font-size: 11px; padding: 2px 8px; }
  /* every card on the phone has the same height: one line each for title, text, details, progress */
  .course-card { height: 112px; }
  .course-card .course-cover { min-height: 0; }
  .course-card .course-body { gap: 3px; }
  .course-card .course-body h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .course-card .course-desc { -webkit-line-clamp: 1; line-clamp: 1; }
  .course-card .course-meta { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
  .course-card .course-foot { margin-top: auto; min-height: 20px; padding-top: 0; }
  .course-arrow { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--line-2); width: 18px; height: 18px; }
  .page-head p { font-size: 13.5px; }

  /* course page: compact band and progress */
  .course-header { gap: 12px; margin-bottom: 18px; }
  .course-band { background: var(--card); border: 1px solid var(--line); min-height: 0; padding: 12px; gap: 13px; border-radius: 16px; box-shadow: 0 3px 0 var(--line); }
  .course-band::after { content: none; }
  .course-band-cover { display: flex; align-items: flex-end; width: 100px; height: 96px; flex: none; background: var(--cc); border-radius: 12px; padding: 8px; font-family: var(--font-head); font-weight: 800; font-size: 11.5px; line-height: 1.15; color: var(--ink); word-break: break-word; }
  .course-band-text { gap: 4px; min-width: 0; }
  .band-subject { display: none; }
  .band-badges .badge { background: var(--card-2); border-color: var(--line); font-size: 11px; padding: 2px 8px; }
  .course-band h1 { font-size: 19px; }
  .band-desc { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .course-band .course-meta { font-size: 12.5px; margin-top: 0; }
  .access-box { padding: 14px 16px; }
  .access-box .big-num { font-size: 28px; margin: 2px 0 8px; }
  .access-box .ab-done { margin: 8px 0 12px; }
  .access-box h3 { font-size: 16px; margin: 8px 0 10px !important; }
  .access-box .next-hint, .access-box .ab-explain { display: none; }
  .access-box .btn-block { padding: 12px 16px; }
  .section-block > h3 { font-size: 13px; }

  .crumbs { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; font-size: 12.5px; margin-bottom: 10px; }
  .crumbs > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; }
  .crumbs > span:not(:last-child) { flex-shrink: 0; }
  /* lesson, result */
  .lesson-title { font-size: 21px; margin: 16px 0 4px; }
  .lesson-actions { margin: 10px 0 14px; flex-wrap: nowrap; gap: 8px; }
  .lesson-actions .btn-row { flex-wrap: nowrap; gap: 8px; }
  .test-cta { padding: 14px; gap: 12px; }
  .test-cta .ico { width: 42px; height: 42px; border-radius: 12px; }
  .test-cta .txt b { font-size: 16px; }
  .test-cta .txt span { font-size: 13px; }
  .test-cta .btn { width: 100%; }
  .score-card { padding: 18px; }
  .score-card .big { font-size: 56px; margin: 4px 0 2px; }
  .score-card .of { font-size: 15px; margin-bottom: 10px; }
  .score-split { margin-bottom: 12px; }
  .review-item { padding: 14px; }
}
