/* «Первая смена»: один файл стилей. Токены, база, компоненты, страницы.
   Без inline-стилей и внешних шрифтов (этого требует CSP). */

/* ---------- 1. Токены ---------- */
:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;

  --fs-12: 12px; --fs-13: 13px; --fs-15: 15px; --fs-17: 17px; --fs-21: 21px; --fs-28: 28px; --fs-40: 40px; --fs-52: 52px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;

  --bg: #f5f5f7;
  --surface: #ffffff;
  --fill: #f2f2f4;
  --fill-hover: #e8e8ed;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --sep: rgba(0, 0, 0, .08);
  --sep-strong: rgba(0, 0, 0, .14);
  --nav-bg: rgba(251, 251, 253, .78);

  /* Акцент: спокойный изумрудный. Белый текст на #0a7a63 даёт контраст 5.3 (AA) */
  --accent: #0a7a63;
  --accent-hover: #08664f;
  --accent-text: #0a7a63;
  --accent-soft: rgba(10, 122, 99, .10);
  --accent-ring: rgba(10, 122, 99, .24);
  --on-accent: #ffffff;

  --orange: #b25000;
  --orange-soft: rgba(255, 149, 0, .14);
  --red: #c4171c;
  --red-soft: rgba(255, 59, 48, .10);
  --blue: #0062c4;
  --blue-soft: rgba(0, 113, 227, .09);
  --gray-soft: rgba(110, 110, 115, .12);
  --yellow-soft: rgba(255, 204, 0, .20);
  --yellow-line: rgba(196, 140, 0, .55);

  --r-card: 22px;
  --r-tile: 18px;
  --r-field: 12px;
  --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
  --sh-2: 0 2px 6px rgba(0, 0, 0, .05), 0 16px 40px rgba(0, 0, 0, .08);

  --ease: cubic-bezier(.25, .1, .25, 1);
  --t: 180ms;
  --container: 1120px;
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --fill: #2c2c2e;
    --fill-hover: #3a3a3c;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --sep: rgba(255, 255, 255, .10);
    --sep-strong: rgba(255, 255, 255, .18);
    --nav-bg: rgba(22, 22, 23, .78);

    /* В тёмной теме светлый акцент и тёмный текст на нём (контраст 7.7) */
    --accent: #34c3a0;
    --accent-hover: #4fd3b1;
    --accent-text: #34c3a0;
    --accent-soft: rgba(52, 195, 160, .16);
    --accent-ring: rgba(52, 195, 160, .32);
    --on-accent: #0b1f1a;

    --orange: #ffb340;
    --orange-soft: rgba(255, 159, 10, .18);
    --red: #ff6961;
    --red-soft: rgba(255, 69, 58, .16);
    --blue: #64aaff;
    --blue-soft: rgba(10, 132, 255, .18);
    --gray-soft: rgba(160, 160, 165, .16);
    --yellow-soft: rgba(255, 214, 10, .14);
    --yellow-line: rgba(255, 214, 10, .45);

    --sh-1: none;
    --sh-2: none;
  }
}

/* ---------- 2. База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); font-size: var(--fs-17); line-height: 1.47; letter-spacing: -0.016em;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
h1, h2, h3 { text-wrap: balance; letter-spacing: -0.024em; }
p { text-wrap: pretty; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-ring); }
img, svg { max-width: 100%; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; }
.icon { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.icon--sm { width: 16px; height: 16px; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-13); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.pre { white-space: pre-line; }
.break { overflow-wrap: anywhere; }
.right { text-align: right; }
.mb-2 { margin-bottom: var(--s-4); } .mb-3 { margin-bottom: var(--s-6); }
.mt-1 { margin-top: var(--s-2); } .mt-2 { margin-top: var(--s-4); } .mt-3 { margin-top: var(--s-6); } .mt-4 { margin-top: var(--s-10); }
.stack > * + * { margin-top: var(--s-4); }
.stack-sm > * + * { margin-top: var(--s-2); }
.row { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.container--narrow { max-width: calc(760px + var(--gutter) * 2); }
.main { flex: 1; padding: var(--s-8) 0 var(--s-16); }
.skip { position: absolute; left: var(--s-4); top: -100px; z-index: 100; padding: var(--s-2) var(--s-4); border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--sh-2); }
.skip:focus { top: var(--s-2); }

/* ---------- 3. Навигация ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; background: var(--nav-bg);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--sep);
}
.nav__row { height: 56px; display: flex; align-items: center; gap: var(--s-4); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; letter-spacing: -0.02em; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand__sub { display: block; font-size: var(--fs-12); font-weight: 400; color: var(--text-2); letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.logo-mark { flex: none; display: block; }
.nav__links { display: flex; gap: var(--s-1); margin-left: auto; align-items: center; }
.nav__links a, .linkbtn {
  padding: 6px 12px; border-radius: var(--r-pill); font-size: var(--fs-13); color: var(--text-2);
  background: none; border: 0; font-family: inherit; cursor: pointer;
}
.nav__links a:hover, .linkbtn:hover { color: var(--text); text-decoration: none; }
.nav__links a[aria-current="page"] { color: var(--text); background: var(--fill); }
.nav__links form { margin: 0; }

.subnav { border-bottom: 1px solid var(--sep); background: var(--nav-bg); }
.subnav__scroll { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; padding: 6px 0; }
.subnav__scroll::-webkit-scrollbar { display: none; }
.subnav a {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 7px 12px; border-radius: var(--r-pill); font-size: var(--fs-13); color: var(--text-2); white-space: nowrap;
}
.subnav a .icon { width: 16px; height: 16px; }
.subnav a:hover { color: var(--text); background: var(--fill); text-decoration: none; }
.subnav a[aria-current="page"] { color: var(--accent-text); background: var(--accent-soft); font-weight: 600; }
.subnav .count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 11px; display: inline-grid; place-items: center; font-weight: 600; }

.foot { border-top: 1px solid var(--sep); padding: var(--s-6) 0 var(--s-8); font-size: var(--fs-13); color: var(--text-2); }
.foot__row { display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }

/* ---------- 4. Заголовки страниц ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-6); }
.page-head h1 { font-size: var(--fs-40); line-height: 1.1; font-weight: 700; }
.page-head p { color: var(--text-2); margin-top: var(--s-2); max-width: 640px; }
.eyebrow { font-size: var(--fs-13); font-weight: 600; color: var(--accent-text); letter-spacing: 0; text-transform: none; margin-bottom: var(--s-2); display: inline-flex; gap: 6px; align-items: center; }
.h2 { font-size: var(--fs-21); font-weight: 600; line-height: 1.25; }
.h3 { font-size: var(--fs-17); font-weight: 600; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin: var(--s-10) 0 var(--s-4); flex-wrap: wrap; }
.section-title:first-child { margin-top: 0; }

/* ---------- 5. Карточки ---------- */
.card { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--sh-1); padding: var(--s-6); min-width: 0; }
.card--flush { padding: 0; overflow: hidden; }
.card--soft { background: var(--fill); box-shadow: none; }
.card--accent { background: var(--accent-soft); box-shadow: none; }
.card__title { font-size: var(--fs-17); font-weight: 600; margin-bottom: var(--s-3); display: flex; gap: var(--s-2); align-items: center; }
.card__title .icon { color: var(--accent-text); }
.grid { display: grid; gap: var(--s-4); }
.grid-2 { display: grid; gap: var(--s-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: var(--s-4); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.layout-side { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }

/* плитки обзора */
.tiles { display: grid; gap: var(--s-3); grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tile { background: var(--surface); border-radius: var(--r-tile); box-shadow: var(--sh-1); padding: var(--s-4) var(--s-5); min-width: 0; }
.tile__value { font-size: var(--fs-28); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile__label { font-size: var(--fs-13); color: var(--text-2); margin-top: var(--s-1); line-height: 1.3; }
.tile--accent .tile__value { color: var(--accent-text); }
.tile--warn .tile__value { color: var(--orange); }

.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-2) var(--s-4); font-size: var(--fs-15); }
.kv dt { color: var(--text-2); }
.kv dd { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }

/* ---------- 6. Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 18px; border-radius: var(--r-pill); border: 0;
  font: inherit; font-size: var(--fs-15); font-weight: 500; letter-spacing: -0.01em; line-height: 1.2;
  cursor: pointer; text-align: center; white-space: nowrap;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.btn:hover { text-decoration: none; }
.btn .icon { width: 18px; height: 18px; }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--secondary { background: var(--accent-soft); color: var(--accent-text); }
.btn--secondary:hover { background: var(--accent-ring); }
.btn--ghost { background: var(--fill); color: var(--text); }
.btn--ghost:hover { background: var(--fill-hover); }
.btn--danger { background: var(--red-soft); color: var(--red); }
.btn--danger:hover { background: var(--red); color: #fff; }
.btn--sm { min-height: 32px; padding: 0 12px; font-size: var(--fs-13); }
.btn--lg { min-height: 50px; padding: 0 26px; font-size: var(--fs-17); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
.btn-row form { margin: 0; }
.inline-form { display: inline; margin: 0; }

/* ---------- 7. Бейджи ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 8px; border-radius: var(--r-pill);
  font-size: var(--fs-12); font-weight: 600; letter-spacing: 0; white-space: nowrap; line-height: 1.4;
  background: var(--gray-soft); color: var(--text-2);
}
.badge .icon { width: 14px; height: 14px; }
.badge--ready, .badge--admitted, .badge--checked, .badge--ok, .badge--accent { background: var(--accent-soft); color: var(--accent-text); }
.badge--lagging, .badge--warn { background: var(--orange-soft); color: var(--orange); }
.badge--learning, .badge--checking, .badge--info { background: var(--blue-soft); color: var(--blue); }
.badge--invited { background: var(--fill); color: var(--text); }
.badge--dismissed, .badge--anonymized { background: var(--gray-soft); color: var(--text-2); }
.badge--error { background: var(--red-soft); color: var(--red); }

/* ---------- 8. Баннеры ---------- */
.banners { display: flex; flex-direction: column; gap: var(--s-2); margin-bottom: var(--s-6); }
.banner { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); border-radius: var(--r-tile); background: var(--fill); }
.banner > .icon { margin-top: 2px; }
.banner__body { flex: 1; min-width: 0; font-size: var(--fs-15); }
.banner__title { font-weight: 600; }
.banner__text { color: var(--text-2); font-size: var(--fs-13); margin-top: 2px; }
.banner .btn { flex: none; align-self: center; }
.banner form { margin: 0; align-self: center; }
.banner--info { background: var(--accent-soft); } .banner--info > .icon { color: var(--accent-text); }
.banner--warn { background: var(--orange-soft); } .banner--warn > .icon { color: var(--orange); }
.banner--error { background: var(--red-soft); } .banner--error > .icon { color: var(--red); }
.banner--ok { background: var(--accent-soft); } .banner--ok > .icon { color: var(--accent-text); }
.banner--admin { background: var(--blue-soft); } .banner--admin > .icon { color: var(--blue); }
.banner--demo { background: var(--yellow-soft); }

.list-warn, .list-err { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-13); }
.list-warn li, .list-err li { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border-radius: 10px; }
.list-warn li { background: var(--yellow-soft); }
.list-err li { background: var(--red-soft); color: var(--red); font-weight: 500; }
.list-warn .icon, .list-err .icon { width: 16px; height: 16px; margin-top: 2px; }

/* ---------- 9. Таблицы (на телефоне превращаются в карточки) ---------- */
.table-wrap { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--sh-1); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-15); }
.table th { text-align: left; font-size: var(--fs-12); font-weight: 600; color: var(--text-2); padding: 12px 16px; border-bottom: 1px solid var(--sep); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--sep); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--fill); }
.table .right { text-align: right; }
.table a.rowlink { color: var(--text); font-weight: 600; }
.table__sub { display: block; font-size: var(--fs-13); color: var(--text-2); }

/* ---------- 10. Формы ---------- */
.form { display: flex; flex-direction: column; gap: var(--s-4); }
.form-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.label { font-size: var(--fs-13); font-weight: 600; color: var(--text); }
.help { font-size: var(--fs-13); color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--r-field);
  border: 1px solid transparent; background: var(--fill); color: var(--text);
  font: inherit; font-size: var(--fs-15); -webkit-appearance: none; appearance: none;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), background-color var(--t) var(--ease);
}
.select { padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
.textarea { min-height: 120px; line-height: 1.5; resize: vertical; }
.textarea--lg { min-height: 260px; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--sep-strong); }
.input:focus, .select:focus, .textarea:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.input[type="file"] { padding: 9px 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: var(--fs-15); }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.radio-list { display: flex; flex-direction: column; gap: var(--s-2); }
.option-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-3); align-items: center; }
.option-row input[type="radio"] { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.errors { background: var(--red-soft); color: var(--red); border-radius: var(--r-tile); padding: var(--s-3) var(--s-4); font-size: var(--fs-15); }
.errors ul { margin: 6px 0 0; padding-left: 20px; }
.filters { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; margin-bottom: var(--s-4); }
.filters .select, .filters .input { width: auto; min-height: 36px; padding-top: 6px; padding-bottom: 6px; font-size: var(--fs-13); background-position: calc(100% - 18px) 15px, calc(100% - 13px) 15px; }
.seg { display: inline-flex; background: var(--fill); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.seg a { padding: 5px 12px; border-radius: var(--r-pill); font-size: var(--fs-13); color: var(--text-2); }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg a[aria-current="true"] { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); font-weight: 600; }

/* ---------- 11. Флэш и пустые состояния ---------- */
.flash { display: flex; gap: var(--s-2); align-items: center; padding: var(--s-3) var(--s-4); border-radius: var(--r-tile); margin-bottom: var(--s-4); font-size: var(--fs-15); font-weight: 500; white-space: pre-line; }
.flash--ok { background: var(--accent-soft); color: var(--text); }
.flash--warn { background: var(--orange-soft); color: var(--text); }
.flash--info { background: var(--blue-soft); color: var(--text); }
.empty { text-align: center; padding: var(--s-10) var(--s-6); color: var(--text-2); }
.empty .icon { width: 32px; height: 32px; color: var(--text-2); margin-bottom: var(--s-2); }
.empty__title { color: var(--text); font-weight: 600; margin-bottom: 4px; }

/* ---------- 12. Прогресс, шаги ---------- */
progress { width: 100%; height: 8px; border-radius: 4px; overflow: hidden; -webkit-appearance: none; appearance: none; border: 0; background: var(--fill); }
progress::-webkit-progress-bar { background: var(--fill); border-radius: 4px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 4px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 4px; }
.steps { list-style: none; padding: 0; display: grid; gap: var(--s-2); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.steps a { display: flex; gap: var(--s-2); align-items: center; padding: var(--s-3) var(--s-4); border-radius: var(--r-tile); background: var(--surface); box-shadow: var(--sh-1); color: var(--text); font-size: var(--fs-15); font-weight: 500; height: 100%; }
.steps a:hover { text-decoration: none; box-shadow: var(--sh-2); }
.steps .dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--text-2); flex: none; font-size: var(--fs-12); font-weight: 700; }
.steps .is-done .dot { background: var(--accent); color: var(--on-accent); }
.steps .is-done { color: var(--text-2); }

/* ---------- 13. Программа (редактор) ---------- */
.day { scroll-margin-top: 120px; }
.day__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); flex-wrap: wrap; }
.day__num { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; margin-right: var(--s-2); }
.items { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.item { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); border-radius: var(--r-tile); background: var(--fill); }
.item__icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); color: var(--accent-text); flex: none; }
.item__body { flex: 1; min-width: 0; }
.item__title { font-weight: 600; font-size: var(--fs-15); overflow-wrap: anywhere; }
.item__meta { font-size: var(--fs-13); color: var(--text-2); margin-top: 2px; overflow-wrap: anywhere; }
.item__actions { display: flex; gap: var(--s-1); flex-wrap: wrap; justify-content: flex-end; }
.item--off { opacity: .62; }
.item--missing { background: var(--yellow-soft); box-shadow: inset 3px 0 0 var(--yellow-line); }
.mark-missing { background: var(--yellow-soft); border-radius: 6px; padding: 0 4px; }

/* ---------- 14. Чат «Проверить бота» ---------- */
.chat { display: flex; flex-direction: column; gap: var(--s-3); }
.chat__log { display: flex; flex-direction: column; gap: var(--s-3); min-height: 200px; }
.bubble { max-width: 86%; padding: 10px 14px; border-radius: 20px; font-size: var(--fs-15); line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.bubble--me { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 6px; }
.bubble--bot { align-self: flex-start; background: var(--fill); border-bottom-left-radius: 6px; }
.bubble--mgr { align-self: flex-start; background: var(--blue-soft); border-bottom-left-radius: 6px; }
.bubble__meta { display: block; font-size: var(--fs-12); color: var(--text-2); margin-top: 6px; }
.bubble__actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.chat__form { display: flex; gap: var(--s-2); }
.chat__form .input { flex: 1; }
.quiz-opts { display: flex; flex-direction: column; gap: var(--s-2); }
.quiz-opt { width: 100%; justify-content: flex-start; text-align: left; white-space: normal; min-height: 46px; padding: 10px 16px; border-radius: 14px; }
.lesson-body { white-space: pre-line; font-size: var(--fs-15); line-height: 1.55; }

/* ---------- 15. Лендинг ---------- */
.hero { padding: var(--s-12) 0 var(--s-10); text-align: center; }
.hero__title { font-size: var(--fs-52); line-height: 1.06; font-weight: 700; letter-spacing: -0.035em; max-width: 860px; margin: 0 auto; }
.hero__lead { font-size: var(--fs-21); color: var(--text-2); max-width: 660px; margin: var(--s-5) auto 0; line-height: 1.4; text-wrap: balance; }
.hero__cta { display: flex; gap: var(--s-3); justify-content: center; margin-top: var(--s-8); flex-wrap: wrap; }
.hero__note { margin-top: var(--s-3); font-size: var(--fs-13); color: var(--text-2); }
.preview { margin: var(--s-10) auto 0; max-width: 820px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-4); text-align: left; }
.phone { background: var(--surface); border-radius: 28px; box-shadow: var(--sh-2); padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); }
.phone__head { display: flex; gap: 10px; align-items: center; font-size: var(--fs-13); color: var(--text-2); padding-bottom: var(--s-2); border-bottom: 1px solid var(--sep); }
.mini-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
.mini-tiles .tile { box-shadow: none; background: var(--fill); padding: var(--s-3) var(--s-4); }
.mini-tiles .tile__value { font-size: var(--fs-21); }
.band { padding: var(--s-12) 0; }
.band__title { font-size: var(--fs-40); font-weight: 700; text-align: center; margin-bottom: var(--s-3); line-height: 1.12; }
.band__lead { text-align: center; color: var(--text-2); font-size: var(--fs-17); max-width: 620px; margin: 0 auto var(--s-8); }
.how { counter-reset: how; }
.how__step { position: relative; }
.how__n { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; margin-bottom: var(--s-3); }
.feature .icon { width: 28px; height: 28px; color: var(--accent-text); margin-bottom: var(--s-3); }
.feature h3 { font-size: var(--fs-17); margin-bottom: 6px; }
.feature p { color: var(--text-2); font-size: var(--fs-15); }
.calc { max-width: 760px; margin: 0 auto; }
.calc__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-4); padding: var(--s-3) 0; border-bottom: 1px solid var(--sep); font-size: var(--fs-15); }
.calc__row:last-child { border-bottom: 0; }
.calc__row b { font-variant-numeric: tabular-nums; }
.calc__total { font-size: var(--fs-21); }
.calc__note { font-size: var(--fs-13); color: var(--text-2); margin-top: var(--s-3); }
.price { display: flex; flex-direction: column; gap: var(--s-3); }
.price--current { box-shadow: 0 0 0 2px var(--accent), var(--sh-1); }
.price__name { font-size: var(--fs-21); font-weight: 700; }
.price__value { font-size: var(--fs-28); font-weight: 700; letter-spacing: -0.03em; }
.price__value small { font-size: var(--fs-15); font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.price ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-15); }
.price li { display: flex; gap: 8px; align-items: flex-start; }
.price li .icon { width: 18px; height: 18px; color: var(--accent-text); margin-top: 3px; }
.faq { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--s-2); }
.faq details { background: var(--surface); border-radius: var(--r-tile); box-shadow: var(--sh-1); padding: var(--s-4) var(--s-5); }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: var(--s-3); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-2); font-weight: 400; font-size: var(--fs-21); line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin-top: var(--s-2); color: var(--text-2); font-size: var(--fs-15); }

/* ---------- 16. Вход ---------- */
.auth { max-width: 420px; margin: var(--s-10) auto 0; }
.auth h1 { font-size: var(--fs-28); margin-bottom: var(--s-2); }

/* ---------- 17. Ссылка-приглашение ---------- */
.invite { display: flex; gap: var(--s-2); align-items: center; padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4); background: var(--fill); border-radius: var(--r-pill); }
.invite code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-big { font-size: var(--fs-28); font-weight: 700; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.secret { padding: var(--s-4); border-radius: var(--r-tile); background: var(--yellow-soft); }

/* ---------- 18. Документ ---------- */
.clauses { list-style: none; padding: 0; display: flex; flex-direction: column; }
.clause { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--sep); }
.clause:last-child { border-bottom: 0; }
.clause__code { font-weight: 700; color: var(--accent-text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.clause__title { font-weight: 600; font-size: var(--fs-15); }
.clause__text { font-size: var(--fs-15); color: var(--text-2); white-space: pre-line; overflow-wrap: anywhere; }

/* ---------- 19. Адаптив ---------- */
@media (max-width: 1000px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .layout-side { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .main { padding-top: var(--s-6); }
  .page-head h1 { font-size: var(--fs-28); }
  .hero { padding-top: var(--s-8); }
  .hero__title { font-size: 36px; }
  .hero__lead { font-size: var(--fs-17); }
  .band { padding: var(--s-10) 0; }
  .band__title { font-size: var(--fs-28); }
  .grid-2, .grid-3, .form-grid, .form-grid--3, .preview { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .card { padding: var(--s-5); }
  .brand__sub { max-width: 120px; }
  .nav__links a.hide-sm { display: none; }
  .item { flex-wrap: wrap; }
  .item__actions { width: 100%; justify-content: flex-start; }
  .clause { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .chat__form { flex-direction: column; }
  .bubble { max-width: 94%; }

  /* разделы кабинета на телефоне переносятся на новые строки, а не уезжают за край */
  .subnav__scroll { flex-wrap: wrap; overflow-x: visible; gap: 4px; padding: 8px 0; }
  .subnav a { padding: 6px 10px; }
  .subnav a .icon { display: none; }

  /* таблица -> карточки */
  .table-wrap { background: none; box-shadow: none; border-radius: 0; overflow: visible; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { background: var(--surface); border-radius: var(--r-tile); box-shadow: var(--sh-1); padding: var(--s-2) var(--s-4); margin-bottom: var(--s-2); }
  .table tbody tr:hover { background: var(--surface); }
  .table td { border: 0; padding: 6px 0; display: flex; justify-content: space-between; gap: var(--s-3); text-align: right; }
  .table td::before { content: attr(data-label); color: var(--text-2); font-size: var(--fs-13); text-align: left; flex: none; max-width: 45%; }
  .table td.cell-main { display: block; text-align: left; font-size: var(--fs-17); }
  .table td.cell-main::before { content: none; }
  .table .right { text-align: right; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
