:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --text: #1c1b22;
  --muted: #6b6878;
  --line: #e6e2da;
  --brand: #5b4bff;
  --brand-2: #ff7a59;
  --brand-soft: #eceaff;
  --ok: #18a058;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(20, 16, 40, .05), 0 8px 30px rgba(20, 16, 40, .07);
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111017;
    --surface: #1b1a23;
    --surface-2: #24222e;
    --text: #f2f0f7;
    --muted: #a19eb0;
    --line: #2f2c3b;
    --brand: #8b7fff;
    --brand-2: #ff9474;
    --brand-soft: #2a2645;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 30px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- Кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: 15px;
  padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s;
  background: var(--surface-2); color: var(--text);
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 20px color-mix(in srgb, var(--brand) 35%, transparent); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-lg { padding: 16px 30px; font-size: 17px; }
.btn-sm { padding: 8px 14px; font-size: 14px; }

.input, select.input, textarea.input {
  width: 100%; font: inherit; font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
label.field { display: block; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
label.field > span { display: block; margin-bottom: 6px; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.error-msg { color: var(--danger); font-size: 14px; min-height: 1.4em; }

/* ---------- Шапка ---------- */
.nav { position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--line); }
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--text); }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 18px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.nav-links { display: flex; align-items: center; gap: 10px; }

/* ---------- Лендинг ---------- */
.hero { padding: 72px 0 96px; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 680px; height: 680px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 22%, transparent), transparent 65%); z-index: -1; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.pill { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand); margin-bottom: 18px; }
.hero h1 { font-size: clamp(36px, 5.4vw, 60px); font-weight: 800; }
.grad { background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 19px; color: var(--muted); max-width: 540px; margin: 0 0 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-note { font-size: 13px; color: var(--muted); margin-top: 14px; }

.mock { padding: 22px; position: relative; transform: rotate(1.2deg); }
.mock-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.mock h3 { font-size: 22px; }
.mock ul { margin: 0 0 16px; padding-left: 18px; }
.mock-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.mock-node { padding: 8px 12px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 14px; }
.mock-arrow { color: var(--muted); }
.mock-voice { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.wave { display: flex; gap: 3px; align-items: center; height: 22px; }
.wave i { width: 3px; border-radius: 3px; background: var(--brand); animation: wave 1s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: .1s } .wave i:nth-child(3) { animation-delay: .2s } .wave i:nth-child(4) { animation-delay: .3s } .wave i:nth-child(5) { animation-delay: .4s }
@keyframes wave { 0%, 100% { height: 6px } 50% { height: 22px } }
.mock-before { position: absolute; left: -24px; bottom: -78px; width: 190px; padding: 12px; transform: rotate(-6deg); font-size: 11px; line-height: 1.35;
  color: var(--muted); font-family: "Caveat", cursive; font-size: 15px; }

section.block { padding: 64px 0; }
section.block h2 { font-size: clamp(28px, 3.6vw, 40px); text-align: center; }
section.block .sub { text-align: center; color: var(--muted); max-width: 620px; margin: 0 auto 40px; font-size: 17px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { padding: 26px; }
.step-num { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); margin-bottom: 14px; }
.step h3 { font-size: 19px; }
.step p { margin: 0; color: var(--muted); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { padding: 24px; }
.feature .ico { font-size: 28px; margin-bottom: 10px; }
.feature h3 { font-size: 18px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.compare .card { padding: 26px; }
.compare h3 { font-size: 18px; }
.compare ul { margin: 0; padding-left: 20px; color: var(--muted); }
.compare .after { border-color: var(--brand); }
.compare .after ul { color: var(--text); }

.faq { max-width: 760px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { padding: 18px 22px; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq p { margin: 10px 0 0; color: var(--muted); }

.final-cta { text-align: center; padding: 56px 24px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border: 0; }
.final-cta h2 { color: #fff; }
.final-cta p { opacity: .9; margin: 0 0 24px; font-size: 17px; }
.final-cta .btn { background: #fff; color: #1c1b22; }

footer { padding: 32px 0; color: var(--muted); font-size: 14px; text-align: center; }

/* Секции лендинга под первым экраном */
.sec { padding: 72px 0; }
.sec-tint { background: var(--surface-2); }
.sec-kicker { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); margin-bottom: 10px; }
.sec-title { font-size: clamp(30px, 4.4vw, 48px); font-weight: 800; max-width: 760px; }
.sec-sub { font-size: 18px; color: var(--muted); max-width: 620px; margin: 0 0 32px; }

.ba { display: grid; grid-template-columns: 1fr auto 1fr; gap: 32px; align-items: center; margin-top: 28px; }
.ba-before { margin: 0; transform: rotate(-2.5deg); }
.ba-before img { width: 100%; max-height: 560px; object-fit: cover; object-position: top; border-radius: 22px; box-shadow: 0 24px 60px rgba(20, 16, 40, .25); display: block; }
.ba-before figcaption { margin-top: 14px; font-size: 14px; color: var(--muted); transform: rotate(2.5deg); }
.ba-arrow { display: grid; justify-items: center; gap: 6px; font-size: 44px; font-weight: 800; color: var(--brand); }
.ba-arrow span { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ba-after { display: grid; justify-items: center; gap: 18px; text-align: center; }
.ba-note { margin: 0; max-width: 340px; color: var(--muted); }

.phone {
  width: 290px; height: 560px; border-radius: 42px; padding: 18px 16px; position: relative; color: #f4f2ff; text-align: left;
  display: flex; flex-direction: column; border: 8px solid #1d1b26;
  background: radial-gradient(300px 220px at 90% -10%, rgba(139, 127, 255, .4), transparent 60%), radial-gradient(260px 200px at -10% 110%, rgba(255, 138, 101, .3), transparent 60%), #0e0d15;
  box-shadow: 0 30px 70px rgba(20, 16, 40, .35);
}
.ph-seg { display: flex; gap: 4px; }
.ph-seg i { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .18); }
.ph-seg i.on { background: linear-gradient(90deg, #8b7fff, #ff8a65); }
.ph-seg i.half { background: linear-gradient(90deg, #8b7fff 50%, rgba(255, 255, 255, .18) 50%); }
.ph-kick { font-size: 11px; font-weight: 700; color: rgba(244, 242, 255, .55); margin-top: 12px; }
.ph-title { font-size: 19px; font-weight: 800; margin: 6px 0 4px; }
.ph-cycle { position: relative; flex: 1; }
.ph-cycle svg { position: absolute; inset: 10% 8%; width: 84%; height: 80%; }
.ph-node { position: absolute; z-index: 1; transform: translate(-50%, -50%); font-size: 10.5px; font-weight: 700; white-space: nowrap; padding: 6px 8px; border-radius: 11px; background: #1d1a29; border: 1.5px solid rgba(139, 127, 255, .45); }
.ph-node.n1 { left: 50%; top: 14%; } .ph-node.n2 { left: 75%; top: 50%; } .ph-node.n3 { left: 50%; top: 86%; } .ph-node.n4 { left: 25%; top: 50%; }
.ph-node.glow { border-color: #ff8a65; background: #3a2422; box-shadow: 0 0 0 4px rgba(255, 138, 101, .2), 0 0 30px rgba(255, 138, 101, .5); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(255, 138, 101, .12), 0 0 40px rgba(255, 138, 101, .6); } }
.ph-cap { font-size: 12.5px; line-height: 1.45; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .07); color: rgba(244, 242, 255, .6); }
.ph-cap mark { color: #fff; background: linear-gradient(90deg, #8b7fff, #ff8a65); border-radius: 4px; padding: 0 3px; }
.ph-ctl { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 12px; }
.ph-ctl i { width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.ph-ctl b { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; background: linear-gradient(135deg, #8b7fff, #ff8a65); }


.flow { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; counter-reset: none; }
.flow li { border-top: 2px solid var(--text); padding-top: 18px; }
.flow-n { display: block; font-size: 15px; font-weight: 800; color: var(--brand); margin-bottom: 10px; }
.flow b { display: block; font-size: 22px; margin-bottom: 6px; }
.flow p { margin: 0; color: var(--muted); }

.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.vs-col { border-radius: 24px; padding: 24px; border: 1px solid var(--line); background: var(--surface); }
.vs-col ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.vs-col li { padding-left: 28px; position: relative; color: var(--muted); }
.vs-col li::before { content: "✕"; position: absolute; left: 0; font-weight: 800; color: var(--muted); }
.vs-col.win { background: #14121d; color: #f4f2ff; border-color: #14121d; }
.vs-col.win li { color: #f4f2ff; }
.vs-col.win li::before { content: "✓"; color: #8bf0b3; }
.vs-h { font-weight: 800; font-size: 18px; margin-bottom: 16px; }

@media (max-width: 860px) {
  .sec { padding: 52px 0; }
  .ba { grid-template-columns: 1fr; gap: 20px; }
  .ba-before { transform: none; }
  .ba-before img { max-height: 380px; }
  .ba-before figcaption { transform: none; }
  .ba-arrow { transform: rotate(90deg); font-size: 36px; }
  .ba-arrow span { display: none; }
  .flow, .vs { grid-template-columns: 1fr; }
  .flow { gap: 24px; }
}

/* ---------- Авторизация ---------- */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 420px; padding: 32px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 999px; padding: 4px; margin-bottom: 24px; }
.tabs button { font: inherit; font-weight: 700; border: 0; background: transparent; color: var(--muted); padding: 10px; border-radius: 999px; cursor: pointer; }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- Кабинет ---------- */
.dash { padding-top: 30px; padding-bottom: 72px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px 32px; align-items: start; }
.dash-head { grid-column: 1 / -1; }
.dash-head h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; margin-bottom: 4px; }
.dash-head p { margin: 0; font-size: 17px; }

.maker { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 26px; box-shadow: var(--shadow); }
.mk-step { margin-bottom: 22px; }
.mk-label { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; margin-bottom: 12px; }
.mk-n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick-btn { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.pick-btn:hover, .pick-btn.over { border-color: var(--brand); }
.pick-btn:active { transform: scale(.98); }
.pick-btn.primary { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.pick-ic { font-size: 28px; }
.pick-btn b { display: block; font-size: 16px; }
.pick-btn small { display: block; font-size: 12.5px; color: var(--muted); }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 78px; height: 78px; border-radius: 14px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; font-size: 11px; text-align: center; padding: 4px; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; line-height: 1; z-index: 1; }
.thumb.add { cursor: pointer; font-size: 24px; color: var(--brand); border-style: dashed; display: flex; flex-direction: column; gap: 0; }
.thumb.add small { font-size: 11px; color: var(--muted); }
.paste { margin-top: 12px; }
.paste summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--muted); }
.paste textarea { margin-top: 10px; }

.go { width: 100%; }
.quota { margin: 10px 0 0; text-align: center; font-size: 13.5px; color: var(--muted); }
.quota.empty { color: var(--warn); font-weight: 700; }
.mk-hint { margin: -4px 0 10px; font-size: 13.5px; color: var(--muted); }

.lessons-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.lessons-head h2 { font-size: 24px; margin: 0; }
.demo-link { font-weight: 700; font-size: 14px; }
.lesson-grid { display: grid; gap: 12px; }
.lesson-card { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); color: var(--text); transition: transform .15s, box-shadow .15s, border-color .15s; }
.lesson-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.lc-art { position: relative; flex: none; width: 84px; height: 84px; border-radius: 18px; display: grid; place-items: center; font-size: 38px; background: linear-gradient(135deg, var(--a), var(--b)); }
.lc-play { position: absolute; right: -6px; bottom: -6px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: #fff; color: #1c1b22; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); }
.lc-spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin 1s linear infinite; }
.lesson-card.failed .lc-art { filter: grayscale(.8); opacity: .7; }
.lc-body { min-width: 0; }
.lc-title { font-weight: 800; font-size: 16.5px; line-height: 1.3; margin-bottom: 3px; }
.lc-meta { font-size: 13.5px; color: var(--muted); }
.lesson-card.processing .lc-meta { color: var(--warn); font-weight: 600; }
.lesson-card.failed .lc-meta { color: var(--danger); }
.lc-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.lc-tags span { font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.empty, .empty-card { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty-card { border: 1.5px dashed var(--line); border-radius: 22px; display: grid; gap: 6px; justify-items: center; }
.empty-card b { color: var(--text); font-size: 17px; }
.empty-card p { margin: 0 0 8px; }

.me { position: relative; }
.me summary { list-style: none; }
.me summary::-webkit-details-marker { display: none; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.me-menu { position: absolute; right: 0; top: 50px; width: 230px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 20; }
.me-name { font-weight: 800; }
.me-mail { font-size: 13px; margin-bottom: 12px; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 860px) {
  .dash { grid-template-columns: 1fr; padding-top: 20px; gap: 20px; }
  .maker { padding: 18px; border-radius: 24px; }
  .pick { grid-template-columns: 1fr; }
  .pick-btn { padding: 14px; }
  .lc-art { width: 70px; height: 70px; font-size: 32px; border-radius: 16px; }
  .hero-grid, .compare { grid-template-columns: 1fr; }
  .steps, .features { grid-template-columns: 1fr; }
  .mock { transform: none; }
  .mock-before { display: none; }
  .hero { padding-top: 44px; }
  .nav-links .hide-sm { display: none; }
  .row { grid-template-columns: 1fr; }
}

/* ---------- Обложка урока ---------- */
.cover-wrap { padding-top: 28px; padding-bottom: 64px; }
.cover { display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 40px; align-items: center; }
.cover-art {
  position: relative; aspect-ratio: 4 / 5; border-radius: 28px; overflow: hidden; display: grid; place-items: center;
  background:
    radial-gradient(420px 320px at 80% 0%, rgba(139, 127, 255, .55), transparent 60%),
    radial-gradient(380px 300px at 0% 100%, rgba(255, 138, 101, .45), transparent 60%),
    #14121d;
  box-shadow: 0 30px 70px rgba(20, 16, 40, .25);
}
.cover-icon { font-size: 120px; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .4)); }
.cover-play {
  position: absolute; right: 22px; bottom: 22px; width: 76px; height: 76px; border-radius: 50%; border: 0; cursor: pointer;
  font-size: 28px; color: #1c1b22; background: #fff; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); transition: transform .15s;
}
.cover-play:hover { transform: scale(1.07); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tag { font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
.cover h1 { font-size: clamp(30px, 4.4vw, 50px); font-weight: 800; }
.cover-sum { font-size: 18px; margin: 0 0 18px; }
.cover-meta { display: flex; flex-wrap: wrap; gap: 18px; font-weight: 700; color: var(--muted); margin-bottom: 26px; }
.cover-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.uncertain { margin-top: 22px; padding: 14px 18px; border-radius: 16px; background: color-mix(in srgb, var(--warn) 12%, transparent); font-size: 14px; }
.uncertain summary { cursor: pointer; font-weight: 700; }
.uncertain ul { margin: 10px 0 6px; padding-left: 20px; }
.uncertain p { margin: 0; color: var(--muted); }
.shared-note { margin: 0 0 16px; padding: 12px 14px; border-radius: 14px; background: var(--brand-soft); color: var(--text); font-weight: 600; font-size: 15px; }
.share-box { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.btn-share { width: 100%; background: var(--surface); border: 1.5px solid var(--brand); color: var(--brand); }
.share-link { display: flex; gap: 8px; margin-top: 10px; }
.share-link input { flex: 1; min-width: 0; font: inherit; font-size: 14px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
.share-link[hidden] { display: none; }
.share-hint { font-size: 13.5px; margin: 8px 0 0; }
.link-danger { margin-top: 22px; background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; text-decoration: underline; }
.link-danger:hover { color: var(--danger); }

.state-card { max-width: 560px; margin: 40px auto; text-align: center; padding: 44px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); }
.state-card h2 { font-size: 26px; }
.state-ic { font-size: 54px; margin-bottom: 8px; }
.chew { display: flex; justify-content: center; gap: 14px; font-size: 40px; margin-bottom: 14px; }
.chew span { animation: bob 1.4s ease-in-out infinite; }
.chew span:nth-child(2) { animation-delay: .2s } .chew span:nth-child(3) { animation-delay: .4s }
@keyframes bob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-10px) } }
.steps-live { list-style: none; padding: 0; margin: 24px auto 0; max-width: 300px; text-align: left; display: grid; gap: 10px; }
.steps-live li { display: flex; align-items: center; gap: 12px; color: var(--muted); font-weight: 600; }
.steps-live li::before { content: ""; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.steps-live li.done { color: var(--text); }
.steps-live li.done::before { content: "✓"; display: grid; place-items: center; font-size: 13px; color: #fff; background: var(--ok); border-color: var(--ok); }
.steps-live li.now { color: var(--text); }
.steps-live li.now::before { border-color: var(--brand); border-top-color: transparent; animation: spin 1s linear infinite; }

.loader { text-align: center; padding: 70px 20px; }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 5px solid var(--brand-soft); border-top-color: var(--brand); animation: spin 1s linear infinite; margin: 0 auto 20px; }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- Полноэкранный урок ---------- */
body.lesson-open { overflow: hidden; }
.lesson {
  --hi: #8b7fff; --hi2: #ff8a65; --ink: #f4f2ff; --ink-dim: rgba(244, 242, 255, .55);
  position: fixed; inset: 0; z-index: 100; color: var(--ink); overflow: hidden;
  display: flex; flex-direction: column; height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background:
    radial-gradient(900px 520px at 85% -15%, rgba(139, 127, 255, .3), transparent 60%),
    radial-gradient(700px 460px at -10% 115%, rgba(255, 138, 101, .22), transparent 60%),
    #0e0d15;
  animation: fadeIn .25s ease;
}
.lesson[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.l-top, .l-screen { width: 100%; max-width: 1240px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.l-top { padding-top: 12px; }
.segments { display: flex; gap: 5px; }
.segments i { flex: 1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.segments b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--hi), var(--hi2)); transition: width .45s ease; }
.l-bar { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.l-kicker { font-size: 13px; font-weight: 700; color: var(--ink-dim); letter-spacing: .02em; }
.ibtn { width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; font-size: 17px; color: var(--ink); background: rgba(255, 255, 255, .08); }
.ibtn:hover { background: rgba(255, 255, 255, .15); }

.l-screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.l-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; }
.s-title { font-size: clamp(24px, 3.2vw, 42px); font-weight: 800; margin: 12px 0 14px; animation: rise .45s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: none } }
.s-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(260px, .8fr) 1.5fr; gap: 32px; align-items: center; }
.s-body.solo { grid-template-columns: 1fr; max-width: 760px; }
.s-side { order: -1; display: flex; flex-direction: column; gap: 14px; position: relative; }
.s-diagram { min-height: 0; height: 100%; display: flex; align-items: center; justify-content: center; }
.fit { width: 100%; position: relative; }

/* Появление и подсветка */
[data-ref], .wire, .wire-label { transition: opacity .45s ease, transform .45s ease, background .3s, box-shadow .3s, border-color .3s, color .3s; }
.is-hidden { opacity: 0 !important; transform: translateY(12px) scale(.96) !important; pointer-events: none; }
.wire.is-hidden { transform: none !important; }
.live [data-ref]:not(.is-active):not(.is-hidden) { opacity: .4; }
.live .wire:not(.is-active):not(.is-hidden), .live .wire-label:not(.is-active):not(.is-hidden) { opacity: .35; }

.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.points li { display: flex; gap: 12px; align-items: flex-start; font-size: 18px; line-height: 1.45; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); }
.points li.is-active { background: rgba(139, 127, 255, .16); border-color: rgba(139, 127, 255, .6); transform: translateX(6px); }
.points b { color: #d2cbff; }
.pnum { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: linear-gradient(135deg, var(--hi), var(--hi2)); color: #fff; margin-top: 1px; }

.example-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 18px; background: #2a1c1f; border: 1px solid rgba(255, 138, 101, .35); font-size: 16px; line-height: 1.5; }
.example-card.is-active { background: #3a2422; box-shadow: 0 0 40px rgba(255, 138, 101, .3); transform: scale(1.02); }
.example-card b { color: #ffc2ad; }
.ex-ic { font-size: 34px; line-height: 1; }
.ex-k { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #ffb39c; margin-bottom: 4px; }

/* Схемы */
.dg { position: relative; width: 100%; transform-origin: top center; }
/* Компактный режим: схема не влезает — убираем подписи стрелок и сжимаем промежутки, чтобы блоки остались крупными */
.dg.compact .wire-label { display: none; }
.dg-rows.compact { gap: 40px; }
.dg-steps.v.compact { gap: 18px; }
.dg-cols.compact .col { gap: 16px; }
.wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 1; }
.wire { fill: none; stroke: rgba(255, 255, 255, .32); stroke-width: 2; }
.wire.is-active { stroke: #e2ddff; stroke-width: 3; filter: drop-shadow(0 0 6px rgba(139, 127, 255, .9)); }
.flow-dot { fill: #fff; filter: drop-shadow(0 0 6px #ff8a65); }
.wire-label { position: absolute; z-index: 3; transform: translate(-50%, -50%); white-space: nowrap; font-size: 13px; font-weight: 600; color: #ddd8ff; background: #1c1a28; border: 1px solid rgba(255, 255, 255, .12); padding: 3px 9px; border-radius: 999px; }
.wire-label.is-hidden { transform: translate(-50%, -50%) scale(.9) !important; }
.wire-label.is-active { background: #2c2650; border-color: rgba(139, 127, 255, .75); color: #fff; }

.node {
  --c: #8b7fff; position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-radius: 18px; font-weight: 700; font-size: 18px; line-height: 1.25;
  background: color-mix(in srgb, var(--c) 12%, #15131e); border: 1.5px solid color-mix(in srgb, var(--c) 50%, transparent);
}
.node .ic { font-size: 28px; line-height: 1; }
.node.is-active {
  background: color-mix(in srgb, var(--c) 26%, #15131e); border-color: var(--c); transform: scale(1.06);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 22%, transparent), 0 0 46px color-mix(in srgb, var(--c) 50%, transparent);
}
.dg-rows { display: flex; flex-direction: column; align-items: center; gap: 84px; padding: 12px 0; }
.dg-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px 36px; position: relative; z-index: 2; }
.dg-cycle { height: 440px; }
.dg-cycle .pos { position: absolute; transform: translate(-50%, -50%); max-width: 40%; z-index: 2; }
.dg-cycle .node { text-align: center; justify-content: center; }
.dg-steps { display: flex; padding: 8px 0; }
.dg-steps.h { flex-direction: row; justify-content: space-between; gap: 56px; align-items: center; }
.dg-steps.v { flex-direction: column; gap: 36px; align-items: center; }
.dg-steps .node { padding: 10px 16px; font-size: 16px; }
.dg-steps .node .ic { font-size: 22px; }
.tl-step { display: flex; align-items: center; gap: 10px; position: relative; z-index: 2; }
.dg-steps.h .tl-step { flex-direction: column; flex: 1; }
.snum { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: rgba(255, 255, 255, .1); color: var(--ink-dim); }
.dg-cols .cols { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 22px; position: relative; z-index: 2; }
.dg-cols .col { display: flex; flex-direction: column; gap: 34px; align-items: stretch; }
.dg-cols .node { justify-content: center; text-align: center; }
.dg-cols .head { font-size: 19px; padding: 14px 16px; }
.dg-cols .kid { font-weight: 600; }
.dg-cols > .dg-row { margin-top: 28px; }
.dg-formula { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.formula-big { font-family: "Cambria Math", "STIX Two Math", "Times New Roman", serif; font-size: clamp(36px, 6vw, 66px); font-weight: 700; text-align: center; letter-spacing: .02em; }
.tok { --c: #8b7fff; color: var(--c); padding: 0 6px; border-radius: 12px; transition: background .3s, box-shadow .3s; }
.tok.is-active { background: color-mix(in srgb, var(--c) 22%, transparent); box-shadow: 0 0 36px color-mix(in srgb, var(--c) 55%, transparent); }
.legend { display: grid; gap: 10px; width: 100%; max-width: 560px; }
.legend .node { display: flex; width: 100%; font-weight: 600; }
.legend .sym { font-family: "Cambria Math", "Times New Roman", serif; font-weight: 800; font-size: 20px; color: var(--c); min-width: 46px; }

/* Субтитры и кнопки */
.l-bottom { padding: 12px 0 16px; }
.caption { position: relative; padding: 14px 18px; min-height: 3.4em; border-radius: 18px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); font-size: 18px; line-height: 1.55; color: rgba(244, 242, 255, .5); }
.caption.dim { font-size: 15px; color: rgba(244, 242, 255, .38); max-height: 5.2em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.caption .w { border-radius: 6px; transition: color .15s; }
.caption .said { color: var(--ink); }
.caption .now { color: #fff; background: linear-gradient(90deg, var(--hi), var(--hi2)); padding: 0 4px; margin: 0 -4px; }
.l-controls { display: flex; justify-content: center; align-items: center; gap: 22px; margin-top: 14px; }
.cbtn { width: 50px; height: 50px; border-radius: 50%; border: 0; cursor: pointer; font-size: 18px; color: var(--ink); background: rgba(255, 255, 255, .09); transition: transform .15s, background .15s; }
.cbtn:hover:not(:disabled) { background: rgba(255, 255, 255, .16); }
.cbtn:active:not(:disabled) { transform: scale(.94); }
.cbtn:disabled { opacity: .3; cursor: default; }
.cbtn.play { width: 68px; height: 68px; font-size: 24px; background: linear-gradient(135deg, var(--hi), var(--hi2)); box-shadow: 0 10px 30px rgba(139, 127, 255, .45); }

/* Настройки */
.sheet { position: absolute; inset: 0; z-index: 5; background: rgba(0, 0, 0, .5); display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-card { width: 100%; max-width: 460px; background: #1b1926; border: 1px solid rgba(255, 255, 255, .1); border-radius: 24px 24px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); display: grid; gap: 16px; animation: up .25s ease; }
@keyframes up { from { transform: translateY(30px); opacity: 0 } to { transform: none; opacity: 1 } }
.sheet-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 700; }
.sheet-row select { max-width: 60%; font: inherit; font-size: 14px; color: var(--ink); background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px; padding: 8px 10px; }
.sheet-row input { width: 22px; height: 22px; accent-color: var(--hi); }
.seg { display: flex; background: rgba(255, 255, 255, .06); border-radius: 12px; padding: 3px; }
.seg button { font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-dim); background: none; border: 0; padding: 7px 9px; border-radius: 9px; cursor: pointer; }
.seg button.on { background: var(--hi); color: #fff; }
.voice-hint { margin: 0; font-size: 13px; color: var(--ink-dim); }

/* Проверка знаний */
.quiz-screen { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; padding: 16px 0 28px; animation: rise .35s ease; overflow-y: auto; }
.q-progress { display: flex; gap: 6px; margin-bottom: 22px; }
.q-progress i { flex: 1; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .12); }
.q-progress i.done { background: var(--hi); }
.q-progress i.now { background: linear-gradient(90deg, var(--hi), var(--hi2)); }
.q-num { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 8px; }
.q-text { font-size: clamp(22px, 3vw, 30px); margin-bottom: 22px; }
.q-options { display: grid; gap: 10px; }
.q-opt { display: flex; align-items: center; gap: 14px; text-align: left; font: inherit; font-size: 17px; font-weight: 600; color: var(--ink); background: rgba(255, 255, 255, .06); border: 1.5px solid rgba(255, 255, 255, .1); border-radius: 16px; padding: 14px 16px; cursor: pointer; transition: background .2s, border-color .2s, transform .15s; }
.q-opt:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }
.q-opt:active:not(:disabled) { transform: scale(.98); }
.q-opt:disabled { cursor: default; }
.q-letter { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: rgba(255, 255, 255, .1); }
.q-opt.right { background: rgba(24, 160, 88, .2); border-color: #22c55e; }
.q-opt.right .q-letter { background: #22c55e; color: #fff; }
.q-opt.wrong { background: rgba(220, 38, 38, .18); border-color: #ef4444; animation: shake .35s; }
.q-opt.wrong .q-letter { background: #ef4444; color: #fff; }
@keyframes shake { 25% { transform: translateX(-6px) } 75% { transform: translateX(6px) } }
.q-feedback { margin-top: 16px; padding: 14px 16px; border-radius: 16px; font-size: 16px; line-height: 1.5; animation: rise .3s ease; }
.q-feedback.ok { background: rgba(34, 197, 94, .12); }
.q-feedback.bad { background: rgba(255, 138, 101, .12); }
.q-self { display: flex; gap: 10px; margin-top: 12px; }
.q-self .btn-ghost { color: var(--ink); border-color: rgba(255, 255, 255, .2); }
.q-next, .q-reveal { margin-top: 18px; width: 100%; }
.result { text-align: center; align-items: center; }
.r-emoji { font-size: 72px; }
.r-score { font-size: 54px; font-weight: 800; background: linear-gradient(90deg, var(--hi), var(--hi2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.r-verdict { font-size: 18px; color: var(--ink-dim); margin: 6px 0 26px; }
.r-actions { display: grid; gap: 10px; width: 100%; max-width: 360px; }
.lesson .btn-ghost { color: var(--ink); border-color: rgba(255, 255, 255, .2); }

@media (max-width: 760px) {
  .cover { grid-template-columns: 1fr; gap: 22px; }
  .cover-art { aspect-ratio: 16 / 10; border-radius: 24px; }
  .cover-icon { font-size: 84px; }
  .cover-play { width: 64px; height: 64px; font-size: 24px; right: 16px; bottom: 16px; }
  .cover-sum { font-size: 16px; }
  .cover-actions { flex-direction: column; }
  .cover-actions .btn { width: 100%; }

  .l-top, .l-screen { padding-left: 14px; padding-right: 14px; }
  .s-title { font-size: 22px; margin: 8px 0 10px; }
  .s-body { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
  .s-diagram { flex: 1; min-height: 160px; }
  .s-side { order: 0; flex: none; }
  .points { gap: 6px; }
  .points li { font-size: 14.5px; padding: 8px 10px; gap: 10px; border-radius: 12px; }
  .points li.is-active { transform: none; }
  .pnum { width: 22px; height: 22px; font-size: 12px; border-radius: 7px; }
  /* Пример на телефоне всплывает поверх пунктов только пока о нём говорят */
  .example-card { position: absolute; left: 0; right: 0; bottom: 0; font-size: 14.5px; padding: 12px 14px; z-index: 4; }
  .l-stage:not(.ex-on) .example-card { opacity: 0 !important; transform: translateY(12px) !important; pointer-events: none; }
  .ex-ic { font-size: 28px; }
  .node { font-size: 14px; padding: 9px 11px; gap: 7px; border-radius: 13px; }
  .node .ic { font-size: 19px; }
  .dg-rows { gap: 70px; }
  .dg-cycle .pos { max-width: 42%; }
  .dg-steps.v { gap: 22px; align-items: stretch; }
  .dg-steps.v .tl-step { width: 100%; }
  .dg-steps.v .node { flex: 1; }
  .dg-steps .node { padding: 8px 12px; font-size: 14px; }
  .dg-steps.v .wire-label { display: none; }
  .dg-cols .col { gap: 22px; }
  .dg-cols .head { font-size: 15px; }
  .wire-label { font-size: 10.5px; padding: 2px 7px; }
  .formula-big { font-size: 34px; }
  .legend .node { font-size: 14px; }
  .l-bottom { padding: 8px 0 10px; }
  .caption { font-size: 15.5px; padding: 10px 14px; border-radius: 14px; max-height: 6.4em; overflow: hidden; }
  .l-controls { gap: 26px; margin-top: 10px; }
  .q-opt { font-size: 15.5px; padding: 12px 14px; }
}
