/* По закону — общий стиль сайта. Эталон вида — макет web/mockup/Main.dc.html
   (v69, 10.10.2026). Встроенных стилей на страницах нет: CSP — style-src 'self'.
   Шрифты Source Serif 4 и Onest подключатся своими файлами (@font-face ниже,
   когда файлы лягут в assets/fonts/); до того — системные запасные. */

:root {
  --bg: #FAF9F5;
  --ink: #141413;
  --ink-2: #3D3D3A;
  --muted: #6B6A64;
  --line: #E8E6DC;
  --line-2: #D9D6CB;
  --sand: #F0EEE6;
  --card: #FFFFFF;
  --accent: #C93A2E;
  --accent-soft: rgba(201, 58, 46, 0.10);
  /* Текст на --accent-soft: --accent там даёт ≈4,2:1, ниже AA 4,5:1 */
  --accent-text: #B8342A;
  --night: #141413;
  --night-text: #F1EFE8;
  --night-muted: #B8C1BD;
  --night-line: #3A4441;
  /* Фоны страниц «Полный разбор» и «Что скажет другая сторона» (12.11.2026,
     razbor-pages.css): в эти же цвета — их пункт панели и кнопки в чате.
     Контраст сверяет tools/site_dev/test_razbor_pages.mjs */
  --rz-bg: #E6E8FA;
  --rz-ink: #2B3290;
  --rz-ink-2: #222877;
  --rz-line: #C9CEF3;
  --rz-muted: #5E5D57;
  --rz-field: #8187C0;
  --opp-bg: #121821;
  --opp-card: #1A2230;
  --opp-line: #2A3547;
  --opp-ink: #F2F5FA;
  --opp-soft: #E9EDF3;
  --opp-muted: #B6C1D1;
  --opp-kicker: #8FB3E6;
  --opp-link: #8FB3E6;
  --opp-error: #FF9C94;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Onest', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --wrap: 1200px;
  --gutter: 24px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  min-width: 0;
}
a { color: var(--ink); }
a:hover { color: var(--accent); }
img, svg { display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
input:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
/* «Входил с этого браузера» (класс от side.js до отрисовки): «Кабинет» сразу,
   «Войти» не мигает; после /auth/me правду ставит app.js, initAuth (п. 6, 12.11).
   !important — иначе «Кабинет» ждал бы ответа под [hidden] выше */
html.pz-in [data-auth="out"] { display: none !important; }
html.pz-in .site-header__login[data-auth="in"][hidden],
html.pz-in .chat-side__acc[data-auth="in"][hidden],
html.pz-in .mobile-menu a[data-auth="in"][hidden] { display: flex !important; }

.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;
}
.skip {
  position: absolute; left: 8px; top: -60px; z-index: 20;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px;
}
.skip:focus { top: 8px; color: var(--bg); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.serif { font-family: var(--serif); }
.muted { color: var(--muted); }
.eyebrow {
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(34px, 4vw, 48px); line-height: 1.12; text-wrap: balance;
}
.section-head { display: flex; flex-direction: column; gap: 12px; max-width: 720px; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px;
  font-size: 15px; font-weight: 500; text-decoration: none; cursor: pointer;
  border: 1px solid var(--ink); background: var(--card); color: var(--ink);
  white-space: nowrap;
}
.btn:hover { color: var(--ink); border-color: var(--accent); }
.btn--dark { background: var(--ink); color: var(--bg); border-color: var(--ink); border-radius: 10px; }
.btn--dark:hover { color: var(--bg); background: #2A2A28; }
.btn--accent { background: var(--accent); color: #FFFFFF; border-color: var(--accent); }
.btn--accent:hover { color: #FFFFFF; background: #B23226; border-color: #B23226; }
.btn--block { display: flex; width: 100%; }
.btn[disabled], .btn[aria-disabled="true"], .btn--off { opacity: 0.55; cursor: default; pointer-events: none; }

/* ---------- шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.site-header__row {
  display: flex; align-items: center; gap: 32px;
  padding-top: 14px; padding-bottom: 14px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-height: 44px; }
.logo:hover { color: var(--ink); }
.logo__mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.logo__name { font-family: var(--serif); font-size: 22px; font-weight: 500; white-space: nowrap; }
.site-nav { display: flex; gap: clamp(14px, 1.8vw, 24px); flex-grow: 1; font-size: 15px; }
.site-nav a { text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--accent); }
.site-header__login {
  margin-left: auto; text-decoration: none; font-size: 15px; font-weight: 500; white-space: nowrap;
  min-height: 44px; display: flex; align-items: center; padding: 0 4px;
}
.menu-btn {
  display: none; width: 44px; height: 44px; border: 0; padding: 0; margin-right: -10px;
  background: transparent; color: var(--ink); align-items: center; justify-content: center; cursor: pointer;
}
.mobile-menu { display: none; border-top: 1px solid var(--line); padding-bottom: 16px; }
.mobile-menu a {
  display: flex; align-items: center; justify-content: space-between; min-height: 56px;
  border-bottom: 1px solid var(--line); text-decoration: none; font-size: 17px; font-weight: 500;
}
.mobile-menu .btn { margin-top: 16px; }
/* «Полный разбор» — в цвет фона своей страницы, как в левой панели (12.11.2026);
   «План работы» — под ним, в тех же цветах (владелец 20.11.2026) */
.mobile-menu a.mobile-menu__plan, .mobile-menu a.mobile-menu__razbor { background: var(--rz-bg); color: var(--rz-ink); padding: 0 12px; border-radius: 10px; }

/* «Меню» вошедшего на широком экране (17.11.2026): между «Личный кабинет» и «Задать
   вопрос»; по нажатию под шапкой выезжает строка всех функций — те же пункты, что в левой
   панели экранов. Видимость — data-auth="in" (initAuth), без мигания — правило pz-in ниже */
.fn-btn {
  display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.fn-btn:hover { background: var(--line); }
.fn-btn svg { transition: transform .18s ease; }
.fn-btn[aria-expanded="true"] { background: var(--line); }
.fn-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.fn-menu { display: none; }
.fn-menu.is-open {
  display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; padding-bottom: 14px;
  border-top: 1px solid var(--line); animation: fn-down .2s ease-out;
  /* При крупном масштабе строка не займёт весь экран: листается внутри шапки */
  max-height: 50vh; overflow-y: auto; overscroll-behavior: contain;
}
.fn-menu a {
  display: flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 15px; white-space: nowrap;
}
.fn-menu a:hover { background: var(--line); color: var(--ink); }
.fn-menu a.fn-menu__plan, .fn-menu a.fn-menu__razbor { background: var(--rz-bg); color: var(--rz-ink); border-color: var(--rz-line); font-weight: 500; }
.fn-menu a.fn-menu__plan:hover, .fn-menu a.fn-menu__razbor:hover { background: var(--rz-line); color: var(--rz-ink-2); }
@keyframes fn-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .fn-menu.is-open { animation: none; }
  .fn-btn svg { transition: none; }
}
/* «not all and (max-width: 900px)», а не «min-width: 901px»: на дробной ширине (900,5 px
   при масштабе) не срабатывало бы ни одно из двух правил (обзор 17.11) */
@media not all and (max-width: 900px) {
  html.pz-in .fn-btn[data-auth="in"][hidden] { display: flex !important; }
  /* Строка тоже data-auth="in": если сервер ответит «не вошёл», initAuth спрячет её
     вместе с кнопкой, даже открытую (обзор безопасности 17.11) */
  html.pz-in .fn-menu.is-open[data-auth="in"][hidden] { display: flex !important; }
}
/* «Личный кабинет» + «Меню» шире «Войти» на ≈ 220 px: на 901 px строка вылезала на 106 px
   (замер 17.11, нужно ≈ 1110). Вошедшему до 1199 px из разделов шапки — только «Тарифы»,
   остальные четыре есть в «Меню». Нижней границы нет: до 900 px .site-nav и так скрыта;
   верхняя — «не от 1200», чтобы не было щели на 1199,5 px */
@media not all and (min-width: 1200px) {
  html.pz-in .site-nav a:not([href="/#prices"]) { display: none; }
}

/* 900, а не 820: с «Калькуляторами» вместо «Зарплаты» меню при 821–880 px не влезало в строку (20.10) */
@media (max-width: 900px) {
  .site-header__row { gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .site-nav, .site-header__ask { display: none; }
  .menu-btn { display: flex; }
  /* На узком — гамбургер с полным меню телефона, «Меню» вошедшего не нужно */
  .fn-btn, .fn-menu.is-open { display: none; }
  /* 14 пунктов по 56 px выше экрана телефона: меню листается внутри шапки (ревизия 12.11).
     66 = строка шапки 10+44+10, нижняя рамка шапки и 1 px запаса; vh — запасное для браузеров без dvh */
  .mobile-menu.is-open { display: block; max-height: calc(100vh - 66px); max-height: calc(100dvh - 66px); overflow-y: auto; overscroll-behavior: contain; }
}

/* ---------- первый экран ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: radial-gradient(900px 520px at 82% 18%, #F1ECDF 0%, rgba(250, 249, 245, 0) 70%), var(--bg);
}
.hero > .wrap { position: relative; z-index: 1; }
.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hero-bg__lines {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(0deg, rgba(20, 20, 19, 0.055) 0 1px, transparent 1px 36px);
  -webkit-mask-image: radial-gradient(ellipse 75% 85% at 60% 45%, #000 0%, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 85% at 60% 45%, #000 0%, transparent 78%);
}
.hero-bg__margin {
  position: absolute; top: 0; bottom: 0; left: 9%; width: 1px;
  background: linear-gradient(180deg, rgba(201, 58, 46, 0) 0%, rgba(201, 58, 46, 0.28) 30%, rgba(201, 58, 46, 0.28) 70%, rgba(201, 58, 46, 0) 100%);
}
.hero-bg__blob {
  position: absolute; width: 900px; height: 900px; border-radius: 50%;
  animation: pz-float 16s ease-in-out infinite alternate;
}
.hero-bg__blob--red { right: -180px; top: -225px; background: radial-gradient(circle, rgba(201, 58, 46, 0.17) 0%, rgba(201, 58, 46, 0) 65%); }
.hero-bg__blob--sand { left: -225px; bottom: -300px; animation-delay: -8s; background: radial-gradient(circle, rgba(214, 190, 150, 0.45) 0%, rgba(214, 190, 150, 0) 65%); }
.hero-bg__sect {
  position: absolute; right: 30%; top: -150px; font-size: 880px;
  font-family: var(--serif); line-height: 1; color: transparent;
  -webkit-text-stroke: 1.5px rgba(201, 58, 46, 0.16); user-select: none;
}
.tape {
  position: absolute; left: 0; white-space: nowrap; font-size: 13px; letter-spacing: 0.03em;
  color: rgba(20, 20, 19, 0.30); animation: pz-marquee 160s linear infinite;
}
.tape--top { top: 26px; }
.tape--bottom { bottom: 34px; animation-direction: reverse; }
.tape b { font-weight: 600; color: rgba(201, 58, 46, 0.55); }
.tape i { font-style: normal; color: rgba(201, 58, 46, 0.45); padding: 0 18px; }
@keyframes pz-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes pz-float { from { transform: translate(0, 0) scale(1); } to { transform: translate(-40px, 30px) scale(1.08); } }

.hero__grid {
  padding-top: 72px; padding-bottom: 96px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 56px; align-items: center;
}
.hero__text { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; min-width: 0; }
.hero__badge { display: flex; align-items: center; gap: 8px; }
.hero__badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(56px, 6.4vw, 96px); line-height: 1; letter-spacing: -0.015em;
}
.hero__lead { max-width: 560px; font-size: 19px; line-height: 1.5; color: var(--ink-2); }

.ask {
  position: relative; width: 100%; max-width: 620px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 8px 8px 8px 18px; display: flex; align-items: center; gap: 10px;
  box-shadow: 0 18px 50px rgba(20, 20, 19, 0.08);
}
.ask input {
  flex-grow: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font-size: 16px; color: var(--ink); padding: 12px 0;
}
.ask input::placeholder { color: var(--muted); }
.ask .btn { border-radius: 12px; }
/* у поля outline снят — фокус с клавиатуры виден по рамке всей строки (WCAG 2.4.7) */
.ask:focus-within { border-color: var(--ink-2); box-shadow: 0 0 0 2px var(--accent), 0 18px 50px rgba(20, 20, 19, 0.08); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; max-width: 620px; }
.chip {
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2);
  border-radius: 999px; padding: 0 14px; min-height: 40px; font-size: 14px; cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip:disabled { opacity: 0.55; cursor: default; border-color: var(--line-2); }
.hero__note { font-size: 14px; color: var(--muted); }
.hero__note b { color: var(--ink); font-weight: 600; }

/* карточка примера ответа */
.sample {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 28px; display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 30px 80px rgba(20, 20, 19, 0.10); overflow: hidden; min-width: 0;
}
.sample__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.astrea { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.astrea__mark {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; background: var(--accent); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 16px; font-weight: 400;
}
.sample__tag { font-size: 12px; color: var(--muted); white-space: nowrap; }
.bubble-user {
  align-self: flex-end; background: var(--sand); border-radius: 14px 14px 4px 14px;
  padding: 10px 14px; font-size: 14.5px; line-height: 1.5; max-width: 88%;
}
.answer-text { font-family: var(--serif); font-size: 17px; line-height: 1.62; display: flex; flex-direction: column; gap: 12px; }
.answer-text strong { font-weight: 600; }
.cite {
  color: var(--accent-text); background: var(--accent-soft); border-radius: 6px; padding: 1px 6px;
  font-family: var(--sans); font-size: 0.8em; font-weight: 600; white-space: nowrap;
}
button.cite { border: 0; cursor: pointer; line-height: inherit; }
button.cite:hover { background: rgba(201, 58, 46, 0.18); }
.sample__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 14px;
}
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.check svg { color: var(--accent); }
.btn--small { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.disclaimer { font-size: 12px; color: var(--muted); }

.norm-panel {
  position: absolute; inset: 0; background: var(--card); padding: 28px;
  display: flex; flex-direction: column; gap: 14px; overflow: auto;
}
.norm-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.norm-panel__title { display: flex; flex-direction: column; gap: 2px; }
.norm-panel__title b { font-weight: 600; }
.norm-panel__title span { font-size: 13px; color: var(--muted); }
.icon-btn {
  width: 40px; height: 40px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.quote {
  margin: 0; border-left: 3px solid var(--accent); padding: 2px 0 2px 16px;
  font-family: var(--serif); font-size: 16px; line-height: 1.6;
}
.small-muted { font-size: 13px; color: var(--muted); }

/* ---------- ситуации ---------- */
.situations { padding-top: 32px; padding-bottom: 96px; display: flex; flex-direction: column; gap: 32px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tile {
  text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 10px; min-height: 150px;
  transition: border-color .15s ease, transform .15s ease;
}
.tile:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--ink); }
.tile svg { color: var(--accent); }
.tile__title { font-weight: 600; font-size: 16px; line-height: 1.3; }
.tile__sub { font-size: 13px; line-height: 1.4; color: var(--muted); }
.tile--dark { background: var(--night); border-color: var(--night); color: var(--bg); }
.tile--dark:hover { color: var(--bg); }
.tile--dark svg { color: var(--bg); }
.tile--dark .tile__sub { color: var(--night-muted); }

/* ---------- цифры и инструменты (главная, 17.10) ---------- */
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px 16px;
  padding-top: 8px; padding-bottom: 72px;
}
.fact {
  border-top: 2px solid var(--ink); padding-top: 14px; display: flex; flex-direction: column; gap: 4px;
}
/* Подписи на одной высоте, даже если жирная часть одного пункта в две строки
   (17.11: «Статья и редакция»): пункт — подсетка из двух строк общей сетки,
   потомков у .fact ровно два — b и span; промежуток между ними — gap из .fact */
@supports (grid-template-rows: subgrid) {
  .fact { display: grid; grid-row: span 2; grid-template-rows: subgrid; }
}
.fact b { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 3vw, 34px); line-height: 1.1; }
.fact span { font-size: 14px; line-height: 1.4; color: var(--muted); }
.tools { padding-bottom: 96px; display: flex; flex-direction: column; gap: 32px; }
.tools__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 14px; }
.tool {
  text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s ease, transform .15s ease;
}
.tool:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--ink); }
/* Функция ещё не открыта: карточка не ссылка — без подъёма при наведении, ярлык песочный */
.tool--soon:hover { border-color: var(--line); transform: none; }
.tool--soon .tool__tag { background: var(--sand); color: var(--ink-2); }
.tool__title { font-family: var(--serif); font-size: 24px; line-height: 1.2; }
.tool__text { font-size: 14.5px; line-height: 1.5; color: var(--ink-2); flex-grow: 1; }
.tool__tag {
  align-self: flex-start; font-size: 13px; font-weight: 500; color: var(--accent);
  background: var(--accent-soft); border-radius: 12px; padding: 4px 10px;
}
.tool--main { grid-column: 1 / -1; background: var(--night); border-color: var(--night); color: var(--night-text); }
.tool--main:hover { color: var(--night-text); }
.tool--main .tool__text { color: var(--night-muted); }
.tool--main .tool__tag { color: #FFFFFF; background: var(--accent); }
@media (min-width: 900px) {
  .tools__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tool--main { grid-column: auto; grid-row: span 2; justify-content: flex-end; }
  .tool--main .tool__title { font-size: 32px; }
  .tool--main .tool__text { flex-grow: 0; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .tool, .tool:hover { transition: none; transform: none; } }

/* ---------- как это работает ---------- */
.how { background: var(--sand); }
.how > .wrap { padding-top: 96px; padding-bottom: 96px; display: flex; flex-direction: column; gap: 32px; }
.tabs { display: flex; gap: 6px; background: var(--line); border-radius: 16px; padding: 6px; max-width: 760px; }
.tab {
  flex: 1 1 0; min-width: 0; border: 0; border-radius: 12px; background: transparent; color: var(--ink-2);
  padding: 0 14px; min-height: 52px; font-size: 15px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
}
.tab[aria-selected="true"] { background: var(--card); color: var(--ink); }
.tab__n { font-size: 12px; opacity: 0.7; }
.tabpanel {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 40px; align-items: center;
}
.tabpanel__text { display: flex; flex-direction: column; gap: 12px; }
.tabpanel h3 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.2; }
.tabpanel__text p { color: var(--ink-2); max-width: 520px; }
.demo {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px;
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.demo--serif { font-family: var(--serif); }
.demo__file {
  align-self: flex-end; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 12px; font-size: 13px; color: var(--ink-2);
}
.demo__file::before { content: ''; width: 34px; height: 42px; border-radius: 4px; background: var(--sand); border: 1px solid var(--line); }
.demo__row {
  display: flex; justify-content: space-between; gap: 10px; border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 14px; font-size: 14px;
}
.demo__row b { font-weight: 600; }
.demo__ok { display: flex; align-items: center; gap: 6px; color: var(--accent); font-size: 13px; white-space: nowrap; }
.demo__to { text-align: right; font-size: 12px; color: var(--muted); line-height: 1.4; }
.demo__title { text-align: center; font-weight: 600; letter-spacing: 0.06em; font-size: 15px; }
.demo__bar { display: block; height: 8px; border-radius: 4px; background: var(--sand); }
.demo__bar--92 { width: 92%; } .demo__bar--97 { width: 97%; } .demo__bar--60 { width: 60%; }
.demo__note { font-size: 12px; color: var(--accent); font-family: var(--sans); }
.demo__mail { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.demo__mail span {
  width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
}
.demo__big { font-family: var(--serif); font-size: 19px; line-height: 1.3; }

/* ---------- тёмный блок: доверие и вопросы ---------- */
.night { background: var(--night); color: var(--night-text); }
.night a { color: var(--night-text); }
.night > .wrap { padding-top: 104px; padding-bottom: 104px; display: flex; flex-direction: column; gap: 56px; }
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 36px; }
.pillar { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--night-line); padding-top: 20px; }
.pillar h3 { font-size: 18px; font-weight: 600; }
.pillar p { color: var(--night-muted); }
.faq { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px; align-items: start; }
.faq > h2 { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.2; }
.faq__list { border-top: 1px solid var(--night-line); }
.faq details { border-bottom: 1px solid var(--night-line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 60px; font-size: 17px; font-weight: 500;
}
.faq summary::-webkit-details-marker { display: none; }
.faq details p { margin: 0 0 18px; color: var(--night-muted); max-width: 640px; }
.plus {
  flex-shrink: 0; width: 28px; height: 28px; border: 1px solid var(--night-line); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; transition: transform .2s ease;
}
.faq details[open] .plus { transform: rotate(45deg); }
@media (max-width: 720px) { .faq { grid-template-columns: minmax(0, 1fr); gap: 20px; } }

/* ---------- тарифы ---------- */
.prices { padding-top: 96px; padding-bottom: 96px; display: flex; flex-direction: column; gap: 40px; }
.perks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.perk {
  display: flex; align-items: center; gap: 10px; background: var(--sand); border-radius: 12px;
  padding: 12px 14px; font-size: 14.5px; font-weight: 500;
}
.perk svg { color: var(--accent); flex-shrink: 0; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.plan {
  border: 1px solid var(--line); border-radius: 18px; padding: 28px; background: var(--card);
  display: flex; flex-direction: column; gap: 14px;
}
.plan--main { border: 2px solid var(--accent); padding: 27px; }
.plan h3 { font-size: 18px; font-weight: 600; }
.plan__price { font-family: var(--serif); font-size: 40px; line-height: 1; }
.plan__per { font-family: var(--sans); font-size: 16px; color: var(--muted); }
.plan__min { font-size: 14px; line-height: 1.4; color: var(--muted); }
.plans__pay { margin: 0 0 14px; font-weight: 600; color: var(--ink-2); }
.plans__note { margin: 16px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.plan__what { color: var(--ink-2); flex-grow: 1; }
.nowrap { white-space: nowrap; }
.plan__flag {
  align-self: flex-start; margin-top: -6px; font-size: 12px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: #FFFFFF; background: var(--accent); border-radius: 999px; padding: 3px 10px;
}
.plan__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; flex-grow: 1; font-size: 14.5px; line-height: 1.4; }
.plan__list li { position: relative; padding-left: 22px; }
.plan__list li::before {
  content: ''; position: absolute; left: 2px; top: 4px; width: 10px; height: 6px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}
.plan__list li.is-off { color: var(--muted); }
.plan__list li.is-off::before { border: 0; border-top: 2px solid var(--line-2); width: 10px; height: 0; top: 9px; transform: none; }
.plan:has(.plan__list) .plan__what { flex-grow: 0; }
/* Оплата тарифов (шаг 6, pay.js): блок и кнопки видны, только когда сервер сказал «оплата открыта» */
/* Без галочки оплата не начнётся — блок заметен: красная рамка и строка-подсказка
   сверху (владелец 29.11 не сразу нашёл галочку); отметили — рамка обычная
   (браузер без :has() оставит красную — оплата от этого не ломается) */
.pay-box { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; border: 2px solid var(--accent); border-radius: 14px; padding: 16px 18px; background: var(--card); }
.pay-box:has([data-pay-agree]:checked) { border-color: var(--line-2); }
.pay-box__lead { flex-basis: 100%; margin: 0; font-weight: 600; color: var(--accent-text); }
.pay-box:has([data-pay-agree]:checked) .pay-box__lead { color: var(--ink-2); font-weight: 500; }
.pay-box__agree { display: flex; align-items: flex-start; gap: 10px; font-size: 17px; font-weight: 600; cursor: pointer; }
.pay-box__agree input { width: 24px; height: 24px; margin: 0; flex-shrink: 0; accent-color: var(--accent); cursor: pointer; }
/* Нажали «Оплатить» без галочки (pay.js): блок прокручен к середине экрана и обведён */
.pay-box.is-attention { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: no-preference) {
  .pay-box.is-attention { animation: pay-nudge 0.4s ease-in-out 2; }
}
@keyframes pay-nudge { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.pay-box__edition { font-size: 14px; color: var(--muted); }
.pay-box__ways { flex-basis: 100%; margin: 0; font-size: 14px; color: var(--muted); }
/* Запертую «Оплатить» нажать можно: pay.js переведёт фокус на галочку и скажет в подсказке у неё ([data-pay-hint]), что галочка нужна */
.btn[data-pay][aria-disabled="true"] { pointer-events: auto; cursor: not-allowed; }
/* Заперта по умолчанию (галочка снята), а это главный призыв страницы: вместо
   общей прозрачности 0.55 (подпись 4:1, рамка фокуса 2,3:1) — серый текст и
   пунктир, 5,3:1; наведение не подсвечивает её как живую (.btn:hover, .btn--dark:hover) */
.btn[data-pay][aria-disabled="true"],
.btn[data-pay][aria-disabled="true"]:hover { opacity: 1; background: var(--card); color: var(--muted); border: 1px dashed var(--muted); }
.pay-box__hint { flex-basis: 100%; margin: 0; font-size: 14px; color: var(--ink-2); }
/* Пустая подсказка — живая область (role=status): не display: none, иначе её нет в
   дереве доступности и первую фразу диктор не объявит; вне потока, без места */
.pay-box__hint:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.plan__pay-status { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
/* Пустую строку состояния не прячем display: none — диктор не объявил бы первую фразу;
   отрицательный отступ гасит gap карточки, чтобы кнопка стояла как у «Базового» */
.plan__pay-status:empty { margin-top: -14px; }
.plan__pay-status .btn { margin-top: 8px; }
.pay-result { font-weight: 600; }
/* Разовые пакеты — заглушка спроса, оплаты нет (docs/features/packages-stub.md) */
.packs { margin-top: 28px; border: 1px dashed var(--line-2); border-radius: 18px; padding: 22px 24px; }
.packs__title { margin: 0; font-size: 18px; font-weight: 600; }
.packs__lead { margin: 6px 0 14px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.packs__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pack {
  display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 2fr) auto auto; gap: 6px 16px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.pack__name { font-weight: 600; }
.pack__what { font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.pack__price { font-family: var(--serif); font-size: 20px; white-space: nowrap; }
.packs__status { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); }
.packs__status:empty { margin: 0; }
@media (max-width: 720px) {
  .pack { grid-template-columns: minmax(0, 1fr) auto; }
  .pack__what { grid-column: 1 / -1; grid-row: 2; }
  .pack .btn { grid-column: 1 / -1; justify-self: start; }
}
.pkg-offer { margin-top: 18px; border-top: 1px dashed var(--line-2); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
/* Отступ блока на /dogovor даёт gap сетки .dg — своего margin-top не нужно */
.pkg-offer--wide { max-width: 760px; border: 1px dashed var(--line-2); border-radius: 18px; padding: 18px 22px; margin-top: 0; }
.pkg-offer__label { margin: 0; font-size: 12.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.pkg-offer__title { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; }
/* Пояснение и строка состояния — свой стиль: .pay-small живёт в payroll.css, а /dogovor его не грузит */
.pkg-offer__text { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.btn[data-pkg][aria-disabled="true"] { opacity: 0.7; cursor: default; }

/* ---------- призыв внизу главной ---------- */
.cta { padding-bottom: 96px; }
.cta__box {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px;
  background: var(--sand); border-radius: 22px; padding: 40px;
}
.cta__box > * { min-width: 0; }
.cta__text { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.cta__text p { margin: 0; color: var(--ink-2); }
.cta__actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 560px) {
  .cta__box { padding: 24px; }
  .tools, .cta { padding-bottom: 64px; }
}

/* ---------- подвал ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--sand); }
.site-footer__grid {
  padding-top: 56px; padding-bottom: 56px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px;
  font-size: 14px; color: var(--ink-2);
}
.site-footer__col { display: flex; flex-direction: column; gap: 8px; }
.site-footer__col b { font-weight: 600; color: var(--ink); }
.site-footer__brand { font-family: var(--serif); font-size: 20px; color: var(--ink); }
.age {
  display: inline-flex; align-self: flex-start; border: 1px solid var(--muted); border-radius: 6px;
  padding: 2px 8px; font-weight: 600; color: var(--ink);
}

/* ---------- страницы с текстом (документы, 404) ---------- */
.page { padding-top: 64px; padding-bottom: 96px; }
.prose { max-width: 720px; display: flex; flex-direction: column; gap: 16px; }
.prose h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 5vw, 56px); line-height: 1.08; }
.prose h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.2; margin-top: 16px; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul, .prose ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.prose a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.prose code { font-size: 0.9em; background: var(--sand); border-radius: 4px; padding: 1px 5px; overflow-wrap: anywhere; }
/* документы (собираются tools/site_dev/build_docs.py из legal/site/) */
.doc { overflow-wrap: break-word; }
.doc h2 { scroll-margin-top: 88px; }
.doc h3 { font-size: 18px; font-weight: 600; margin-top: 8px; }
.doc b { color: var(--ink); font-weight: 600; }
.doc__crumbs { font-size: 14px; }
.doc__crumbs a { color: var(--muted); }
.doc-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.doc-table table { width: 100%; border-collapse: collapse; font-size: 15px; }
.doc-table th, .doc-table td { padding: 10px 14px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); color: var(--ink-2); }
.doc-table tr:first-child > * { border-top: 0; }
.doc-table th { font-weight: 600; color: var(--ink); background: var(--sand); }
.doc-gap { background: #FFF1B8; color: var(--ink); border-radius: 4px; padding: 0 3px; }
.doc-list { list-style: none; padding-left: 0 !important; gap: 0 !important; }
.doc-list li { display: flex; flex-direction: column; gap: 2px; padding: 16px 0; border-top: 1px solid var(--line); }
.doc-list a { font-family: var(--serif); font-size: 22px; text-decoration: none; }
.doc-list a:hover { text-decoration: underline; }
.doc-list span { font-size: 15px; color: var(--muted); }

/* ---------- вход, регистрация, сброс пароля ---------- */
.auth { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; overflow-x: hidden; isolation: isolate; }
.auth > .hero-bg { position: fixed; }
.auth__top { position: relative; width: 100%; padding-top: 20px; padding-bottom: 20px; }
.auth__main {
  position: relative; flex-grow: 1; display: flex; align-items: flex-start; justify-content: center;
  padding: 24px var(--gutter) 64px;
}
.auth-card {
  width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 32px; display: flex; flex-direction: column; gap: 24px;
  box-shadow: 0 30px 80px rgba(20, 20, 19, 0.10);
}
.auth-card:focus { outline: none; }
.auth-card__head { display: flex; flex-direction: column; gap: 8px; }
.auth-card__head h1 { font-family: var(--serif); font-weight: 400; font-size: 36px; line-height: 1.1; }
.auth-card__foot { display: flex; flex-direction: column; gap: 6px; font-size: 14px; border-top: 1px solid var(--line); padding-top: 18px; }
/* «Войти» на регистрации — заметная кнопка в акценте сайта (замечание владельца 20.11, п. 6);
   текст --accent-text: на --accent-soft при наведении --accent ниже AA */
.auth-card__login { margin-top: 4px; border: 1.5px solid var(--accent); color: var(--accent-text); font-weight: 600; }
.auth-card__login:hover { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-text); }
.auth-card__note { font-size: 13px; color: var(--muted); }
.auth__foot {
  position: relative; display: flex; flex-wrap: wrap; gap: 8px 24px; padding-top: 16px; padding-bottom: 24px;
  font-size: 13px;
}
.auth__foot a { color: var(--muted); }

.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; }
.field__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14px; }
.field input, .field select {
  width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--card); font-size: 16px;
}
.field input:focus-visible, .field select:focus-visible { outline-offset: 0; border-color: var(--accent); }
.field__hint { font-size: 13px; color: var(--muted); }
.field__match:empty { display: none; }
.field__match.is-ok { color: #2E7D4F; }
.pass { position: relative; }
.pass input { padding-right: 52px; }
.pass__eye {
  position: absolute; right: 2px; top: 2px; width: 44px; height: 44px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.pass__eye[data-shown] { color: var(--accent); }
.field .code-input { font-size: 24px; letter-spacing: 0.5em; text-align: center; font-variant-numeric: tabular-nums; }
.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check-row input { width: 20px; height: 20px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--accent); }
.form__error { color: var(--accent); font-size: 14px; }
.form__error:empty { display: none; }
.back {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: -12px 0 -12px -4px;
  padding: 0 4px; border: 0; background: transparent; font-size: 14px; color: var(--ink-2); text-decoration: none; cursor: pointer;
}
.linkbtn {
  border: 0; padding: 0; background: transparent; color: var(--ink); text-decoration: underline;
  font-size: inherit; cursor: pointer; min-height: 24px;
}
.linkbtn:hover { color: var(--accent); }

/* ---------- обучение на сложных экранах (tour.js) ---------- */
.tour-again { align-self: flex-start; min-height: 44px; font-size: 13.5px; color: var(--muted); }
/* --accent на светлом фоне — 4,38:1 при 13,5 px; как у .hist .linkbtn:hover */
.tour-again:hover { color: var(--accent-text); }
/* В строке оговорки (чат): цель 44 px, а строка не растёт — поля внутрь соседних строк */
.disclaimer > .tour-again { display: inline-flex; align-items: center; vertical-align: middle; margin: -13px 0 -13px 6px; font-size: inherit; }
/* Экран занят ответом: кнопки не видно, место держит (tour.js, init) */
.tour-again--busy { visibility: hidden; }
.tour__catch { position: fixed; inset: 0; z-index: 1000; }
.tour__hole {
  position: fixed; z-index: 1001; pointer-events: none; border-radius: 12px;
  box-shadow: 0 0 0 200vmax rgba(20, 20, 19, 0.55); outline: 2px solid var(--accent);
}
.tour__card {
  position: fixed; z-index: 1002; display: grid; gap: 8px; overflow: auto;
  /* 100dvh: на телефоне 100vh выше видимой области, низ с кнопками ушёл бы за экран */
  max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px);
  /* Рамка видна в режиме высокой контрастности, где тень пропадает */
  border: 1px solid transparent;
  padding: 18px 18px 14px; border-radius: 14px; background: var(--card); color: var(--ink);
  box-shadow: 0 12px 40px rgba(20, 20, 19, 0.25);
}
.tour--glide .tour__hole { transition: top 0.32s ease, left 0.32s ease, width 0.32s ease, height 0.32s ease; }
.tour--glide .tour__card { transition: top 0.32s ease, left 0.32s ease; }
.tour__count { font-size: 12.5px; color: var(--muted); }
.tour__title { font-size: 17px; font-weight: 600; line-height: 1.3; }
.tour__text { font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.tour__btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.tour__btns .btn, .tour__btns .linkbtn { min-height: 44px; }
.tour__skip { margin-right: auto; padding: 0 4px; color: var(--muted); }
.tour__never { justify-self: start; min-height: 44px; padding: 0 4px; font-size: 13.5px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  .tour--glide .tour__hole, .tour--glide .tour__card { transition: none; }
}
/* Высокая контрастность гасит box-shadow, а им сделано затемнение: у выреза
   текста нет, поэтому его цвета оставляем как есть; вырез — системной рамкой */
@media (forced-colors: active) {
  .tour__hole { forced-color-adjust: none; outline: 3px solid Highlight; }
}

/* ---------- чат (макеты NewChat, Chat, ChatClarify, ChatSpecial) ---------- */
.chat { display: flex; min-height: 100vh; min-height: 100dvh; }
.chat-top { display: none; }
.chat-side {
  position: sticky; top: 0; width: 280px; height: 100vh; height: 100dvh; flex-shrink: 0;
  background: var(--sand); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 18px; padding: 18px 14px; overflow-y: auto;
}
.chat-side__logo { padding: 0 4px; }
.chat-side__grow { flex-grow: 1; }
.chat-side__nav { display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.chat-side__nav a { color: var(--ink); text-decoration: none; padding: 9px 10px; border-radius: 10px; min-height: 40px; }
.chat-side__nav a:hover { background: var(--line); color: var(--ink); }
/* Текущий раздел (страница /nalogi; 16.10.2026) */
.chat-side__nav a[aria-current="page"] { background: var(--line); font-weight: 500; }
/* «Полный разбор» — в цвет фона своей страницы (п. 10 замечаний владельца 12.11);
   «План работы» под ним — в тех же цветах, страница плана тоже (владелец 20.11) */
.chat-side__nav a.chat-side__plan, .chat-side__nav a.chat-side__razbor { background: var(--rz-bg); color: var(--rz-ink); font-weight: 500; box-shadow: inset 0 0 0 1px var(--rz-line); }
.chat-side__nav a.chat-side__plan:hover, .chat-side__nav a.chat-side__razbor:hover { background: var(--rz-line); color: var(--rz-ink-2); }
.chat-side__nav a.chat-side__plan[aria-current="page"], .chat-side__nav a.chat-side__razbor[aria-current="page"] { font-weight: 600; box-shadow: inset 3px 0 0 var(--rz-ink), inset 0 0 0 1px var(--rz-line); }
.chat-side__quota { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); padding: 0 4px; }
.chat-side__quota a { color: var(--accent-text); font-weight: 500; text-decoration: none; align-self: flex-start; min-height: 24px; }
.chat-side__me { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line-2); padding: 14px 4px 0; font-size: 14px; }
.chat-side__error { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--accent-text); }
/* --accent на --sand панели — 4,38:1 при 13–14 px, ниже AA; --accent-text — 5,07:1,
   как у .hist (аудит 29.11): ссылка остатка, ошибка выхода, «Выйти» и аккаунт при наведении */
.chat-side .linkbtn:hover, .chat-side__acc:hover { color: var(--accent-text); }
.chat-side__acc { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.chat-side__avatar {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: var(--ink); color: var(--bg);
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px;
}
.chat-side__who { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.chat-side__who b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-side__who span { font-size: 12px; color: var(--muted); }
/* Свернуть панель (замечание владельца 02.11, п. 5): кнопка в углу панели,
   класс side-folded на <html> ставит assets/side.js до первой отрисовки.
   Только на широком экране: до 820 px панель — меню телефона (ниже). */
.chat-side__fold {
  display: none; position: absolute; top: 12px; right: 10px; width: 44px; height: 44px;
  border: 0; border-radius: 10px; padding: 0; background: transparent; color: var(--ink-2);
  align-items: center; justify-content: center; cursor: pointer;
}
.chat-side__fold:hover { background: var(--line); color: var(--ink); }
.chat-side__fold-arrow { transform-box: fill-box; transform-origin: center; }
@media (min-width: 821px) {
  .chat-side { transition: width 0.2s ease, padding 0.2s ease; overflow-x: hidden; }
  .side-js .chat-side__fold { display: flex; }
  /* Своя ширина у содержимого: при развороте панель открывает его, а не переносит строки.
     Не 252 px (вся ширина без полей): полоса прокрутки длинной панели (≈17 px в Windows)
     закрывала правый край — «Выйти» внизу (владелец 29.11); test_side.mjs держит запас */
  .chat-side > :not(.chat-side__fold) { min-width: 220px; }
  .side-folded .chat-side { width: 64px; padding-left: 10px; padding-right: 10px; }
  .side-folded .chat-side > :not(.chat-side__fold) { display: none; }
  .side-folded .chat-side__fold-arrow { transform: rotate(180deg); }
}
@media (prefers-reduced-motion: reduce) {
  .chat-side, .hist { transition: none; }
}

/* ---------- правая панель «История» (п. 3 и 13 владельца, 12.11; assets/hist.js) ----------
   Только вошедшему: до ответа — по подсказке side.js (pz-in), после — по ответу
   сервера (hist-on / hist-off на <html>). От 1200 px — колонка, сворачивается
   (hist-folded ставит side.js до отрисовки); уже — шторка по кнопке «История». */
.hist, .hist-top, .hist-edge { display: none; }
.hist {
  flex-direction: column; gap: 14px; background: var(--sand); padding: 18px 14px;
  overflow-y: auto; font-size: 14px;
}
.hist__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.hist__title { font-family: var(--serif); font-weight: 400; font-size: 20px; padding-left: 4px; }
.hist__fold, .hist__close, .hist-more__btn {
  width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 10px; padding: 0; background: transparent;
  color: var(--ink-2); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.hist__fold:hover, .hist__close:hover, .hist-more__btn:hover { background: var(--line); color: var(--ink); }
.hist__fold-arrow { transform-box: fill-box; transform-origin: center; }
.hist__close { display: none; }
.hist__body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hist__terms { color: var(--muted); font-size: 12px; line-height: 1.4; padding: 0 4px; }
.hist__new { align-self: flex-start; min-height: 44px; padding: 0 4px; }
.hist-head { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 6px 4px 0; }
.hist-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.hist-item { display: flex; align-items: flex-start; gap: 2px; position: relative; }
.hist-item__open {
  flex-grow: 1; min-width: 0; min-height: 44px; display: flex; flex-direction: column; justify-content: center; gap: 2px;
  padding: 6px 8px; border-radius: 10px; color: var(--ink); text-decoration: none;
}
.hist-item__open:hover { background: var(--line); color: var(--ink); }
.hist-item__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-item__date { font-size: 12px; color: var(--muted); }
/* --muted на фоне наведения (--line) — 4,34:1 при 12 px */
.hist-item__open:hover .hist-item__date { color: var(--ink-2); }
/* Пометка «Напрямую, без сверки с законом» — как дата */
.hist-item__kind { font-size: 12px; color: var(--muted); }
.hist-item__open:hover .hist-item__kind { color: var(--ink-2); }
.hist-more > summary { list-style: none; }
.hist-more > summary::-webkit-details-marker { display: none; }
.hist-more__menu {
  position: absolute; right: 0; top: 46px; z-index: 5; min-width: 210px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 12px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 12px 30px rgba(20, 20, 19, 0.12);
}
.hist-more__menu .linkbtn { min-height: 36px; text-align: left; }
.hist-move { font-size: 12px; color: var(--muted); }
.hist-more__menu select { min-height: 36px; max-width: 100%; }
/* --accent на --sand — 4,38:1 при 13–14 px; --accent-text — 5,07:1 (аудит доступности 12.11) */
.hist-danger { color: var(--accent-text); }
/* .linkbtn:hover даёт --accent: на --sand это 4,38:1 при 13–14 px — у всех кнопок-ссылок панели */
.hist .linkbtn:hover { color: var(--accent-text); }
.hist .form__error { color: var(--accent-text); }
.hist-folder { border-top: 1px solid var(--line-2); padding-top: 8px; }
.hist-folder__name {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 0 4px;
  font-weight: 600; cursor: pointer;
}
.hist-count { font-weight: 400; font-size: 12px; color: var(--muted); }
.hist-folder__tools { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 0 4px 6px; font-size: 13px; }
.hist-empty { color: var(--muted); font-size: 13px; padding: 4px; }
.hist-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; padding: 4px; }
.hist-name__label { flex: 1 1 100%; font-size: 12px; color: var(--muted); }
/* Рамка --line-2 давала 1,25:1 к фону панели — поля не было видно; --muted — ≥ 3:1 */
.hist-name input {
  flex: 1 1 100%; min-height: 40px; padding: 6px 10px;
  border: 1px solid var(--muted); border-radius: 10px; background: var(--bg);
}
.hist-name__ok { min-height: 40px; padding: 0 14px; }
@media (min-width: 1200px) {
  /* :where — без веса: иначе показ (0,3,1) сильнее свёртки ниже (0,2,0), и свёрнутая оставалась в 280 px */
  html:where(.pz-in:not(.hist-off)) .hist, html:where(.hist-on) .hist {
    display: flex; position: sticky; top: 0; width: 280px; height: 100vh; height: 100dvh; flex-shrink: 0;
    border-left: 1px solid var(--line); overflow-x: hidden;
  }
  /* Своя ширина у содержимого: при развороте панель открывает его, а не переносит строки;
     с запасом под полосу прокрутки, как у левой панели (.chat-side, 29.11) */
  .hist > * { min-width: 220px; }
  .hist-folded .hist { width: 64px; padding-left: 10px; padding-right: 10px; }
  .hist-folded .hist > * { min-width: 0; }
  .hist-folded .hist__title, .hist-folded .hist__body { display: none; }
  .hist-folded .hist__fold-arrow { transform: rotate(180deg); }
}
/* Переход свёртки — только при согласии на движение: в правиле показа (с `html`,
   вес больше) он перебивал общее `.hist { transition: none }` (аудит 12.11) */
@media (min-width: 1200px) and (prefers-reduced-motion: no-preference) {
  .hist { transition: width 0.2s ease, padding 0.2s ease; }
}
@media (max-width: 1199px) {
  .hist.is-open {
    display: flex; position: fixed; top: 0; right: 0; bottom: 0; z-index: 20; width: min(340px, 100vw);
    border-left: 1px solid var(--line-2); box-shadow: -20px 0 40px rgba(20, 20, 19, 0.12);
  }
  .hist__fold { display: none; }
  .hist__close { display: flex; }
}
@media (min-width: 821px) and (max-width: 1199px) {
  html.pz-in:not(.hist-off) .hist-edge, html.hist-on .hist-edge {
    display: flex; align-items: center; gap: 6px; position: fixed; top: 12px; right: 12px; z-index: 8;
    min-height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px;
    background: var(--bg); color: var(--ink); font-size: 14px; cursor: pointer;
  }
  /* Кнопка в углу закрывала первый вопрос ленты чата (стенд 12.11) — место под неё */
  html:where(.pz-in:not(.hist-off)) .chat-log, html:where(.hist-on) .chat-log { padding-top: 68px; }
}
@media (max-width: 820px) {
  html.pz-in:not(.hist-off) .hist-top, html.hist-on .hist-top {
    display: flex; align-items: center; margin-left: auto; min-height: 44px; padding: 0 10px;
    border: 0; background: transparent; color: var(--ink); font-size: 15px; font-weight: 500; cursor: pointer;
  }
  .hist.is-open { top: 61px; }
}
/* Истории нет (гость, выключена на сервере) — ни панели, ни кнопок; сильнее подсказки pz-in */
html.hist-off .hist, html.hist-off [data-hist-open] { display: none !important; }

.chat-main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-empty {
  flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: 48px var(--gutter); text-align: center;
}
.chat-empty__title {
  display: flex; align-items: center; justify-content: center; gap: 16px; max-width: 720px;
  font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 4vw, 42px); line-height: 1.15; text-wrap: balance;
}
.chat-empty__title .astrea__mark { width: 44px; height: 44px; font-size: 24px; }
.chat-empty__slot { width: 100%; max-width: 720px; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.chat-empty .chips { justify-content: center; max-width: 720px; }
.chat-empty .disclaimer { max-width: 560px; font-size: 13px; }

.composer {
  width: 100%; background: var(--card); border: 1px solid var(--line-2); border-radius: 22px;
  padding: 18px 18px 14px 22px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 6px 24px rgba(20, 20, 19, 0.06);
}
/* у поля outline снят — фокус виден кольцом всей строки, как у .ask (WCAG 2.4.7, аудит 29.11) */
.composer:focus-within { border-color: var(--ink-2); box-shadow: 0 0 0 2px var(--accent), 0 6px 24px rgba(20, 20, 19, 0.06); }
.composer textarea {
  width: 100%; min-width: 0; border: 0; padding: 0; resize: none; background: transparent;
  font-size: 17px; line-height: 1.5; max-height: 240px;
}
.composer textarea:focus-visible { outline: none; }
.composer textarea::placeholder { color: var(--muted); }
.composer__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.composer__note { font-size: 13px; color: var(--muted); }
.composer__send {
  width: 40px; height: 40px; flex-shrink: 0; border: 0; border-radius: 12px; background: var(--accent); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center; cursor: pointer; margin-left: auto;
}
.composer__send:hover { background: #B23226; }
.composer__send:disabled { opacity: 0.45; cursor: default; }

/* Полоса о пределе (dom.js showLimit, docs/features/limit-warning.md): узел
   role="status" живёт всегда, пустой — вне потока, чтобы не давать отступ
   колонки, но оставаться для диктора. «warn» — песок и текст --ink-2,
   «stop» — --accent-text на --accent-soft (AA, см. :root) */
.limit-slot:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.limit-band {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 14px;
  padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.45;
  background: var(--sand); color: var(--ink-2);
}
.limit-band p { flex: 1 1 260px; }
.limit-band a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.limit-band--stop { background: var(--accent-soft); color: var(--accent-text); }

.chat-log {
  flex-grow: 1; width: 100%; max-width: 788px; margin: 0 auto; padding: 32px var(--gutter) 24px;
  display: flex; flex-direction: column; gap: 36px;
}
.turn { display: flex; flex-direction: column; gap: 18px; scroll-margin-top: 16px; }
.turn .bubble-user { font-size: 15.5px; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 85%; }
.turn__reply { display: flex; flex-direction: column; gap: 14px; }
.turn__status { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.turn__note { font-size: 13px; color: var(--muted); }
.turn__body { display: flex; flex-direction: column; gap: 14px; }
.turn__body:empty { display: none; }
.answer-text p, .answer-text li { overflow-wrap: anywhere; }
/* Разметка модели (rich-text.js): заголовки «## …» и списки внутри ответа */
.answer-text .rich-head { margin: 4px 0 -4px; font-family: var(--sans); font-size: 16px; font-weight: 600; line-height: 1.35; }
.answer-text h4.rich-head { font-size: 15px; }
.answer-text ul, .answer-text ol { margin: 0; padding-left: 24px; display: flex; flex-direction: column; gap: 6px; }
.answer-list { margin: -6px 0 0; padding-left: 24px; display: flex; flex-direction: column; gap: 6px; }
.answer-ask { font-weight: 600; }
.answer-warn {
  background: var(--sand); border-radius: 12px; padding: 12px 16px; font-size: 14px; color: var(--ink-2);
  display: flex; flex-direction: column; gap: 6px;
}
.answer-warn ul { margin: 0; padding-left: 20px; }
/* Госпошлина под ответом (17.11.2026): справка, а не предупреждение — рамка, без заливки */
.answer-fee {
  border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 16px; font-size: 14px; color: var(--ink);
  display: flex; flex-direction: column; gap: 6px;
}
.answer-fee p { margin: 0; }
.answer-lawyer { border-left: 3px solid var(--accent); color: var(--ink); }
.answer-lawyer p { margin: 0; }
.cites { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.cites .cite { font-size: 13px; padding: 4px 8px; }
.cite__ed { font-weight: 400; }
.turn__options { max-width: none; }
.turn__tools { display: flex; align-items: center; gap: 10px; }
.turn__tools .icon-btn { width: 36px; height: 36px; border-color: transparent; background: transparent; color: var(--muted); }
.turn__tools .icon-btn:hover { color: var(--ink); border-color: var(--line); }
.turn__error {
  border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: 12px; background: var(--card);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; font-size: 15px;
}
.turn__actions, .special__actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* Выгрузка ответа в Word и PDF (answer-export.js) — под ответом, рядом со строкой статуса */
.turn__export { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---------- «Ответ помог?» под ответом (feedback.js) ---------- */
.fb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 14px; color: var(--ink-2); }
.fb__votes { display: flex; gap: 8px; }
.fb__votes .btn[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); font-weight: 600; }
/* Голос записан — обе заперты (feedback.js, 18.11); выбранную не гасим: её и читают */
.fb__votes .btn[aria-pressed="true"][aria-disabled="true"] { opacity: 1; }
.fb__status { flex-basis: 100%; margin: 0; font-size: 13px; }
.fb__status:empty { display: none; }
.fb__more {
  flex-basis: 100%; margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); display: flex; flex-direction: column; gap: 10px; max-width: 560px;
}
.fb__more[hidden] { display: none; }
.fb__legend { padding: 0 4px; font-weight: 500; color: var(--ink); }
.fb__opts { display: flex; flex-direction: column; }
.fb__opt { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; line-height: 1.45; }
.fb__opt input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--ink); }
.fb__label { font-weight: 500; color: var(--ink); }
.fb__comment {
  width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--bg); resize: vertical;
}
.fb__hint { margin: -4px 0 0; font-size: 13px; color: var(--muted); }
.fb__more .btn { align-self: flex-start; }

/* ---------- полный разбор (макет Razbor) ---------- */
.razbor-entry { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; margin: 0; font-size: 13px; color: var(--ink-2); max-width: 560px; }
/* Кнопки-переходы в цвет фона своих страниц (12.11.2026, п. 2 и 10):
   «Полный разбор» под полем чата и «Что скажет другая сторона» под ответом */
.btn.btn--razbor { background: var(--rz-bg); color: var(--rz-ink); border-color: var(--rz-line); }
.btn.btn--razbor:hover { background: var(--rz-line); color: var(--rz-ink-2); border-color: var(--rz-ink); }
/* Главные кнопки страниц «Полный разбор» и «План работы» — в цвет их пункта панели */
.btn.rz-btn { background: var(--rz-ink); border-color: var(--rz-ink); color: #FFFFFF; }
.btn.rz-btn:hover { background: var(--rz-ink-2); border-color: var(--rz-ink-2); color: #FFFFFF; }
.btn.btn--op { background: var(--opp-bg); color: var(--opp-ink); border-color: var(--opp-line); }
.btn.btn--op:hover { background: var(--opp-card); color: var(--opp-ink); border-color: var(--opp-kicker); }
.razbor-box {
  border: 1px solid var(--line); border-radius: 16px; background: var(--card); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.razbor-box__label, .razbor-label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.razbor-box__done { font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.razbor-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; }
.razbor-steps > li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 4px 10px; align-items: center; }
.razbor-steps__mark {
  width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.razbor-steps .razbor-qs { grid-column: 2; }
.razbor-qs { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: var(--ink-2); }
.razbor-qs li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.razbor-plan { display: flex; flex-direction: column; gap: 8px; }
.razbor-plan__title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.2; }
.razbor-plan > p { font-family: var(--serif); font-size: 17px; line-height: 1.6; color: var(--ink-2); }
.razbor-plan > p:has(strong) { font-family: inherit; font-size: 15px; }
.razbor-steps-plan { margin: 0; padding: 0; list-style: none; counter-reset: rz; }
.razbor-step {
  counter-increment: rz; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 4px 12px;
  padding: 16px 0; border-top: 1px solid var(--line);
}
.razbor-step::before {
  content: counter(rz); grid-row: span 3; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--accent); color: var(--accent); display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.razbor-step > * { grid-column: 2; }
.razbor-step__title { font-weight: 600; }
.razbor-step__why { font-family: var(--serif); font-size: 16.5px; line-height: 1.6; overflow-wrap: anywhere; }
.razbor-step .cites { padding-top: 4px; }
.razbor-opp, .razbor-docs { display: flex; flex-direction: column; gap: 10px; }
.razbor-opp__card {
  border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--ink-2);
}
.razbor-opp__says { font-size: 14.5px; color: var(--ink); overflow-wrap: anywhere; }
.razbor-opp__card strong { font-weight: 600; color: var(--ink); }
.razbor-docs ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.razbor-answers { border-top: 1px solid var(--line); padding-top: 12px; }
.razbor-answers summary { cursor: pointer; font-weight: 500; min-height: 24px; }
.razbor-answers > ol { margin: 12px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 18px; }
.razbor-answer > div { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.razbor-answer__q { font-weight: 600; }
.razbor-foot { font-size: 12px; color: var(--muted); }

/* Строка ожидания ответа сервера (waiting.js) — одна на все экраны (02.11):
   пульсирующая точка, блик по тексту, счётчик секунд. Появляется с задержкой
   в четверть секунды — быстрый расчёт не мигает строкой. Блик — не светлее
   --muted: и на пике он даёт 4,6:1 на песочном фоне (WCAG 1.4.3; светлый
   #B5B2A6 опускал фразу до 1,8:1 — обзор 02.11, круг 3). */
.wait {
  --wait-ink: var(--ink-2); --wait-shine: var(--muted);
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; max-width: 100%;
  animation: wait-in 0.3s ease-out 0.25s backwards;
}
.wait__dot { width: 9px; height: 9px; flex-shrink: 0; border-radius: 50%; background: var(--accent); animation: wait-pulse 1.4s ease-in-out infinite; }
.wait__text {
  color: var(--wait-ink);
  background: linear-gradient(90deg, var(--wait-ink) 0 38%, var(--wait-shine) 50%, var(--wait-ink) 62% 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: wait-shine 2.4s linear infinite;
}
.wait__time { font-size: 0.92em; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wait-slot { font-size: 14px; align-self: center; }
.wait-slot:empty { display: none; }
@keyframes wait-in { from { opacity: 0; } }
@keyframes wait-pulse { 0%, 100% { opacity: 0.4; transform: scale(0.72); } 50% { opacity: 1; transform: scale(1); } }
@keyframes wait-shine { from { background-position: 100% 0; } to { background-position: 0 0; } }
/* Режим высокой контрастности красит текст сам — прозрачная заливка его бы стёрла */
@media (forced-colors: active) {
  .wait__text { background: none; -webkit-text-fill-color: currentColor; }
}

.special {
  background: var(--card); border: 1px solid var(--line-2); border-radius: 16px; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 12px; font-size: 14.5px; color: var(--ink-2); text-align: left;
}
.special__text { background: var(--sand); border-radius: 10px; padding: 10px 14px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.special__text mark { background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 0 3px; }

.chat-dock {
  position: sticky; bottom: 0; background: linear-gradient(rgba(250, 249, 245, 0), var(--bg) 24px);
  padding: 24px var(--gutter) 14px;
}
.chat-dock__inner { max-width: 740px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.chat-dock__inner > .disclaimer { text-align: center; }
.chat-dock .composer { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 12px 12px 12px 18px; border-radius: 20px; }
/* Поле растёт от нуля: с переносом width: 100% увёл бы его на свою строку, а
   кнопку — на следующую. Полоса о пределе — своей строкой над полем, а не
   колонкой слева от него (обзор 01.11) */
.chat-dock .composer textarea { flex: 1 1 0; font-size: 15.5px; padding: 8px 0; }
.chat-dock .limit-slot:not(:empty) { flex: 0 0 100%; }
.chat-dock .composer__note { display: none; }

.norm-dialog {
  width: min(640px, calc(100vw - 32px)); max-height: min(80vh, 760px); border: 0; border-radius: 22px; padding: 28px;
  background: var(--card); color: var(--ink); box-shadow: 0 30px 80px rgba(20, 20, 19, 0.25);
}
.norm-dialog[open] { display: flex; flex-direction: column; gap: 16px; }
.norm-dialog::backdrop { background: rgba(20, 20, 19, 0.45); }
.norm-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.norm-dialog__plain { background: var(--sand); border-radius: 12px; padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.norm-dialog__body { white-space: pre-line; overflow-wrap: anywhere; }

/* ---------- личный кабинет (макет Account) ---------- */
.account { padding: 48px var(--gutter) 64px; }
.account__inner { width: 100%; max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.account__title { font-family: var(--serif); font-weight: 400; font-size: 36px; line-height: 1.15; }
.account__title:focus { outline: none; }
.acc-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 24px 28px; display: flex; flex-direction: column; gap: 16px;
}
.acc-card h2 { font-size: 18px; font-weight: 600; }
.acc-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.acc-card__head a { font-size: 14px; color: var(--accent); font-weight: 500; text-decoration: none; }
.acc-rows { display: flex; flex-direction: column; }
.acc-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px;
}
.acc-row:first-child { border-top: 0; padding-top: 0; }
.acc-row dt { color: var(--muted); }
.acc-row dd { margin: 0; text-align: right; font-weight: 500; overflow-wrap: anywhere; }
/* Дата — одним куском: переносится подпись слева, а не год (обход 20.11, № 18) */
.acc-row dd[data-plan-until] { white-space: nowrap; }
/* Полоска остатка обращений: число в строке выше, полоска — его доля от предела */
.acc-meter { height: 8px; margin-top: -6px; border-radius: 999px; background: var(--sand); border: 1px solid var(--line); overflow: hidden; }
.acc-meter__fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--ink-2); transition: width .4s ease; }
.acc-meter--low .acc-meter__fill { background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .acc-meter__fill { transition: none; } }
.acc-card__action { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.acc-card__action .small-muted { flex: 1 1 260px; }
.acc-card--danger p { color: var(--ink-2); }
.acc-danger { color: var(--accent); border-color: var(--accent); align-self: flex-start; }
.acc-danger:hover { color: #FFFFFF; background: var(--accent); }
.acc-danger--fill { color: #FFFFFF; background: var(--accent); }
.acc-danger--fill:hover { background: #B23226; border-color: #B23226; }
.acc-delete { border-top: 1px solid var(--line); padding-top: 16px; }
.acc-delete .field, .acc-b2b .field { max-width: 360px; }
.acc-delete__buttons { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 820px) {
  .chat-top {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter);
  }
  .chat-top .menu-btn { display: flex; }
  .chat-side {
    display: none; position: fixed; top: 61px; left: 0; right: 0; bottom: auto; z-index: 9; width: auto; height: auto;
    max-height: calc(100dvh - 61px); border-right: 0; border-bottom: 1px solid var(--line-2);
    box-shadow: 0 20px 40px rgba(20, 20, 19, 0.12);
  }
  .chat-side.is-open { display: flex; }
  .chat-side__logo, .chat-side__grow { display: none; }
  .chat { min-height: calc(100dvh - 61px); }
  .chat-empty { justify-content: flex-start; padding-top: 32px; }
}
@media (max-width: 560px) {
  .chat-empty__title { flex-direction: column; gap: 12px; }
  .composer { padding: 14px 14px 12px 16px; border-radius: 18px; }
  .composer__note { font-size: 12px; }
  .chat-log { padding-top: 20px; gap: 28px; }
  .answer-text { font-size: 16.5px; }
  .norm-dialog { padding: 20px; border-radius: 18px; }
}

@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .auth-card { padding: 24px 20px; }
  .auth__main { padding-top: 8px; }
  .hero__grid { padding-top: 40px; padding-bottom: 64px; gap: 40px; }
  .hero__lead { font-size: 17px; }
  .ask { padding-left: 14px; flex-wrap: wrap; }
  .ask input { flex-basis: 100%; }
  .ask .btn { width: 100%; }
  .sample, .norm-panel { padding: 20px; }
  .tabs { overflow-x: auto; }
  .tab { flex: 0 0 auto; }
  .situations, .prices { padding-bottom: 64px; }
  .how > .wrap, .night > .wrap { padding-top: 64px; padding-bottom: 64px; }
  .plan__price { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .tape, .hero-bg__blob { animation: none; }
  .tile { transition: none; }
  .tile:hover { transform: none; }
  .plus { transition: none; }
  .wait, .wait__dot { animation: none; }
  .wait__text { animation: none; background: none; -webkit-text-fill-color: currentColor; }
}

/* План работы: под итогами — вопросы Астрее по плану и ряд «Word / PDF /
   другая сторона» (plan-export.js). Здесь, а не в plan.css: его сейчас правит
   соседняя работа (панель и меню) */
.plan-res__more { display: flex; flex-direction: column; gap: 20px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.plan-ask { display: flex; flex-direction: column; gap: 10px; }
.plan-ask__title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.2; }
.plan-ask__form { display: flex; flex-direction: column; gap: 10px; }
.plan-ask__form textarea { min-height: 88px; }
.plan-thread { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 18px; }
.plan-thread:empty { display: none; }
.plan-thread__item, .plan-thread__a { display: flex; flex-direction: column; gap: 10px; }
.plan-thread__q {
  margin: 0; align-self: flex-end; max-width: 100%; background: var(--line); border-radius: 12px; padding: 8px 12px;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.plan-res__tools { display: flex; flex-direction: column; gap: 10px; }

/* ---------- «История» на /plan и /razbor и запись из неё (общая история, 20.11; hist.js, hist-saved.js) ----------
   Панель — только по ответу сервера (hist-on), не по подсказке входа pz-in:
   пока общая история выключена, она мелькала бы у каждого вошедшего. Кнопки
   в шапке там нет (шапка общая) — на телефоне открывает кнопка у нижнего края. */
html:not(.hist-on) .hist[data-hist-shared], html:not(.hist-on) .hist-edge[data-hist-shared] { display: none !important; }
@media (max-width: 820px) {
  html.hist-on .hist-edge[data-hist-shared] {
    display: flex; align-items: center; gap: 6px; position: fixed; right: 12px; bottom: 16px; z-index: 8;
    min-height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px;
    background: var(--bg); color: var(--ink); font-size: 14px; cursor: pointer; box-shadow: 0 6px 18px rgba(20, 20, 19, 0.12);
  }
}
/* Кнопка у края не ложится на содержимое: место под неё — у основного блока страницы */
@media (min-width: 821px) and (max-width: 1199px) {
  html.hist-on main:has(~ .hist-edge[data-hist-shared]) { padding-top: 68px; }
}
@media (max-width: 820px) {
  html.hist-on main:has(~ .hist-edge[data-hist-shared]) { padding-bottom: 76px; }
}
.hist-saved { display: flex; flex-direction: column; gap: 10px; }
.hist-saved__title { font-family: var(--serif); font-weight: 400; font-size: 22px; }
.hist-saved__part { margin-top: 10px; }
/* Шаг сохранённого плана — без переключателя: столбец флажка не нужен (как у итогов, plan.css) */
.plan-step.plan-step--ro { grid-template-columns: minmax(0, 1fr) auto; }
.plan-step.plan-step--ro > :not(.plan-step__badge):not(.plan-step__title) { grid-column: 1 / -1; }
.plan-step.plan-step--ro .plan-step__badge { grid-row: auto; }
@media (max-width: 560px) {
  .plan-step.plan-step--ro { grid-template-columns: minmax(0, 1fr); }
  .plan-step.plan-step--ro .plan-step__badge { grid-column: 1; justify-self: start; }
}
