﻿@import url('../fonts/faces.css');

/* ==========================================================================
   Просто Урок — премиальная тема (черновик V1)
   Принципы: крупная типографика, много воздуха, овальные карточки,
   мягкие тени, один акцент, спокойные нейтральные поверхности.
   Правки контента/цветов: всё в токенах ниже (см. README.md).
   ========================================================================== */

:root {
  /* Нейтральные поверхности */
  --ink: #0A1128;
  --ink-2: #1C2540;
  --muted: #47506B;
  --line: #DDE3F0;
  --line-soft: #EFF2F9;
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F4F6FC;
  --surface-3: #E9EEFB;

  /* Акцент: фирменный красно-оранжевый */
  --accent: #0B3FC4;
  --accent-deep: #062A8C;
  --accent-soft: #E6EDFF;

  /* Смысловые цвета */
  --blue: #1E3A8A;
  --blue-soft: #EDF1FA;
  --green: #1F6B45;
  --green-soft: #EAF4EE;
  --amber: #A15C07;
  --amber-soft: #FDF4E3;

  /* Радиусы: карточки 24, малые 18, кнопки pill, поля 16 (правило зафиксировано) */
  --r-card: 24px;
  --r-sm: 18px;
  --r-pill: 999px;
  --r-field: 16px;

  /* Тени: тонированные, без чистого чёрного */
  --sh-1: 0 1px 2px rgba(36,31,43,.04), 0 8px 24px rgba(36,31,43,.05);
  --sh-2: 0 2px 4px rgba(36,31,43,.05), 0 18px 44px rgba(36,31,43,.09);

  --font-display: 'Onest', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-body: 'Golos Text', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --wrap: 1240px;
  --ease: cubic-bezier(.16,1,.3,1);
}

[data-theme="dark"] {
  --ink: #F2F5FF; --ink-2: #C3CBDF; --muted: #8A93AB;
  --line: #26304A; --line-soft: #1F2840;
  --bg: #0A1020; --surface: #111A30; --surface-2: #16203A;
  --accent: #3D82FF; --accent-deep: #005BFF; --accent-soft: #14284D;
  --blue: #9DB4FF; --blue-soft: #232A40;
  --green: #7FD3A6; --green-soft: #1F3A2C;
  --amber: #F0C27B; --amber-soft: #3A2F1C;
  --sh-1: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  --sh-2: 0 2px 6px rgba(0,0,0,.35), 0 18px 44px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 18px/1.75 var(--font-body);
  font-feature-settings: "ss01" 1, "cv01" 1;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ── типографика ── */
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); margin: 0; letter-spacing: -.022em; }
h1 { font-size: clamp(38px, 5.4vw, 62px); line-height: 1.04; font-weight: 800; }
h2 { font-size: clamp(27px, 3.2vw, 40px); line-height: 1.12; font-weight: 750; }
h3 { font-size: clamp(20px, 2vw, 24px); line-height: 1.28; font-weight: 700; letter-spacing: -.015em; }
.lead { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.62; color: var(--ink-2); }
.muted { color: var(--muted); }
.small { font-size: 15px; line-height: 1.6; }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.eyebrow {
  font-family: var(--font-display); font-size: 12.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent);
}

/* ── раскладка ── */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.section { padding: clamp(56px, 7vw, 104px) 0; }
.section-tight { padding: clamp(40px, 5vw, 72px) 0; }
.stack { display: grid; gap: 18px; }
.split { display: grid; gap: clamp(28px, 4vw, 56px); align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1.05fr .95fr; } }
.grid-2 { display: grid; gap: 20px; }
.grid-3 { display: grid; gap: 20px; }
.grid-4 { display: grid; gap: 18px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* ── шапка ── */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line-soft);
}
.nav-in { display: flex; align-items: center; gap: 20px; height: 74px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -.03em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-logo { width: 40px; height: 40px; border-radius: 12px; flex: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 19px; font-weight: 800; }
.nav-links { display: none; gap: 4px; margin-left: 8px; }
@media (min-width: 1024px) { .nav-links { display: flex; } }
.nav-links a { color: var(--ink-2); font-size: 16px; font-weight: 500; padding: 9px 13px; border-radius: var(--r-pill); }
.nav-links a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 44px; height: 44px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { border-color: var(--ink-2); color: var(--ink); }

/* ── кнопки (одна подпись на одно намерение) ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-display); font-size: 16.5px; font-weight: 700; letter-spacing: -.01em;
  padding: 14px 24px; border-radius: var(--r-pill); border: 1.5px solid transparent;
  cursor: pointer; transition: transform .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
  min-height: 50px; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); text-decoration: none; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0) scale(.99); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); text-decoration: none; transform: translateY(-1px); }
.btn-quiet { background: transparent; color: var(--ink-2); border-color: transparent; padding: 12px 14px; }
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.btn-sm { font-size: 15px; padding: 11px 18px; min-height: 44px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── карточки ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 26px; box-shadow: var(--sh-1); }
.card-flat { box-shadow: none; }
.card-tint { background: var(--surface-2); border-color: transparent; box-shadow: none; }
.card-hover { transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease); }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.chip { display: inline-flex; align-items: center; gap: 7px; font-size: 14.5px; font-weight: 600; padding: 7px 14px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); }
.chip-accent { background: var(--accent-soft); color: var(--accent-deep); }
.chip-blue { background: var(--blue-soft); color: var(--blue); }
.chip-green { background: var(--green-soft); color: var(--green); }

/* ── иконки ── */
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic-lg { width: 28px; height: 28px; }
.ic-box { width: 52px; height: 52px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-deep); }

/* ── герой ── */
.hero { position: relative; overflow: hidden; padding: clamp(44px, 5vw, 72px) 0 clamp(48px, 6vw, 84px); }
.hero-mesh {
  position: absolute; inset: -20% -10% auto -10%; height: 130%;
  background:
    radial-gradient(48% 42% at 12% 8%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(42% 38% at 88% 4%, color-mix(in srgb, var(--blue) 12%, transparent), transparent 68%),
    radial-gradient(38% 34% at 60% 78%, color-mix(in srgb, var(--amber) 12%, transparent), transparent 72%);
  filter: blur(6px); pointer-events: none;
}
.hero-in { position: relative; }
.hero h1 { max-width: 15ch; }
.hero .lead { max-width: 44ch; margin-top: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-note { margin-top: 16px; font-size: 15px; color: var(--muted); }

/* ── цифры ── */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 860px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 18px 20px; }
.stat b { display: block; font-family: var(--font-display); font-size: clamp(26px, 3vw, 34px); font-weight: 800; letter-spacing: -.03em; }
.stat span { font-size: 14.5px; color: var(--muted); }

/* ── шаги ── */
.steps { display: grid; gap: 18px; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 26px; }
.step-n { font-family: var(--font-display); font-size: 15px; font-weight: 800; color: var(--accent); letter-spacing: .02em; }
.step h3 { margin: 12px 0 8px; }

/* ── предметы ── */
.subject { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px; box-shadow: var(--sh-1); }
.subject .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.subject h3 { font-size: 19px; }
.subject .meta { font-size: 14.5px; color: var(--muted); }
.subject:hover { text-decoration: none; }

/* ── демо-вопрос (реальный компонент, не картинка) ── */
.demo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px; box-shadow: var(--sh-2); }
.demo-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14.5px; color: var(--muted); }
.bar { height: 8px; border-radius: var(--r-pill); background: var(--line-soft); overflow: hidden; margin: 14px 0 18px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: var(--r-pill); transition: width .3s var(--ease); }
.q-text { font-family: var(--font-display); font-size: 20px; font-weight: 700; line-height: 1.35; letter-spacing: -.015em; }
.opts { display: grid; gap: 10px; margin-top: 16px; }
.opt { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; font: inherit; font-size: 16.5px; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-field); padding: 15px 16px; cursor: pointer; transition: border-color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease); }
.opt:hover { border-color: var(--ink-2); }
.opt:active { transform: scale(.995); }
.opt b { flex: none; width: 30px; height: 30px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.opt.is-right { border-color: var(--green); background: var(--green-soft); }
.opt.is-right b { background: var(--green); color: #fff; }
.opt.is-wrong { border-color: var(--accent); background: var(--accent-soft); }
.opt.is-wrong b { background: var(--accent); color: #fff; }
.opt[disabled] { cursor: default; }
.answer-note { margin-top: 14px; font-size: 15.5px; color: var(--ink-2); display: none; }
.answer-note.show { display: block; }

/* ── статья ── */
.art-head { padding: clamp(28px, 4vw, 48px) 0 8px; }
.crumbs { font-size: 14.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.art-title { margin-top: 14px; }
.art-lead { margin-top: 16px; max-width: 62ch; }
.art-layout { display: grid; gap: 40px; }
@media (min-width: 1024px) { .art-layout { grid-template-columns: minmax(0, 1fr) 290px; align-items: start; } }
.art-body { max-width: 68ch; font-size: 19px; line-height: 1.82; }
.art-body h2 { margin: 46px 0 14px; scroll-margin-top: 96px; }
.art-body p { margin: 0 0 18px; }
.art-body ul, .art-body ol { margin: 0 0 20px; padding-left: 24px; }
.art-body li { margin: 8px 0; }
.toc { position: sticky; top: 96px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 18px; box-shadow: var(--sh-1); }
.toc h4 { font-family: var(--font-display); font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 12px; }
.toc a { display: block; font-size: 15.5px; color: var(--ink-2); padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.toc a:last-child { border-bottom: 0; }
.toc a:hover { color: var(--accent-deep); text-decoration: none; }
.callout { display: flex; gap: 14px; background: var(--surface-2); border-radius: var(--r-sm); padding: 18px 20px; margin: 26px 0; border: 1px solid var(--line-soft); }
.callout b { display: block; font-family: var(--font-display); font-size: 16.5px; margin-bottom: 4px; }
.callout p { margin: 0; font-size: 17px; }
.callout .ic { flex: none; margin-top: 2px; color: var(--accent-deep); }
.callout-blue { background: var(--blue-soft); border-color: transparent; }
.callout-blue .ic { color: var(--blue); }
.formula { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 20px 22px; margin: 22px 0; text-align: center; font-family: var(--font-display); font-size: 23px; font-weight: 700; letter-spacing: -.01em; box-shadow: var(--sh-1); }
.faq { display: grid; gap: 10px; margin-top: 18px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 16px 20px; }
.faq summary { font-family: var(--font-display); font-weight: 700; font-size: 17.5px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 12px 0 0; font-size: 17px; color: var(--ink-2); }
.bridge { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px; box-shadow: var(--sh-1); display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.bridge p { margin: 0; flex: 1 1 320px; font-size: 16.5px; }

/* ── тест ── */
.quiz { max-width: 780px; margin: 0 auto; }
.quiz-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: clamp(22px, 3vw, 34px); box-shadow: var(--sh-2); }
.quiz-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
.result { text-align: center; padding: 8px 0 4px; }
.result .score { font-family: var(--font-display); font-size: 62px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.ring { width: 132px; height: 132px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) 0turn, var(--accent) var(--p, .7turn), var(--line-soft) var(--p, .7turn)); }
.ring i { width: 104px; height: 104px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-family: var(--font-display); font-size: 30px; font-weight: 800; font-style: normal; }
.review { display: grid; gap: 10px; margin-top: 20px; text-align: left; }
.review-row { display: flex; gap: 12px; align-items: flex-start; background: var(--surface-2); border-radius: var(--r-field); padding: 14px 16px; font-size: 16px; }
.review-row .ic { flex: none; margin-top: 3px; }

/* ── подвал ── */
.foot { border-top: 1px solid var(--line); background: var(--surface); margin-top: 40px; }
.foot-in { display: grid; gap: 26px; padding: 40px 0 26px; }
@media (min-width: 860px) { .foot-in { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.foot h4 { font-family: var(--font-display); font-size: 14.5px; font-weight: 700; margin: 0 0 12px; }
.foot a { display: block; color: var(--ink-2); font-size: 15.5px; padding: 5px 0; }
.foot-note { border-top: 1px solid var(--line-soft); padding: 18px 0 26px; font-size: 14.5px; color: var(--muted); line-height: 1.6; }
.legal { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 14.5px; }

/* ── доступность и движение ── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .wrap { padding: 0 18px; }
  .card, .demo, .quiz-card { padding: 20px; }
  .btn { width: 100%; }
  .hero-actions { flex-direction: column; align-items: stretch; }
}

/* ── приёмы из разбора Нетологии: промо-полоса, пары CTA, цветные подборки ── */
.strip {
  background: var(--ink); color: #fff; font-size: 14.5px;
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 18px; text-align: center;
}
.strip b { font-weight: 700; }
.strip a { color: #fff; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.subject .row-arrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.subject .count { font-size: 14px; color: var(--muted); }
.subject .go { color: var(--accent-deep); display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: 15px; }
.subject:hover .go { gap: 10px; }
.cta-pair { display: grid; gap: 18px; }
@media (min-width: 820px) { .cta-pair { grid-template-columns: 1fr 1fr; } }
.cta-card { position: relative; overflow: hidden; border-radius: var(--r-card); padding: 30px; color: var(--ink); background: var(--surface-2); box-shadow: var(--sh-1); display: flex; flex-direction: column; gap: 10px; min-height: 190px; }
.cta-card:hover { text-decoration: none; }
.cta-card h3 { font-size: 24px; max-width: 22ch; }
.cta-card span { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--accent-deep); }
.cta-blue { background: linear-gradient(135deg, var(--blue-soft), color-mix(in srgb, var(--blue) 18%, var(--surface))); }
.cta-warm { background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent) 22%, var(--surface))); }
.collage { display: grid; gap: 16px; }
@media (min-width: 720px) { .collage { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .collage { grid-template-columns: repeat(4, 1fr); } }
.coll { border-radius: var(--r-card); padding: 24px; min-height: 168px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; box-shadow: var(--sh-1); }
.coll:hover { text-decoration: none; transform: translateY(-3px); transition: transform .22s var(--ease); }
.coll h3 { color: #fff; font-size: 21px; }
.coll .tag { font-size: 13.5px; font-weight: 650; opacity: .9; }
.coll .go { font-weight: 700; font-size: 15px; }
.coll-1 { background: linear-gradient(140deg, #2B4BC8, #1E3A8A); }
.coll-2 { background: linear-gradient(140deg, #E8543F, #B93A28); }
.coll-3 { background: linear-gradient(140deg, #1F6B45, #14543A); }
.coll-4 { background: linear-gradient(140deg, #A15C07, #7C4405); }

/* PREMIUM-LAYER v3: дорогие градиенты, объёмные поверхности, анимации */
:root {
  --indigo: #2A3A8F;
  --indigo-deep: #1B2566;
  --accent-2: #F0824B;                 /* второй тон градиента акцента */
  --grad-accent: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  --grad-ink: linear-gradient(150deg, var(--indigo) 0%, var(--indigo-deep) 60%, #101540 100%);
  --grad-surface: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--surface)) 0%, var(--surface) 42%);
}
.btn-primary { background: var(--grad-accent); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 28%, transparent); }
.btn-primary:hover { box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 36%, transparent); }
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ""; position: absolute; inset: 0 auto 0 -40%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: translateX(-120%); transition: transform .6s var(--ease);
}
.btn-primary:hover::after { transform: translateX(320%); }

/* секции с фоновыми заливками */
.section-tight:nth-of-type(even) { background: var(--grad-surface); }
.hero { background: radial-gradient(60% 60% at 85% 0%, color-mix(in srgb, var(--indigo) 10%, transparent), transparent 70%), radial-gradient(50% 50% at 10% 10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%); }
.strip { background: var(--grad-ink); }

/* карточка предмета: иконка проекта в мягком тайле */
.subject { position: relative; overflow: hidden; }
.subject::before {
  content: ""; position: absolute; inset: -40% -20% auto auto; width: 220px; height: 220px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent), transparent 65%);
  opacity: 0; transition: opacity .3s var(--ease);
}
.subject:hover::before { opacity: 1; }
.subj-tile { border-radius: 20px; 
  width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface-2));
  border: 1px solid var(--line-soft); box-shadow: inset 0 1px 0 #fff;
}
.subj-ico { width: 56px; height: 56px; object-fit: contain; }
.subject:hover .subj-ico { transform: scale(1.06) rotate(-2deg); transition: transform .3s var(--ease); }
.feat-ico { width: 34px; height: 34px; object-fit: contain; margin-right: 8px; vertical-align: -8px; }

/* появление блоков при прокрутке */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; transform: none !important; } }

/* парящие блики в герое */
.hero-mesh { animation: floaty 18s ease-in-out infinite alternate; }
@keyframes floaty { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(0,-18px,0) scale(1.03); } }
.demo { animation: demoIn .7s var(--ease) both; }
@keyframes demoIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.coll-1 { background: linear-gradient(140deg, #3448B4, var(--indigo-deep)); }
.coll-2 { background: linear-gradient(140deg, var(--accent), var(--accent-deep)); }
.coll-3 { background: linear-gradient(140deg, #22875A, #0F4A32); }
.coll-4 { background: linear-gradient(140deg, #B4670A, #7C4405); }
.coll:hover { box-shadow: 0 18px 44px rgba(16,21,64,.28); }
.cta-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.step { background: var(--grad-surface); border-color: var(--line-soft); }
.step:hover { box-shadow: var(--sh-2); transform: translateY(-2px); transition: all .25s var(--ease); }

/* Иллюстрации */
.ill-band { border-radius: var(--r-card); overflow: hidden; box-shadow: var(--sh-2); background: var(--grad-surface); }
.ill-band img { display: block; width: 100%; height: clamp(220px, 30vw, 380px); object-fit: cover; object-position: center; }
.ill-side { border-radius: var(--r-sm); overflow: hidden; box-shadow: var(--sh-1); margin-bottom: 22px; }
.ill-side img { display: block; width: 100%; height: 220px; object-fit: cover; }

/* PALETTE-V4: непрерывный фон страницы, мягкие края секций, дорогая типографика */
:root {
  --navy: #0A1128;
  --blue: #0B3FC4;
  --blue-2: #1A55CC;
  --violet: #6C4DE6;
  --pink: #FF5C8A;
  --grad-accent: linear-gradient(135deg, #0B3FC4 0%, #1A55CC 100%);
  --grad-ink: linear-gradient(140deg, #101B3C 0%, var(--navy) 55%, #060B1C 100%);
  --grad-surface: none;
  --page-mesh:
    radial-gradient(52% 34% at 88% -2%, rgba(0,91,255,.10), transparent 62%),
    radial-gradient(46% 30% at 6% 14%, rgba(108,77,230,.08), transparent 60%),
    radial-gradient(50% 32% at 50% 58%, rgba(0,91,255,.05), transparent 64%),
    linear-gradient(180deg, #F7F9FF 0%, #FFFFFF 26%, #F6F9FF 52%, #FFFFFF 78%, #F8FAFF 100%);
}
@media (prefers-color-scheme: dark) {
  :root { --page-mesh: radial-gradient(60% 40% at 80% 0%, rgba(61,130,255,.14), transparent 62%), linear-gradient(180deg, #0A1020 0%, #0C1426 55%, #0A1020 100%); }
}
body { background-color: var(--bg); background-image: var(--page-mesh); background-repeat: no-repeat; background-attachment: scroll; }

/* подложки секций: затухают к краям, стыки не читаются */
.section-tight:nth-of-type(even), section.tinted {
  background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--accent) 4%, var(--bg)) 9%, color-mix(in srgb, var(--accent) 4%, var(--bg)) 91%, transparent 100%);
  border-radius: 0;
}
.hero {
  background:
    radial-gradient(58% 52% at 84% 4%, rgba(0,91,255,.13), transparent 66%),
    radial-gradient(44% 44% at 12% 8%, rgba(108,77,230,.10), transparent 62%),
    linear-gradient(180deg, transparent 0%, transparent 78%, rgba(255,255,255,0) 100%);
}
.hero::after { content: ""; display: block; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.strip { background: var(--grad-ink); color: #EAF0FF; }
.strip .btn, .strip a { color: inherit; }

/* типографика «дорого»: спокойнее вес, плотный трекинг, воздух */
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.032em; }
h1 { line-height: 1.04; }
h2 { line-height: 1.12; }
.eyebrow { color: var(--blue); letter-spacing: .14em; font-size: 12.5px; font-weight: 700; }
.lead { color: var(--ink-2); }
.btn { font-weight: 600; letter-spacing: -.005em; }

/* подборки и CTA — холодная гамма */
.coll-1 { background: linear-gradient(140deg, #1B2C5E, #0A1128); }
.coll-2 { background: linear-gradient(140deg, #0B3FC4, #062A8C); }
.coll-3 { background: linear-gradient(140deg, #6C4DE6, #3F2AAE); }
.coll-4 { background: linear-gradient(140deg, #12419E, #08265F); }
.cta-card { background: linear-gradient(150deg, #F3F7FF, #FFFFFF); border-color: var(--line); }

/* карточка предмета: овал «5–11» всегда в одну строку */
.subject .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.subject .row h3 { min-width: 0; overflow-wrap: anywhere; }
.subject .chip {
  white-space: nowrap; flex: 0 0 auto; min-width: 62px; justify-content: center;
  padding: 6px 13px; font-size: 13.5px; letter-spacing: .01em;
  background: var(--accent-soft); color: var(--accent-deep); border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}
.subj-tile { border-radius: 20px;  background: #FFFFFF; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(10,17,40,.04); }
.subject { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease); }
.subject:hover { border-color: color-mix(in srgb, var(--blue) 42%, var(--line)); box-shadow: 0 2px 6px rgba(10,17,40,.06), 0 18px 44px rgba(10,17,40,.10); }
.subject::before { background: radial-gradient(circle, rgba(0,91,255,.12), transparent 66%); }

/* мягкие тени вместо тёплых */
:root { --sh-1: 0 1px 2px rgba(10,17,40,.05), 0 8px 24px rgba(10,17,40,.05); --sh-2: 0 2px 4px rgba(10,17,40,.06), 0 16px 40px rgba(10,17,40,.09); }
.ill-band, .ill-side { background: linear-gradient(160deg, #EEF3FF, #FFFFFF); }

/* CONTRAST-V5: читаемость с экрана */
.lead { color: #19223C; }
p, li, dd, blockquote { color: var(--ink-2); }
.muted, .small { color: var(--muted); }
.meta, .subject .meta, .card .meta, .row-arrow .count { color: var(--ink-2); font-weight: 500; }
.faq summary { color: var(--ink); font-weight: 600; }
.faq p, .faq .a { color: var(--ink-2); }
.nav-links a { color: #16203A; }
.foot, .foot a, footer { color: var(--ink-2); }
.chip { color: var(--ink); font-weight: 600; }
.subject h3, .card h3 { color: var(--ink); font-weight: 700; }
.step .step-num, .eyebrow { color: var(--accent-deep); }
.btn-ghost { color: var(--ink); font-weight: 600; }
/* мелкий текст чуть крупнее и плотнее */
.small, .meta, .chip, .nav-links a { font-size: 15px; }
.subject .meta { font-size: 15px; line-height: 1.55; }
article p, .prose p { color: #1A2340; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

/* V6-BLOCKS */
.ticks { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 14px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; }
.ticks li b { display: block; color: var(--ink); font-size: 16.5px; }
.ticks li span { display: block; color: var(--muted); font-size: 15px; margin-top: 2px; line-height: 1.55; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.cab-visual { display: grid; gap: 16px; align-content: start; }
.ill-panel { border-radius: var(--r-card); overflow: hidden; background: linear-gradient(160deg, #EEF3FF, #FFFFFF); box-shadow: var(--sh-1); }
.ill-panel img { display: block; width: 100%; height: clamp(230px, 28vw, 320px); object-fit: cover; }
.cab-note { padding: 18px 20px; }
.cab-note b { display: block; color: var(--ink); font-size: 16.5px; }
.cab-note span { display: block; color: var(--muted); font-size: 15px; margin-top: 6px; line-height: 1.55; }
.principles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.final-cta { display: grid; grid-template-columns: 1.12fr .88fr; gap: clamp(20px, 3vw, 44px); align-items: center; background: linear-gradient(155deg, #F2F6FF 0%, #FFFFFF 62%); border: 1px solid var(--line); border-radius: var(--r-card); padding: clamp(26px, 3.4vw, 46px); box-shadow: var(--sh-1); }
.final-cta-img img { display: block; width: 100%; height: clamp(190px, 21vw, 270px); object-fit: contain; }
@media (max-width: 960px) {
  .principles-grid { grid-template-columns: 1fr; }
  .final-cta { grid-template-columns: 1fr; }
}

/* V7-CONSENT */
.consent-bar { position: fixed; left: 18px; right: auto; bottom: 18px; transform: translateY(22px); width: min(430px, calc(100% - 28px)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: 0 18px 50px rgba(10,17,40,.16); padding: 18px 20px; z-index: 90; opacity: 0; transition: opacity .35s var(--ease), transform .35s var(--ease); display: grid; gap: 10px; }
.consent-bar.show { opacity: 1; transform: none; }
.consent-icon-row { display: flex; align-items: center; gap: 10px; }
.consent-icon-row strong { color: var(--ink); font-size: 17px; }
.consent-shield { width: 24px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.consent-body { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
.consent-actions { display: flex; justify-content: flex-end; }
@media (max-width: 620px) {
  .consent-bar { left: 10px; right: 10px; width: auto; bottom: 10px; transform: translateY(22px); }
  .consent-bar.show { transform: none; }
  .consent-actions .btn { width: 100%; }
}

/* V8-PAGES: каталог тем, кабинет, достижения */
html.dark { --ink: #F2F5FF; --ink-2: #C3CBDF; --muted: #8A93AB; --line: #26304A; --line-soft: #1F2840; --bg: #0A1020; --surface: #111A30; --surface-2: #16203A; --accent: #3D82FF; --accent-deep: #005BFF; --accent-soft: #14284D; --navy: #EAF0FF; }
html.dark body { background-image: radial-gradient(60% 40% at 80% 0%, rgba(61,130,255,.14), transparent 62%), linear-gradient(180deg, #0A1020 0%, #0C1426 55%, #0A1020 100%); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 200; background: var(--surface); color: var(--ink); padding: 10px 14px; border-radius: 12px; box-shadow: var(--sh-2); }

/* хаб */
.hub-head { padding-bottom: 10px; }
.hub-search-wrap { position: relative; margin-top: 26px; max-width: 720px; }
.hub-search-ico { position: absolute; left: 18px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.hub-search { width: 100%; padding: 18px 20px 18px 52px; font: inherit; font-size: 17px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); box-shadow: var(--sh-1); }
.hub-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.hub-stats { margin-top: 16px; color: var(--muted); font-size: 15px; }
.hub-stats b { color: var(--ink); }
.hub-filters-wrap { padding-top: 0; }
.hub-group { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.hub-group-label { min-width: 108px; color: var(--muted); font-size: 14px; font-weight: 600; padding-top: 8px; }
.hub-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hub-chip { font: inherit; font-size: 15px; font-weight: 500; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 8px 15px; cursor: pointer; transition: all .18s var(--ease); }
.hub-chip:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--ink); }
.hub-chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.hub-tools { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.hub-count { color: var(--muted); font-size: 15px; }
.hub-count b { color: var(--ink); }
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.topic-card { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px; text-decoration: none; box-shadow: var(--sh-1); }
.topic-card h3 { font-size: 19px; line-height: 1.28; color: var(--ink); }
.topic-card p { margin: 0; color: var(--muted); }
.topic-tag { align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--accent-deep); background: var(--accent-soft); border-radius: var(--r-pill); padding: 5px 11px; }
.topic-meta { color: var(--muted); font-size: 14px; margin-top: auto; }
.topic-go { display: inline-flex; align-items: center; gap: 7px; color: var(--accent-deep); font-weight: 600; font-size: 15px; }
.topic-card:hover .topic-go svg { transform: translateX(3px); }
.topic-go svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; transition: transform .2s var(--ease); }
.hub-empty { text-align: center; padding: 40px 0; }
.hub-empty .btn { margin-top: 16px; }
.pager { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.pager-btn { font: inherit; font-size: 15px; font-weight: 500; min-width: 42px; padding: 9px 12px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.pager-btn:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--ink); }
.pager-btn.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager-gap { padding: 9px 4px; color: var(--muted); }

/* кабинет */
.cab-hero-in { display: grid; grid-template-columns: 1.3fr .7fr; gap: clamp(20px, 3vw, 40px); align-items: center; }
.cab-hi { font-size: clamp(30px, 4vw, 46px); }
.cab-hero-side { display: flex; gap: 14px; justify-content: flex-end; }
.cab-grade, .cab-streak { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--sh-1); padding: 18px 22px; text-align: center; min-width: 118px; }
.cab-grade b, .cab-streak b { display: block; font-family: var(--font-display); font-size: 34px; font-weight: 700; color: var(--ink); letter-spacing: -.03em; }
.cab-grade span, .cab-streak span { color: var(--muted); font-size: 14px; }
.cab-streak { background: linear-gradient(150deg, #EEF3FF, #FFFFFF); }
.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 20px; box-shadow: var(--sh-1); }
.stat-tile b { display: block; font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--ink); letter-spacing: -.03em; }
.stat-tile span { color: var(--muted); font-size: 14.5px; }
.cab-head-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.subj-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.subj-card { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 18px; text-decoration: none; box-shadow: var(--sh-1); }
.subj-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.subj-card-top b { color: var(--ink); font-size: 16.5px; }
.subj-pct { color: var(--accent-deep); font-weight: 700; font-size: 15px; }
.bar { display: block; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--grad-accent); }
.ach-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.ach-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 16px; text-align: center; box-shadow: var(--sh-1); opacity: .5; filter: saturate(.5); }
.ach-card.is-on { opacity: 1; filter: none; }
.ach-card img { width: 56px; height: 56px; object-fit: contain; }
.ach-card b { display: block; color: var(--ink); font-size: 15px; margin-top: 8px; }
.ach-card span { display: block; font-size: 13.5px; margin-top: 4px; }
.recent-list { display: grid; gap: 10px; }
.recent-item { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 18px; text-decoration: none; box-shadow: var(--sh-1); }
.recent-item:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.recent-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--accent); flex: 0 0 auto; }
.recent-dot.is-warn { background: #D97706; }
.recent-body { display: grid; gap: 3px; flex: 1; min-width: 0; }
.recent-body b { color: var(--ink); font-size: 16px; }
.subj-table { display: grid; gap: 12px; }
.subj-row { display: grid; grid-template-columns: minmax(180px, 1.1fr) 1.6fr 62px; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 18px; box-shadow: var(--sh-1); }
.subj-name { display: grid; gap: 2px; }
.subj-name b { color: var(--ink); font-size: 16px; }
.subj-res { text-align: right; color: var(--accent-deep); font-weight: 700; }
@media (max-width: 1020px) {
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
  .subj-grid { grid-template-columns: repeat(2, 1fr); }
  .ach-row { grid-template-columns: repeat(3, 1fr); }
  .stat-tiles { grid-template-columns: repeat(2, 1fr); }
  .cab-hero-in { grid-template-columns: 1fr; }
  .cab-hero-side { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .topic-grid, .subj-grid, .stat-tiles, .ach-row { grid-template-columns: 1fr; }
  .subj-row { grid-template-columns: 1fr; }
  .subj-res { text-align: left; }
  .hub-group { display: grid; }
  .hub-group-label { padding-top: 0; }
}

/* V9-CAB-FIX: плотный вертикальный ритм в кабинете */
.cab-wrap > .section, .cab-wrap > .section-tight { padding-top: clamp(16px, 1.9vw, 26px); padding-bottom: clamp(16px, 1.9vw, 26px); }
.cab-wrap > .section:first-child, .cab-wrap > .section-tight:first-child { padding-top: clamp(24px, 2.8vw, 38px); }
.cab-wrap h2 { margin: 0 0 4px; }
.cab-wrap .recent-list, .cab-wrap .ach-row { margin-top: 12px; }
.cab-wrap .subj-table { margin-top: 12px; }
.cab-wrap .subj-grid { margin-top: 12px; }
.cab-wrap .section-tight + .section-tight { padding-top: clamp(10px, 1.2vw, 16px); }

/* значки достижений: векторные, в фирменных тонах */
.ach-badge { width: 58px; height: 58px; display: block; margin: 0 auto; }
.ach-badge .ring { fill: none; stroke: currentColor; stroke-width: 2; opacity: .28; }
.ach-badge .disc { fill: currentColor; }
.ach-badge .glyph { fill: #fff; }
.ach-badge .glyph-s { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ach-card { color: var(--accent); }
.ach-card.tone-amber { color: #D97706; }
.ach-card.tone-rose { color: #D6455B; }
.ach-card.tone-green { color: #12855C; }
.ach-card.tone-teal { color: #0E7490; }
.ach-card.tone-violet { color: #6C4DE6; }
.ach-card b { display: block; margin-top: 10px; }

/* V10-FOOT: нижняя строка подвала */
.foot-in { display: grid; grid-template-columns: 1.4fr .8fr .8fr .8fr; gap: 24px; align-items: start; }
.foot-in > div { display: grid; gap: 8px; align-content: start; }
.foot-in h4 { margin-bottom: 2px; }
.foot-bottom { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 14.5px; }
.foot-links { display: flex; gap: 16px; flex-wrap: wrap; }
.foot-links a { color: var(--ink-2); }
@media (max-width: 900px) { .foot-in { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .foot-in { grid-template-columns: 1fr; } }

/* V11-CHAT: чат ИИ-репетитора */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.chat-wrap { display: grid; grid-template-columns: 1.62fr .88fr; gap: 22px; align-items: start; padding: clamp(18px, 2.4vw, 34px) 0 clamp(30px, 4vw, 60px); }
.chat-shell { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--sh-2); overflow: hidden; min-height: 560px; }
.chat-topbar { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); background: linear-gradient(150deg, #F4F7FF, #FFFFFF); position: relative; }
.chat-title { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.chat-title > span:last-child { display: grid; }
.chat-title b { color: var(--ink); font-size: 17px; }
.chat-sub { color: var(--muted); font-size: 14px; }
.chat-av, .av { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--grad-accent); color: #fff; font-size: 13.5px; font-weight: 700; flex: 0 0 auto; }
.chat-subj { font: inherit; font-size: 15px; font-weight: 600; color: var(--accent-deep); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent); border-radius: var(--r-pill); padding: 9px 15px; cursor: pointer; white-space: nowrap; }
.chat-subj .caret { font-size: 12px; opacity: .8; }
.chat-subj-menu { position: absolute; right: 18px; top: 66px; z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--sh-2); padding: 8px; display: grid; gap: 2px; min-width: 230px; max-height: 320px; overflow: auto; }
.chat-subj-menu button { font: inherit; font-size: 15px; text-align: left; color: var(--ink-2); background: none; border: 0; border-radius: 10px; padding: 9px 11px; cursor: pointer; }
.chat-subj-menu button:hover { background: var(--surface-2); color: var(--ink); }
.chat-subj-menu button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: 22px; overflow-y: auto; max-height: min(58vh, 620px); overscroll-behavior: contain; }
.msg { display: flex; gap: 12px; align-items: flex-start; }
.msg.me { justify-content: flex-end; }
.bubble { max-width: 68ch; background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; padding: 14px 18px; color: var(--ink-2); font-size: 16.5px; line-height: 1.65; }
.bubble p { margin: 0 0 8px; }
.bubble p:last-child { margin-bottom: 0; }
.msg.me .bubble { background: var(--grad-accent); border-color: transparent; color: #fff; }
.steps-list { margin: 8px 0 10px; padding-left: 20px; }
.steps-list li { margin-bottom: 4px; }
.b-math { margin: 12px 0; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 12px; font-size: 17px; color: var(--ink); text-align: center; }
.bubble-cta { margin-top: 12px; font-size: 15px; padding: 10px 16px; }
.chat-quick { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 20px 12px; }
.chat-quick button { font: inherit; font-size: 14.5px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 8px 14px; cursor: pointer; }
.chat-quick button:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--ink); }
.chat-input { display: flex; gap: 10px; align-items: flex-end; padding: 14px 20px 6px; border-top: 1px solid var(--line-soft); background: var(--surface); }
.chat-input textarea { flex: 1; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; resize: none; max-height: 140px; }
.chat-input textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
.chat-limit { margin: 0; padding: 0 20px 12px; color: var(--muted); font-size: 14px; }
.chat-limit b { color: var(--ink); }
.chat-demo { margin: 0; padding: 0 20px 16px; }
.chat-side { display: grid; gap: 16px; }
.chat-side .card h3 { font-size: 17px; margin-bottom: 10px; }
.chat-topics { display: grid; gap: 6px; }
.chat-topics a { color: var(--ink-2); font-size: 15px; padding: 8px 10px; border-radius: 10px; }
.chat-topics a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.typing .dot { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: var(--muted); animation: bounce 1.1s infinite; }
.typing .dot:nth-child(2) { animation-delay: .15s; }
.typing .dot:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .typing .dot { animation: none; } }
@media (max-width: 960px) {
  .chat-wrap { grid-template-columns: 1fr; }
  .chat-shell { min-height: 0; }
  .chat-log { max-height: none; }
}
@media (max-width: 640px) {
  .chat-page .nav-links { display: none; }
  .chat-wrap { padding: 10px 0 24px; }
  .chat-shell { border-radius: 18px; }
  .chat-topbar { padding: 12px 14px; gap: 10px; }
  .chat-sub { display: none; }
  .chat-log { padding: 14px; gap: 14px; }
  .bubble { max-width: 100%; font-size: 16px; padding: 12px 14px; }
  .chat-quick { padding: 0 14px 10px; overflow-x: auto; flex-wrap: nowrap; }
  .chat-quick button { white-space: nowrap; }
  .chat-input { padding: 12px 14px 4px; }
  .chat-input textarea { font-size: 16px; }
  .chat-input .btn { padding: 12px 16px; }
  .chat-limit, .chat-demo { padding-left: 14px; padding-right: 14px; }
}

/* V12-MOBILE: удобство на телефоне (школа заходит с мобильного) */
@media (max-width: 820px) {
  /* шапка: логотип и кнопки в одну строку, меню — горизонтальная карусель */
  .nav-in { flex-wrap: wrap; gap: 8px 10px; padding: 10px 0 6px; }
  .nav-links { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding: 2px 0 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { white-space: nowrap; padding: 11px 13px; font-size: 15px; border: 1px solid var(--line); background: var(--surface); }
  .brand { font-size: 18px; }
  .brand-logo { width: 34px; height: 34px; }
  .nav-right { gap: 8px; }
  .nav-right .btn { padding: 11px 16px; }

  /* ссылки и кнопки: комфортная зона нажатия */
  .foot-in a, .foot-links a { display: inline-flex; align-items: center; min-height: 40px; }
  .foot-in { gap: 4px 18px; }
  .foot-in > div { gap: 2px; }
  .btn-quiet { padding: 11px 13px; min-height: 42px; }
  .row-arrow, .go { min-height: 40px; align-items: center; }
  .subject .row-arrow { margin-top: 6px; }
  .hub-chip { padding: 10px 14px; }
  .pager-btn { min-width: 46px; padding: 12px 12px; }
  .crumbs a { display: inline-flex; align-items: center; min-height: 38px; }

  /* надзаголовки и мелкие подписи читаемее */
  .eyebrow { font-size: 13.5px; letter-spacing: .12em; }
  .meta, .small, .stat span, .topic-meta { font-size: 15px; }
  .topic-card { padding: 18px; }
  .subject { padding: 18px; }
  .card { padding: 20px; }
  .cta-row .btn { flex: 1 1 auto; justify-content: center; }
  .final-cta { padding: 22px; }
  .ill-band img { height: clamp(180px, 46vw, 260px); }
  .hub-group-label { font-size: 14px; }
}
@media (max-width: 420px) {
  h1 { font-size: clamp(28px, 8.4vw, 34px); }
  h2 { font-size: clamp(22px, 6.6vw, 28px); }
  .hero-actions .btn, .cta-row .btn { width: 100%; }
  .stat-tiles { grid-template-columns: 1fr 1fr; }
  .ach-row { grid-template-columns: 1fr 1fr; }
  .chat-quick { gap: 6px; }
}

/* V12b-MOBILE-TAPS: зоны нажатия, декоративные слои */
.hero { overflow: hidden; }
@media (max-width: 820px) {
  .brand { min-height: 44px; align-items: center; }
  .strip a { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; margin: -4px 0; }
  .foot-in a, .foot-links a { padding: 10px 0; line-height: 1.35; }
  .foot-links { gap: 6px 16px; }
  .section-head a, .hub-tools a, .link-arrow { display: inline-flex; align-items: center; min-height: 42px; }
}

.link-more { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; color: var(--accent-deep); }
.link-more:hover { text-decoration: underline; }

/* V12c-FIX: скрытое состояние выпадающего списка и меню на телефоне */
.chat-subj-menu[hidden] { display: none; }
@media (max-width: 820px) {
  /* меню остаётся доступным: горизонтальная карусель ссылок */
  .nav .nav-in .nav-links, .chat-page .nav .nav-links { display: flex; order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding: 2px 0 6px; }
  .nav .nav-in .nav-links a { white-space: nowrap; padding: 11px 14px; font-size: 15px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-pill); }
  .nav .nav-in .nav-links a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
}

/* V12e: шапка на телефоне растёт под две строки */
@media (max-width: 820px) {
  .nav, .nav .nav-in { height: auto; min-height: 0; }
  .nav .nav-in { padding-bottom: 8px; }
}

/* V12f: компактная шапка на телефоне */
@media (max-width: 820px) {
  .strip { font-size: 13.5px; padding: 8px 12px; gap: 10px; line-height: 1.35; }
  .strip-more { display: none; }
  .strip a { padding: 7px 13px; min-height: 36px; white-space: nowrap; }
  .nav .nav-in { padding: 8px 0 6px; gap: 8px; }
  .nav .nav-in .nav-links { padding: 0 0 4px; }
  .nav .nav-in .nav-links a { padding: 9px 13px; font-size: 14.5px; }
  .nav .brand { font-size: 17px; }
}

/* V13: дедупликация правовых ссылок и полноэкранный чат на телефоне */
.site-legal-links:not(.foot-links) { display: none !important; } /* чужие плавающие ссылки не показываем, у нас они в подвале */
.chat-back { display: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); place-items: center; flex: 0 0 auto; }
.chat-back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 820px) {
  .chat-back { display: grid; }
  /* классический чат-помощник: только лента и поле ввода на весь экран */
  .chat-page { overflow: hidden; }
  .chat-page .nav, .chat-page .strip, .chat-page .foot, .chat-page .chat-side, .chat-page .chat-demo { display: none !important; }
  .chat-page .chat-wrap { padding: 0; display: block; }
  .chat-page .chat-shell { position: fixed; inset: 0; border: 0; border-radius: 0; box-shadow: none; min-height: 0; height: 100dvh; display: flex; flex-direction: column; z-index: 70; }
  .chat-page .chat-topbar { position: sticky; top: 0; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: var(--surface); border-bottom: 1px solid var(--line-soft); }
  .chat-page .chat-log { flex: 1 1 auto; max-height: none; padding: 14px 12px; }
  .chat-page .chat-input { position: sticky; bottom: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-soft); }
  .chat-page .chat-limit { padding: 0 12px calc(8px + env(safe-area-inset-bottom)); font-size: 13px; }
  .chat-page .chat-quick { position: sticky; bottom: 0; background: var(--surface); padding: 6px 12px 8px; border-top: 1px solid var(--line-soft); }
  .chat-page .chat-input + .chat-limit { border-top: 0; }
}

/* V14: чистый низ чата и лимит в шапке */
.chat-left { display: flex; align-items: center; gap: 8px; margin-left: auto; order: 2; }
.chat-limit-chip { font-size: 13px; font-weight: 600; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 6px 11px; white-space: nowrap; }
.chat-topbar { flex-wrap: nowrap; }
.chat-subj { order: 3; }
.chat-page .chat-demo { display: none !important; }
@media (max-width: 640px) {
  .chat-limit-chip { font-size: 12px; padding: 5px 9px; }
  .chat-sub { display: none; }
}

/* V15-BRAND-ACCENT: прежний фирменный красно-оранжевый — точечно */
:root {
  --brand: #E8543F;
  --brand-deep: #C9402C;
  --brand-soft: #FDEDE9;
  --grad-brand: linear-gradient(135deg, #F0684C 0%, #C9402C 100%);
}
.btn-brand { background: var(--grad-brand); color: #fff; box-shadow: 0 6px 18px rgba(201,64,44,.26); position: relative; overflow: hidden; }
.btn-brand:hover { box-shadow: 0 10px 26px rgba(201,64,44,.34); transform: translateY(-1px); }
.btn-brand::after { content: ""; position: absolute; inset: 0 auto 0 -40%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.34), transparent); transform: translateX(-120%); transition: transform .6s var(--ease); }
.btn-brand:hover::after { transform: translateX(320%); }
/* полосы прогресса — тоже фирменный цвет */
.bar i { background: var(--grad-brand); }
.subj-pct { color: var(--brand-deep); }
.cab-streak { background: linear-gradient(150deg, var(--brand-soft), #FFFFFF); }
.cab-streak b { color: var(--brand-deep); }
html.dark .btn-brand { background: var(--grad-brand); }

/* ── компактный подвал на телефоне ── */
@media (max-width: 640px) {
  .foot { padding: 18px 0 30px; }
  .foot-in { grid-template-columns: 1fr; gap: 8px; }
  .foot-in > div:not(:first-child) { display: none; }
  .foot-in > div:first-child p { display: none; }
  .foot-in > div:first-child .brand { min-height: 32px; }
  .foot-bottom { flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 10px; padding-top: 10px; font-size: 13px; }
  .foot-links { gap: 2px 12px; font-size: 13px; }
  .foot-links a, .foot-in a { min-height: 30px; padding: 3px 0; }
}

/* V15b: подвал на телефоне — только строка с копирайтом и правовыми ссылками */
@media (max-width: 640px) {
  .foot { padding: 14px 0 22px; }
  .foot-in { display: none; }
  .foot-bottom { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 2px 10px; margin: 0; padding: 0; border: 0; font-size: 12.5px; }
  .foot-links { gap: 2px 10px; font-size: 12.5px; }
  .foot-links a, .foot-in a { min-height: 26px; padding: 2px 0; }
}

/* V16-DARK: тёмная тема (текст, поверхности, элементы управления) */
html.dark .lead { color: #DCE3F4; }
html.dark .nav-links a { color: var(--ink-2); }
html.dark article p, html.dark .prose p { color: #C9D2E6; }
html.dark .eyebrow { color: #7FA8FF; }
html.dark .muted, html.dark .small, html.dark .meta, html.dark .topic-meta, html.dark .stat span { color: var(--muted); }
html.dark .brand, html.dark h1, html.dark h2, html.dark h3, html.dark h4 { color: var(--ink); }
html.dark .subject h3, html.dark .topic-card h3, html.dark .card h3, html.dark .subj-card-top b,
html.dark .recent-body b, html.dark .cab-note b, html.dark .chat-title b { color: var(--ink); }

/* поверхности, которые были светлыми градиентами */
html.dark .cta-card, html.dark .ill-panel, html.dark .final-cta, html.dark .chat-topbar,
html.dark .cab-streak, html.dark .card-tint, html.dark .cab-note, html.dark .b-math, html.dark .step {
  background: linear-gradient(150deg, #17223C 0%, #101A2E 100%); border-color: var(--line);
}
html.dark .subject, html.dark .topic-card, html.dark .subj-card, html.dark .stat-tile,
html.dark .ach-card, html.dark .recent-item, html.dark .subj-row, html.dark .card,
html.dark .hub-search, html.dark .chat-shell, html.dark .consent-bar, html.dark .chat-input textarea,
html.dark .chat-quick button, html.dark .chat-subj-menu { background: var(--surface); border-color: var(--line); color: var(--ink); }
html.dark .subj-tile { background: #FFFFFF; } /* под цветными иконками плитка остаётся светлой */
html.dark .bar { background: rgba(255,255,255,.12); }
html.dark .chip, html.dark .hub-chip, html.dark .chat-quick button { background: var(--surface-2); color: var(--ink-2); border-color: var(--line); }
html.dark .chip-accent, html.dark .topic-tag, html.dark .chat-subj, html.dark .chat-limit-chip { background: rgba(61,130,255,.18); color: #C3D7FF; border-color: rgba(61,130,255,.3); }
html.dark .hub-chip.is-on, html.dark .pager-btn.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
html.dark .btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
html.dark .btn-quiet { color: var(--ink-2); }
html.dark .btn-primary, html.dark .btn-brand { color: #fff; }
html.dark .subj-pct, html.dark .subj-res { color: #A9C2FF; }
html.dark .cab-streak b { color: #FFB9A6; }
html.dark .strip { background: linear-gradient(140deg, #101B3C 0%, #060B1C 100%); color: #E7EEFF; }
html.dark .crumbs a, html.dark .crumbs span { color: var(--muted); }
html.dark .hub-search::placeholder, html.dark .chat-input textarea::placeholder { color: #8A93AB; }
html.dark .nav-links a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* кнопка смены темы: ровные размеры и видимая иконка в обеих темах */
.nav-right { display: flex; align-items: center; gap: 10px; }
.icon-btn { flex: 0 0 auto; line-height: 0; }
html.dark .icon-btn { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
html.dark .icon-btn:hover { color: var(--ink); border-color: var(--ink-2); }

/* ── полоса «Все разборы и тесты бесплатны» не нужна в мобильной версии ── */
@media (max-width: 820px) {
  .strip { display: none !important; }
}

/* V16b: ссылки в тёмной теме светлее */
html.dark a { color: #9CBBFF; }
html.dark .consent-body a, html.dark .faq a, html.dark .c 	a { color: #9CBBFF; }
html.dark .btn-primary, html.dark .btn-brand, html.dark .chip-accent, html.dark .topic-tag { color: #fff; }
html.dark .chat-topics a { color: #C9D2E6; }
html.dark .link-more { color: #9CBBFF; }

/* V17-NAV: бургер, выдвижная панель, группы */
.nav-burger { display: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); place-items: center; cursor: pointer; flex: 0 0 auto; }
.nav-burger .ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.nav-mobile-right, .nav-right { margin-left: auto; }
.nav-overlay { position: fixed; inset: 0; z-index: 120; background: rgba(10,17,40,.45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: opacity .25s var(--ease), visibility .25s var(--ease); }
.nav-overlay.open { opacity: 1; visibility: visible; }
.nav-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 130; width: min(360px, 88vw); background: var(--surface); border-left: 1px solid var(--line); box-shadow: -18px 0 50px rgba(10,17,40,.18); transform: translateX(102%); transition: transform .3s var(--ease); display: flex; flex-direction: column; gap: 6px; padding: 16px 18px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; }
.nav-panel.open { transform: none; }
.nav-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.nav-panel-close { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; font-size: 15px; }
.nav-panel-close:hover { color: var(--brand-deep); border-color: var(--brand); }
.nav-panel-links { display: grid; gap: 2px; }
.nav-panel-links a { color: var(--ink-2); font-size: 16px; font-weight: 500; padding: 13px 12px; border-radius: 12px; }
.nav-panel-links a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-panel-links a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }
.nav-group { border-top: 1px solid var(--line-soft); margin-top: 4px; }
.nav-group-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); background: none; border: 0; padding: 14px 12px; cursor: pointer; }
.nav-group-btn .ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; transition: transform .25s var(--ease); }
.nav-group.open .nav-group-btn .ic { transform: rotate(180deg); }
.nav-group-list { display: grid; gap: 2px; max-height: 0; overflow: hidden; transition: max-height .28s var(--ease); }
.nav-group.open .nav-group-list { max-height: 260px; padding-bottom: 6px; }
.nav-group-list a { color: var(--ink-2); font-size: 15.5px; padding: 11px 12px 11px 22px; border-radius: 12px; }
.nav-group-list a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-panel-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.nav-panel-foot .btn { width: 100%; justify-content: center; }
html.dark .nav-panel, html.dark .nav-overlay { background-color: var(--surface); }
html.dark .nav-overlay { background: rgba(4,8,20,.6); }

@media (max-width: 820px) {
  .nav-burger { display: grid; order: 2; }
  .nav .brand { order: 1; margin-right: auto; }
  .nav .nav-right { order: 3; }
  .nav .nav-in .nav-links { display: none; }          /* ссылки ушли в панель */
  .nav-right .nav-cta { padding: 10px 14px; font-size: 14.5px; }
  .nav .nav-in { padding: 10px 0; }
}
@media (max-width: 420px) { .nav-right .nav-cta { font-size: 13.5px; padding: 9px 12px; } }

/* V17b: шапка телефона в одну строку */
@media (max-width: 820px) {
  .nav .nav-in { flex-wrap: nowrap; gap: 8px; padding: 8px 0; }
  .nav .brand { min-width: 0; flex: 1 1 auto; white-space: nowrap; overflow: hidden; }
  .nav .brand-logo { width: 32px; height: 32px; }
  .nav-right { flex: 0 0 auto; gap: 8px; }
  .nav-right .nav-cta { white-space: nowrap; }
  .nav-burger { width: 40px; height: 40px; }
}
@media (max-width: 520px) {
  .nav .brand span, .nav .brand-name { display: none; }
  .nav .brand { flex: 0 0 auto; }
}
@media (max-width: 420px) {
  .nav .brand { display: none; }
}

/* V18-CHAT-MOBILE: поле ввода на всю ширину, лимит не мешает заголовку */
@media (max-width: 820px) {
  .chat-page .chat-limit-chip { display: none; }
  .chat-page .chat-topbar { gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; }
  .chat-page .chat-title { flex: 1 1 auto; min-width: 0; }
  .chat-page .chat-title b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .chat-page .chat-sub { display: none; }
  .chat-page .chat-subj { padding: 9px 13px; font-size: 14.5px; flex: 0 0 auto; }

  /* поле ввода — классическая строка ассистента */
  .chat-page .chat-input { flex-wrap: nowrap; gap: 8px; align-items: center; padding: 10px 12px calc(8px + env(safe-area-inset-bottom)); }
  .chat-page .chat-input textarea { flex: 1 1 auto; width: auto; min-width: 0; padding: 12px 16px; border-radius: 22px; font-size: 16px; }
  .chat-page .chat-input .btn { flex: 0 0 auto; width: auto; min-width: 0; padding: 12px 18px; border-radius: 22px; font-size: 15px; }
  .chat-page .chat-quick { padding: 6px 12px 8px; }
  .chat-page .chat-log { padding: 14px 12px 6px; }
}
@media (max-width: 400px) {
  .chat-page .chat-input .btn { padding: 12px 14px; font-size: 14px; }
}

/* V19-SUGGEST: блок подсказок внутри ленты, ничего не перекрывает */
.chat-suggest { display: grid; gap: 10px; padding: 4px 0 6px 50px; }
.chat-suggest-title { margin: 0; color: var(--muted); font-size: 14.5px; }
.chat-suggest-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-suggest-list button { font: inherit; font-size: 14.5px; font-weight: 500; color: var(--accent-deep); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); border-radius: var(--r-pill); padding: 9px 14px; cursor: pointer; transition: all .18s var(--ease); }
.chat-suggest-list button:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.chat-page .chat-quick { display: none !important; }   /* старый прилипающий ряд больше не нужен */
.chat-page .chat-input { padding-top: 12px; }
html.dark .chat-suggest-list button { background: rgba(61,130,255,.18); color: #C3D7FF; border-color: rgba(61,130,255,.3); }
html.dark .chat-suggest-list button:hover { background: var(--accent); color: #fff; }
@media (max-width: 820px) {
  .chat-suggest { padding-left: 0; }
  .chat-suggest-list { flex-wrap: wrap; }
  .chat-suggest-list button { font-size: 14px; padding: 9px 12px; }
}

/* V20-COUNTS: количество разборов в чипах каталога */
.hub-chip-count { display: inline-block; margin-left: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 2px 8px; }
.hub-chip.is-on .hub-chip-count { color: #fff; background: rgba(255,255,255,.22); }
html.dark .hub-chip-count { background: rgba(255,255,255,.10); color: var(--ink-2); }
html.dark .hub-chip.is-on .hub-chip-count { color: #fff; background: rgba(255,255,255,.2); }

/* V21-RHYTHM: убираем накопленные вертикальные разрывы */
:root { --rhythm-lg: clamp(30px, 3.6vw, 54px); --rhythm-md: clamp(20px, 2.4vw, 34px); --rhythm-sm: clamp(12px, 1.4vw, 20px); }
.section { padding: var(--rhythm-lg) 0; }
.section-tight { padding: var(--rhythm-md) 0; }
.section + .section, .section + .section-tight, .section-tight + .section, .section-tight + .section-tight { padding-top: var(--rhythm-sm); }
/* стыки подшапки и первого блока */
.hero { padding-bottom: var(--rhythm-md); }
.crumbs { margin-bottom: 4px; }
.crumbs + .eyebrow, .crumbs + h1 { margin-top: 10px; }
/* фильтры и сетка каталога ближе друг к другу */
.hub-filters-wrap { padding-bottom: 0; }
.hub-tools { margin-top: 10px; }
.topic-grid { margin-top: 4px; }
.pager { margin-top: 22px; }
.hub-empty { padding: 26px 0; }
/* финальный блок и подвал не отрываются */
.final-cta + .foot, main + .foot { margin-top: 0; }
.foot { padding-top: var(--rhythm-lg); }
.foot-bottom { margin-top: 18px; padding-top: 14px; }
@media (max-width: 820px) {
  :root { --rhythm-lg: 26px; --rhythm-md: 18px; --rhythm-sm: 12px; }
  .pager { margin-top: 16px; }
}

/* V22-INFOGRAPHICS: картинки и мини-инфографика */
.hub-head-in { display: grid; grid-template-columns: 1.12fr .88fr; gap: clamp(20px, 3.4vw, 52px); align-items: center; }
.hub-head-ill img { display: block; width: 100%; height: auto; max-height: 420px; object-fit: contain; }
.result-ill { display: flex; justify-content: center; margin-bottom: 14px; }
.result-ill img { width: clamp(150px, 22vw, 210px); height: auto; }
.art-map { margin: 22px 0 26px; padding: 18px 20px; background: linear-gradient(155deg, #F3F7FF, #FFFFFF); border: 1px solid var(--line); border-radius: var(--r-card); }
.art-map-title { font-weight: 600; color: var(--ink); font-size: 15px; letter-spacing: -.01em; margin-bottom: 12px; }
.art-map-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.art-map-step { display: grid; gap: 4px; position: relative; padding-left: 26px; }
.art-map-num { position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-deep); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.art-map-ico svg { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.art-map-step b { color: var(--ink); font-size: 15.5px; }
.art-map-step > span:last-child { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
html.dark .art-map { background: linear-gradient(155deg, #17223C, #101A2E); }
@media (max-width: 900px) {
  .hub-head-in { grid-template-columns: 1fr; }
  .hub-head-ill { order: -1; max-width: 340px; }
  .art-map-steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .art-map-steps { grid-template-columns: 1fr; }
  .result-ill img { width: 140px; }
}

/* V24-PROD-COMPAT: боевой common.js создаёт баннер согласия со своими классами */
.consent-continue { font: inherit; font-size: 15px; font-weight: 600; color: #fff; background: var(--grad-accent); border: 0; border-radius: var(--r-pill); padding: 12px 20px; cursor: pointer; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 26%, transparent); }
.consent-continue:hover { box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 34%, transparent); }
.consent-shield { width: 24px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html.dark .consent-bar { background: var(--surface); }
/* подстраховка: контейнер и колонки из новой темы главнее старых правил */
main .wrap, .nav .nav-in, .foot .foot-in { box-sizing: border-box; }

/* V26-TRANSITION: прежние классы страниц входа, кабинета и чата в новой теме */
.screen { display: none; }
.screen.active { display: block; }
.page-shell { max-width: 1080px; margin: 18px auto; padding: clamp(16px, 2.4vw, 28px); }
.page-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--sh-1); }
.auth-card { max-width: 460px; margin: 30px auto; padding: 28px; display: grid; gap: 10px; box-shadow: var(--sh-2); }
.page-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 17px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad-accent); color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 700; }
.auth-title { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.auth-sub { color: var(--muted); font-size: 15px; line-height: 1.5; }
.auth-tabs { display: flex; gap: 6px; background: var(--surface-2); border-radius: var(--r-pill); padding: 4px; margin: 6px 0 4px; }
.auth-tab { flex: 1; font: inherit; font-size: 15px; font-weight: 500; color: var(--ink-2); background: none; border: 0; border-radius: var(--r-pill); padding: 10px 14px; cursor: pointer; }
.auth-tab.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--sh-1); }
.auth-form { display: grid; gap: 4px; }
.field-label { display: block; color: var(--ink-2); font-size: 15px; margin-top: 10px; }
.auth-input { font: inherit; font-size: 16px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; width: 100%; box-sizing: border-box; }
.auth-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
.auth-btn { font: inherit; font-size: 16px; font-weight: 600; color: #fff; background: var(--grad-accent); border: 0; border-radius: var(--r-pill); padding: 14px 20px; width: 100%; cursor: pointer; margin-top: 12px; }
.auth-btn:hover { box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 30%, transparent); }
.auth-error { color: #B42318; background: #FEF3F2; border: 1px solid #FECDCA; border-radius: 12px; padding: 10px 12px; font-size: 14.5px; }
.auth-error:empty { display: none; }
.auth-consent, .auth-home-link { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.auth-consent a, .auth-home-link a { color: var(--accent-deep); }
.welcome-card { text-align: center; display: grid; gap: 12px; justify-items: center; padding: 30px; }
.welcome-btn, .full-width { width: 100%; }
html.dark .auth-error { color: #FFB4AB; background: #3A1D1A; border-color: #5C2A24; }
@media (max-width: 640px) {
  .auth-card { margin: 14px auto; padding: 20px; }
  .auth-input, .page-shell input, .page-shell textarea, .page-shell select { font-size: 16px; }
  .page-shell { padding: 14px; margin: 10px auto; }
}

/* V27-COMPAT-PAGES: ОГЭ, ЕГЭ, справочник, витрина тестов */
.exam-card-wide, .theory-card-wide { max-width: 1080px; margin: 18px auto; padding: clamp(18px, 2.6vw, 30px); }
.subjects-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--sh-1); }
.exam-seo-h1 { font-family: var(--font-display); font-size: clamp(24px, 3.4vw, 34px); font-weight: 700; letter-spacing: -.03em; color: var(--ink); margin: 0 0 10px; }
.exam-seo-text { color: var(--ink-2); font-size: 16.5px; line-height: 1.65; margin: 0 0 16px; }
.subjects-header { display: grid; gap: 6px; margin-bottom: 12px; }
.subjects-greeting { color: var(--ink); font-weight: 700; font-size: 20px; }
.subjects-sub { color: var(--muted); font-size: 15px; }
.subjects-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.exam-task-grid { display: grid; gap: 10px; }
.subject-item-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.subject-name { color: var(--ink); }
.subjects-list a, .subjects-list button, .exam-task-grid a, .exam-task-grid button, .subject-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; box-sizing: border-box;
  font: inherit; font-size: 16px; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; text-decoration: none; cursor: pointer;
}
.subjects-list a:hover, .exam-task-grid a:hover, .subject-item:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--sh-1); text-decoration: none; }
.theory-open-btn { font: inherit; font-size: 15px; font-weight: 600; color: var(--accent-deep); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent); border-radius: var(--r-pill); padding: 9px 14px; text-decoration: none; white-space: nowrap; }
.theory-toc { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.toc-chip { font-size: 14.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 8px 13px; text-decoration: none; }
.toc-chip:hover { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); text-decoration: none; }
.theory-body { padding: 18px 0; display: grid; gap: 14px; }
.theory-block { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 16px 18px; }
.theory-block h2, .theory-block h3 { font-size: 18px; color: var(--ink); margin: 0 0 8px; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 4px 0 12px; border-bottom: 1px solid var(--line-soft); }
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-subject { color: var(--ink); font-weight: 600; }
.link-plain, .back-btn { color: var(--ink-2); font-size: 15px; text-decoration: none; }
.link-plain:hover, .back-btn:hover { color: var(--ink); }
.site-disclaimer { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
/* витрина тестов: карточки как в каталоге */
.tst-main { max-width: 1080px; margin: 0 auto; padding: clamp(16px, 2.4vw, 28px) 0 clamp(24px, 3vw, 40px); }
.tst-head { display: grid; gap: 10px; margin-bottom: 18px; }
.tst-head h1 { font-family: var(--font-display); font-size: clamp(26px, 4vw, 40px); font-weight: 700; letter-spacing: -.03em; color: var(--ink); margin: 0; }
.tst-head p { color: var(--ink-2); font-size: 16.5px; line-height: 1.65; margin: 0; max-width: 76ch; }
.test-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 16px; }
.test-card { display: grid; gap: 10px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px; box-shadow: var(--sh-1); text-decoration: none; transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease); }
.test-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); text-decoration: none; }
.test-card h3 { font-size: 19px; line-height: 1.28; color: var(--ink); margin: 0; }
.tc-tag { justify-self: start; font-size: 13px; font-weight: 600; color: var(--accent-deep); background: var(--accent-soft); border-radius: var(--r-pill); padding: 5px 11px; }
.tc-meta { color: var(--muted); font-size: 14px; }
.tc-go { display: inline-flex; align-items: center; gap: 7px; color: var(--accent-deep); font-weight: 600; font-size: 15px; margin-top: auto; }
.hub-chip .n { display: inline-block; margin-left: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 2px 8px; }
.hub-chip.is-on .n { color: #fff; background: rgba(255,255,255,.22); }
@media (max-width: 1020px) { .test-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .subjects-list { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .test-grid { grid-template-columns: 1fr; } }
html.dark .theory-block, html.dark .subjects-list a, html.dark .exam-task-grid a, html.dark .toc-chip, html.dark .subject-item { background: var(--surface-2); }

/* V27b: верх каталога компактнее + поиск в строке экзаменов */
.hub-head { padding-bottom: 2px; }
.hub-head h1 { font-size: clamp(26px, 3.5vw, 36px); max-width: 22ch; }
.hub-head .lead { font-size: 16.5px; max-width: 54ch; }
.hub-group .hub-search-wrap { margin-top: 0; margin-left: auto; flex: 1 1 240px; max-width: 340px; }
.hub-group .hub-search { padding: 12px 16px 12px 44px; font-size: 16px; }
.hub-group .hub-search-ico { width: 19px; height: 19px; left: 15px; }
@media (max-width: 820px) { .hub-group .hub-search-wrap { margin-left: 0; max-width: none; } }

/* V27c: шапка каталога ниже, чтобы фильтры были видны сразу */
.hub-head { padding-top: clamp(16px, 2vw, 26px); padding-bottom: 0; }
.hub-head h1 { font-size: clamp(24px, 3.1vw, 32px); line-height: 1.12; max-width: 24ch; }
.hub-head .lead { font-size: 16px; line-height: 1.6; max-width: 52ch; margin-top: 10px; }
.hub-head-ill img { max-height: 260px; }
.hub-head-in { gap: clamp(16px, 2.6vw, 36px); }
.hub-filters-wrap { padding-top: 10px; }
@media (max-width: 900px) { .hub-head-ill img { max-height: 190px; } }

/* V27d: на телефоне шапка каталога короче — фильтр предметов виден раньше */
@media (max-width: 820px) {
  .hub-head .crumbs { display: none; }
  .hub-head .eyebrow { display: none; }
  .hub-head h1 { font-size: clamp(22px, 6.4vw, 28px); max-width: none; }
  .hub-head .lead { font-size: 15.5px; max-width: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .hub-head-ill { display: none; }
  .hub-head { padding-top: 10px; }
  .hub-filters-wrap { padding-top: 6px; }
}

/* STAGE-A1: иллюстрация шапки каталога — справа от текста, не под ним */
@media (max-width: 900px) and (min-width: 701px) {
  .hub-head-in { grid-template-columns: 1.2fr .8fr; }
  .hub-head-ill { order: 0; max-width: none; }
}
@media (max-width: 700px) { .hub-head-in { grid-template-columns: 1fr; } .hub-head-ill { display: none; } }

/* STAGE-A2: страница опроса — свой набор классов в новой теме */
.sv-main { max-width: 920px; margin: 0 auto; padding: clamp(18px, 2.6vw, 34px) 0 clamp(30px, 4vw, 56px); }
.sv-hero { display: grid; gap: 14px; }
.sv-badge { justify-self: start; font-size: 14px; font-weight: 600; color: var(--accent-deep); background: var(--accent-soft); border-radius: var(--r-pill); padding: 7px 14px; }
.sv-hero h1 { font-family: var(--font-display); font-size: clamp(28px, 4.4vw, 44px); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; color: var(--ink); margin: 0; }
.sv-hero p { color: var(--ink-2); font-size: 17px; line-height: 1.65; margin: 0; max-width: 70ch; }
.sv-note { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.sv-note svg { width: 22px; height: 22px; flex: 0 0 auto; stroke: var(--accent); }
.sv-sec { margin-top: 26px; }
.sv-sec > h2, .sv-sec > h3 { font-family: var(--font-display); font-size: clamp(20px, 2.6vw, 26px); font-weight: 700; letter-spacing: -.02em; color: var(--ink); margin: 0 0 12px; }
.sv-sec > p, .hint { color: var(--muted); font-size: 15.5px; line-height: 1.6; }
.sv-q { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px 22px; box-shadow: var(--sh-1); margin-bottom: 14px; }
.q-tag { display: inline-block; font-size: 13px; font-weight: 600; color: var(--accent-deep); background: var(--accent-soft); border-radius: var(--r-pill); padding: 4px 10px; margin-bottom: 8px; }
.q-text { color: var(--ink); font-size: 18px; line-height: 1.5; font-weight: 600; margin: 0 0 12px; }
.sv-textarea, .sv-sec textarea, .sv-sec input[type=text] { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; }
.sv-textarea:focus, .sv-sec textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
.opt, .box { display: flex; align-items: center; gap: 12px; font-size: 16.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 13px 16px; margin-bottom: 8px; cursor: pointer; transition: all .16s var(--ease); }
.opt:hover, .box:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--ink); }
.opt input, .box input { width: 20px; height: 20px; accent-color: var(--accent); }
.opt.is-on, .box.is-on, .opt:has(input:checked), .box:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.sv-submit { font: inherit; font-size: 17px; font-weight: 600; color: #fff; background: var(--grad-accent); border: 0; border-radius: var(--r-pill); padding: 15px 26px; cursor: pointer; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 26%, transparent); }
.sv-submit:hover { box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 34%, transparent); }
.sv-err { color: #B42318; background: #FEF3F2; border: 1px solid #FECDCA; border-radius: 12px; padding: 10px 12px; font-size: 14.5px; }
.sv-err:empty { display: none; }
.res-head { display: grid; gap: 10px; }
.res-score { font-family: var(--font-display); color: var(--ink); }
.res-score .big { font-size: clamp(34px, 5vw, 52px); font-weight: 700; letter-spacing: -.03em; }
.res-score .lbl { color: var(--muted); font-size: 15px; }
.res-q { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 16px 18px; margin-bottom: 10px; }
.res-q .t { color: var(--ink); font-size: 16.5px; font-weight: 600; margin-bottom: 8px; }
.trk { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.fill { height: 100%; border-radius: 999px; background: var(--grad-accent); }
.fill.win { background: var(--grad-brand); }
.cnt { color: var(--muted); font-size: 14.5px; }
.res-comment { color: var(--ink-2); font-size: 16px; line-height: 1.6; }
.res-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.hint { margin-top: 8px; }
@media (max-width: 640px) {
  .sv-q { padding: 16px; }
  .q-text { font-size: 16.5px; }
  .sv-main { padding: 14px 0 30px; }
}
html.dark .sv-q, html.dark .res-q { background: var(--surface); }
html.dark .sv-note, html.dark .opt, html.dark .box { background: var(--surface-2); }
html.dark .sv-err { color: #FFB4AB; background: #3A1D1A; border-color: #5C2A24; }

/* STAGE-A4: оранжевые штрихи — разбавляем синий в меру */
.btn-primary:hover { background: var(--grad-brand); box-shadow: 0 10px 26px rgba(201,64,44,.28); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-deep); }
.nav-cta:hover { background: var(--grad-brand); }
.nav-links a[aria-current="page"] { position: relative; }
.nav-links a[aria-current="page"]::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--brand); }
.foot-links a:hover, .crumbs a:hover { color: var(--brand-deep); }
.toc-chip:hover, .hub-chip:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); color: var(--brand-deep); }
.pager-btn:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); color: var(--brand-deep); }
.topic-card:hover, .test-card:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.subject:hover { border-color: color-mix(in srgb, var(--brand) 42%, var(--line)); }
.link-more { color: var(--brand-deep); }
.link-more:hover { color: var(--brand); }
.art-map-num { background: var(--brand-soft); color: var(--brand-deep); }
.art-map-ico svg { stroke: var(--brand); }
::selection { background: color-mix(in srgb, var(--brand) 26%, transparent); }
.eyebrow { color: var(--accent-deep); }
.eyebrow::after { content: ""; display: inline-block; width: 26px; height: 2px; margin-left: 10px; vertical-align: middle; border-radius: 2px; background: var(--brand); }

/* STAGE-BC: страницы статей и тестов в новой теме */
.art-main, .tst-main { max-width: 1080px; margin: 0 auto; padding: clamp(16px, 2.4vw, 28px) 0 clamp(24px, 3vw, 40px); }
.art-hero { display: grid; gap: 12px; margin-bottom: 20px; }
.art-hero h1 { font-family: var(--font-display); font-size: clamp(26px, 3.6vw, 40px); font-weight: 700; letter-spacing: -.03em; line-height: 1.12; color: var(--ink); margin: 0; }
.art-lead { color: var(--ink-2); font-size: 18px; line-height: 1.7; margin: 0; max-width: 74ch; }
.art-tag { justify-self: start; font-size: 13.5px; font-weight: 600; color: var(--accent-deep); background: var(--accent-soft); border-radius: var(--r-pill); padding: 6px 12px; }
.art-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 15px; }
.art-toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px 20px; box-shadow: var(--sh-1); }
.art-toc-title { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.art-toc a { display: block; color: var(--ink-2); font-size: 16px; line-height: 1.6; padding: 4px 0; }
.art-toc a:hover { color: var(--brand-deep); }
.art-body { font-size: 18px; line-height: 1.78; color: var(--ink-2); }
.art-body h2 { font-family: var(--font-display); font-size: clamp(21px, 2.4vw, 27px); font-weight: 700; letter-spacing: -.02em; color: var(--ink); margin: 32px 0 12px; }
.art-body h3 { font-size: 19px; color: var(--ink); margin: 24px 0 10px; }
.art-body p, .art-body li { font-size: 18px; line-height: 1.78; color: var(--ink-2); }
.art-body p { margin: 0 0 14px; }
.art-body ul, .art-body ol { padding-left: 22px; margin: 0 0 14px; }
.art-body li::marker { color: var(--brand); }
.art-callout { display: flex; gap: 12px; background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 14px; padding: 16px 18px; margin: 18px 0; }
.art-callout.callout-blue, .art-callout.blue { border-left-color: var(--brand); }
.art-callout .co-ic svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; }
.art-callout.callout-blue .co-ic svg { stroke: var(--brand); }
.art-callout .co-body { color: var(--ink-2); font-size: 16.5px; line-height: 1.65; }
.art-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; background: linear-gradient(150deg, #F5F8FF, #FFFFFF); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px 22px; margin: 26px 0 6px; }
html.dark .art-cta { background: linear-gradient(150deg, #17223C, #101A2E); }
.crumbs, .sep { color: var(--muted); font-size: 15px; }
.crumbs a { color: var(--ink-2); }
/* тест */
.quiz-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--sh-2); padding: clamp(18px, 2.6vw, 30px); }
.quiz-progress { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.quiz-progress-fill { height: 100%; border-radius: 999px; background: var(--grad-accent); }
.quiz-progress-text { color: var(--muted); font-size: 14.5px; margin-top: 8px; }
.qb-status, .quiz-status { color: var(--muted); font-size: 15px; }
.qq-head { display: flex; gap: 10px; align-items: baseline; }
.qq-num { color: var(--muted); font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.qq-text { color: var(--ink); font-size: 20px; font-weight: 600; line-height: 1.42; margin: 8px 0 16px; }
.qq-opts { display: grid; gap: 10px; }
.qq-opt { display: flex; align-items: center; gap: 12px; font-size: 16.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; cursor: pointer; transition: all .16s var(--ease); }
.qq-opt:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); color: var(--ink); }
.qq-opt.ok, .qq-opt.is-ok, .qq-opt.correct { border-color: #12855C; background: rgba(18,133,92,.09); color: var(--ink); }
.qq-opt.bad, .qq-opt.is-bad, .qq-opt.wrong { border-color: #D6455B; background: rgba(214,69,91,.09); color: var(--ink); }
.qq-expl { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 12px; padding: 14px 16px; margin-top: 14px; color: var(--ink-2); font-size: 16px; line-height: 1.62; }
@media (max-width: 640px) {
  .art-body, .art-body p, .art-body li { font-size: 17px; line-height: 1.72; }
  .qq-text { font-size: 18px; }
  .qq-opt { font-size: 16px; padding: 13px 14px; }
}

/* STAGE-BC: страницы статей и тестов в новой теме */
.art-main, .tst-main { max-width: 1080px; margin: 0 auto; padding: clamp(16px, 2.4vw, 28px) 0 clamp(24px, 3vw, 40px); }
.art-hero { display: grid; gap: 12px; margin-bottom: 20px; }
.art-hero h1 { font-family: var(--font-display); font-size: clamp(26px, 3.6vw, 40px); font-weight: 700; letter-spacing: -.03em; line-height: 1.12; color: var(--ink); margin: 0; }
.art-lead { color: var(--ink-2); font-size: 18px; line-height: 1.7; margin: 0; max-width: 74ch; }
.art-tag { justify-self: start; font-size: 13.5px; font-weight: 600; color: var(--accent-deep); background: var(--accent-soft); border-radius: var(--r-pill); padding: 6px 12px; }
.art-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 15px; }
.art-toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px 20px; box-shadow: var(--sh-1); }
.art-toc-title { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.art-toc a { display: block; color: var(--ink-2); font-size: 16px; line-height: 1.6; padding: 4px 0; }
.art-toc a:hover { color: var(--brand-deep); }
.art-body { font-size: 18px; line-height: 1.78; color: var(--ink-2); }
.art-body h2 { font-family: var(--font-display); font-size: clamp(21px, 2.4vw, 27px); font-weight: 700; letter-spacing: -.02em; color: var(--ink); margin: 32px 0 12px; }
.art-body h3 { font-size: 19px; color: var(--ink); margin: 24px 0 10px; }
.art-body p, .art-body li { font-size: 18px; line-height: 1.78; color: var(--ink-2); }
.art-body p { margin: 0 0 14px; }
.art-body ul, .art-body ol { padding-left: 22px; margin: 0 0 14px; }
.art-body li::marker { color: var(--brand); }
.art-callout { display: flex; gap: 12px; background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 14px; padding: 16px 18px; margin: 18px 0; }
.art-callout.callout-blue, .art-callout.blue { border-left-color: var(--brand); }
.art-callout .co-ic svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; }
.art-callout.callout-blue .co-ic svg { stroke: var(--brand); }
.art-callout .co-body { color: var(--ink-2); font-size: 16.5px; line-height: 1.65; }
.art-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; background: linear-gradient(150deg, #F5F8FF, #FFFFFF); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px 22px; margin: 26px 0 6px; }
html.dark .art-cta { background: linear-gradient(150deg, #17223C, #101A2E); }
.crumbs, .sep { color: var(--muted); font-size: 15px; }
.crumbs a { color: var(--ink-2); }
/* тест */
.quiz-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--sh-2); padding: clamp(18px, 2.6vw, 30px); }
.quiz-progress { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.quiz-progress-fill { height: 100%; border-radius: 999px; background: var(--grad-accent); }
.quiz-progress-text { color: var(--muted); font-size: 14.5px; margin-top: 8px; }
.qb-status, .quiz-status { color: var(--muted); font-size: 15px; }
.qq-head { display: flex; gap: 10px; align-items: baseline; }
.qq-num { color: var(--muted); font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.qq-text { color: var(--ink); font-size: 20px; font-weight: 600; line-height: 1.42; margin: 8px 0 16px; }
.qq-opts { display: grid; gap: 10px; }
.qq-opt { display: flex; align-items: center; gap: 12px; font-size: 16.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; cursor: pointer; transition: all .16s var(--ease); }
.qq-opt:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); color: var(--ink); }
.qq-opt.ok, .qq-opt.is-ok, .qq-opt.correct { border-color: #12855C; background: rgba(18,133,92,.09); color: var(--ink); }
.qq-opt.bad, .qq-opt.is-bad, .qq-opt.wrong { border-color: #D6455B; background: rgba(214,69,91,.09); color: var(--ink); }
.qq-expl { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 12px; padding: 14px 16px; margin-top: 14px; color: var(--ink-2); font-size: 16px; line-height: 1.62; }
@media (max-width: 640px) {
  .art-body, .art-body p, .art-body li { font-size: 17px; line-height: 1.72; }
  .qq-text { font-size: 18px; }
  .qq-opt { font-size: 16px; padding: 13px 14px; }
}

/* STAGE-BC-FIX: правила теста сильнее прежних */
.quiz-wrap .qq-text, .quiz-q .qq-text { font-size: 20px; font-weight: 600; line-height: 1.42; color: var(--ink); }
.quiz-wrap .qq-opt, .quiz-q .qq-opt, .qq-opts .qq-opt { font-size: 16.5px; color: var(--ink-2); padding: 14px 16px; }
.quiz-wrap .qq-num, .quiz-q .qq-num { font-size: 14.5px; color: var(--muted); }
.quiz-wrap .qq-expl, .quiz-q .qq-expl { font-size: 16px; color: var(--ink-2); }
.tst-head p { font-size: 16.5px; }
@media (max-width: 640px) {
  .quiz-wrap .qq-text, .quiz-q .qq-text { font-size: 18px; }
  .quiz-wrap .qq-opt, .quiz-q .qq-opt { font-size: 16px; }
}

/* STAGE-A2b: дополнения для анкеты */
.sv-main { max-width: 920px; margin: 0 auto; }
.sv-q .q-text, .q-text { font-size: 18px; font-weight: 600; line-height: 1.5; color: var(--ink); }
.sv-q .opt, .sv-q .box { font-size: 16.5px; }
.sv-sec h2, .sv-sec h3, .sv-sec > .sv-sec-title { font-size: clamp(20px, 2.6vw, 26px); }
.opt-row, .opt-i { display: grid; gap: 8px; }
.res-q .t { font-size: 16.5px; }
.bar.win .fill, .fill.win { background: var(--grad-brand); }
.sv-hero h1 + p { margin-top: 4px; }

/* STAGE-FIX3: алиасы переменных прежних таблиц статей и тестов + выбор ответов */
:root {
  --hairline: var(--line);
  --border: var(--line);
  --bg-alt: var(--surface-2);
  --text: var(--ink);
  --text2: var(--ink-2);
  --label: var(--muted);
  --accent-light: var(--accent-soft);
  --cyan: var(--accent);
  --cyan-light: var(--accent-soft);
  --yellow-light: var(--brand-soft);
  --green: #12855C;
  --green-light: rgba(18,133,92,.10);
  --err: #D6455B;
  --err-bg: rgba(214,69,91,.10);
  --r-xs: 10px;
  --r-md: var(--r-sm);
  --r-lg: var(--r-card);
  --r-xl: 28px;
  --shadow-sm: var(--sh-1);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
/* выбор в анкете: движок ставит класс sel */
.opt .box, .box { width: 20px; height: 20px; flex: 0 0 auto; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: inline-block; }
.opt.sel, .box.sel { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.opt.sel .box { border-color: var(--accent); background: var(--accent); }
.opt.multi .box { border-radius: 6px; }
/* ответы теста */
.qq-opt { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 14px 16px; font-size: 16.5px; color: var(--ink-2); cursor: pointer; }
.qq-opt:hover:not(.ok):not(.bad) { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); background: var(--surface-2); }
.quiz-q.answered .qq-opt { cursor: default; }
.qq-opt.ok { border-color: #12855C; background: rgba(18,133,92,.10); color: #0B5F42; font-weight: 600; }
.qq-opt.bad { border-color: #D6455B; background: rgba(214,69,91,.10); color: #B4263C; }
.qq-expl { border-left-color: var(--accent); }
/* статья: шире текст, читаемые ссылки */
.art-main { max-width: 1240px; }
.art-hero, .art-lead, .art-body { max-width: none; }
.art-body p, .art-body li { max-width: 88ch; }
.art-body a { color: var(--accent-deep); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.art-body a:hover { color: var(--brand-deep); }
.art-body strong, .art-body b { color: var(--ink); }
.art-toc, .art-cta, .art-callout { max-width: 88ch; }
@media (max-width: 1020px) { .art-body p, .art-body li { max-width: none; } }
html.dark .qq-opt { background: var(--surface); color: var(--ink-2); }
html.dark .qq-opt.ok { color: #8FE3BE; }
html.dark .qq-opt.bad { color: #FFB4AB; }
html.dark .art-body a { color: #9CBBFF; }

/* STAGE-FIX4: блок-призыв в статьях — светлая подложка и читаемый текст */
.art-body .art-cta, .art-cta {
  background: linear-gradient(150deg, #F4F7FF, #FFFFFF) !important;
  border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px 22px;
}
.art-cta p { color: var(--ink-2); font-size: 16.5px; line-height: 1.6; max-width: none; }
.art-cta p a, .art-cta a:not([class]) { color: var(--accent-deep) !important; text-decoration: underline; text-underline-offset: 3px; }
.art-cta p a:hover, .art-cta a:not([class]):hover { color: var(--brand-deep) !important; }
.art-cta .btn-ghost { color: var(--ink) !important; background: var(--surface); border: 1px solid var(--line); }
.art-cta .btn-ghost:hover { color: var(--brand-deep) !important; border-color: var(--brand); }
.art-cta .btn-white { color: #fff !important; background: var(--grad-accent); border: 0; }
.art-cta-btns { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
html.dark .art-body .art-cta, html.dark .art-cta { background: linear-gradient(150deg, #17223C, #101A2E) !important; }
html.dark .art-cta p { color: var(--ink-2); }
html.dark .art-cta p a, html.dark .art-cta a:not([class]) { color: #9CBBFF !important; }
html.dark .art-cta .btn-ghost { color: var(--ink) !important; background: var(--surface); }

/* STAGE-D: мелочи мобильной вёрстки */
@media (max-width: 820px) {
  input[type=search], input[type=text], input[type=password], input[type=email], textarea, select, .hub-search, .hub-search input { font-size: 16px; }
  .hub-search { padding-top: 13px; padding-bottom: 13px; }
}
