/* ============ Пассивный поток — стили ============ */
[hidden] { display: none !important; }
:root {
  --navy: #142033;
  --navy-2: #1e2d48;
  --navy-3: #2a3c5e;
  --bg: #f3f5f9;
  --card: #ffffff;
  --line: #e3e8f0;
  --line-2: #d3dae6;
  --text: #172033;
  --muted: #5f6b80;
  --green: #16a34a;
  --green-2: #22c55e;
  --green-soft: #e9f8ef;
  --red: #e5484d;
  --red-soft: #fdecec;
  --amber: #b45309;
  --amber-soft: #fff6e5;
  --blue: #2563eb;
  --blue-soft: #eaf1ff;
  --violet: #7c3aed;
  --violet-soft: #f3edff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 32, 51, .05), 0 4px 18px rgba(20, 32, 51, .06);
  --shadow-lg: 0 10px 40px rgba(20, 32, 51, .14);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(26px, 4vw, 36px); font-weight: 800; }
h2 { font-size: 22px; font-weight: 800; }
h3 { font-size: 17px; font-weight: 700; }
img { max-width: 100%; }
button { font-family: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: #eef1f6; padding: .1em .35em; border-radius: 5px; }
.muted { color: var(--muted); }
.sm { font-size: 13px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 700; }
.ok-text { color: var(--green); font-weight: 600; }
.warn-text { color: var(--amber); font-weight: 600; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 780px; }
main { min-height: calc(100vh - 160px); padding-bottom: 60px; }

/* ---------- шапка ---------- */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; }
.topbar-in { display: flex; align-items: center; gap: 20px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 16px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.logo-mark { width: 28px; height: 28px; flex: none; }
.topnav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { color: #c5cfe0; padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.topnav a:hover { color: #fff; background: rgba(255, 255, 255, .07); text-decoration: none; }
.topnav a.on { color: #fff; background: rgba(255, 255, 255, .12); }
.topnav a.admin-link { color: #ffd27a; }
.logout button { background: none; border: 1px solid rgba(255, 255, 255, .18); color: #c5cfe0; border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 13px; font-weight: 600; }
.logout button:hover { color: #fff; border-color: rgba(255, 255, 255, .4); }
.banner { background: linear-gradient(90deg, #fff4d6, #ffe8b0); color: #6b4a00; font-weight: 700; font-size: 14px; padding: 10px 0; text-align: center; }
.banner a { color: inherit; }

@media (max-width: 720px) {
  .topbar-in { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 6px; gap: 6px 10px; }
  .brand span { font-size: 15px; }
  .topnav { order: 3; width: 100%; margin: 0 -6px; }
  .logout { margin-left: auto; }
}

/* ---------- кнопки, поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2); background: #fff; color: var(--text); font-weight: 700; font-size: 15px; padding: 10px 18px; border-radius: 12px; cursor: pointer; transition: transform .08s, box-shadow .15s, background .15s; text-decoration: none; line-height: 1.3; }
.btn:hover { text-decoration: none; box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: #15913f; }
.btn.done { background: var(--green-soft); border-color: #bfe8cf; color: var(--green); }
.btn.ghost { background: transparent; }
.btn.ghost-light { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #fff; }
.btn.danger { background: #fff; color: var(--red); border-color: #f3c3c5; }
.btn.danger:hover { background: var(--red-soft); }
.btn.big { padding: 14px 24px; font-size: 16px; border-radius: 14px; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: default; }
button.link { background: none; border: 0; color: var(--blue); cursor: pointer; font-size: inherit; padding: 0; font-weight: 600; }
.icon-btn { width: 28px; height: 28px; border: 1px solid var(--line-2); background: #fff; border-radius: 7px; cursor: pointer; font-size: 14px; }
.icon-btn:disabled { opacity: .3; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 700; color: var(--muted); }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=search], input:not([type]), select, textarea {
  font: inherit; font-size: 15px; color: var(--text); background: #fff; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
textarea { resize: vertical; line-height: 1.55; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-gap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }

.alert { border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; font-size: 14px; font-weight: 600; }
.alert.err { background: var(--red-soft); color: #b42318; }
.alert.ok { background: var(--green-soft); color: #11743a; }
.alert.warn { background: var(--amber-soft); color: var(--amber); }
.alert.info { background: var(--blue-soft); color: #1d4ed8; }

/* ---------- вход ---------- */
.auth-body { background: radial-gradient(1200px 600px at 80% -10%, #22365a 0%, var(--navy) 60%); }
.auth-body .footer { color: #8c99b3; border-top-color: rgba(255,255,255,.08); }
.auth { min-height: calc(100vh - 200px); display: grid; place-items: center; padding: 40px 16px; }
.auth-card { background: #fff; border-radius: 22px; padding: 34px 30px; width: 100%; max-width: 430px; box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 28px; margin-bottom: 8px; }
.auth-badge { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--green); background: var(--green-soft); padding: 4px 10px; border-radius: 99px; margin-bottom: 14px; }
.code-input { font-size: 28px !important; letter-spacing: 10px; text-align: center; font-weight: 800; }
.resend { margin-top: 14px; font-size: 14px; color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); margin-top: 12px; }

/* ---------- главная ---------- */
.hero { margin: 28px 0 34px; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 60%, #223a5f 100%); color: #fff; border-radius: 24px; padding: 32px; display: grid; grid-template-columns: 1fr auto; gap: 28px; position: relative; overflow: hidden; box-shadow: var(--shadow-lg); }
.hero::after { content: ''; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; background: radial-gradient(circle, rgba(34, 197, 94, .25), transparent 65%); pointer-events: none; }
.hero h1 { color: #fff; margin: 4px 0 8px; }
.hero p { color: #c5cfe0; margin: 0 0 20px; max-width: 560px; }
.hero-kicker { font-size: 13px; font-weight: 700; color: #8fe3ad; letter-spacing: .02em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero-side { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-width: 180px; position: relative; z-index: 1; }
.hero-stat { color: #c5cfe0; font-size: 14px; }
.hero-stat b { color: #fff; font-size: 18px; }
.hero-hint { color: #8c99b3; font-size: 12px; text-align: center; max-width: 170px; }
.ring { width: 120px; height: 120px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring-bg { stroke: rgba(255, 255, 255, .12); }
.ring-fg { stroke: var(--green-2); stroke-linecap: round; transition: stroke-dashoffset .6s; }
.ring text { transform: rotate(90deg); transform-origin: 40px 40px; fill: #fff; font-weight: 800; font-size: 17px; font-family: var(--font); }
.countdown { display: flex; flex-direction: column; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; padding: 7px 14px; line-height: 1.3; }
.cd-label { font-size: 11px; color: #a8b4ca; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.cd-val { font-weight: 800; font-variant-numeric: tabular-nums; }
.level-pill { margin-top: 18px; font-size: 14px; color: #c5cfe0; }
.level-pill b { color: #fff; }
.level-pill a { color: #8fe3ad; }
.test-cta { margin-top: 20px; display: flex; align-items: center; gap: 14px; background: rgba(255, 255, 255, .08); border: 1px dashed rgba(143, 227, 173, .5); border-radius: 14px; padding: 12px 16px; color: #fff; max-width: 520px; }
.test-cta:hover { background: rgba(255, 255, 255, .12); text-decoration: none; }
.test-cta div { display: flex; flex-direction: column; }
.test-cta span { color: #a8b4ca; font-size: 13px; }
.test-cta svg { width: 22px; flex: none; margin-left: auto; color: #8fe3ad; }
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; padding: 24px 20px; border-radius: 20px; margin-top: 16px; }
  .hero-side { flex-direction: row; justify-content: flex-start; flex-wrap: wrap; }
  .ring { width: 84px; height: 84px; }
  .hero-actions .btn { width: 100%; }
}

.week { margin-bottom: 38px; }
.week-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; }
.week-head h2 { margin: 2px 0 0; font-size: 24px; }
.week-head p { margin: 2px 0 0; font-size: 14px; }
.week-label { font-size: 12px; font-weight: 800; color: var(--green); text-transform: uppercase; letter-spacing: .07em; }
.week-count { font-weight: 800; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.lcard { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; min-height: 176px; }
a.lcard:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #c8d3e4; }
.lcard h3 { margin: 10px 0 6px; font-size: 17px; }
.lcard p { margin: 0 0 12px; font-size: 14px; color: var(--muted); line-height: 1.45; }
.lc-top { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.lc-day { color: #8a95a8; font-weight: 700; text-transform: none; letter-spacing: 0; }
.lc-day::before { content: '·'; margin-right: 8px; }
.st { margin-left: auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.st svg { width: 16px; height: 16px; }
.st.done { background: var(--green); color: #fff; }
.st.lock { background: #eef1f6; color: #8a95a8; }
.st.go { background: var(--navy); color: #fff; }
.lc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: #eef1f6; color: var(--muted); white-space: nowrap; }
.chip svg { width: 12px; height: 12px; }
.chip.c-video { background: var(--violet-soft); color: var(--violet); }
.chip.c-text { background: var(--blue-soft); color: var(--blue); }
.chip.req { background: var(--green-soft); color: var(--green); }
.chip.skim { background: #f1f3f7; color: #7b8699; }
.chip.admin { background: #fff3d6; color: #8a5a00; }
.when { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #7b8699; margin-top: 12px; }
.when svg { width: 14px; height: 14px; }
.lcard.locked { background: repeating-linear-gradient(135deg, #fafbfd 0 12px, #f4f6fa 12px 24px); box-shadow: none; }
.lcard.locked h3, .lcard.locked p { opacity: .65; }
.lcard.done { border-color: #c9ecd6; }
.lcard.next { border: 2px solid var(--green); box-shadow: 0 0 0 4px rgba(22, 163, 74, .12), var(--shadow); }
.lcard.next::before { content: 'Сейчас'; position: absolute; top: -11px; left: 16px; background: var(--green); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 99px; letter-spacing: .04em; text-transform: uppercase; }

/* ---------- урок ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; font-size: 14px; margin: 24px 0 18px; }
.back svg { width: 16px; height: 16px; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.lesson h1 { margin-bottom: 10px; }
.lead { font-size: 18px; color: var(--muted); margin: 0 0 24px; line-height: 1.55; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: #0d1626; margin: 8px 0 10px; box-shadow: var(--shadow-lg); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video.placeholder { display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, #2a3c5e, #0f1a2c 70%); }
.ph-in { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #c5cfe0; text-align: center; padding: 20px; }
.ph-in b { color: #fff; font-size: 18px; }
.ph-in span:last-child { font-size: 14px; max-width: 340px; }
.ph-icon { width: 64px; height: 64px; border-radius: 50%; background: rgba(255, 255, 255, .12); display: grid; place-items: center; margin-bottom: 8px; }
.ph-icon svg { width: 26px; height: 26px; color: #fff; margin-left: 4px; }
.konspekt-label { margin: 26px 0 6px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--green); }

.prose { font-size: 17px; line-height: 1.7; }
.prose h2 { font-size: 24px; margin: 1.6em 0 .55em; }
.prose h3 { font-size: 19px; margin: 1.4em 0 .5em; }
.prose h4 { font-size: 16px; margin: 1.2em 0 .4em; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--green); font-weight: 700; }
.prose blockquote { margin: 1.2em 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--line-2); color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose img { border-radius: 12px; border: 1px solid var(--line); display: block; margin: 1em auto; }
.prose strong { font-weight: 800; }
.prose pre { background: #0f1a2c; color: #e3e9f3; padding: 14px 16px; border-radius: 12px; overflow-x: auto; font-size: 14px; }
.prose pre code { background: none; padding: 0; color: inherit; }
.table-wrap { overflow-x: auto; margin: 1.2em 0 1.4em; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.45; }
.prose th { background: #f5f7fb; text-align: left; font-weight: 800; font-size: 13px; color: var(--muted); }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.prose ul.checklist { list-style: none; padding-left: 0; }
.prose li.check { display: flex; gap: 10px; align-items: flex-start; }
.prose li.check .box { width: 20px; height: 20px; border: 2px solid var(--line-2); border-radius: 6px; flex: none; margin-top: 4px; cursor: pointer; }
.prose li.check.done .box, .prose li.check.on .box { background: var(--green); border-color: var(--green); box-shadow: inset 0 0 0 3px #fff; }
.callout { border-radius: 14px; padding: 14px 18px; margin: 1.3em 0; border: 1px solid; }
.callout-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; margin-bottom: 4px; }
.callout-body > :last-child { margin-bottom: 0; }
.callout-body { font-size: 16px; }
.callout.tip { background: var(--green-soft); border-color: #c4ead2; }
.callout.tip .callout-title { color: #11743a; }
.callout.warn { background: var(--amber-soft); border-color: #f6dcaa; }
.callout.warn .callout-title { color: var(--amber); }
.callout.info { background: var(--blue-soft); border-color: #cdddff; }
.callout.info .callout-title { color: #1d4ed8; }
.callout.key { background: var(--navy); border-color: var(--navy); color: #e3e9f3; }
.callout.key .callout-title { color: #8fe3ad; }
.callout.key strong { color: #fff; }
.callout.example { background: var(--violet-soft); border-color: #e2d6fb; }
.callout.example .callout-title { color: var(--violet); }

.deeper { margin: 30px 0; border: 1px solid #ddd0fb; border-radius: 16px; background: #fbf9ff; overflow: hidden; }
.deeper summary { cursor: pointer; padding: 16px 20px; display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--muted); list-style: none; }
.deeper summary::-webkit-details-marker { display: none; }
.deeper summary::after { content: '+'; margin-left: auto; font-size: 22px; color: var(--violet); font-weight: 400; }
.deeper[open] summary::after { content: '–'; }
.deeper-badge { background: var(--violet); color: #fff; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 4px 10px; border-radius: 99px; }
.deeper > .prose { padding: 0 22px 10px; font-size: 16px; }
.homework, .files { margin: 26px 0; border: 2px solid #bfe8cf; background: #f7fdf9; border-radius: 16px; padding: 18px 22px 8px; }
.files { border-color: var(--line); background: #fff; padding-bottom: 14px; }
.hw-title { font-weight: 800; font-size: 16px; margin-bottom: 8px; }
.homework .prose { font-size: 16px; }
.file { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; color: var(--text); font-weight: 600; }
.file:hover { background: #f7f9fc; text-decoration: none; }
.file svg { width: 20px; color: var(--green); flex: none; }
.file small { margin-left: auto; color: var(--muted); }

.lesson-done { margin: 36px 0 20px; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.lesson-done svg { width: 18px; height: 18px; }
.fb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 600; margin-left: auto; }
.fb-btn { font-size: 20px; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; transition: transform .1s; }
.fb-btn:hover { transform: scale(1.06); }
.fb-btn.on { background: var(--green-soft); border-color: var(--green); }
.fb-comment { width: 100%; display: flex; gap: 10px; align-items: flex-end; }
.fb-comment textarea { flex: 1; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.pg { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); background: #fff; border-radius: 14px; color: var(--text); font-weight: 700; font-size: 15px; line-height: 1.35; }
.pg:hover { text-decoration: none; box-shadow: var(--shadow); }
.pg span { display: flex; flex-direction: column; }
.pg small { font-size: 12px; color: var(--muted); font-weight: 600; }
.pg svg { width: 18px; flex: none; color: var(--muted); }
.pg.next { text-align: right; justify-content: flex-end; }
.pg.locked { opacity: .7; background: #f7f9fc; }
@media (max-width: 600px) {
  .prose { font-size: 16px; }
  .pager { grid-template-columns: 1fr; }
  .fb { margin-left: 0; }
  .lesson-done .btn { width: 100%; }
}

.locked-page { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 48px 24px; margin: 10px 0 30px; }
.lp-icon { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; background: #eef1f6; color: #8a95a8; display: grid; place-items: center; }
.lp-icon svg { width: 30px; height: 30px; }
.lp-code { font-size: 64px; font-weight: 800; color: var(--line-2); }
.countdown.big { display: inline-flex; background: var(--navy); color: #fff; margin: 10px 0 24px; padding: 12px 22px; }
.countdown.big .cd-val { font-size: 26px; }

/* ---------- тест ---------- */
.quiz { margin-top: 24px; }
.q { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 18px 20px; margin: 0 0 16px; }
.q legend { font-weight: 800; font-size: 17px; padding: 0; display: flex; gap: 10px; align-items: baseline; margin-bottom: 10px; float: left; width: 100%; }
.q legend + * { clear: both; }
.qn { font-size: 12px; color: var(--green); background: var(--green-soft); padding: 2px 8px; border-radius: 99px; flex: none; }
.opt { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; cursor: pointer; font-size: 15px; transition: background .12s, border-color .12s; }
.opt:hover { background: #f7f9fc; }
.opt input { accent-color: var(--green); width: 18px; height: 18px; flex: none; }
.opt:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.result-card { background: #fff; border-radius: 22px; padding: 30px; border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 18px; border-top: 6px solid var(--green); }
.result-card.lvl2 { border-top-color: var(--blue); }
.result-card.lvl3 { border-top-color: var(--violet); }
.result-kicker { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* ---------- калькуляторы ---------- */
.tool { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 24px; margin: 22px 0; box-shadow: var(--shadow); }
.tool h2 { margin-bottom: 4px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 14px; margin-top: 16px; }
.tool-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 6px 0 14px; }
.kpi { background: #f5f7fb; border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi small { color: var(--muted); font-weight: 700; font-size: 12px; }
.kpi b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi.accent { background: var(--navy); color: #fff; }
.kpi.accent small { color: #a8b4ca; }
.kpi.warn { background: var(--amber-soft); }
.kpi a { font-size: 13px; font-weight: 700; }
.chart { height: 180px; display: flex; align-items: flex-end; gap: 4px; padding: 10px 0 0; border-bottom: 1px solid var(--line); }
.chart .col { flex: 1; display: flex; flex-direction: column-reverse; height: 100%; position: relative; }
.chart .col span { display: block; }
.chart .inv { background: #cdd7e6; border-radius: 0 0 3px 3px; }
.chart .prof { background: var(--green-2); border-radius: 4px 4px 0 0; }
.chart .col em { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); font-style: normal; }
.tool .hint { margin-top: 26px; }

/* ---------- словарь ---------- */
.search { margin: 6px 0 18px; font-size: 16px !important; padding: 12px 16px !important; border-radius: 14px !important; }
.gloss { margin: 0; }
.gt { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin-bottom: 10px; }
.gt dt { font-weight: 800; font-size: 16px; }
.gt dd { margin: 4px 0 0; color: #3b465a; font-size: 15px; }

/* ---------- карточка выпускника ---------- */
#cert { width: 100%; max-width: 360px; height: auto; display: block; margin: 10px 0 20px; border-radius: 18px; box-shadow: var(--shadow-lg); }
.cert-form { max-width: 360px; }

/* ---------- подвал ---------- */
.footer { border-top: 1px solid var(--line); padding: 24px 0 34px; color: #8a95a8; font-size: 12px; line-height: 1.55; }
.footer p { margin: 0 0 6px; max-width: 760px; }

/* ============ админка ============ */
.admin { padding-top: 20px; }
.atabs, .subtabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 22px; scrollbar-width: none; }
.atabs a, .subtabs a { padding: 10px 14px; font-weight: 700; font-size: 14px; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.atabs a:hover, .subtabs a:hover { color: var(--text); text-decoration: none; }
.atabs a.on, .subtabs a.on { color: var(--text); border-bottom-color: var(--green); }
.subtabs { margin-bottom: 14px; }
.ahead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.ahead h1 { font-size: 28px; margin: 0; }
.ahead .back { margin: 0 0 8px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 18px 0 24px; }
.kpis .kpi { background: #fff; border: 1px solid var(--line); }
.acols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.acols.wide-left { grid-template-columns: minmax(0, 1fr) 320px; }
@media (max-width: 960px) { .acols, .acols.wide-left { grid-template-columns: 1fr; } }
.apanel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-bottom: 20px; }
.apanel h2 { font-size: 18px; }
.apanel.sticky { position: sticky; top: 80px; }
.danger-zone { border-color: #f3c3c5; }
.table-scroll { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 14px; }
.apanel .table-scroll { border: 0; }
.atable { width: 100%; border-collapse: collapse; font-size: 14px; }
.atable th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 800; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f8fafc; white-space: nowrap; }
.atable td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.atable tr:last-child td { border-bottom: 0; }
.atable select { padding: 6px 8px; font-size: 13px; width: auto; }
.muted-row td { opacity: .55; }
.wk { font-size: 12px; font-weight: 800; background: #eef1f6; color: var(--muted); padding: 2px 7px; border-radius: 6px; }
.sel-open { color: var(--green); font-weight: 700; }
.sel-closed { color: var(--red); font-weight: 700; }
.sel-draft { color: var(--muted); }
.thumb { width: 54px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.badge { display: inline-block; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: #eef1f6; color: var(--muted); }
.badge.active { background: var(--green-soft); color: var(--green); }
.badge.blocked { background: var(--red-soft); color: var(--red); }
.badge.refunded { background: var(--amber-soft); color: var(--amber); }
.bar { position: relative; background: #f1f4f8; border-radius: 6px; height: 22px; min-width: 90px; overflow: hidden; }
.bar span { position: absolute; inset: 0 auto 0 0; background: #c9d6ea; border-radius: 6px; }
.bar.green span { background: #b9e8cb; }
.bar em { position: relative; font-style: normal; font-size: 12px; font-weight: 800; padding: 0 8px; line-height: 22px; }
.bar.sm { height: 18px; }
.bar.sm em { line-height: 18px; }
.lvrow { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pay-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pay-row small { grid-column: 1 / -1; color: var(--muted); }
.pay-row.refund span:first-child { color: var(--amber); font-weight: 700; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; align-items: center; }
.filters input, .filters select { width: auto; flex: 1 1 160px; }
.add-user { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.checks { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.checks label { display: flex; gap: 8px; align-items: center; }
.upload-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 16px; }
.upload-row select { width: auto; }
.stream-form input { width: auto; }
.status-list { display: flex; flex-direction: column; gap: 6px; font-size: 14px; margin-top: 6px; }
.grant input { width: 180px; padding: 6px 8px; font-size: 13px; }
.save-hint { display: block; text-align: center; margin-top: 8px; }
.side-panel .btn.big { width: 100%; margin-top: 6px; }

.ed-block { margin-bottom: 20px; }
.ed-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.ed-head label { font-weight: 800; font-size: 15px; }
.md-editor { border: 1px solid var(--line-2); border-radius: 12px; background: #fff; overflow: hidden; }
.md-editor:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.md-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.md-toolbar button { border: 0; background: none; padding: 5px 8px; border-radius: 6px; font-size: 13px; font-weight: 700; color: #3b465a; cursor: pointer; }
.md-toolbar button:hover { background: #e9eef5; }
.md-toolbar button.tgl.on { background: var(--navy); color: #fff; }
.md-toolbar .grow { flex: 1; }
.md-editor textarea { border: 0; border-radius: 0; box-shadow: none !important; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; line-height: 1.6; min-height: 120px; }
.md-preview { padding: 16px 20px; min-height: 120px; }
.wrap.narrow > h1:first-child { margin-top: 32px; }
.acols > * { min-width: 0; }
@media (max-width: 600px) {
  .admin .ahead h1 { font-size: 24px; }
  .apanel { padding: 16px; }
  .two { grid-template-columns: 1fr; }
  .filters input, .filters select, .filters button { flex: 1 1 100%; }
  .upload-row > * { flex: 1 1 100%; }
  .stream-form { flex-wrap: wrap; }
  .grant input { width: 140px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi b { font-size: 20px; }
  .tool { padding: 18px; }
  .week-head h2 { font-size: 21px; }
  .auth-card { padding: 26px 20px; }
}
