/* BVTS (Школа Вани и Наташи Буявец). Светлая тема, акцент #7324FF.
   Радиусы (одна система на весь продукт): оболочка карточки 28px, ядро 22px, поля 14px, кнопки и бейджи — pill. */

@font-face { font-family: "Onest"; src: url("../fonts/onest-cyrillic.fe2bd26ae82a.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; src: url("../fonts/onest-latin.3db826ed1c5d.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;
  --bg: #f6f5fa;
  --bg-deep: #efedf6;
  --surface: #ffffff;
  --ink: #16131f;
  --ink-2: #3b3649;
  --muted: #6e6981;
  --line: rgb(22 19 31 / 0.07);
  --line-strong: rgb(22 19 31 / 0.12);
  --accent: #7324ff;
  --accent-hover: #6418ec;
  --accent-ink: #ffffff;
  --accent-soft: #f1eaff;
  --accent-soft-2: #e5d8ff;
  --accent-text: #5b14d6;
  --ok: #0f8a5f; --ok-soft: #e3f6ee;
  --warn: #b4530b; --warn-soft: #fdf0e3;
  --err: #c8243a; --err-soft: #fde8eb;
  --shadow-sm: 0 1px 2px rgb(52 24 120 / 0.04), 0 2px 6px -2px rgb(52 24 120 / 0.06);
  --shadow: 0 1px 2px rgb(52 24 120 / 0.04), 0 18px 40px -18px rgb(70 30 160 / 0.18);
  --shadow-lg: 0 2px 4px rgb(52 24 120 / 0.04), 0 30px 70px -28px rgb(80 30 180 / 0.28);
  --r-shell: 28px; --r-core: 22px; --r-field: 14px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --wrap: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.6 "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100dvh;
}
/* Мягкое фиолетовое свечение у верхнего края — фон один на весь продукт, без полос и блобов по секциям. */
body::before {
  content: ""; position: fixed; inset: 0 0 auto 0; height: 520px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 70% at 85% -10%, rgb(115 36 255 / 0.10), transparent 70%),
    radial-gradient(45% 60% at 0% 0%, rgb(160 120 255 / 0.08), transparent 70%);
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; color: var(--ink); letter-spacing: -0.02em; line-height: 1.15; font-weight: 600; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.6rem); letter-spacing: -0.035em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; letter-spacing: -0.01em; }
p { margin: 0 0 0.8em; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.tnum { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon { width: 1.15em; height: 1.15em; flex: none; }
.icon-lg { width: 1.5rem; height: 1.5rem; }

/* ---------- Каркас ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.page { padding: 36px 0 96px; }
@media (max-width: 767px) { .wrap { padding: 0 16px; } .page { padding: 20px 0 72px; } }

/* Навигация: парящая «таблетка», прилипает к верху со стеклом */
.nav-dock { position: sticky; top: 14px; z-index: 20; padding: 0 16px; }
.nav {
  max-width: var(--wrap); margin: 14px auto 0; height: 64px; display: flex; align-items: center; gap: 8px;
  padding: 0 10px 0 22px; border-radius: 999px;
  background: rgb(255 255 255 / 0.72); border: 1px solid rgb(255 255 255 / 0.9);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 650; letter-spacing: -0.02em; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 0.95rem; font-weight: 700;
  background: linear-gradient(140deg, #8d4dff, var(--accent) 55%, #5a12d9); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.35), 0 6px 14px -6px rgb(115 36 255 / 0.6); }
.nav-links { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav-link { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-size: 0.94rem; font-weight: 500;
  transition: background 0.4s var(--ease), color 0.4s var(--ease); white-space: nowrap; }
.nav-link:hover { background: var(--accent-soft); color: var(--accent-text); }
.nav-link[aria-current="page"] { background: var(--ink); color: #fff; }
.nav-link .icon { opacity: 0.8; }
.nav-user { display: flex; align-items: center; gap: 6px; margin-left: 6px; }
.avatar { width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; font-weight: 600; font-size: 0.9rem;
  color: var(--accent-text); background: var(--accent-soft); text-decoration: none; box-shadow: inset 0 0 0 1px var(--accent-soft-2); transition: transform 0.4s var(--ease); }
.avatar:hover { transform: scale(1.05); color: var(--accent-text); }
.icon-btn { width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  transition: background 0.4s var(--ease), color 0.4s var(--ease); }
.icon-btn:hover { background: var(--bg-deep); color: var(--ink); }

/* Бургер: две линии собираются в крест */
.burger { display: none; position: relative; width: 44px; height: 44px; border: 0; border-radius: 999px; background: var(--ink); cursor: pointer; margin-left: auto; }
.burger span { position: absolute; left: 14px; right: 14px; height: 1.5px; background: #fff; border-radius: 2px; transition: transform 0.5s var(--ease), top 0.5s var(--ease); }
.burger span:first-child { top: 18px; } .burger span:last-child { top: 25px; }
.menu-open .burger span:first-child { top: 21.5px; transform: rotate(45deg); }
.menu-open .burger span:last-child { top: 21.5px; transform: rotate(-45deg); }
.mobile-menu { position: fixed; inset: 0; z-index: 15; padding: 110px 24px 40px; background: rgb(250 249 253 / 0.86);
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); opacity: 0; visibility: hidden; transition: opacity 0.5s var(--ease), visibility 0.5s; }
.menu-open .mobile-menu { opacity: 1; visibility: visible; }
.mobile-menu a, .mobile-menu button { display: block; font: 600 1.9rem/1.2 "Onest", sans-serif; letter-spacing: -0.03em; color: var(--ink); text-decoration: none; padding: 10px 0;
  background: none; border: 0; cursor: pointer; transform: translateY(24px); opacity: 0; transition: transform 0.7s var(--ease), opacity 0.7s var(--ease); }
.menu-open .mobile-menu a, .menu-open .mobile-menu button { transform: none; opacity: 1; }
.mobile-menu > :nth-child(2) { transition-delay: 0.05s; } .mobile-menu > :nth-child(3) { transition-delay: 0.1s; }
.mobile-menu > :nth-child(4) { transition-delay: 0.15s; } .mobile-menu > :nth-child(5) { transition-delay: 0.2s; } .mobile-menu > :nth-child(6) { transition-delay: 0.25s; }
@media (max-width: 899px) {
  .nav-links, .nav-user { display: none; }
  .burger { display: block; }
  .nav { padding-right: 10px; }
}
@media (min-width: 900px) { .mobile-menu { display: none; } }

/* ---------- Поверхности: «двойной ободок» ---------- */
.shell { background: rgb(255 255 255 / 0.5); border-radius: var(--r-shell); padding: 6px; box-shadow: inset 0 0 0 1px var(--line), var(--shadow); }
.core { background: var(--surface); border-radius: var(--r-core); padding: 28px; box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.9), 0 0 0 1px var(--line); }
.core-tight { padding: 20px; }
.core + .core { margin-top: 6px; }
@media (max-width: 767px) { .core { padding: 20px; } }
.panel { background: var(--surface); border-radius: var(--r-core); padding: 24px; box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.stack > * + * { margin-top: 20px; }
.stack-lg > * + * { margin-top: 32px; }

/* ---------- Кнопки ---------- */
.btn { --btn-bg: var(--accent); --btn-ink: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 6px 22px; border: 0; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-ink); font: 600 0.97rem/1 "Onest", sans-serif; letter-spacing: -0.01em; text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.22), 0 10px 24px -12px rgb(115 36 255 / 0.7);
  transition: transform 0.5s var(--ease), background 0.4s var(--ease), box-shadow 0.5s var(--ease); }
.btn:hover { background: var(--accent-hover); color: var(--btn-ink); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.22), 0 16px 30px -12px rgb(115 36 255 / 0.75); }
.btn:active { transform: scale(0.98); }
.btn.has-icon:has(> .btn-orb:last-child) { padding-right: 6px; } /* кругляш справа прижат к краю; иконка слева отступ не трогает */
.btn.has-icon:not(:has(> .btn-orb)) { padding-left: 18px; }
.btn-sm.has-icon:not(:has(> .btn-orb)) { padding-left: 13px; gap: 8px; }
.btn-orb { width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; background: rgb(255 255 255 / 0.18); transition: transform 0.5s var(--ease); }
.btn:hover .btn-orb { transform: translate(2px, -1px) scale(1.06); }
.btn-ghost { --btn-bg: var(--surface); --btn-ink: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-sm); }
.btn-ghost:hover { --btn-bg: var(--surface); background: var(--surface); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent-soft-2), var(--shadow-sm); }
.btn-ghost .btn-orb { background: var(--accent-soft); color: var(--accent-text); }
.btn-dark { --btn-bg: var(--ink); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.12), 0 10px 24px -12px rgb(22 19 31 / 0.6); }
.btn-dark:hover { background: #2a2536; }
.btn-dark .btn-orb { background: rgb(255 255 255 / 0.12); }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 4px 16px; font-size: 0.9rem; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-text); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link-btn:hover { color: var(--accent); }
.inline { display: inline; }

/* ---------- Формы ---------- */
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 0 0 18px; }
.field > label, .label { font-size: 0.9rem; font-weight: 550; color: var(--ink-2); }
.help { font-size: 0.84rem; color: var(--muted); }
.req { color: var(--err); font-weight: 600; margin-left: 2px; }
.errorlist { list-style: none; margin: 0; padding: 0; color: var(--err); font-size: 0.86rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search], input[type=number], input[type=url], input[type=date], input[type=datetime-local], input:not([type]), textarea, select {
  width: 100%; padding: 13px 16px; border: 0; border-radius: var(--r-field); background: var(--bg); color: var(--ink); font: inherit;
  box-shadow: inset 0 0 0 1px var(--line-strong); transition: box-shadow 0.4s var(--ease), background 0.4s var(--ease); }
input::placeholder, textarea::placeholder { color: #8a849c; }
input:hover, textarea:hover { box-shadow: inset 0 0 0 1px rgb(22 19 31 / 0.2); }
input:focus, textarea:focus, select:focus { outline: none; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px rgb(115 36 255 / 0.12); }
textarea { resize: vertical; min-height: 120px; }
input[type=file] { font: inherit; font-size: 0.9rem; color: var(--muted); }
.hw-fields { display: grid; gap: 8px; margin: 18px 0 6px; }
.hw-fields-row { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: center; }
.hw-fields-row:has(.is-number) { grid-template-columns: 22px 1fr 150px; }
.hw-fields-head { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.hw-fields-n { color: var(--accent); font-weight: 600; text-align: right; }
.hw-fields-cell input { width: 100%; }
.hw-fields.is-locked input { opacity: 0.85; }
.hw-fields + .prose { margin: 14px 0 22px; }
.md-answers { margin: 10px 0 16px; padding: 12px 18px; border-radius: 14px; background: var(--accent-soft); }
.md-answers ol { margin: 0; } .md-answers p { margin: 0; }
.hw-checklist { margin: 18px 0 10px; }
[data-checklist-submit]:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }
.hw-check { margin-bottom: 12px; font-size: 0.97rem; color: var(--ink); }
.hw-check input:checked + span { color: var(--muted); }
.hw-checklist.is-locked .hw-check { cursor: default; }
.hw-checklist + .prose { margin: 14px 0 22px; }
.md-checklist ul { list-style: none; padding-left: 0; }
.md-checklist li { position: relative; padding-left: 32px; }
.md-checklist li::before { content: ""; position: absolute; left: 0; top: 0.15em; width: 20px; height: 20px; border-radius: 7px; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
/* Аудит рутины (::: audit, static/js/audit.js) */
.prose .md-audit { margin: 1.4em 0 30px; }
.prose .md-audit table { margin: 0; }
.md-audit .md-audit-group { padding: 26px 12px 8px; font-weight: 650; color: var(--accent-text); background: none; box-shadow: none; }
.md-audit tr.md-audit-group td { font-size: 1.2rem; line-height: 1.3; }
.md-audit td { vertical-align: middle; }
.md-audit .md-audit-hand, .md-audit .md-audit-ai { white-space: nowrap; color: var(--muted); }
.md-audit tr.is-on .md-audit-hand { color: var(--ink); }
.md-audit tr.is-on .md-audit-ai { color: var(--ok); font-weight: 600; }
.md-audit tr.is-on td { background: var(--accent-soft); }
.md-audit .md-audit-links { font-size: 0.86rem; }
.md-audit .audit-check { margin: 0; color: var(--ink); font-size: 0.97rem; }
.md-audit .audit-freq { width: 74px; padding: 8px 10px; text-align: center; }
.audit-sum { position: sticky; bottom: 12px; z-index: 5; display: grid; grid-template-columns: 1fr auto; gap: 14px 24px; align-items: center; margin-top: 16px;
  padding: 18px 22px; border-radius: var(--r-core); background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); }
.audit-sum p { margin: 0; }
.audit-sum-title { font-weight: 650; font-size: 1.05rem; line-height: 1.35; }
.audit-sum-text { color: rgb(255 255 255 / 0.7); font-size: 0.9rem; margin-top: 4px !important; }
.audit-sum-nums { display: flex; gap: 22px; }
.audit-sum-nums div { display: grid; gap: 2px; }
.audit-sum-nums span { font-size: 0.74rem; color: rgb(255 255 255 / 0.6); text-transform: uppercase; letter-spacing: 0.06em; }
.audit-sum-nums b { font-size: 1.25rem; font-weight: 700; white-space: nowrap; }
.audit-sum-nums .is-win b { color: #4ade80; }
.audit-sum-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: center; }
.audit-sum .btn-win { --btn-bg: #22c55e; --btn-ink: #0b2615; background: #22c55e; color: #0b2615; }
.audit-sum .btn-win:hover { background: #4ade80; color: #0b2615; }
.audit-sum .link-btn { color: rgb(255 255 255 / 0.75); }
.audit-sum.is-empty .audit-sum-nums, .audit-sum.is-empty .audit-sum-actions { display: none; }
@media (max-width: 760px) {
  .prose .md-audit table, .md-audit thead, .md-audit tbody { display: block; overflow: visible; }
  .md-audit thead { display: none; }
  .md-audit tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 12px 6px; box-shadow: inset 0 -1px 0 var(--line); }
  .md-audit tbody tr.md-audit-group { display: block; padding: 0; box-shadow: none; }
  .md-audit tbody td { padding: 0; box-shadow: none; background: none !important; }
  .md-audit tr.is-on { background: var(--accent-soft); border-radius: 14px; }
  .md-audit .md-audit-task { grid-column: 1 / -1; margin-bottom: 4px; }
  .md-audit .md-audit-hand, .md-audit .md-audit-ai, .md-audit .md-audit-links { grid-column: 1; padding-left: 34px; font-size: 0.85rem; }
  .md-audit .md-audit-hand::before { content: "руками: "; } .md-audit .md-audit-ai::before { content: "с нейросетями: "; }
  .md-audit .md-audit-freq { grid-column: 2; grid-row: 2 / span 2; }
  .md-audit .md-audit-freq::before { content: "раз в нед."; display: block; font-size: 0.72rem; color: var(--muted); text-align: center; }
  .md-audit .audit-freq { width: 64px; padding: 6px 8px; }
  .md-audit .md-audit-links { margin-top: 4px; }
  /* На телефоне итог — одна строка и кнопки: заголовок уже называет обе цифры, плашка не закрывает таблицу. */
  .audit-sum { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px 16px; bottom: 8px; }
  .audit-sum-title { font-size: 0.95rem; }
  .audit-sum-text, .audit-sum-nums { display: none !important; }
  .audit-sum-actions { gap: 8px 16px; }
}
@media (max-width: 560px) { .hw-fields-row:has(.is-number) { grid-template-columns: 18px 1fr 92px; } }
input[type=file]::file-selector-button { font: 600 0.88rem "Onest", sans-serif; margin-right: 12px; padding: 9px 16px; border: 0; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); cursor: pointer; }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 14px; font-size: 0.93rem; color: var(--ink-2); cursor: pointer; }
.check input { appearance: none; flex: none; width: 22px; height: 22px; margin: 1px 0 0; border-radius: 7px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-strong); cursor: pointer;
  display: grid; place-items: center; transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.check input[type=radio] { border-radius: 999px; }
.check input:checked { background: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.check input:checked::after { content: ""; width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.check input[type=radio]:checked::after { width: 8px; height: 8px; border: 0; border-radius: 999px; background: #fff; transform: none; }
.check input:focus-visible { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px rgb(115 36 255 / 0.15); }

/* ---------- Бейджи, сообщения ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 550; line-height: 1.2;
  background: var(--bg-deep); color: var(--ink-2); white-space: nowrap; }
.pill .icon { width: 14px; height: 14px; }
.pill-accent { background: var(--accent-soft); color: var(--accent-text); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-err { background: var(--err-soft); color: var(--err); }
.eyebrow { display: inline-flex; padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text);
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }

.flash { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: 18px; margin: 0 0 20px; background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); font-size: 0.95rem; animation: rise 0.7s var(--ease-out) both; }
.flash .icon { color: var(--accent); margin-top: 2px; }
.flash-success .icon { color: var(--ok); } .flash-warning .icon { color: var(--warn); } .flash-error .icon { color: var(--err); }

/* ---------- Прогресс ---------- */
progress { appearance: none; width: 100%; height: 6px; border: 0; border-radius: 999px; background: var(--bg-deep); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--bg-deep); border-radius: 999px; }
progress::-webkit-progress-value { background: linear-gradient(90deg, #9a5cff, var(--accent)); border-radius: 999px; transition: width 1s var(--ease-out); }
progress::-moz-progress-bar { background: linear-gradient(90deg, #9a5cff, var(--accent)); border-radius: 999px; }
.progress-row { display: flex; align-items: center; gap: 14px; }
.progress-row progress { flex: 1; }

/* ---------- Обложки курсов: фирменные градиенты, 4 варианта по курсу ---------- */
.cover { position: relative; overflow: hidden; border-radius: calc(var(--r-core) - 4px); isolation: isolate; color: #fff; }
.cover::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgb(255 255 255 / 0.18) 1px, transparent 1px); background-size: 18px 18px;
  mask-image: linear-gradient(120deg, transparent 30%, #000 100%); }
.cover-0 { background: radial-gradient(90% 120% at 100% 0%, #b48cff 0%, transparent 55%), linear-gradient(135deg, #7324ff, #4a0fb8); }
.cover-1 { background: radial-gradient(90% 120% at 0% 100%, #ff9ad5 0%, transparent 50%), linear-gradient(135deg, #8a3dff, #5414cf); }
.cover-2 { background: radial-gradient(80% 110% at 90% 100%, #7fd3ff 0%, transparent 55%), linear-gradient(135deg, #6a2bff, #3b13a6); }
.cover-3 { background: radial-gradient(90% 120% at 10% 0%, #ffc79a 0%, transparent 50%), linear-gradient(135deg, #7a2cff, #4b11b3); }

/* ---------- Кабинет: главная ---------- */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin: 12px 0 32px; }
.hello p { margin: 10px 0 0; font-size: 1.05rem; }
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.bento > * { min-width: 0; }
.span-8 { grid-column: span 8; } .span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; } .span-12 { grid-column: span 12; }
@media (max-width: 899px) { .bento { grid-template-columns: 1fr; gap: 16px; } .span-8, .span-4, .span-6, .span-12 { grid-column: auto; } }

.feature-course .core { padding: 8px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 8px; min-height: 340px; }
.feature-course .cover { padding: 28px; display: flex; flex-direction: column; justify-content: space-between; }
.feature-course .cover h2 { color: #fff; font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); letter-spacing: -0.035em; max-width: 14ch; }
.cover .pill { background: rgb(255 255 255 / 0.18); color: #fff; backdrop-filter: blur(6px); }
.feature-course .detail { padding: 22px 22px 22px 18px; display: flex; flex-direction: column; gap: 18px; }
.next-lesson { padding: 18px; border-radius: 18px; background: var(--bg); }
.next-lesson .label { display: block; color: var(--muted); font-weight: 500; font-size: 0.84rem; margin-bottom: 4px; }
.next-task { display: grid; gap: 8px; justify-items: start; }
.next-task .label { color: var(--muted); font-weight: 500; font-size: 0.84rem; }
.next-task .lesson-row { width: 100%; box-shadow: 0 0 0 1px var(--line); }
.next-task .lesson-row .title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.92rem; line-height: 1.35; }
.next-task .lesson-row.is-waiting .title { color: var(--ink); }
.next-task .lesson-row.is-waiting .status { color: var(--muted); }
.module-opens { flex: none; }
.schedule { padding: 18px; border-radius: 18px; background: var(--bg); }
.schedule .label { display: block; color: var(--muted); font-weight: 500; font-size: 0.84rem; margin-bottom: 8px; }
.schedule ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.schedule li { display: grid; gap: 2px; font-size: 0.92rem; line-height: 1.35; }
.schedule li .when { font-size: 0.8rem; }
.schedule li a.what { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.schedule li a.what:hover { color: var(--accent-text); }

.schedule li .tnum { color: var(--muted); }
.schedule li.is-open .what { color: var(--muted); }
.schedule li.is-upcoming .what { font-weight: 500; }
.next-lesson strong { font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; }
@media (max-width: 767px) { .feature-course .core { grid-template-columns: 1fr; } .feature-course .cover { min-height: 200px; } .feature-course .detail { padding: 16px; } }

.side-tile .core { height: 100%; display: flex; flex-direction: column; gap: 14px; }
.side-tile .tile-icon { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.side-tile .grow { flex: 1; }
.side-tile ul { list-style: none; margin: 0; padding: 0; }
.side-tile li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 0.93rem; }
.side-tile li + li { box-shadow: 0 -1px 0 var(--line); }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.course-card { display: block; text-decoration: none; color: inherit; transition: transform 0.6s var(--ease); }
.course-card:hover { transform: translateY(-3px); color: inherit; }
.course-card .core { padding: 8px; }
.course-card .cover { height: 150px; padding: 18px; display: flex; align-items: flex-start; justify-content: flex-end; }
.course-card .body { padding: 18px 16px 14px; display: grid; gap: 12px; }
.course-card h3 { font-size: 1.15rem; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 56px 0 20px; }

.empty { text-align: center; padding: 64px 24px; }
.empty .tile-icon { margin: 0 auto 18px; width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.empty .tile-icon .icon { width: 30px; height: 30px; }
.empty p { max-width: 42ch; margin: 10px auto 0; }

/* ---------- Программа курса ---------- */
.course-head { margin: 8px 0 28px; }
.course-head .shell { padding: 6px; }
.course-head .cover { padding: 40px; min-height: 230px; display: flex; flex-direction: column; justify-content: flex-end; gap: 18px; border-radius: var(--r-core); }
.course-head .cover h1 { color: #fff; max-width: 18ch; }
.course-head .cover .progress-row { max-width: 420px; color: rgb(255 255 255 / 0.85); font-size: 0.9rem; }
.course-head .cover progress { background: rgb(255 255 255 / 0.22); }
.course-head .cover progress::-webkit-progress-bar { background: rgb(255 255 255 / 0.22); }
.course-head .cover progress::-webkit-progress-value { background: #fff; }
.course-head .cover progress::-moz-progress-bar { background: #fff; }
@media (max-width: 767px) { .course-head .cover { padding: 24px; min-height: 200px; } }

.course-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.course-aside { position: sticky; top: 100px; }
@media (max-width: 999px) { .course-layout { grid-template-columns: 1fr; } .course-aside { position: static; order: -1; } }

.module + .module { margin-top: 16px; }
.module-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 6px 14px; }
.module-head h2 { font-size: 1.15rem; }
.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-row { display: flex; align-items: center; gap: 14px; padding: 12px 12px; border-radius: 16px; text-decoration: none; color: var(--ink);
  transition: background 0.4s var(--ease); }
a.lesson-row:hover { background: var(--accent-soft); color: var(--ink); }
.lesson-row .state { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--bg); color: var(--muted); }
.lesson-row.is-done .state { background: var(--ok-soft); color: var(--ok); }
.lesson-row.is-open .state { background: var(--accent-soft); color: var(--accent-text); }
.lesson-row .title { flex: 1; min-width: 0; font-weight: 500; }
.lesson-row .why { display: block; font-size: 0.84rem; color: var(--muted); font-weight: 400; }
.lesson-row.is-locked .title { color: var(--muted); }
.lesson-row .num { color: var(--muted); font-size: 0.85rem; width: 22px; text-align: right; flex: none; }

/* ---------- Урок ---------- */
.crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.9rem; color: var(--muted); margin: 8px 0 14px; }
.crumbs a { color: var(--muted); text-decoration: none; } .crumbs a:hover { color: var(--accent-text); }
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.lesson-main { min-width: 0; }
.lesson-main > h1 { margin-bottom: 26px; max-width: 24ch; }
.lesson-aside { position: sticky; top: 100px; max-height: calc(100dvh - 120px); overflow: auto; }
.lesson-aside .lesson-row { padding: 9px 10px; gap: 10px; font-size: 0.92rem; }
.lesson-aside .lesson-row .state { width: 30px; height: 30px; border-radius: 10px; }
.lesson-aside .lesson-row[aria-current="page"] { background: var(--ink); color: #fff; }
.lesson-aside .lesson-row[aria-current="page"] .state { background: rgb(255 255 255 / 0.14); color: #fff; }
.lesson-aside .module-name { font-size: 0.86rem; color: var(--ink-2); font-weight: 600; letter-spacing: -0.005em; line-height: 1.3; padding: 14px 10px 6px; }
@media (max-width: 999px) {
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-aside { position: static; max-height: none; order: 2; }
}

/* Сворачиваемые блоки: оглавление, программа, модули (details[data-fold]). */
.fold > summary { list-style: none; cursor: pointer; position: relative; padding-right: 30px; user-select: none; border-radius: 10px; transition: background 0.3s var(--ease), color 0.3s var(--ease); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: ""; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; margin-top: -6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform 0.4s var(--ease), margin 0.4s var(--ease); opacity: 0.7; }
.fold[open] > summary::after { transform: rotate(-135deg); margin-top: -2px; }
.fold > summary:hover { background: var(--accent-soft); color: var(--accent-text); }
.fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fold-head { font-size: 0.95rem; color: var(--ink); font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; padding: 8px 30px 8px 10px; }
.lesson-aside .fold-module > summary.module-name { display: flex; align-items: baseline; gap: 8px; padding: 10px 30px 6px 10px; margin-top: 6px; }
.fold-count { margin-left: auto; font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.fold-module:not([open]) > summary { padding-bottom: 10px; }
.toc.fold { padding: 10px; }
.toc nav { margin-top: 4px; }
.aside-program { margin-top: 12px; padding: 10px; background: var(--surface); }
.aside-program .fold-module > summary.module-name { padding-right: 34px; }
.aside-program .lesson-row .title { font-size: 0.88rem; line-height: 1.35; }
.fold-course-module > summary.module-head { padding: 4px 36px 14px 6px; align-items: center; }
.fold-course-module > summary.module-head::after { right: 14px; top: calc(50% - 5px); margin-top: -6px; }
.fold-course-module[open] > summary.module-head::after { margin-top: -2px; }
.fold-course-module:not([open]) > summary.module-head::after { top: 50%; }
.module-count { flex: none; white-space: nowrap; }
.fold-course-module:not([open]) > summary.module-head { padding-bottom: 4px; }
.fold-course-module > summary.module-head:hover { background: transparent; }
.fold-course-module > summary.module-head:hover h2 { color: var(--accent-text); }

.program-bar { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 8px 12px; }
.program-title { font-size: 1.05rem; margin: 0; }
.fold-all { font-size: 0.9rem; text-decoration: none; }
.fold-all:hover { text-decoration: underline; }

/* Отметка урока: снять можно там же, где ставили. */
.undo-done { font-size: 0.82rem; color: var(--muted); }
.undo-done:hover { color: var(--accent-text); }

/* Окно «Урок пройден». */
.celebrate { border: 0; padding: 40px 32px 28px; border-radius: 28px; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); text-align: center; box-shadow: 0 30px 80px rgb(30 10 70 / 0.28); overflow: hidden; }
.celebrate::backdrop { background: rgb(20 10 40 / 0.45); backdrop-filter: blur(4px); }
.celebrate[open] { animation: celebrate-in 0.6s var(--ease) both; }
.celebrate h2 { font-size: 1.6rem; margin: 18px 0 6px; }
.celebrate p { margin: 0 0 18px; }
.celebrate-mark { position: relative; z-index: 1; width: 76px; height: 76px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; box-shadow: 0 0 0 10px var(--accent-soft); animation: celebrate-pop 0.7s 0.15s var(--ease) both; }
.celebrate-mark svg { width: 38px; height: 38px; }
.celebrate-burst { position: absolute; left: 50%; top: 78px; width: 0; height: 0; }
.celebrate-burst i { position: absolute; width: 9px; height: 9px; border-radius: 3px; background: var(--accent); opacity: 0; animation: celebrate-burst 1s 0.25s var(--ease) both; }
.celebrate-burst i:nth-child(2n) { background: #ffb547; border-radius: 50%; }
.celebrate-burst i:nth-child(3n) { background: #3fd08f; }
.celebrate-burst i:nth-child(1) { --dx: -120px; --dy: -40px; } .celebrate-burst i:nth-child(2) { --dx: 120px; --dy: -46px; }
.celebrate-burst i:nth-child(3) { --dx: -90px; --dy: 40px; }  .celebrate-burst i:nth-child(4) { --dx: 96px; --dy: 36px; }
.celebrate-burst i:nth-child(5) { --dx: -150px; --dy: 4px; }  .celebrate-burst i:nth-child(6) { --dx: 150px; --dy: -6px; }
.celebrate-burst i:nth-child(7) { --dx: -40px; --dy: -70px; } .celebrate-burst i:nth-child(8) { --dx: 44px; --dy: -72px; }
.celebrate-module { text-align: left; margin: 14px 0 18px; padding: 14px 16px; border-radius: 16px; background: var(--accent-soft); }
.celebrate-module ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.celebrate-module li { display: flex; gap: 8px; align-items: flex-start; font-size: 0.92rem; }
.celebrate-module li svg { flex: none; color: var(--accent); margin-top: 3px; }
.celebrate-module .muted { margin: 10px 0 0; }
.celebrate-progress { appearance: none; width: 100%; height: 8px; border: 0; border-radius: 99px; background: var(--accent-soft); overflow: hidden; margin-bottom: 22px; }
.celebrate-progress::-webkit-progress-bar { background: var(--accent-soft); border-radius: 99px; }
.celebrate-progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
.celebrate-progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
.celebrate-rate { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; margin: -4px 0 20px; }
.celebrate-rate .rate-q { font-weight: 500; }
.celebrate-rate-btns { display: inline-flex; gap: 8px; }
.celebrate-rate.is-done .rate-q { color: var(--muted); font-weight: 400; }
/* Конфетти поверх окна: окно в top layer, поэтому холст тоже поднимаем туда как popover. */
.confetti-canvas[popover] { margin: 0; padding: 0; border: 0; background: transparent; inset: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; overflow: visible; }
.celebrate-actions { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.celebrate-actions .btn { width: 100%; justify-content: space-between; text-align: left; gap: 16px; }
.celebrate-next { display: flex; flex-direction: column; gap: 2px; line-height: 1.25; flex: 1; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.celebrate-actions .btn-orb { flex-shrink: 0; }
.celebrate-actions .btn { height: auto; min-height: 56px; padding-top: 10px; padding-bottom: 10px; }
.celebrate-next .small { opacity: 0.75; font-weight: 500; }
.celebrate-locked { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
@keyframes celebrate-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } }
@keyframes celebrate-pop { from { transform: scale(0.3); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } }
@keyframes celebrate-burst { 0% { opacity: 1; transform: translate(0, 0) scale(0.4); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1) rotate(160deg); } }
@media (prefers-reduced-motion: reduce) { .celebrate[open], .celebrate-mark, .celebrate-burst i { animation: none; } .celebrate-burst { display: none; } }

.block + .block { margin-top: 20px; }
.block-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.block-head .tile-icon { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.block-head h2 { font-size: 1.15rem; }
.block .core > h2 { font-size: 1.7rem; } /* заголовок текстового блока урока, тот же размер, что у h2 в тексте */
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: #0e0b16; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Закреплённое видео: плеер не переносим в DOM (iframe перезагрузился бы и встал), а снимаем с места через position: fixed —
   в углу экрана на компьютере, вверху на телефоне. На его месте в уроке остаётся заглушка той же высоты. */
.block-head--bare { justify-content: flex-end; margin-bottom: 12px; }
.video-pin { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 0; border-radius: 999px; font: inherit; font-size: 0.86rem; font-weight: 500; cursor: pointer;
  background: var(--surface); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-strong); transition: color 0.2s, box-shadow 0.2s, background 0.2s; }
.video-pin:hover { color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent-soft-2); }
.video-pin[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); box-shadow: none; }
.video-pin .icon { width: 16px; height: 16px; }
.video-slot { position: relative; }
/* Где смотреть: основной плеер и запасной на другом хостинге; выбор ученика помнит сервер (lesson.js → accounts:video_host). */
.video-hosts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 12px; font-size: 0.86rem; color: var(--muted); }
.video-host { padding: 5px 12px; border: 0; border-radius: 999px; font: inherit; font-weight: 500; cursor: pointer; background: var(--surface); color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line-strong); transition: color 0.2s, box-shadow 0.2s, background 0.2s; }
.video-host:hover { color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent-soft-2); }
.video-host[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); box-shadow: none; cursor: default; }
.video-hosts-hint { margin-left: auto; }
@media (max-width: 767px) { .video-hosts-hint { margin-left: 0; flex-basis: 100%; } }
/* Текстовая версия урока с видео: плашка «Свернуть / Развернуть», выбор ученика помнит сервер (lesson.js → accounts:lesson_text).
   Развёрнутая — белая с фиолетовой рамкой, свёрнутая — фиолетовая. */
.text-fold { display: flex; align-items: center; gap: 14px; margin: 20px 0; padding: 14px 14px 14px 16px; border-radius: 22px;
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--accent), var(--shadow-sm); transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease); }
.text-fold .tile-icon { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--accent); color: #fff; flex: none; transition: background 0.35s var(--ease); }
.text-fold-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.text-fold-title { color: var(--ink); }
.text-fold [data-text-toggle] { flex: none; }
.text-fold:not([data-collapsed]) [data-when-closed], .text-fold[data-collapsed] [data-when-open] { display: none; }
.text-fold:not([data-collapsed]) [data-text-toggle] { --btn-bg: var(--surface); --btn-ink: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent-soft-2); }
.text-fold:not([data-collapsed]) [data-text-toggle]:hover { background: var(--accent); color: #fff; box-shadow: none; }
.text-fold[data-collapsed] { background: var(--accent); box-shadow: 0 16px 30px -14px rgb(115 36 255 / 0.7); }
.text-fold[data-collapsed] .text-fold-title { color: #fff; }
.text-fold[data-collapsed] .muted { color: rgb(255 255 255 / 0.78); }
.text-fold[data-collapsed] .tile-icon { background: rgb(255 255 255 / 0.18); }
.text-fold[data-collapsed] [data-text-toggle] { --btn-bg: #fff; --btn-ink: var(--accent); box-shadow: none; }
.text-fold[data-collapsed] [data-text-toggle]:hover { background: #ebe3ff; color: var(--accent-hover); box-shadow: none; }
@media (max-width: 767px) { .text-fold { flex-wrap: wrap; } .text-fold [data-text-toggle] { width: 100%; } }
.text-fold { scroll-margin-top: 100px; } /* свернули из плавающей кнопки — докручиваем к плашке, не под шапку */
/* Плавающие «Свернуть текст» и «Наверх» внизу по центру: правый нижний угол занят закреплённым видео. */
.lesson-dock { position: fixed; z-index: 30; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 8px; pointer-events: none; animation: dock-in 0.3s var(--ease-out); }
.lesson-dock[hidden] { display: none; }
.lesson-dock-btn { pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 0; border-radius: 999px; font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  background: var(--surface); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent-soft-2), 0 12px 28px -12px rgb(22 19 31 / 0.35);
  transition: background 0.2s, color 0.2s; }
.lesson-dock-btn:hover { background: var(--accent); color: #fff; }
.lesson-dock-btn .icon { width: 18px; height: 18px; }
.lesson-dock-fold { background: var(--accent); color: #fff; box-shadow: 0 12px 28px -12px rgb(115 36 255 / 0.8); }
.lesson-dock-fold:hover { background: var(--accent-hover); }
.lesson-dock:not([data-collapsed]) [data-when-closed], .lesson-dock[data-collapsed] [data-when-open] { display: none; }
@keyframes dock-in { from { opacity: 0; transform: translate(-50%, 10px); } }
@media (max-width: 767px) { .lesson-dock-btn[data-dock-top] span { display: none; } .lesson-dock-btn[data-dock-top] { padding: 0 12px; } }
@media (prefers-reduced-motion: reduce) { .lesson-dock { animation: none; } }
.video-bar, .video-ghost { display: none; }
.video-slot.is-pinned { aspect-ratio: 16 / 9; border-radius: 18px; background: var(--bg-deep); box-shadow: inset 0 0 0 1px var(--line-strong); }
.video-slot.is-pinned .video-ghost { display: flex; position: absolute; inset: 0; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px; text-align: center; color: var(--muted); font-size: 0.95rem; }
.video-ghost .icon { width: 22px; height: 22px; color: var(--accent-text); }
.only-narrow { display: none; }
.video-slot.is-pinned .video-float { position: fixed; z-index: 35; right: 20px; bottom: 20px; width: min(420px, calc(100vw - 40px)); border-radius: 16px; overflow: hidden;
  background: #0e0b16; box-shadow: var(--shadow-lg), 0 0 0 1px rgb(255 255 255 / 0.06); animation: video-pin-in 0.35s var(--ease); }
.video-slot.is-pinned .video { border-radius: 0; }
.video-slot.is-pinned .video-bar { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 14px; background: #16131f; color: #fff; font-size: 0.84rem; }
.video-bar-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: rgb(255 255 255 / 0.78); }
.video-bar-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: #fff; font: inherit; cursor: pointer; }
.video-bar-btn:hover { background: rgb(255 255 255 / 0.12); }
.video-bar-btn .icon { width: 15px; height: 15px; }
/* На компьютере окно двигают за полоску и тянут за углы; размеры и место запоминает lesson.js. */
.video-grip { display: none; }
@media (min-width: 768px) {
  .video-slot.is-pinned .video-bar { cursor: grab; touch-action: none; padding-left: 24px; }
  .video-slot.is-pinned .video-grip { display: block; position: absolute; z-index: 2; width: 22px; height: 22px; touch-action: none; cursor: nwse-resize; opacity: 0; transition: opacity 0.2s;
    --grip: transparent 50%, rgb(255 255 255 / 0.55) 50% 57%, transparent 57% 68%, rgb(255 255 255 / 0.55) 68% 75%, transparent 75%; }
  .video-grip--nw { top: 0; left: 0; background: linear-gradient(315deg, var(--grip)); }
  .video-grip--se { right: 0; bottom: 0; background: linear-gradient(135deg, var(--grip)); }
  .video-float:hover .video-grip, .video-float.is-moving .video-grip { opacity: 1; }
}
.video-float.is-moving { animation: none; user-select: none; }
.video-float.is-moving .video-bar { cursor: grabbing; }
.video-float.is-moving iframe { pointer-events: none; } /* иначе плеер перехватывает мышь, пока тянем */
@keyframes video-pin-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
@media (max-width: 767px) {
  .only-wide { display: none; } .only-narrow { display: inline; }
  .video-slot.is-pinned .video-float { top: 0 !important; right: 0 !important; bottom: auto !important; left: 0 !important; width: auto !important; border-radius: 0; padding-top: env(safe-area-inset-top); animation-name: video-pin-down; }
}
@keyframes video-pin-down { from { opacity: 0; transform: translateY(-16px); } }
@media (prefers-reduced-motion: reduce) { .video-slot.is-pinned .video-float { animation: none; } }
.prose { font-size: 1.04rem; line-height: 1.75; color: var(--ink-2); max-width: 70ch; }
.prose > :first-child { margin-top: 0; } .prose > :last-child { margin-bottom: 0; }
.prose h2, .prose h3 { margin: 1.6em 0 0.6em; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; } .prose li { margin: 0.35em 0; } .prose li::marker { color: var(--accent); }
.prose blockquote { margin: 1.2em 0; padding: 4px 0 4px 20px; box-shadow: inset 3px 0 0 var(--accent); color: var(--ink); }
.prose blockquote > :first-child { margin-top: 0; } .prose blockquote > :last-child { margin-bottom: 0; }
.prose code { font-size: 0.9em; padding: 2px 6px; border-radius: 6px; background: var(--bg-deep); }
.prose pre { padding: 18px; border-radius: 16px; background: #17131f; color: #eee; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose .code-box { position: relative; margin: 1.2em 0; }
.prose .code-box pre { margin: 0; padding-right: 92px; }
.prose .code-box.is-wrap pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.code-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; padding: 2px; border-radius: 12px; background: #17131f; }
.code-tool { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; border: 0; cursor: pointer;
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); transition: background .15s, color .15s; }
.code-tool:hover { background: rgba(255,255,255,0.16); color: #fff; }
.code-tool[aria-pressed="true"] { color: #fff; background: rgba(255,255,255,0.18); }
.code-tool.is-done { color: #19b97c; }
.prose img { max-width: 100%; height: auto; border-radius: 16px; }
.prose table { border-collapse: separate; border-spacing: 0; display: table; width: 100%; margin: 1.2em auto 30px; }
@media (max-width: 640px) { .prose table { display: block; overflow-x: auto; } }
.prose td, .prose th { padding: 8px 12px; box-shadow: inset 0 -1px 0 var(--line); text-align: left; }
.prose thead th { background: var(--accent); color: #fff; font-weight: 600; box-shadow: none; }
.prose thead th:first-child { border-top-left-radius: 12px; } .prose thead th:last-child { border-top-right-radius: 12px; }

.file-row { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: var(--bg); text-decoration: none; color: var(--ink); transition: background 0.4s var(--ease); }
.file-row:hover { background: var(--accent-soft); color: var(--ink); }
.file-row .tile-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); color: var(--accent-text); box-shadow: 0 0 0 1px var(--line); }
.file-row .grow { flex: 1; min-width: 0; font-weight: 550; }

.question { padding: 20px; border-radius: 18px; background: var(--bg); border: 0; margin: 0 0 14px; }
.question legend { float: left; width: 100%; padding: 0; margin-bottom: 14px; font-weight: 600; color: var(--ink); }
.question legend + * { clear: both; }
.option { display: flex; gap: 12px; align-items: center; padding: 12px 14px; margin: 0 0 8px; border-radius: 14px; background: var(--surface); cursor: pointer;
  box-shadow: 0 0 0 1px var(--line); transition: box-shadow 0.4s var(--ease), background 0.4s var(--ease); }
.option:last-child { margin-bottom: 0; }
.option:hover { box-shadow: 0 0 0 1px var(--accent-soft-2); }
.option:has(input:checked) { background: var(--accent-soft); box-shadow: 0 0 0 1.5px var(--accent); }
.option input { appearance: none; flex: none; width: 20px; height: 20px; margin: 0; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--line-strong); background: var(--surface); display: grid; place-items: center; }
.option input[type=radio] { border-radius: 999px; }
.option input:checked { background: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.option input:checked::after { content: ""; width: 7px; height: 7px; border-radius: 999px; background: #fff; }
/* Тренировочный квиз: отметка у вопроса, верный и ошибочный варианты, пояснение под вариантом */
.question .q-mark { margin-left: 10px; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; vertical-align: 2px; }
.question.is-ok .q-mark { background: var(--ok-soft); color: var(--ok); }
.question.is-wrong .q-mark { background: var(--err-soft); color: var(--err); }
.option-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.option-why { font-size: 0.92rem; color: var(--muted); line-height: 1.5; }
.option.is-correct { background: var(--ok-soft); box-shadow: 0 0 0 1.5px var(--ok); }
.option.is-correct:has(input:checked) { background: var(--ok-soft); box-shadow: 0 0 0 1.5px var(--ok); }
.option.is-wrong, .option.is-wrong:has(input:checked) { background: var(--err-soft); box-shadow: 0 0 0 1.5px var(--err); }
.quiz-foot[hidden], .quiz-multi-row[hidden] { display: none; }
.question.is-done .option:not(.is-correct):not(.is-wrong) { opacity: 0.6; }
.question.is-done .option:hover { box-shadow: 0 0 0 1px var(--line); }
.question.is-done .option.is-correct:hover { box-shadow: 0 0 0 1.5px var(--ok); }
.question.is-done .option.is-wrong:hover { box-shadow: 0 0 0 1.5px var(--err); }
.quiz-multi-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.quiz-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-radius: 18px; background: var(--accent-soft); }
.quiz-score strong { font-size: 1.15rem; }
.option:has(input:disabled) { cursor: default; }
.option:has(.option-why) { align-items: flex-start; }
.option:has(.option-why) input { margin-top: 2px; }
.option.is-correct input:checked { background: var(--ok); box-shadow: inset 0 0 0 1.5px var(--ok); }
.option.is-wrong input:checked { background: var(--err); box-shadow: inset 0 0 0 1.5px var(--err); }
.result { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 18px; margin-bottom: 16px; }
.result-ok { background: var(--ok-soft); color: var(--ok); } .result-warn { background: var(--warn-soft); color: var(--warn); }
.result strong { font-size: 1.4rem; letter-spacing: -0.02em; }

.thread { display: flex; flex-direction: column; gap: 10px; margin: 0 0 18px; }
.bubble { max-width: 86%; padding: 14px 16px; border-radius: 18px 18px 18px 6px; background: var(--bg); }
.bubble.mine { align-self: flex-end; border-radius: 18px 18px 6px 18px; background: var(--accent-soft); }
.bubble .meta { display: flex; gap: 10px; align-items: baseline; font-size: 0.82rem; color: var(--muted); margin-bottom: 4px; }
.bubble .meta b { color: var(--ink); font-weight: 600; font-size: 0.88rem; }
.bubble p { margin: 0; white-space: normal; }
.bubble a { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 0.9rem; }

.lesson-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: center; margin-top: 32px; }
.lesson-nav .prev { justify-self: start; } .lesson-nav .next { justify-self: end; text-align: right; }
.nav-step { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-2); text-decoration: none; font-weight: 500; max-width: 260px; }
.nav-step span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-step:hover { color: var(--accent-text); }
.nav-step-next { display: inline-grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; text-align: left; max-width: 340px; padding: 12px 16px 12px 18px; border-radius: 16px; background: var(--accent); color: #fff; box-shadow: 0 12px 26px -16px rgb(91 20 214 / 0.7); transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.nav-step-next:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 16px 30px -16px rgb(91 20 214 / 0.8); }
.nav-step-next .nav-step-label { grid-column: 1; font-size: 0.78rem; font-weight: 600; opacity: 0.85; }
.nav-step-next > span:not(.nav-step-label) { grid-column: 1; font-weight: 600; }
.nav-step-next .icon { grid-column: 2; grid-row: 1 / span 2; }
.lesson-done-top { margin: -14px 0 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.lesson-done-top form { display: inline; }
/* Большая зелёная «Отметить пройденным» под блоками урока. */
.lesson-done-big { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 36px 0 0; text-align: center; }
.lesson-done-big form { display: block; width: 100%; max-width: 480px; }
.btn-done { --btn-bg: #12a06c; --btn-ink: #fff; position: relative; overflow: hidden; isolation: isolate; width: 100%; max-width: 480px; min-height: 88px; padding: 14px 36px; gap: 14px; border-radius: 26px; font-size: 1.25rem;
  background: linear-gradient(135deg, #19b97c, #0f8a5f); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.28), 0 18px 36px -16px rgb(15 138 95 / 0.75);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), filter 0.35s var(--ease-out); }
.btn-done.has-icon { padding: 14px 36px; }
.btn-done .icon, .btn-done svg { width: 28px; height: 28px; transition: transform 0.45s var(--ease-out); }
.btn-done::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, transparent 30%, rgb(255 255 255 / 0.35) 50%, transparent 70%); transform: translateX(-120%); transition: transform 0.8s var(--ease-out); }
.btn-done:hover { background: linear-gradient(135deg, #1fc988, #109566); color: #fff; transform: translateY(-3px) scale(1.015); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.3), 0 26px 44px -18px rgb(15 138 95 / 0.85), 0 0 0 6px rgb(25 185 124 / 0.14); }
.btn-done:hover::before { transform: translateX(120%); }
.btn-done:hover .icon, .btn-done:hover svg { transform: rotate(-12deg) scale(1.25); }
.btn-done:active { transform: translateY(0) scale(0.97); }
.btn-done:focus-visible { outline: 3px solid rgb(25 185 124 / 0.45); outline-offset: 3px; }
.btn-done.is-done { background: var(--ok-soft); color: var(--ok); box-shadow: inset 0 0 0 1px rgb(15 138 95 / 0.25); transform: none; }
.btn-done.is-done::before { display: none; }
.lesson-done-big .pill { font-size: 1rem; padding: 10px 18px; }
.confetti-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 1000; }
@media (prefers-reduced-motion: reduce) { .btn-done, .btn-done::before, .btn-done svg { transition: none; } .btn-done:hover { transform: none; } }
[data-preview-done].is-done { background: var(--ok-soft); color: var(--ok); box-shadow: none; }
.lesson-row.is-done .status { color: var(--ok); }
.lesson-topnav a.is-next { color: var(--accent-text); font-weight: 600; padding: 4px 10px; border-radius: 10px; background: var(--accent-soft); }
.lesson-topnav { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 12px; font-size: 0.9rem; }
.lesson-topnav a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 500; }
.lesson-topnav a:hover { color: var(--accent-text); }

/* ---------- Вход / оплата: разделённый экран ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: stretch; min-height: calc(100dvh - 140px); padding: 24px 0 48px; }
.split-form { display: flex; flex-direction: column; justify-content: center; padding: 24px 6% 24px 0; }
.split-form .head { margin-bottom: 28px; }
.split-form .head p { margin-top: 12px; font-size: 1.05rem; }
.split-art { border-radius: var(--r-shell); padding: 6px; background: rgb(255 255 255 / 0.5); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-lg); }
.split-art .cover { height: 100%; min-height: 460px; padding: 40px; display: flex; flex-direction: column; justify-content: flex-end; border-radius: var(--r-core); }
.split-art .cover p.big { font-size: clamp(1.6rem, 1.1rem + 1.5vw, 2.3rem); line-height: 1.15; letter-spacing: -0.035em; font-weight: 600; max-width: 16ch; margin: 0 0 18px; color: #fff; }
.split-art .cover ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; color: rgb(255 255 255 / 0.9); }
.split-art .cover li { display: flex; gap: 10px; align-items: center; }
.divider { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 0.85rem; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
@media (max-width: 899px) { .split { grid-template-columns: 1fr; min-height: 0; } .split-form { padding: 8px 0; } .split-art .cover { min-height: 260px; padding: 28px; } .split-art.hide-sm { display: none; } }

.checkout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 32px; align-items: start; padding: 16px 0 40px; }
.checkout .offer-art .cover { min-height: 300px; padding: 36px; display: flex; flex-direction: column; justify-content: space-between; border-radius: var(--r-core); }
.checkout .offer-art h1 { color: #fff; max-width: 16ch; }
.price-tag { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price-tag strong { font-size: clamp(2rem, 1.5rem + 1.5vw, 2.8rem); letter-spacing: -0.04em; font-weight: 650; }
.includes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.includes li { display: flex; gap: 12px; align-items: flex-start; }
.includes .icon { color: var(--accent); margin-top: 3px; }
.checkout-form { position: sticky; top: 100px; }
.fine { font-size: 0.82rem; color: var(--muted); margin-top: 14px; }
@media (max-width: 899px) { .checkout { grid-template-columns: 1fr; } .checkout-form { position: static; } .checkout .offer-art .cover { min-height: 220px; padding: 24px; } }

/* ---------- Центрированное состояние (замок, спасибо, проверьте почту) ---------- */
.state-card { max-width: 520px; margin: 48px auto; text-align: center; }
.state-card .core { padding: 44px 36px; }
.state-card .tile-icon { margin: 0 auto 20px; width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.state-card .tile-icon .icon { width: 30px; height: 30px; }
.state-card .tile-icon.ok { background: var(--ok-soft); color: var(--ok); }
.state-card p { margin: 12px auto 0; max-width: 40ch; }
.state-card .actions { margin-top: 26px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Списки: заказы, очередь ДЗ, устройства ---------- */
.rows { display: grid; gap: 6px; }
.row { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 18px; background: var(--surface); box-shadow: 0 0 0 1px var(--line);
  text-decoration: none; color: var(--ink); transition: box-shadow 0.4s var(--ease), transform 0.5s var(--ease); }
a.row:hover { color: var(--ink); box-shadow: 0 0 0 1px var(--accent-soft-2), var(--shadow); transform: translateY(-1px); }
.row .grow { flex: 1; min-width: 0; }
.row .grow strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .tile-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--bg); color: var(--ink-2); flex: none; }
.row .amount { font-weight: 600; white-space: nowrap; }
@media (max-width: 599px) { .row { flex-wrap: wrap; } .row .grow { flex-basis: calc(100% - 60px); } }

.tabs { display: inline-flex; gap: 4px; padding: 5px; border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); margin-bottom: 20px; overflow-x: auto; max-width: 100%; }
.tab { padding: 9px 16px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 0.92rem; white-space: nowrap; transition: background 0.4s var(--ease); }
.tab:hover { background: var(--bg); color: var(--ink); }
.tab[aria-current="page"] { background: var(--ink); color: #fff; }

.two-col { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 20px; align-items: start; }
@media (max-width: 899px) { .two-col { grid-template-columns: 1fr; } }
.page-head { margin: 12px 0 28px; }
.page-head p { margin: 10px 0 0; font-size: 1.05rem; }

/* ---------- База знаний ---------- */
.search { display: flex; gap: 8px; padding: 6px; border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); max-width: 560px; margin-bottom: 32px; }
.search input { background: transparent; box-shadow: none; border-radius: 999px; padding-left: 18px; }
.search input:focus { box-shadow: none; background: transparent; }
.search:focus-within { box-shadow: 0 0 0 1.5px var(--accent), 0 0 0 5px rgb(115 36 255 / 0.12); }
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.kb-grid .core h2 { font-size: 1.1rem; margin-bottom: 12px; }
.kb-link { display: flex; align-items: center; gap: 12px; padding: 11px 12px; margin: 0 -12px; border-radius: 14px; text-decoration: none; color: var(--ink); transition: background 0.4s var(--ease); }
.kb-link:hover { background: var(--accent-soft); color: var(--ink); }
.kb-link .icon { color: var(--accent-text); }
.article { max-width: 760px; }
.article .core { padding: 44px; }
.article.is-free { max-width: 860px; margin-inline: auto; }
@media (max-width: 640px) { .article.is-free .core { padding: 22px 18px; } }
@media (max-width: 767px) { .article .core { padding: 22px; } }

/* ---------- Анимации ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 28px; } .mb-0 { margin-bottom: 0; }
.feature-course .detail .next-lesson { margin-top: auto; }
.row .grow > span { display: block; }
.state-card form { text-align: left; }
.state-card form.actions { text-align: center; }
.crypto-pay .crypto-sum { display: grid; gap: 2px; margin-top: 18px; } .crypto-pay .crypto-sum b { font-size: 1.8rem; }
.crypto-pay .crypto-wallets { margin-top: 20px; text-align: left; } .crypto-pay .copy-row input { min-width: 0; }
.rows > * { min-width: 0; } .row .grow strong { white-space: nowrap; }
/* Плашка «смотрю как ученик» — тёмная, чтобы её нельзя было спутать с интерфейсом ученика */
.imp-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--ink); color: #fff; font-size: 0.92rem; }
.imp-bar > span { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.imp-bar b { font-weight: 600; }
.imp-email { color: rgb(255 255 255 / 0.6); }
.imp-bar .btn { min-height: 34px; }
.imp-bar + .nav-dock { top: 70px; }
@media (max-width: 599px) { .imp-email { display: none; } }
.pages-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; align-items: start; }
@media (max-width: 420px) { .pages-grid { grid-template-columns: 1fr; } }
.page-note { display: block; }
.kb-link .grow { flex: 1; min-width: 0; }
.imp-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.imp-cta .grow { flex: 1; min-width: 220px; }
.imp-cta strong { display: block; font-weight: 600; }

/* ================= Панель управления ================= */
.m-body { background: var(--bg); }
.m-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100dvh; }
.m-side { position: sticky; top: 0; height: 100dvh; overflow-y: auto; padding: 20px 14px 24px; display: flex; flex-direction: column; gap: 4px;
  background: rgb(255 255 255 / 0.6); box-shadow: inset -1px 0 0 var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.m-side .brand { padding: 4px 10px 18px; }
.m-side .brand small { display: block; font-size: 0.75rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.m-group { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 10px; padding: 8px 12px; border: 0; border-radius: 10px; background: none; cursor: pointer;
  font: 600 0.72rem/1.2 "Onest", sans-serif; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); transition: background 0.3s var(--ease), color 0.3s var(--ease); }
.m-group:hover { background: var(--bg-deep); color: var(--ink-2); }
.m-chev { width: 7px; height: 7px; margin-right: 4px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform 0.4s var(--ease); }
.m-section.is-collapsed .m-chev { transform: rotate(-45deg); }
.m-items { display: grid; gap: 4px; padding-top: 2px; }
.m-section.is-collapsed .m-items { display: none; }
.m-section.is-collapsed.has-current .m-group { color: var(--accent-text); }
.m-section.is-collapsed.has-current .m-group::after { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--accent); margin-left: auto; margin-right: 10px; }
.m-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; color: var(--ink-2); text-decoration: none; font-size: 0.94rem; font-weight: 500;
  transition: background 0.4s var(--ease), color 0.4s var(--ease); }
.m-link:hover { background: var(--accent-soft); color: var(--accent-text); }
.m-link[aria-current="page"] { background: var(--ink); color: #fff; }
/* Счётчик: ровный круг для 1–2 цифр, таблетка для больших чисел; цифра жирная, чтобы «1» не терялась */
.m-link .count, .count-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 0.75rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; box-shadow: 0 4px 10px -4px rgb(115 36 255 / 0.6); }
.m-link[aria-current="page"] .count { background: #fff; color: var(--accent-text); box-shadow: none; }
.m-side .spacer { flex: 1; }
.m-user { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.m-user .grow { flex: 1; min-width: 0; font-size: 0.85rem; line-height: 1.3; }
.m-user .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.m-main { min-width: 0; padding: 28px 36px 80px; }
.m-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.m-top h1 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.m-top p { margin: 8px 0 0; color: var(--muted); }
.m-top .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.m-top .paid-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; } .m-top .paid-form select, .m-top .paid-form input { width: auto; min-height: 0; padding: 6px 10px; font-size: 0.88rem; }
.m-mobilebar { display: none; }
@media (max-width: 999px) {
  .m-shell { grid-template-columns: 1fr; }
  .m-side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 25; transform: translateX(-100%); transition: transform 0.5s var(--ease); background: rgb(250 249 253 / 0.97); }
  .menu-open .m-side { transform: none; box-shadow: var(--shadow-lg); }
  .m-mobilebar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; position: sticky; top: 0; z-index: 20;
    background: rgb(255 255 255 / 0.8); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: inset 0 -1px 0 var(--line); }
  .m-mobilebar .burger { display: block; margin: 0; }
  .m-main { padding: 20px 16px 72px; }
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.stat { padding: 20px; }
.stat .label { font-size: 0.86rem; color: var(--muted); }
.stat strong { display: block; font-size: 1.9rem; letter-spacing: -0.03em; font-weight: 650; margin-top: 6px; }
.stat.accent { background: linear-gradient(140deg, #8d4dff, var(--accent) 55%, #5a12d9); color: #fff; }
.stat.accent .label { color: rgb(255 255 255 / 0.75); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 18px; }
.filters input, .filters select { width: auto; min-width: 180px; padding: 10px 14px; }
.filters input[type=search] { min-width: 260px; }
@media (max-width: 599px) { .filters input, .filters select, .filters input[type=search] { width: 100%; min-width: 0; } }

.tbl-wrap { overflow-x: auto; }
.data { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.data th { text-align: left; font-weight: 550; font-size: 0.8rem; color: var(--muted); padding: 10px 14px; white-space: nowrap; }
.data td { padding: 13px 14px; box-shadow: inset 0 1px 0 var(--line); vertical-align: middle; }
.data tr.link-row { cursor: pointer; transition: background 0.3s var(--ease); }
.data tr.link-row:hover td { background: var(--accent-soft); }
.data td a.cell-link { color: var(--ink); text-decoration: none; font-weight: 550; }
.data td a.cell-link:hover { color: var(--accent-text); }
.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.who { display: flex; align-items: center; gap: 12px; }
.who .avatar { width: 34px; height: 34px; font-size: 0.8rem; flex: none; }
.who > div > span { display: block; font-size: 0.82rem; color: var(--muted); }

.struct-module + .struct-module { margin-top: 16px; }
.struct-head { display: flex; align-items: center; gap: 10px; padding: 2px 4px 12px; flex-wrap: wrap; }
.struct-head h3 { flex: 1; font-size: 1.05rem; }
.lesson-line { display: flex; align-items: center; gap: 12px; padding: 10px 10px; border-radius: 14px; transition: background 0.3s var(--ease); }
.lesson-line:hover { background: var(--bg); }
.lesson-line .n { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--bg-deep); font-size: 0.8rem; font-weight: 600; color: var(--ink-2); flex: none; }
.lesson-line a.t { flex: 1; min-width: 0; color: var(--ink); text-decoration: none; font-weight: 550; }
.lesson-line a.t:hover { color: var(--accent-text); }
.lesson-line .flags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.mini { display: inline-flex; gap: 2px; }
.mini button, .mini a { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; text-decoration: none; }
.mini button.is-on { color: var(--accent-text); background: var(--accent-soft); }
.mini button:hover, .mini a:hover { background: var(--bg-deep); color: var(--ink); }
.mini .danger:hover { background: var(--err-soft); color: var(--err); }
.add-line { display: flex; gap: 8px; margin-top: 10px; }
.add-line input { padding: 10px 14px; }
.module-date { display: inline-flex; align-items: center; gap: 6px; }
.module-date input { padding: 6px 10px; width: auto; }
.module-schedule { align-items: center; flex-wrap: wrap; }
.module-schedule input { width: 80px; }

.block-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 18px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.block-card + .block-card { margin-top: 10px; }
.lesson-insert { position: relative; display: flex; justify-content: center; align-items: center; height: 24px; margin: 2px 0; }
.lesson-insert::before { content: ""; position: absolute; left: 24px; right: 24px; top: 12px; border-top: 1.5px dashed var(--accent-soft-2); opacity: 0; transition: opacity 0.2s var(--ease); }
.lesson-insert summary { position: relative; list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--surface); color: var(--accent-text); font-size: 0.82rem; font-weight: 600; box-shadow: 0 0 0 1px var(--accent-soft-2); cursor: pointer; opacity: 0; transition: opacity 0.2s var(--ease); }
.lesson-insert summary::-webkit-details-marker { display: none; }
.lesson-insert summary svg { width: 14px; height: 14px; }
.lesson-insert:hover::before, .lesson-insert:hover summary, .lesson-insert summary:focus-visible, .lesson-insert[open]::before, .lesson-insert[open] summary { opacity: 1; }
.lesson-insert .add-blocks { position: absolute; top: calc(100% - 4px); left: 50%; transform: translateX(-50%); z-index: 5; display: grid; gap: 2px; min-width: 220px; padding: 6px; border-radius: 14px; background: var(--surface); box-shadow: 0 0 0 1px var(--line-strong), 0 18px 40px -20px rgb(22 19 31 / 0.35); }
.lesson-insert .add-blocks .btn { justify-content: flex-start; border: 0; box-shadow: none; background: none; color: var(--ink); font-weight: 400; }
.lesson-insert .add-blocks .btn:hover { background: var(--accent-soft); color: var(--accent-text); }
@media (hover: none) { .lesson-insert summary { opacity: 1; } }
.block-card .tile-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.block-card .grow { flex: 1; min-width: 0; }
.block-card .grow strong { display: block; font-weight: 600; }
.block-card .preview { font-size: 0.88rem; color: var(--muted); margin-top: 4px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.add-blocks { display: flex; flex-wrap: wrap; gap: 8px; }

.multi { border: 0; padding: 0; margin: 0 0 18px; }
.multi legend { font-size: 0.9rem; font-weight: 550; color: var(--ink-2); margin-bottom: 10px; padding: 0; }
.multi .opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }
.multi .check { margin-bottom: 6px; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.formset-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 10px 0; box-shadow: inset 0 -1px 0 var(--line); }
.formset-row .field { margin: 0; }
.formset-row .check { margin: 0; white-space: nowrap; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 9px 0; font-size: 0.9rem; box-shadow: inset 0 -1px 0 var(--line); }
.timeline li:last-child { box-shadow: none; }
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 0.93rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 18px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; padding: 2px 6px; border-radius: 6px; background: var(--bg-deep); }

/* Выбор файла по-русски вместо системной кнопки браузера */
.file-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px; border-radius: var(--r-field); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-strong);
  cursor: pointer; transition: box-shadow 0.4s var(--ease); }
.file-pick:hover { box-shadow: inset 0 0 0 1px var(--accent-soft-2); }
.file-pick:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px rgb(115 36 255 / 0.12); }
.file-pick input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-pick .pick-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; font-size: 0.9rem; }
.file-pick .file-name { color: var(--muted); font-size: 0.9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pick.has-file .file-name { color: var(--ink); }
.file-current { font-size: 0.86rem; color: var(--muted); }
details > summary.btn { list-style: none; } details > summary.btn::-webkit-details-marker { display: none; } details.panel[open] > summary.btn { margin-bottom: 4px; }
/* Нумерация уроков: номер слева, статус значком справа */
.lesson-row .state { font-weight: 600; font-size: 0.92rem; }
.lesson-row .status { flex: none; display: grid; place-items: center; color: var(--muted); }
.lesson-row.is-done .status { color: var(--ok); }
.lesson-row.is-open .status { color: var(--accent); }
.lesson-row[aria-current="page"] .status { color: #fff; }
.lesson-aside .lesson-row .state { font-size: 0.82rem; }
.lesson-no { display: block; font-size: 0.95rem; font-weight: 550; color: var(--accent-text); letter-spacing: 0; margin-bottom: 6px; }
.crumb-edit { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--accent-text) !important; }
.crumb-edit + .crumb-edit { margin-left: 14px; }
.sale-summary { color: rgb(255 255 255 / 0.85); max-width: 56ch; font-size: 1.05rem; margin: 0; }
.sale-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.sale-facts .panel { padding: 16px 18px; }
.sale-facts strong { display: block; font-size: 1.4rem; letter-spacing: -0.02em; font-weight: 650; margin-top: 2px; }
.sale-offer + .sale-offer { padding-top: 18px; box-shadow: inset 0 1px 0 var(--line); }
.unopened-foot { text-align: center; margin: 28px 0 0; font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; color: var(--accent-text); }
.course-card .price { font-weight: 600; }
.course-card .progress-row { justify-content: space-between; }
a.stat { text-decoration: none; color: inherit; }
a.stat:hover { box-shadow: 0 0 0 1px var(--accent-soft-2), var(--shadow); }
.panel > .section-title:first-child { margin-top: 0; }
.avatar-lg, .who .avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }
.course-card .core { height: 100%; display: flex; flex-direction: column; } .course-card .body { flex: 1; align-content: start; } .course-card .body .progress-row { align-self: end; }
.seq-step { padding: 18px; border-radius: 18px; background: var(--bg); } .seq-step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; } .seq-step-head strong { flex: 1; } .seq-step-head .n { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; font-size: 0.85rem; }

/* Столбики выручки: высота классом h1..h20 (по 5%), без inline-стилей */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 220px; padding-bottom: 26px; overflow-x: auto; }
.bar { position: relative; flex: 1 0 22px; height: 100%; display: flex; align-items: flex-end; }
.bar-fill { width: 100%; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #9a5cff, var(--accent)); transition: opacity 0.3s var(--ease); }
.bar:hover .bar-fill { opacity: 0.8; }
.bar-label { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); font-size: 0.7rem; color: var(--muted); white-space: nowrap; }
.bar-fill.h1 { height: 5%; }
.bar-fill.h2 { height: 10%; }
.bar-fill.h3 { height: 15%; }
.bar-fill.h4 { height: 20%; }
.bar-fill.h5 { height: 25%; }
.bar-fill.h6 { height: 30%; }
.bar-fill.h7 { height: 35%; }
.bar-fill.h8 { height: 40%; }
.bar-fill.h9 { height: 45%; }
.bar-fill.h10 { height: 50%; }
.bar-fill.h11 { height: 55%; }
.bar-fill.h12 { height: 60%; }
.bar-fill.h13 { height: 65%; }
.bar-fill.h14 { height: 70%; }
.bar-fill.h15 { height: 75%; }
.bar-fill.h16 { height: 80%; }
.bar-fill.h17 { height: 85%; }
.bar-fill.h18 { height: 90%; }
.bar-fill.h19 { height: 95%; }
.bar-fill.h20 { height: 100%; }
.bar { flex: 1 0 8px; max-width: 42px; } .bars { gap: 4px; } .bar-fill.h0 { height: 3px; background: var(--bg-deep); }
.cert { max-width: 860px; margin: 24px auto 0; }
.cert .core { padding: 56px 64px; text-align: center; position: relative; overflow: hidden; isolation: isolate; }
.cert .core::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 50% at 100% 0%, rgb(115 36 255 / 0.10), transparent 70%), radial-gradient(50% 50% at 0% 100%, rgb(115 36 255 / 0.08), transparent 70%); }
.cert-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 48px; }
.cert-kicker { text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.78rem; font-weight: 600; color: var(--accent-text); }
.cert-name { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem); margin: 18px 0 10px; letter-spacing: -0.04em; }
.cert-text { color: var(--muted); margin: 0; }
.cert-course { font-size: clamp(1.3rem, 1rem + 1.2vw, 1.8rem); margin-top: 10px; }
.cert-foot { display: flex; justify-content: space-between; gap: 24px; margin-top: 56px; text-align: left; flex-wrap: wrap; }
.cert-foot strong { display: block; font-weight: 600; margin-top: 4px; }
.cert-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }
@media (max-width: 767px) { .cert .core { padding: 32px 22px; } .cert-top { margin-bottom: 28px; } }
@media print {
  .nav-dock, .mobile-menu, .imp-bar, .cert-actions, .flash, body::before { display: none !important; }
  body { background: #fff; } .page { padding: 0; } .cert { margin: 0; } .cert.shell { box-shadow: none; padding: 0; background: none; }
  .cert .core { box-shadow: 0 0 0 1px #ddd; }
  @page { size: A4 landscape; margin: 12mm; }
}
.board { display: grid; grid-template-columns: repeat(5, minmax(230px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.board-col { background: rgb(255 255 255 / 0.5); border-radius: var(--r-core); padding: 12px; box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.board-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 12px; }
.board-card { background: var(--surface); border-radius: 16px; padding: 12px; box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.board-card + .board-card { margin-top: 8px; }
.board-card .who { text-decoration: none; color: var(--ink); }
.board-card .who b { font-weight: 600; font-size: 0.92rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.board-card .who > div > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.board-meta { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0 0; }
.board-meta:empty { display: none; }
.studio-board { grid-template-columns: repeat(6, minmax(220px, 1fr)); }
.studio-bcard { cursor: grab; } .studio-bcard:active { cursor: grabbing; }
.studio-bcard .title { display: block; font-weight: 600; font-size: 0.95rem; color: var(--ink); text-decoration: none; line-height: 1.3; }
.studio-bcard.is-dragging { opacity: 0.4; }
.board-col.is-over { box-shadow: inset 0 0 0 2px var(--accent); }
.bcard-progress { margin-top: 10px; display: grid; gap: 4px; }
.bcard-progress progress { width: 100%; height: 6px; appearance: none; border: 0; border-radius: 99px; background: var(--line); overflow: hidden; }
.bcard-progress progress::-webkit-progress-bar { background: var(--line); border-radius: 99px; }
.bcard-progress progress::-webkit-progress-value { background: var(--ok); border-radius: 99px; }
.bcard-progress progress::-moz-progress-bar { background: var(--ok); border-radius: 99px; }

.task-row { gap: 14px; }
.task-row.is-done strong { color: var(--muted); text-decoration: line-through; }
.task-row.is-overdue { box-shadow: 0 0 0 1px var(--err-soft), 0 0 0 1px var(--line); }
.task-check { width: 24px; height: 24px; border-radius: 999px; border: 0; box-shadow: inset 0 0 0 1.5px var(--line-strong); background: var(--surface); cursor: pointer; display: grid; place-items: center; flex: none; transition: box-shadow 0.3s var(--ease), background 0.3s var(--ease); }
.task-check:hover { box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--accent-soft); }
.task-check.done { background: var(--ok); color: #fff; box-shadow: none; cursor: default; }
.twofa { max-width: 560px; }
.twofa-steps { text-align: left; margin: 20px 0 8px; padding-left: 1.2em; color: var(--ink-2); font-size: 0.95rem; }
.twofa-steps li { margin: 8px 0; }
.qr-box { display: grid; place-items: center; margin: 14px auto 20px; padding: 14px; width: 220px; border-radius: 18px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.qr-box svg.qr { width: 190px; height: 190px; }
.backup-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 20px 0 4px; }
.backup-codes .code { padding: 10px; font-size: 1rem; letter-spacing: 0.08em; }

/* ---------- Свой выпадающий список ---------- */
.cselect { position: relative; width: 100%; }
.cselect-native { position: absolute !important; inset: 0; opacity: 0; pointer-events: none; }
.cselect-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border: 0; border-radius: var(--r-field);
  background: var(--bg); color: var(--ink); font: inherit; text-align: left; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: box-shadow 0.4s var(--ease), background 0.4s var(--ease); }
.cselect-btn:hover { box-shadow: inset 0 0 0 1px rgb(22 19 31 / 0.2); }
.cselect-btn:focus-visible, .cselect.is-open .cselect-btn { outline: none; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px rgb(115 36 255 / 0.12); }
.cselect-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.cselect-btn.is-placeholder .cselect-text { color: var(--muted); }
.cselect-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cselect-btn::after { content: ""; flex: none; width: 8px; height: 8px; margin: -4px 2px 0 0; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg); transition: transform 0.4s var(--ease), margin 0.4s var(--ease); }
.cselect.is-open .cselect-btn::after { transform: rotate(-135deg); margin-top: 4px; }
.cselect-list { position: fixed; z-index: 40; margin: 0; padding: 6px; list-style: none; min-width: 200px;
  max-height: 290px; overflow-y: auto; border-radius: 16px; background: rgb(255 255 255 / 0.96); outline: none;
  box-shadow: 0 0 0 1px var(--line), 0 24px 50px -18px rgb(60 25 140 / 0.35); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(0.98); transform-origin: top center;
  transition: opacity 0.25s var(--ease-out), transform 0.35s var(--ease-out), visibility 0.25s; }
.cselect.drop-up .cselect-list { transform-origin: bottom center; transform: translateY(6px) scale(0.98); }
.cselect.is-open .cselect-list { opacity: 1; visibility: visible; transform: none; }
.cselect-list li { position: relative; padding: 10px 36px 10px 12px; border-radius: 10px; cursor: pointer; font-size: 0.94rem; color: var(--ink-2); }
.cselect-list li.is-active { background: var(--accent-soft); color: var(--ink); }
.cselect-list li[aria-selected="true"] { color: var(--accent-text); font-weight: 600; }
.cselect-list li[aria-selected="true"]::after { content: ""; position: absolute; right: 14px; top: 50%; width: 10px; height: 5px; margin-top: -4px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.cselect-list li[aria-disabled="true"] { opacity: 0.45; cursor: default; }
/* Компактные варианты: фильтры, строка добавления, доска CRM */
.filters .cselect { width: auto; min-width: 190px; }
.filters .cselect-btn, .add-line .cselect-btn { padding: 10px 14px; }
.add-line .cselect { flex: 1; }
.board-move .cselect { margin-top: 10px; }
.board-move .cselect-btn { padding: 7px 12px; font-size: 0.84rem; border-radius: 999px; }
.board-move .cselect-list { font-size: 0.88rem; }
@media (max-width: 599px) { .filters .cselect { width: 100%; } }
.title-accent { color: var(--accent-text); font-weight: 600; }
/* Неоткрытый курс: обложка приглушена до 30%, при наведении проступает целиком */
.cover-muted::before { content: ""; position: absolute; inset: 0; z-index: 0; background: var(--bg); opacity: 0.7; transition: opacity 0.6s var(--ease); }
.cover-muted > * { position: relative; z-index: 1; }
.course-card.is-locked:hover .cover-muted::before { opacity: 0.35; }
.pill-lock { background: var(--surface) !important; color: var(--ink-2) !important; box-shadow: 0 0 0 1px var(--line); backdrop-filter: none !important; }
.course-card.is-locked h3 { color: var(--ink-2); }

/* Сумма уведомлений группы — видна только в свёрнутом состоянии, рядом со стрелкой */
.m-group .m-group-count { display: none; margin: 0 8px 0 auto; letter-spacing: 0; text-transform: none; }
.m-section.is-collapsed .m-group-count { display: inline-grid; }
.m-section.is-collapsed.has-current .m-group:has(.m-group-count)::after { display: none; }

/* Бренд: короткое имя + дескриптор мелко под ним */
.brand-text { display: flex; flex-direction: column; line-height: 1.1; font-weight: 700; letter-spacing: -0.01em; }
.brand-text small { font-size: 0.72rem; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: 2px; }
@media (max-width: 420px) { .nav .brand-text small { display: none; } }

/* Карточка доступа к курсу в карточке ученика */
.access-card { padding: 16px; border-radius: 18px; background: var(--bg); margin-top: 12px; }
.access-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.access-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.inline-form input[type=number] { width: 72px; padding: 8px 10px; background: var(--surface); }
.inline-form input[type=date] { width: auto; padding: 8px 10px; background: var(--surface); }
.danger-link { color: var(--err); }
.danger-link:hover { color: var(--err); }
.access-history { margin-top: 10px; }
.access-history summary { cursor: pointer; }
.access-history .timeline { margin-top: 6px; }
.price-why { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.mb-1 { margin-bottom: 8px; }
input[readonly] { color: var(--muted); }
.copy-row { display: flex; gap: 8px; } .copy-row input { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }
.program-link .copy-row { flex-wrap: wrap; align-items: center; } .program-link .copy-row > * { flex: 0 0 auto; width: auto; margin: 0; } .program-link .copy-row > input { flex: 1 1 320px; min-width: 0; }
.plain-list { list-style: none; margin: 0; padding: 0; } .plain-list li { padding: 7px 0; box-shadow: inset 0 -1px 0 var(--line); font-size: 0.93rem; } .plain-list li:last-child { box-shadow: none; }
input[type=date]::-webkit-calendar-picker-indicator, input[type=datetime-local]::-webkit-calendar-picker-indicator { opacity: 0.55; cursor: pointer; }
.pay-mode .option { margin-bottom: 6px; } .pay-mode .option .grow { flex: 1; } .center { justify-content: center; }
.dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.dot-step { width: 10px; height: 10px; border-radius: 999px; background: var(--bg-deep); box-shadow: inset 0 0 0 1px var(--line-strong); }
.dot-step.is-paid { background: var(--ok); box-shadow: none; }
.dot-step.is-late { background: var(--err); box-shadow: none; }
.tile-icon.ok-tile { background: var(--ok-soft); color: var(--ok); }
.tile-icon.err-tile { background: var(--err-soft); color: var(--err); }
.next-lesson.is-late { background: var(--err-soft); } .next-lesson.is-late .label { color: var(--err); }
.mb-2 { margin-bottom: 16px; }

/* ---------- Markdown-редактор ---------- */
.md { border-radius: var(--r-field); box-shadow: inset 0 0 0 1px var(--line-strong); background: var(--bg); overflow: hidden; transition: box-shadow 0.4s var(--ease); }
.md:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px rgb(115 36 255 / 0.12); }
.md.is-drop { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.md textarea { border-radius: 0; box-shadow: none !important; background: transparent; min-height: 260px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9rem; line-height: 1.6; }
.md-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 6px; box-shadow: inset 0 -1px 0 var(--line); background: var(--surface); }
.md-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--bg); }
.md-tabs button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font: 500 0.85rem "Onest", sans-serif; color: var(--ink-2); cursor: pointer; }
.md-tabs button.is-on { background: var(--ink); color: #fff; }
.md-tools { display: flex; gap: 2px; flex-wrap: wrap; }
.md-tools button { min-width: 32px; height: 32px; padding: 0 8px; border: 0; border-radius: 9px; background: none; color: var(--ink-2); font: 600 0.85rem "Onest", sans-serif; cursor: pointer; }
.md-tools button:hover { background: var(--accent-soft); color: var(--accent-text); }
.md-preview { padding: 18px 20px; min-height: 260px; background: var(--surface); max-width: none; }
.md-status { padding: 6px 12px; min-height: 0; }
.md-status:empty { display: none; }
.md-tools[hidden] { display: none; } .md-tools button .icon { width: 16px; height: 16px; }
.token-once { box-shadow: 0 0 0 1.5px var(--accent), var(--shadow); }

/* ================= Уроки: Markdown-компоненты ================= */
.prose h2 { font-size: 1.7rem; margin: 2em 0 0.6em; scroll-margin-top: 100px; }
.prose h3 { font-size: 1.35rem; margin: 1.6em 0 0.5em; scroll-margin-top: 100px; }
.prose p { margin: 0 0 1em; }
.prose hr { border: 0; height: 1px; margin: 2.4em 0; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }
.prose a { word-break: break-word; }
.prose strong { color: var(--ink); font-weight: 650; }

.md-figure { margin: 1.6em 0; }
.md-figure img { display: block; width: auto; max-width: 100%; max-height: 80vh; margin: 0 auto; border-radius: 16px; cursor: zoom-in;
  box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease); }
.md-figure img:hover { box-shadow: 0 0 0 1px var(--accent-soft-2), var(--shadow); }
.md-figure figcaption, .md-gallery-cap { margin-top: 10px; text-align: center; font-size: 0.88rem; color: var(--muted); }

.md-card, .md-tip, .md-warning { margin: 1.6em 0; padding: 22px 24px; border-radius: 20px; background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-soft-2); }
.md-card > :first-child, .md-tip > :first-child, .md-warning > :first-child { margin-top: 0; }
.md-card > :last-child, .md-tip > :last-child, .md-warning > :last-child { margin-bottom: 0; }
.md-card h3 { margin-top: 0; color: var(--accent-text); }
.md-tip { background: var(--ok-soft); box-shadow: inset 0 0 0 1px rgb(15 138 95 / 0.18); }
.md-warning { background: var(--warn-soft); box-shadow: inset 0 0 0 1px rgb(180 83 11 / 0.18); }
.md-box-title { font-weight: 650; color: var(--ink); }

.md-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; align-items: start; margin: 1.6em 0; }
.md-col > :first-child { margin-top: 0; } .md-col .md-figure { margin: 0; }
@media (max-width: 767px) { .md-columns { grid-template-columns: 1fr; gap: 12px; } }

.md-details { margin: 1.6em 0; border-radius: 20px; background: var(--surface); box-shadow: 0 0 0 1px var(--line-strong); overflow: hidden; }
.md-details summary { list-style: none; cursor: pointer; padding: 18px 56px 18px 22px; font-weight: 600; color: var(--ink); position: relative; transition: background 0.3s var(--ease); }
.md-details summary::-webkit-details-marker { display: none; }
.md-details summary:hover { background: var(--accent-soft); }
.md-details summary::after { content: ""; position: absolute; right: 24px; top: 50%; width: 9px; height: 9px; margin-top: -7px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(45deg); transition: transform 0.4s var(--ease), margin 0.4s var(--ease); }
.md-details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.md-details-body { padding: 0 22px 18px; }
.md-details-body > :first-child { margin-top: 0.4em; }

/* Галерея: лента с прокруткой и привязкой к кадру, на телефоне — свайп */
.md-gallery { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 46%); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 1.6em 0 0; padding: 4px 4px 12px; scrollbar-width: thin; }
.md-gallery .md-figure { margin: 0; scroll-snap-align: start; }
.md-gallery .md-figure img { width: 100%; height: 300px; max-height: none; object-fit: cover; object-position: top center; background: var(--bg); }
@media (max-width: 767px) { .md-gallery .md-figure img { height: 360px; } }
@media (max-width: 767px) { .md-gallery { grid-auto-columns: 82%; } }

/* Чтение урока */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 40; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, #9a5cff, var(--accent)); pointer-events: none; }
.lesson-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 0.9rem; margin: -14px 0 24px; }
.lesson-meta span { display: inline-flex; align-items: center; gap: 6px; }
.toc { margin-bottom: 12px; padding: 12px; background: var(--surface); } .toc[hidden] { display: none; }
.toc a { display: block; padding: 6px 10px; border-radius: 10px; font-size: 0.88rem; color: var(--ink-2); text-decoration: none; line-height: 1.35; transition: background 0.3s var(--ease), color 0.3s var(--ease); }
.toc a:hover { background: var(--accent-soft); color: var(--accent-text); }
.toc a.is-active { color: var(--accent-text); background: var(--accent-soft); font-weight: 550; }
/* Задание урока — главное после видео: фиолетовая рамка и подпись. */
.shell.block[data-kind="homework"] { box-shadow: inset 0 0 0 2px var(--accent), 0 18px 40px -22px rgb(115 36 255 / 0.5); }
.hw-label { color: var(--accent); font-weight: 600; }
.toc a.toc-task { margin-top: 6px; background: var(--accent); color: #fff; font-weight: 600; }
.toc a.toc-task:hover, .toc a.toc-task.is-active { background: var(--accent-hover); color: #fff; }

/* Просмотр картинки на весь экран */
.lightbox { position: fixed; inset: 0; z-index: 60; overflow: hidden; touch-action: none; background: rgb(14 11 22 / 0.86);
  backdrop-filter: blur(6px); opacity: 0; visibility: hidden; transition: opacity 0.35s var(--ease), visibility 0.35s; cursor: zoom-out; }
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img { position: absolute; top: 0; left: 0; max-width: none; max-height: none; transform-origin: 0 0; border-radius: 6px;
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.5); cursor: zoom-in; user-select: none; -webkit-user-drag: none; }
.lightbox img.is-animated { transition: transform 0.3s var(--ease); }
.lightbox.is-zoomed img { cursor: grab; }
.lightbox.is-dragging img { cursor: grabbing; }
.lightbox-close { position: absolute; top: 16px; right: 16px; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 999px;
  background: rgb(255 255 255 / 0.14); color: #fff; cursor: pointer; transition: background 0.2s var(--ease); }
.lightbox-close:hover { background: rgb(255 255 255 / 0.26); }
@media (prefers-reduced-motion: reduce) { .read-progress { display: none; } }

/* Вложения в переписке по заданию */
.bubble-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bubble-files .thumb { display: block; width: 120px; height: 120px; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); cursor: zoom-in; margin: 0 !important; }
.bubble-files .thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-chip { display: inline-flex !important; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); font-size: 0.85rem; text-decoration: none; margin: 0 !important; }

/* ---------- Левое меню панели: сворачивание до иконок ---------- */
.m-side-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.m-side-top .brand { min-width: 0; }
.m-collapse { width: 34px; height: 34px; margin-top: 2px; }
.m-collapse .icon { width: 20px; height: 20px; }
@media (min-width: 1000px) {
  .m-shell { transition: grid-template-columns 0.45s var(--ease); }
  .m-shell.side-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
  .side-collapsed .m-side { padding: 20px 10px 24px; overflow-x: hidden; }
  .side-collapsed .m-side-top { flex-direction: column; align-items: center; gap: 10px; }
  .side-collapsed .m-side .brand { padding: 4px 0 6px; }
  .side-collapsed .brand-text, .side-collapsed .m-group, .side-collapsed .m-user .grow { display: none; }
  .side-collapsed .m-section { padding-top: 8px; margin-top: 6px; box-shadow: inset 0 1px 0 var(--line); }
  .side-collapsed .m-section .m-items { display: grid; } /* свёрнутые группы в иконочном режиме не прячем */
  .side-collapsed .m-link { position: relative; justify-content: center; gap: 0; padding: 11px 0; font-size: 0; }
  .side-collapsed .m-link .icon { width: 21px; height: 21px; }
  .side-collapsed .m-link .count { position: absolute; top: 6px; right: 10px; min-width: 9px; width: 9px; height: 9px; padding: 0; font-size: 0; }
  .side-collapsed .m-user { flex-direction: column; padding: 8px 0; gap: 6px; background: none; box-shadow: none; }
}

/* ---------- Редактор блока: форма слева, «как увидит ученик» справа ---------- */
.editor-split.has-preview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.editor-split.has-preview .editor-form { max-width: none; }
.editor-split.has-preview .md-tabs { display: none; } /* предпросмотр и так рядом */
.editor-preview { position: sticky; top: 20px; max-height: calc(100dvh - 40px); overflow: auto; border-radius: var(--r-core); background: var(--bg-deep); padding: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.editor-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 6px 12px; font-size: 0.86rem; font-weight: 600; color: var(--ink-2); }
.editor-preview-head > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.editor-preview-body .block { margin: 0; }
.editor-preview-body img { max-width: 100%; height: auto; }
@media (max-width: 1199px) {
  .editor-split.has-preview { grid-template-columns: minmax(0, 1fr); }
  .editor-preview { position: static; max-height: none; }
}

/* Блок «Картинка» */
.block-image { margin: 0; }
.block-image img { height: auto; }
.image-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 180px; padding: 24px; border-radius: 14px; border: 1.5px dashed var(--accent-soft-2); color: var(--muted); font-size: 0.92rem; text-align: center; background: var(--accent-soft); }
.image-empty .icon { width: 30px; height: 30px; color: var(--accent); }
.image-current { display: block; max-width: 100%; max-height: 220px; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.block-thumb { display: block; max-height: 90px; max-width: 220px; border-radius: 10px; margin-top: 6px; box-shadow: 0 0 0 1px var(--line); }

/* ---------- Скроллбары в цветах школы ----------
   Chrome/Safari/Edge — через ::-webkit-scrollbar (тонкий скруглённый ползунок с отступом от края),
   Firefox — стандартными scrollbar-color/width: он webkit-псевдоэлементы не знает. */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background-color: rgb(115 36 255 / 0.22); border: 3.5px solid transparent; border-radius: 999px; background-clip: padding-box; min-height: 40px; }
::-webkit-scrollbar-thumb:hover { background-color: rgb(115 36 255 / 0.45); }
::-webkit-scrollbar-thumb:active { background-color: rgb(115 36 255 / 0.6); }
.lesson-aside::-webkit-scrollbar, .editor-preview::-webkit-scrollbar, .m-side::-webkit-scrollbar, .md-gallery::-webkit-scrollbar { width: 10px; height: 10px; }
.lesson-aside::-webkit-scrollbar-thumb, .editor-preview::-webkit-scrollbar-thumb, .m-side::-webkit-scrollbar-thumb { background-color: transparent; }
.lesson-aside:hover::-webkit-scrollbar-thumb, .editor-preview:hover::-webkit-scrollbar-thumb, .m-side:hover::-webkit-scrollbar-thumb { background-color: rgb(115 36 255 / 0.22); }
@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-color: rgb(115 36 255 / 0.3) transparent; }
  .lesson-aside, .editor-preview, .m-side, .md-gallery, textarea { scrollbar-width: thin; scrollbar-color: rgb(115 36 255 / 0.3) transparent; }
}

/* Страница «Оплата не прошла» */
.state-card .tile-icon.fail { background: var(--err-soft); color: var(--err); }
.fail-tips { list-style: none; padding: 0; margin: 22px auto 26px; max-width: 360px; text-align: left; display: grid; gap: 10px; }
.fail-tips li { position: relative; padding-left: 26px; color: var(--ink-2); font-size: 0.95rem; line-height: 1.45; }
.fail-tips li::before { content: ""; position: absolute; left: 6px; top: 0.55em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.state-card .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.fail-help { margin: 22px 0 0; }

/* Возврат денег в карточке заказа */
.btn-danger { --btn-bg: var(--err); --btn-ink: #fff; box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.18), 0 10px 24px -12px rgb(200 36 58 / 0.6); }
.btn-danger:hover { --btn-bg: #a91d31; }
.refund-head { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--err); }
.refund-head::-webkit-details-marker { display: none; }
.refund-panel[open] .refund-head { margin-bottom: 16px; }
.refund-form { display: grid; gap: 14px; }

/* Мастерская курсов */
/* Карта проекта: «Обзор» полоской сверху, под ним 12 этапов ровными рядами (6 → 4 → 3 → 2 по ширине контента) */
.studio-map { container-type: inline-size; margin: 0 0 8px; }
.studio-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
@container (max-width: 959px) { .studio-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (max-width: 619px) { .studio-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (max-width: 459px) { .studio-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 960px) and (max-width: 1099px) {  /* шесть в ряд на узком экране: плотнее, чтобы «Производство» влезало целиком */
  .studio-steps .studio-step { padding: 12px 12px 10px; gap: 8px; }
  .studio-steps .studio-step .n { width: 22px; height: 22px; }
  .studio-steps .studio-step .p { font-size: 0.74rem; }
}
.studio-step { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "n t" "cells cells" "p p"; gap: 8px 10px; align-content: start; min-height: 96px; padding: 14px 14px 12px;
  border-radius: 18px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); color: var(--ink-2); text-decoration: none; font-size: 0.88rem; line-height: 1.25;
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease); }
.studio-step:hover { color: var(--ink); box-shadow: 0 0 0 1px var(--accent-soft-2), var(--shadow-sm); transform: translateY(-1px); }
.studio-step .n { grid-area: n; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 999px; background: var(--bg-deep); font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.studio-step .n .icon { width: 14px; height: 14px; }
.studio-step .t { grid-area: t; font-weight: 600; padding-top: 3px; overflow-wrap: anywhere; hyphens: auto; color: var(--ink); }
.studio-step .cells { grid-area: cells; display: flex; gap: 2px; height: 8px; }
.studio-step .cells i, .studio-legend i { flex: 1; min-width: 2px; border-radius: 2px; background: var(--bg-deep); }
.c-ok { background: var(--ok) !important; }
.c-draft { background: var(--accent-soft-2) !important; }
.c-ask { background: #f0a35c !important; }
.c-empty { background: var(--bg-deep) !important; box-shadow: inset 0 0 0 1px var(--line-strong); }
.studio-step .p { grid-area: p; font-size: 0.78rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.studio-step .p b { color: var(--ink); font-weight: 650; }
.studio-step .p .ask { font-style: normal; font-weight: 600; color: var(--warn); background: var(--warn-soft); padding: 1px 7px; border-radius: 999px; }
.studio-step.is-done { box-shadow: 0 0 0 1px rgb(15 138 95 / 0.35); background: color-mix(in srgb, var(--ok-soft) 50%, var(--surface)); }
.studio-step.is-done .n { background: var(--ok); color: #fff; }
.studio-step.is-done .p b { color: var(--ok); }
.studio-step[aria-current="page"] { background: var(--ink); color: #fff; box-shadow: none; }
.studio-step[aria-current="page"] .t, .studio-step[aria-current="page"] .p b { color: #fff; }
.studio-step[aria-current="page"] .n { background: rgb(255 255 255 / 0.16); color: #fff; }
.studio-step[aria-current="page"] .p { color: rgb(255 255 255 / 0.72); }
.studio-step[aria-current="page"] .cells i.c-empty { background: rgb(255 255 255 / 0.14) !important; box-shadow: none; }
.studio-step[aria-current="page"] .cells i.c-draft { background: rgb(255 255 255 / 0.55) !important; }
.studio-step.studio-overview { grid-template-columns: auto auto minmax(120px, 1fr) auto; grid-template-areas: "n t cells p"; align-items: center; gap: 8px 16px;
  min-height: 0; margin: 0 0 10px; padding: 12px 18px; }
.studio-overview .t { padding-top: 0; white-space: nowrap; }
.studio-overview .cells { height: 10px; min-width: 0; }
.studio-overview .cells i { min-width: 1px; }
.studio-overview .p { justify-content: flex-end; font-size: 0.82rem; }
@container (max-width: 759px) {
  .studio-step.studio-overview { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "n t" "cells cells" "p p"; align-items: start; gap: 8px 10px; padding: 14px; }
  .studio-overview .p { justify-content: flex-start; }
}
.studio-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 22px; }
.studio-legend span { display: inline-flex; align-items: center; gap: 6px; }
.studio-legend i { display: inline-block; flex: none; width: 14px; height: 8px; }
.studio-cells-line { display: flex; gap: 2px; height: 8px; width: 100%; }
.studio-cells-line i { flex: 1; min-width: 2px; border-radius: 2px; background: var(--bg-deep); }
.studio-bar.studio-cells-line { width: 140px; flex: none; }
.studio-sell { margin: 4px 0 8px; color: var(--ink-2); }
.studio-sell-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 0.93rem; }
.studio-sell-list:empty { display: none; }
.studio-goal { max-width: 760px; color: var(--ink-2); margin: 0 0 20px; }
.studio-card h2 { margin-bottom: 4px; }
.studio-q { margin-top: 22px; padding: 16px 16px 12px; border-radius: 18px; background: var(--bg); box-shadow: inset 3px 0 0 var(--line-strong); }
.studio-q.is-ask { background: color-mix(in srgb, var(--warn-soft) 55%, var(--bg)); box-shadow: inset 3px 0 0 var(--warn); }
.studio-q.is-ok { box-shadow: inset 3px 0 0 var(--ok); }
.studio-qtext { display: block; font-weight: 600; margin-bottom: 10px; }
/* Ответ показываем оформленным (жирный, списки, абзацы через 10 px); клик — правка исходного текста */
.studio-render { padding: 13px 16px; border-radius: var(--r-field); background: var(--surface); color: var(--ink); line-height: 1.55; cursor: text;
  box-shadow: inset 0 0 0 1px var(--line-strong); transition: box-shadow 0.2s var(--ease); }
.studio-render:hover, .studio-render:focus-visible { box-shadow: inset 0 0 0 1px var(--accent-soft-2); outline: none; }
.studio-render p, .studio-render li { margin: 0 0 10px; }
.studio-render ul, .studio-render ol { margin: 0 0 10px; padding-left: 22px; }
.studio-render > :last-child, .studio-render li:last-child { margin-bottom: 0; }
.studio-render ul:not(:last-child) li:last-child, .studio-render ol:not(:last-child) li:last-child { margin-bottom: 0; }
.studio-render strong { font-weight: 650; }
.studio-render .tbl-wrap { margin: 0 0 10px; }
.studio-render .tbl-wrap:last-child { margin-bottom: 0; }
.studio-render th { text-align: left; }
.studio-q textarea { line-height: 1.65; }
.studio-q textarea { min-height: 56px; field-sizing: content; background: var(--surface); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 1px 2px rgb(52 24 120 / 0.04); }
.studio-q textarea:hover { box-shadow: inset 0 0 0 1px var(--accent-soft-2), 0 1px 2px rgb(52 24 120 / 0.04); }
.studio-q textarea:focus { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px rgb(115 36 255 / 0.12); }
.studio-note { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 10px; padding: 8px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 0.88rem; }
.studio-note .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.studio-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 10px; }
.studio-status { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.studio-status label { position: relative; cursor: pointer; }
.studio-status input { position: absolute; opacity: 0; pointer-events: none; }
.studio-status span { display: block; padding: 5px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 550; color: var(--muted); transition: background 0.25s var(--ease), color 0.25s var(--ease); }
.studio-status label:hover span { color: var(--ink); }
.studio-status input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.studio-status .st-draft input:checked + span { background: var(--bg-deep); color: var(--ink); }
.studio-status .st-ask input:checked + span { background: var(--warn-soft); color: var(--warn); }
.studio-status .st-ok input:checked + span { background: var(--ok-soft); color: var(--ok); }
.studio-save { position: sticky; bottom: 12px; z-index: 5; padding: 10px 12px 10px 20px; border-radius: 999px; background: var(--surface); box-shadow: 0 10px 30px -12px rgb(22 19 31 / 0.25), 0 0 0 1px var(--line); width: fit-content; margin-inline: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.studio-save-progress { display: flex; align-items: center; gap: 10px; padding-right: 6px; color: var(--ink-2); white-space: nowrap; }
.studio-save-progress progress { width: 120px; height: 6px; border: 0; border-radius: 999px; appearance: none; background: var(--bg-deep); overflow: hidden; }
.studio-save-progress progress::-webkit-progress-bar { background: var(--bg-deep); border-radius: 999px; }
.studio-save-progress progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.studio-save-progress progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.studio-save-progress.is-full progress::-webkit-progress-value { background: var(--ok); }
.studio-save-progress.is-full progress::-moz-progress-bar { background: var(--ok); }
.studio-save-progress.is-full b { color: var(--ok); }
.studio-bar { width: 96px; flex: none; }
.studio-line { display: block; margin-top: 6px; }
.studio-module + .studio-module { padding-top: 16px; border-top: 1px solid var(--line); }
.studio-module p { margin: 4px 0; }
.studio-material { padding: 12px 0; border-top: 1px solid var(--line); }
.studio-material summary { cursor: pointer; }
.studio-md { margin-top: 10px; font-size: 0.93rem; color: var(--ink-2); }
.studio-rows .row .grow strong { white-space: normal; overflow: visible; }
@media (max-width: 720px) {
  .studio-save { width: auto; border-radius: 20px; }
  .studio-q { padding: 12px 12px 10px; }
}
.studio-sell-list a { color: var(--ink-2); text-decoration: none; } .studio-sell-list a:hover { color: var(--accent-text); }
.studio-goal-row { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.studio-goal-row .studio-goal { margin: 0; }
.studio-card-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  position: sticky; top: var(--cardnav-h, 0px); z-index: 4; margin: -24px -24px 0; padding: 16px 24px 12px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px); border-radius: var(--r-core) var(--r-core) 0 0; }
.studio-card-head + p { margin-top: 4px; }
.studio-card-stage { display: block; font-size: 0.75rem; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; margin-bottom: 2px; }
@media (max-width: 999px) { .studio-card-head { top: calc(60px + var(--cardnav-h, 0px)); } }
.studio-card-head h2 { margin: 0; }
.studio-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.studio-card-fold .icon { transition: transform 0.25s var(--ease); }
.studio-card.is-folded .studio-card-fold .icon { transform: rotate(180deg); }
.studio-card.is-folded > :not(.studio-card-head):not(.studio-card-preview) { display: none; }
.studio-card.is-folded .studio-card-head { position: static; }
.studio-card-preview { margin: 8px 0 0; font-size: 0.88rem; color: var(--muted); cursor: pointer; }
.studio-card-preview:hover { color: var(--ink-2); }
.studio-card { scroll-margin-top: calc(12px + var(--cardnav-h, 0px)); }
@media (max-width: 999px) { .studio-card { scroll-margin-top: calc(72px + var(--cardnav-h, 0px)); } }
/* Мини-навигация по блокам этапа: липнет сверху, показывает, где вы и что утверждено */
.studio-cardnav { position: sticky; top: 0; z-index: 6; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -8px 16px; padding: 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 16px; }
.studio-cardnav::-webkit-scrollbar { display: none; }
.studio-cardnav a { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--surface);
  box-shadow: 0 0 0 1px var(--line); color: var(--ink-2); text-decoration: none; font-size: 0.82rem; font-weight: 550; white-space: nowrap; transition: background 0.2s var(--ease), color 0.2s var(--ease); }
.studio-cardnav a:hover { color: var(--ink); box-shadow: 0 0 0 1px var(--accent-soft-2); }
.studio-cardnav .cn-p { font-size: 0.75rem; color: var(--muted); }
.studio-cardnav a.is-passed { color: var(--muted); }
.studio-sec.is-folded > :not(.section-title):not(.studio-card-preview) { display: none; }
.studio-sec.is-folded .studio-card-fold .icon { transform: rotate(180deg); }
.studio-sec .studio-card-fold .icon { transition: transform 0.25s var(--ease); }
.studio-cardnav a.is-done { background: var(--ok-soft); color: var(--ok); box-shadow: 0 0 0 1px rgb(15 138 95 / 0.3); }
.studio-cardnav a.is-done .cn-p { color: var(--ok); }
.studio-cardnav a.is-active { background: var(--ink); color: #fff; box-shadow: none; }
.studio-cardnav a.is-active .cn-p { color: rgb(255 255 255 / 0.7); }
@media (max-width: 999px) { .studio-cardnav { top: 60px; } }
.studio-insights .ins-context { color: var(--ink-2); font-style: italic; }
.studio-qtext { display: flex; gap: 10px; align-items: baseline; }
.studio-qn { flex: none; display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px var(--line-strong); font-size: 0.78rem; font-weight: 600; color: var(--muted); transform: translateY(-1px); }
.studio-q.is-ask .studio-qn { background: var(--warn-soft); color: var(--warn); box-shadow: none; }
.studio-q.is-ok .studio-qn { background: var(--ok-soft); color: var(--ok); box-shadow: none; }
[data-studio-copy].is-copied { color: var(--ok); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.studio-ladder { display: grid; gap: 8px; }
.studio-ladder > div { display: grid; gap: 4px; padding: 12px 14px; border-radius: 16px; background: var(--bg); }
.studio-ladder > div a { text-decoration: none; color: var(--ink); font-weight: 550; }
.studio-ladder .is-current { background: var(--accent-soft); }
.studio-ladder > div + div { position: relative; }
.studio-saved.is-error { color: var(--err); }
.studio-dates-line { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.studio-dates { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin: 0 0 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.studio-dates label { display: grid; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
.studio-dates input { width: 200px; }
.studio-dates .help { font-weight: 400; color: var(--muted); font-size: 0.78rem; }
.studio-dates-saved { flex: 1 1 100%; }
.studio-dates-saved.is-error { color: var(--err); }
.studio-insights { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.studio-insights:empty { display: none; }
.studio-insights a { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--surface); box-shadow: 0 0 0 1px var(--line-strong); color: var(--ink); text-decoration: none; transition: box-shadow 0.25s var(--ease); }
.studio-insights a:hover { box-shadow: 0 0 0 1px var(--accent-soft-2), var(--shadow-sm); }
.studio-insights .ins-text { font-weight: 500; }
.studio-insights .ins-answer { flex-basis: 100%; font-size: 0.85rem; color: var(--muted); }
.ins-w { display: inline-flex; gap: 3px; margin-left: auto; }
.ins-w i { width: 7px; height: 7px; border-radius: 999px; background: var(--bg-deep); box-shadow: inset 0 0 0 1px var(--line-strong); }
.ins-w i.on { background: var(--accent); box-shadow: none; }
.studio-segs .seg-v { color: var(--ink-2); font-size: 0.9rem; }
.studio-segs .seg-v.muted { color: var(--muted); }
.studio-ins-add { margin-bottom: 4px; }

/* Окно карточки Мастерской */
.studio-modal { width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 0; border-radius: 24px; background: var(--surface); color: var(--ink);
  box-shadow: 0 30px 80px -20px rgb(22 19 31 / 0.35), 0 0 0 1px var(--line); overflow: auto; }
.studio-modal[open] { animation: studio-modal-in 0.28s var(--ease-out); }
.studio-modal::backdrop { background: rgb(22 19 31 / 0.32); backdrop-filter: blur(3px); animation: studio-fade 0.28s var(--ease-out); }
@keyframes studio-modal-in { from { opacity: 0; translate: 0 10px; scale: 0.98; } }
@keyframes studio-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .studio-modal[open], .studio-modal::backdrop { animation: none; } }
.studio-modal-body { padding: 20px 24px 24px; }
.studio-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.studio-modal-head h2 { margin: 0; font-size: 1.2rem; }
.studio-item-form .form-actions { position: sticky; bottom: -24px; margin: 16px -24px -24px; padding: 14px 24px; background: var(--surface); border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.studio-item-form .studio-del { margin-left: auto; color: var(--err); }
/* Сила 0–5 и выбор сегмента — чипами */
.weight-scale, .chip-choice { display: flex; flex-wrap: wrap; gap: 6px; }
.weight-scale > div, .chip-choice > div { display: contents; }
.weight-scale label, .chip-choice label { position: relative; cursor: pointer; display: inline-flex; align-items: center; padding: 7px 14px; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: 0.86rem; font-weight: 550; color: var(--ink-2); transition: background 0.2s var(--ease), color 0.2s var(--ease); }
.weight-scale input, .chip-choice input { position: absolute; opacity: 0; pointer-events: none; }
.weight-scale label:has(input:checked), .chip-choice label:has(input:checked) { background: var(--accent); color: #fff; box-shadow: none; }
.weight-scale label:has(input:focus-visible), .chip-choice label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Сегменты: целевые / нейтральные / антисегменты */
.seg-w { margin-left: auto; min-width: 38px; padding: 3px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 650; text-align: center; }
.seg-w.seg-target { background: var(--ok-soft); color: var(--ok); }
.seg-w.seg-neutral { background: var(--bg-deep); color: var(--muted); }
.seg-w.seg-anti { background: var(--err-soft); color: var(--err); }
.pill.seg-target { background: var(--accent-soft); color: var(--accent-text); }
.pill.seg-neutral { background: var(--bg-deep); color: var(--ink-2); }
.pill.seg-anti { background: var(--err-soft); color: var(--err); }
.fib-scale label { min-width: 44px; justify-content: center; padding: 7px 10px; }
.fib-scale label:has(input[value^="-"]:checked) { background: var(--err); }
.fib-scale label:has(input[value="0"]:checked) { background: var(--ink-2); }
.fib-scale label:has(input[value^="-"]) { color: var(--err); }
.fib-scale label:has(input:checked) { color: #fff; }
/* Мастерская: тип продукта и обложка */
.studio-type { display: inline-flex; align-items: center; width: fit-content; padding: 4px 11px; border-radius: 999px; font-size: 0.78rem; font-weight: 650; background: var(--accent-soft); color: var(--accent-text); }
.studio-type.type-leadmagnet { background: var(--ok-soft); color: var(--ok); }
.studio-type.type-masterclass { background: #ffe9f4; color: #b0247a; }
.studio-type.type-practicum { background: var(--accent-soft); color: var(--accent-text); }
.studio-type.type-course { background: #e6f0ff; color: #1f5fd1; }
.studio-type.type-flagship { background: var(--ink); color: #fff; }
.studio-type.type-maximizer { background: var(--warn-soft); color: var(--warn); }
.studio-type.type-personal, .studio-type.type-other { background: var(--bg-deep); color: var(--ink-2); }
.cover-img { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; }
.cover.has-img::after { display: none; }
.studio-cover-preview { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px; margin-top: 12px; }
/* Эксперты школы */
.studio-experts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
@media (max-width: 720px) { .studio-experts-grid { grid-template-columns: 1fr; } }
.studio-reach { margin: 10px 0 0; color: var(--ink-2); }
.studio-reach b { font-size: 1.4rem; color: var(--ink); margin-right: 4px; }
.studio-channels { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.studio-channels a { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--bg); color: var(--ink); text-decoration: none; }
.studio-channels a:hover { box-shadow: inset 0 0 0 1px var(--accent-soft-2); }
.studio-channels .ch-title { font-weight: 550; min-width: 0; }
.studio-channels .ch-num { font-weight: 650; }
.studio-channels .ch-meta { grid-column: 2 / -1; font-size: 0.82rem; color: var(--muted); }
/* Сворачивание вопросов */
.studio-goal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.studio-qhead { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.studio-qhead .studio-qtext { flex: 1; }
.studio-fold { width: 32px; height: 32px; flex: none; margin: -4px -6px 0 0; }
.studio-fold .icon { width: 16px; height: 16px; transition: transform 0.25s var(--ease); }
.studio-q.is-folded .studio-fold .icon { transform: rotate(180deg); }
.studio-q.is-folded { padding-bottom: 12px; }
.studio-q.is-folded > :not(.studio-qhead):not(.studio-qpreview) { display: none; }
.studio-q.is-folded .studio-qtext { margin-bottom: 4px; }
.studio-qpreview { margin: 0 0 0 34px; font-size: 0.88rem; color: var(--muted); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-qpreview:hover { color: var(--ink-2); }
/* Архив карточек */
.studio-archive { margin: 4px 0 8px; }
.studio-archive summary { cursor: pointer; width: fit-content; font-size: 0.84rem; color: var(--muted); padding: 4px 10px; border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.studio-archive summary:hover { color: var(--ink-2); }
.studio-insights.is-archived { margin-top: 8px; }
.studio-insights.is-archived a { background: transparent; box-shadow: 0 0 0 1px dashed var(--line-strong); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--muted); }
.studio-item-form .studio-arch { margin-left: auto; }
.studio-item-form .studio-arch + .studio-del { margin-left: 0; }
.studio-terms .term-aud { color: var(--ink-2); }
/* Связи инсайтов с программой */
.studio-item-form .multi .opts { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--bg); }
.studio-item-form .multi .opts .check { margin: 0; padding: 4px 0; font-size: 0.88rem; }
.studio-closes { margin: 0 0 16px; padding: 12px 14px; border-radius: 14px; background: var(--ok-soft); }
.studio-closes .label { display: block; font-weight: 600; font-size: 0.86rem; margin-bottom: 6px; color: var(--ok); }
.studio-closes ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 0.88rem; }
.ins-links { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px; }
.ins-links span { font-size: 0.76rem; padding: 2px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); }
.ins-links .none { background: var(--err-soft); color: var(--err); }
.cov-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.cov-stats > div { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--bg); }
.cov-stats b { font-size: 1.3rem; }
.cov-stats span { font-size: 0.84rem; color: var(--muted); }
.cov-stats .ok b { color: var(--ok); }
.cov-stats .warn b { color: var(--warn); }
.cov-table td { vertical-align: top; }
.cov-table a { color: var(--ink); text-decoration: none; }
.cov-table tr.cov-bad td { background: color-mix(in srgb, var(--err-soft) 60%, transparent); }
.cov-table tr.cov-weak td { background: color-mix(in srgb, var(--warn-soft) 50%, transparent); }
.cov-link { display: inline-block; margin: 0 4px 4px 0; padding: 2px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: 0.8rem; }
.cov-none { color: var(--err); font-size: 0.84rem; font-weight: 600; }
.cov-idle { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }
/* Опора: данные других блоков, из которых растёт ответ */
.studio-refs { margin: 0 0 10px; }
.studio-refs > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.8rem; }
.studio-refs > summary::-webkit-details-marker { display: none; }
.studio-refs .ref-label { font-weight: 650; color: var(--accent-text); padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); }
.studio-refs .ref-label::before { content: "↳ "; }
.studio-refs .ref-chip { padding: 3px 10px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink-2); }
.studio-refs .ref-chip.is-empty { color: var(--err); box-shadow: inset 0 0 0 1px rgb(200 36 58 / 0.3); }
.studio-refs[open] .ref-label { background: var(--accent); color: #fff; }
.studio-refs .ref-body { display: grid; gap: 10px; margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--accent-soft-2); }
.studio-refs .ref-title { font-weight: 650; font-size: 0.86rem; margin-bottom: 4px; display: flex; gap: 8px; align-items: baseline; }
.studio-refs ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.studio-refs li { font-size: 0.86rem; line-height: 1.4; }
.studio-refs .ref-text { display: block; color: var(--ink-2); }
.studio-refs .ref-empty { color: var(--err); margin: 0; }
.studio-q.is-folded .studio-refs { display: none; }
/* Связность и покрытие по сегментам */
.connect-score { font-weight: 700; font-size: 1.1rem; padding: 4px 12px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }
.connect-score.is-ok { background: var(--ok-soft); color: var(--ok); }
.connect-group { border-top: 1px solid var(--line); padding: 10px 0; }
.connect-group > summary { cursor: pointer; display: flex; gap: 8px; align-items: center; list-style: none; }
.connect-group > summary::-webkit-details-marker { display: none; }
.connect-group > summary .icon { width: 18px; height: 18px; color: var(--ok); }
.connect-group .cg-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--warn); margin: 0 4px; }
.connect-group ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.connect-group li a { display: flex; gap: 10px; padding: 8px 10px; border-radius: 12px; text-decoration: none; color: var(--ink); background: var(--bg); }
.connect-group li.is-ok a { color: var(--ink-2); background: transparent; }
.connect-group .ci { flex: none; width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; }
.connect-group li.is-ok .ci { background: var(--ok-soft); color: var(--ok); }
.connect-group li.is-bad .ci { background: var(--warn-soft); color: var(--warn); }
.connect-group .ct { display: grid; gap: 2px; font-size: 0.9rem; }
.connect-group .cd { font-size: 0.8rem; color: var(--muted); }
.cov-matrix td, .cov-matrix th { text-align: center; }
.cov-matrix td:first-child, .cov-matrix th:first-child { text-align: left; }
.cov-matrix .cm-ok { color: var(--ok); font-weight: 650; }
.cov-matrix .cm-warn { color: var(--warn); font-weight: 650; }
.cov-matrix .cm-none { color: var(--muted); }
.studio-effect { margin: 4px 0; }
.studio-for { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 4px 0 6px; }
.studio-closes.is-terms { background: var(--accent-soft); }
.studio-closes.is-terms .label { color: var(--accent-text); }

/* Окна карточек: поля растут по содержимому, без внутренних прокруток */
.studio-modal textarea, .studio-item-form textarea { field-sizing: content; min-height: 64px; max-height: none; resize: none; overflow: hidden; }
.studio-q textarea { overflow: hidden; }
.studio-comps .comp-meta { font-size: 0.86rem; color: var(--ink-2); }
.studio-comps .comp-angle { color: var(--ok); }
.comps-table td { vertical-align: top; }
.comps-table td.tnum { white-space: nowrap; }
.comps-table a { color: var(--ink); text-decoration: none; }
.comps-table tr.is-us td { background: var(--accent-soft); }

/* Плавный скролл до якорей (мини-навигация, «Опора», проверки связности); кто отключил анимации в системе — без него */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
/* Якорные ссылки: заголовок встаёт не под самый край экрана и не под шапку, а с запасом сверху — так удобнее читать. */
html { scroll-padding-top: 140px; }

/* ---------- Телефон с кодом страны (static/js/phone.js) ---------- */
.phone-field { display: flex; gap: 8px; align-items: stretch; }
.phone-field input { flex: 1; min-width: 0; }
.phone-cc { position: relative; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 14px; border-radius: var(--r-field); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-strong); font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; transition: box-shadow 0.4s var(--ease); }
.phone-cc:hover { box-shadow: inset 0 0 0 1px rgb(22 19 31 / 0.2); }
.phone-cc:focus-within { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px rgb(115 36 255 / 0.12); }
.phone-cc::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-2px) rotate(45deg); margin-left: 2px; }
.phone-cc select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; box-shadow: none; }
.phone-field input.is-incomplete:not(:focus) { box-shadow: inset 0 0 0 1px rgb(200 36 58 / 0.45); }

/* ---------- Страница «Спасибо»: конфетти, подарок, ОТО ---------- */
.thanks { max-width: 560px; margin: 0 auto; display: grid; gap: 16px; padding-bottom: 48px; }
.thanks .state-card { margin-bottom: 0; max-width: none; }
.thanks-mail { margin-top: 18px; }
.confetti-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 60; }
.tile-icon.is-poke { cursor: pointer; transition: transform 0.25s var(--ease); }
.tile-icon.is-poke:active { transform: scale(0.9); }

.gift .gift-head { display: flex; align-items: center; gap: 16px; cursor: pointer; list-style: none; padding: 20px 24px; }
.gift .gift-head::-webkit-details-marker { display: none; }
.gift .gift-head > span:last-child { display: grid; gap: 2px; text-align: left; }
.gift-box { width: 52px; height: 52px; flex: none; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.gift-box .icon { width: 28px; height: 28px; }
.gift:not([open]) .gift-box { animation: gift-wiggle 2.8s var(--ease) infinite; }
.gift[open] .gift-head .small { display: none; }
.gift-body { padding: 0 24px 22px; animation: gift-in 0.5s var(--ease); }
@keyframes gift-wiggle { 0%, 82%, 100% { transform: rotate(0); } 86% { transform: rotate(-9deg); } 90% { transform: rotate(8deg); } 94% { transform: rotate(-5deg); } 97% { transform: rotate(3deg); } }
@keyframes gift-in { from { opacity: 0; transform: translateY(-6px); } }

.oto .core { padding: 24px; display: grid; gap: 12px; }
.oto h2 { margin: 0; }
.oto-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.oto-timer { font-weight: 650; font-size: 1.05rem; padding: 4px 12px; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-strong); }
.oto-timer.is-hot { color: var(--err); background: var(--err-soft); box-shadow: none; }
.oto-buy { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.oto-buy .price-tag strong { font-size: 2rem; }
.oto.is-gone { opacity: 0; transform: scale(0.98); transition: opacity 0.4s var(--ease), transform 0.4s var(--ease); }
@media (prefers-reduced-motion: reduce) { .gift:not([open]) .gift-box, .gift-body { animation: none; } }

/* Предпросмотр урока из Мастерской */
.preview-note { margin-bottom: 24px; }
.preview-video { aspect-ratio: 16 / 9; display: grid; place-content: center; justify-items: center; gap: 8px; }
.ai-box .label { display: block; font-weight: 600; margin-bottom: 4px; }
.ai-box-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ai-box-actions .btn { max-width: 100%; min-width: 0; white-space: normal; text-align: left; }

/* Блоки урока: «Полезно почитать» и задание */
.md-read { position: relative; margin: 1.8em 0; padding: 18px 22px 18px 76px; border-radius: 20px; background: var(--surface);
  box-shadow: 0 0 0 1px var(--accent-soft-2), 0 14px 30px -22px rgb(91 20 214 / 0.45); }
.md-read::before { content: ""; position: absolute; left: 18px; top: 18px; width: 42px; height: 42px; border-radius: 13px; background: var(--accent-soft); }
.md-read::after { content: ""; position: absolute; left: 29px; top: 29px; width: 20px; height: 20px; background: var(--accent-text);
  -webkit-mask: url("../icons/book-open-text.e2a4becf4813.svg") center / contain no-repeat; mask: url("../icons/book-open-text.e2a4becf4813.svg") center / contain no-repeat; }
.md-read .md-box-title { margin: 1px 0 4px; font-size: 1.02rem; font-weight: 650; line-height: 1.35; color: var(--ink); }
.md-read p { margin: 0; color: var(--ink-2); font-size: 0.96rem; }
.md-read p + p { margin-top: 8px; }
.md-read a { color: var(--accent-text); font-weight: 600; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.md-read a:hover { color: var(--accent); }
@media (max-width: 560px) { .md-read { padding: 16px 16px 16px 66px; } .md-read::before { left: 14px; top: 16px; } .md-read::after { left: 25px; top: 27px; } }
.md-task { margin: 1.6em 0; padding: 24px; border-radius: 22px; background: color-mix(in srgb, var(--warn-soft) 70%, var(--surface)); box-shadow: inset 0 0 0 1.5px rgb(180 83 11 / 0.35); }
.md-task .md-box-title { font-size: 1.15rem; margin: 0 0 10px; }
.md-task > :last-child { margin-bottom: 0; }
.lesson-task { box-shadow: 0 0 0 2px rgb(180 83 11 / 0.35), var(--shadow-sm); }
.lesson-task .tile-icon { background: var(--warn-soft); color: var(--warn); }
.ai-fold > .fold-head { font-weight: 600; }
.ai-box-note { margin: 10px 0 0; font-size: 0.78rem; font-style: italic; }
.ai-fold.fold { padding: 10px; background: var(--surface); margin-top: 12px; }
.ai-fold .core { padding: 6px 10px 6px; }

/* Правка урока руками в предпросмотре */
.lesson-main .shell.block { position: relative; }
.preview-tools { position: absolute; top: 14px; right: 14px; z-index: 2; display: flex; gap: 6px; opacity: 0; transition: opacity 0.2s var(--ease); }
.preview-tools .icon-btn { background: var(--surface); box-shadow: 0 0 0 1px var(--line-strong); }
.preview-tools .icon-btn[disabled] { opacity: 0.35; cursor: default; }
.lesson-main .shell.block:hover .preview-tools, .preview-tools:focus-within { opacity: 1; }
@media (hover: none) { .preview-tools { opacity: 1; } }
.preview-course-link { align-self: center; margin-right: 4px; padding: 4px 10px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 0.78rem; text-decoration: none; box-shadow: 0 0 0 1px var(--line-strong); }
.preview-course-link:hover { color: var(--accent-text); }
.block-insert { position: relative; height: 24px; margin: 2px 0; display: flex; justify-content: center; align-items: center; }
.block-insert::before { content: ""; position: absolute; left: 24px; right: 24px; top: 50%; border-top: 1.5px dashed var(--accent-soft-2); opacity: 0; transition: opacity 0.2s var(--ease); }
.block-insert-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border: 0; border-radius: 999px; background: var(--surface); color: var(--accent-text); font: inherit; font-size: 0.82rem; font-weight: 600; box-shadow: 0 0 0 1px var(--accent-soft-2); cursor: pointer; opacity: 0; transition: opacity 0.2s var(--ease); }
.block-insert:hover::before, .block-insert:hover .block-insert-btn, .block-insert-btn:focus-visible, .block-insert.is-open .block-insert-btn, .block-insert.is-open::before { opacity: 1; }
@media (hover: none) { .block-insert-btn { opacity: 1; } }
.block-insert-menu { position: absolute; top: calc(100% - 4px); z-index: 5; display: grid; gap: 2px; min-width: 220px; padding: 6px; border-radius: 14px; background: var(--surface); box-shadow: 0 0 0 1px var(--line-strong), 0 18px 40px -20px rgb(22 19 31 / 0.35); }
.block-insert-menu[hidden] { display: none; }
.block-insert-menu button { text-align: left; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: inherit; font-size: 0.9rem; cursor: pointer; }
.block-insert-menu button:hover { background: var(--accent-soft); color: var(--accent-text); }
.core.is-editing .preview-tools { display: none; }
.core.is-editing > :not(.preview-edit):not(.preview-tools) { display: none; }
.preview-edit { display: grid; gap: 10px; }
.preview-edit[hidden] { display: none; }
.preview-edit-area { field-sizing: content; min-height: 160px; max-height: none; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86rem; line-height: 1.6; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); }
.preview-edit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Мастерская: форма квиза в предпросмотре (static/js/quiz_edit.js) */
.qb-label { display: block; margin: 12px 0 6px; font-size: 0.85rem; color: var(--muted); }
.qb-title, .qb-q-text, .qb-c-text, .qb-c-why { width: 100%; font: inherit; padding: 10px 12px; border-radius: 12px; border: 0; box-shadow: inset 0 0 0 1px var(--line-strong); background: var(--surface); color: var(--ink); resize: none; }
.qb-title { font-weight: 600; }
.qb-q-text, .qb-c-why { min-height: 0; }
.qb-q { margin: 14px 0; padding: 16px; border-radius: 18px; background: var(--bg); display: flex; flex-direction: column; gap: 10px; }
.qb-q-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.qb-tools { display: flex; gap: 4px; flex-wrap: wrap; }
.qb-c { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 14px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.qb-c.is-correct { box-shadow: 0 0 0 1.5px var(--ok); }
.qb-c-line { display: flex; align-items: center; gap: 10px; }
.qb-c-line .qb-c-text { flex: 1; min-width: 0; }
.qb-ok { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--muted); white-space: nowrap; cursor: pointer; }
.qb-c-why { font-size: 0.92rem; }
.qb-warn { color: var(--warn); }
.qb-q > .btn { align-self: flex-start; }
@media (max-width: 560px) { .qb-c-line { flex-wrap: wrap; } }

/* Отчёт «Доходимость»: полоска доли в строке урока — ширина классом w0..w20 (CSP без style-атрибутов) */
.meter { display: block; height: 6px; border-radius: 99px; background: var(--bg-deep); overflow: hidden; margin-top: 6px; min-width: 80px; }
.meter-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #9a5cff, var(--accent)); }
.meter-fill.w0 { width: 0; } .meter-fill.w1 { width: 5%; } .meter-fill.w2 { width: 10%; } .meter-fill.w3 { width: 15%; } .meter-fill.w4 { width: 20%; }
.meter-fill.w5 { width: 25%; } .meter-fill.w6 { width: 30%; } .meter-fill.w7 { width: 35%; } .meter-fill.w8 { width: 40%; } .meter-fill.w9 { width: 45%; }
.meter-fill.w10 { width: 50%; } .meter-fill.w11 { width: 55%; } .meter-fill.w12 { width: 60%; } .meter-fill.w13 { width: 65%; } .meter-fill.w14 { width: 70%; }
.meter-fill.w15 { width: 75%; } .meter-fill.w16 { width: 80%; } .meter-fill.w17 { width: 85%; } .meter-fill.w18 { width: 90%; } .meter-fill.w19 { width: 95%; } .meter-fill.w20 { width: 100%; }
.data tr.is-worst td { background: var(--warn-soft); }
.cohort td.num { white-space: nowrap; }
.risk-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* Обратная связь: «Урок был полезен?» и оценка курса 0–10 */
.lesson-rate, .nps-card { margin-top: 20px; }
.rate-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rate-q { font-weight: 550; margin-right: 6px; }
.nps-scale { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 6px; }
.nps-point { position: relative; cursor: pointer; }
.nps-point input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.nps-point span { display: flex; align-items: center; justify-content: center; height: 42px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-strong); font-variant-numeric: tabular-nums; font-weight: 550; transition: background 0.2s var(--ease), color 0.2s var(--ease); }
.nps-point:hover span { background: var(--bg-deep); }
.nps-point input:checked + span { background: var(--accent); color: #fff; box-shadow: none; }
.nps-point input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.nps-ends { display: flex; justify-content: space-between; margin-top: 6px; }
.nps-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.away-reasons .check { margin-bottom: 10px; }
@media (max-width: 520px) { .nps-scale { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* ---------- Рассылки: редактор с живым предпросмотром, отчёт ---------- */
.mail-editor { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 20px; align-items: start; }
.mail-aside { position: sticky; top: 20px; display: grid; gap: 16px; }
@media (max-width: 899px) { .mail-editor { grid-template-columns: 1fr; } .mail-aside { position: static; } }
.mail-count { display: block; font-size: 1.9rem; font-weight: 650; letter-spacing: -0.03em; margin: 4px 0 6px; }
.mail-sample { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mail-preview-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.mail-preview-head > span { white-space: nowrap; }
.mail-preview-head select { flex: 1; min-width: 0; }
.mail-subject { font-weight: 650; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.55; margin: 0; max-height: 60vh; overflow-y: auto; }
.mail-body.is-error { color: var(--err); }
.mail-warnings { background: var(--warn-soft); box-shadow: 0 0 0 1px rgb(180 83 11 / 0.18); }
.mail-warnings h3 { color: var(--warn); font-size: 1rem; }
.mail-warnings ul { margin: 8px 0 0; padding-left: 18px; }
.mail-warnings li + li { margin-top: 6px; }
.bars.bars-sm { height: 140px; gap: 3px; overflow: hidden; }
.bars.bars-sm .bar { flex: 1 1 0; min-width: 0; }
.link-stats { list-style: none; margin: 0; padding: 0; }
.link-stats li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.link-stats li:first-child { border-top: 0; }
.link-stats .tnum { white-space: nowrap; color: var(--muted); }
table.data tfoot .avg-row td { border-top: 1px solid var(--line-strong); }
.seq-step-stats { margin: 4px 0 10px; }
/* длинные названия уроков в выпадающих списках не распирают колонку сетки */
.seq-step .bento > *, .mail-editor .bento > * { min-width: 0; }
.unsub-settings { text-align: left; border-top: 1px solid var(--line); padding-top: 16px; }

/* Код формы для Тильды в тарифе и ссылке на оплату */
.snippet-code { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; line-height: 1.4; }
