:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --side: #f8f9fb;
  --ink: #1c2633;
  --muted: #6b7480;
  --line: #e2e4e8;
  --navy: #1d3a5f;
  --navy-ink: #ffffff;
  --navy-soft: #e8eef6;
  --gold: #c49a45;
  --gold-soft: #f7efdd;
  --warn: #9a5b00;
  --warn-soft: #fff4e0;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(20, 35, 55, .06);
  --bar-h: 60px;
  color-scheme: light;
}
/* Сайт всегда светлый: тёмную тему системы не подхватываем. */

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--navy); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* каркас: шапка, панель слева, чат справа */
.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
  height: 100dvh; padding-top: env(safe-area-inset-top, 0px); }
.bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; height: var(--bar-h); padding: 0 28px;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--navy); color: var(--gold); display: grid; place-items: center; }
.brand-name { font: 700 21px/1 Lora, Georgia, serif; color: var(--navy); letter-spacing: -.01em; }
.bar-sep { width: 1px; height: 22px; background: var(--line); }
.bar-label { color: var(--muted); font-size: 15px; }
.bar-btn { background: transparent; border: 1px solid var(--line); color: var(--ink); border-radius: 9px;
  padding: 7px 12px; font: 600 13px Inter, system-ui, sans-serif; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; -webkit-tap-highlight-color: transparent; }
.bar-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.bar-btn:hover { border-color: var(--navy); color: var(--navy); }
.bar-new { margin-left: auto; }
/* только для телефона/планшета: кнопка «О сервисе», полоска консультанта, шторка */
.sep-m, .bar-about, .consultant-live, .consultant-more, .sheet-head, .side-links, .sheet-backdrop { display: none; }

/* панель слева */
.side { background: var(--side); border-right: 1px solid var(--line); overflow-y: auto; }
.consultant { padding: 14px 16px 12px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--navy-soft), transparent); }
.consultant-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.big-avatar { position: relative; width: 56px; height: 56px; flex-shrink: 0; border-radius: 50%; background: var(--navy);
  box-shadow: 0 0 0 2px var(--gold); }
.big-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.online { position: absolute; right: 0; bottom: 2px; width: 12px; height: 12px; border-radius: 50%; background: #2fb36b; border: 2px solid var(--surface); }
.consultant-name { font: 700 15.5px/1.25 Lora, Georgia, serif; margin: 0 0 3px; color: var(--navy); white-space: nowrap; }
.consultant-sub { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
/* показатели: всегда ровная сетка; до загрузки цифр блок невидим, но место занимает — ничего не прыгает */
.kpis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; align-items: start;
  border-top: 1px solid var(--line); padding-top: 10px; min-height: 52px; transition: opacity .2s; }
.kpis.loading { visibility: hidden; opacity: 0; }
.kpis > div { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.kpis b { font: 700 15px/1.2 Lora, Georgia, serif; color: var(--navy); white-space: nowrap; }
.kpis b i { font: inherit; font-style: normal; }
.kpis b .star { font-size: .85em; color: var(--gold); }
/* защита от копирования: текст документа и переписки не выделяется (поля ввода — можно) */
.no-copy .messages, .no-copy .paper { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.kpis span { font-size: 10.5px; line-height: 1.25; color: var(--muted); overflow-wrap: anywhere; hyphens: auto; }
.review p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.side-block { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.side-block h3 { margin: 0 0 8px; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 7px; }
.steps li { counter-increment: s; position: relative; padding-left: 28px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.steps li b { color: var(--ink); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 19px; height: 19px; border-radius: 50%;
  background: var(--navy); color: var(--navy-ink); font: 700 11px/19px Inter, sans-serif; text-align: center; }
.why { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.why li { font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.why li b { color: var(--ink); }
.reviews { display: grid; gap: 7px; }
.review { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; line-height: 1.45; }
.review-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.review-top b { font-size: 13px; }
.stars { color: var(--gold); letter-spacing: 1px; font-size: 12px; }
.review p { margin: 0 0 5px; color: var(--muted); }
.review-tag { display: inline-block; background: var(--navy-soft); color: var(--navy); border-radius: 6px; padding: 2px 8px; font-size: 11.5px; font-weight: 600; }
.demo-tag { background: var(--warn-soft); color: var(--warn); border-radius: 6px; padding: 1px 6px; font-size: 10px; letter-spacing: .05em; margin-left: 6px; }
details { border-bottom: 1px dashed var(--line); padding: 6px 0; font-size: 12.5px; }
details:last-child { border-bottom: 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 6px 0 0; color: var(--muted); }

/* чат */
.chat { display: flex; flex-direction: column; min-height: 0; }
.messages { flex: 1; overflow-y: auto; padding: 24px 28px 12px; display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; gap: 12px; max-width: 760px; }
.msg.user { align-self: flex-end; max-width: 640px; }
.msg-avatar { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; background: var(--navy); color: #f1ece2;
  display: grid; place-items: end center; overflow: hidden; box-shadow: 0 0 0 2px var(--gold); }
.msg-main { min-width: 0; flex: 1; }
.msg-name { font-size: 12px; color: var(--muted); margin: 0 0 4px 2px; }
.bubble { padding: 14px 18px; border-radius: 16px; overflow-wrap: anywhere; }
.msg.assistant .bubble { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-top-left-radius: 4px; }
.msg.user .bubble { background: var(--navy); color: var(--navy-ink); border-top-right-radius: 4px; }
.bubble p { margin: 0 0 10px; } .bubble p:last-child { margin-bottom: 0; }
.msg.assistant .bubble b { color: var(--navy); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.quick button { border: 1px solid var(--navy); color: var(--navy); background: var(--surface); border-radius: 999px;
  padding: 8px 15px; font: 600 14px Inter, system-ui, sans-serif; cursor: pointer; }
@media (hover: hover) { .quick button:hover { background: var(--navy); color: var(--navy-ink); } }
.typing { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 10px; }
.dots span { display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%; background: var(--gold); animation: blink 1.2s infinite; }
.dots span:nth-child(2) { animation-delay: .2s; } .dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.err-msg { align-self: center; color: var(--warn); background: var(--warn-soft); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.err-msg button { margin-left: 8px; }

.dock { background: var(--surface); border-top: 1px solid var(--line); padding: 14px 24px 10px; }
.composer { display: flex; gap: 10px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; border: 1.5px solid var(--navy); border-radius: 12px; padding: 12px 14px;
  font: 15px/1.4 Inter, system-ui, sans-serif; background: var(--surface); color: var(--ink); max-height: 180px; min-height: 48px; }
.composer textarea:focus { outline: 3px solid var(--navy-soft); }
.send { width: 48px; height: 48px; flex-shrink: 0; border-radius: 12px; border: 0; background: var(--navy); color: var(--navy-ink); cursor: pointer; display: grid; place-items: center; }
.send:disabled { opacity: .5; cursor: default; }
.composer-note { text-align: center; font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.foot { background: var(--bg); border-top: 1px solid var(--line); padding: 10px 24px calc(10px + env(safe-area-inset-bottom, 0px)); font-size: 12.5px; }
.foot-links { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); }
.foot-req { color: var(--muted); margin-top: 2px; font-size: 11.5px; }

button.primary { background: var(--navy); color: var(--navy-ink); border: 0; border-radius: 12px; padding: 12px 18px; font: 700 15px Inter, system-ui, sans-serif; cursor: pointer; }
a.btn-primary { display: inline-block; background: var(--navy); color: var(--navy-ink); border-radius: 12px; padding: 12px 18px; font: 700 15px Inter, system-ui, sans-serif; text-decoration: none; }
button.gold { background: var(--gold); color: #1c1407; border: 0; border-radius: 12px; padding: 13px 20px; font: 700 15px Inter, system-ui, sans-serif; cursor: pointer; }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; font: 600 14px Inter, system-ui, sans-serif; cursor: pointer; }
button.ghost.small { padding: 6px 10px; font-size: 12px; }

/* карточка документа */
.doc { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.doc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; background: var(--navy); color: var(--navy-ink); font-size: 14px; }
.doc-head span { white-space: nowrap; font-size: 12.5px; opacity: .8; }
.paper { font: 15px/1.55 "Times New Roman", Times, serif; padding: 22px 26px; max-height: 340px; overflow: auto; color: #1b1b1b; background: #fff;
  border-bottom: 1px solid var(--line); }
.paper .ln { min-height: 1.5em; white-space: pre-wrap; }
.paper .ln .mk { filter: blur(3.2px); user-select: none; color: #444; }
.paper.full { max-height: 520px; }
.doc-body { padding: 16px; display: grid; gap: 12px; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.facts li::before { content: "✓ "; color: var(--gold); font-weight: 800; }
.hook { background: var(--gold-soft); border-radius: 10px; padding: 10px 12px; font-weight: 600; }
.fields-note { font-size: 13px; color: var(--muted); }
.pay-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pay-row .price { font: 700 24px Lora, Georgia, serif; color: var(--navy); }
.paid-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #e3f4ea; color: #1d7a45; }
.doc-body details { border: 0; padding: 0; }

/* оплата */
.pay-dialog { border: 0; border-radius: 18px; padding: 22px; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.pay-dialog::backdrop { background: rgba(15, 25, 40, .5); }
.pay-dialog h3 { margin: 0 0 4px; font: 700 20px Lora, Georgia, serif; color: var(--navy); }
.pay-dialog label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 14px; }
.pay-dialog input { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font: 16px Inter, system-ui, sans-serif; background: var(--bg); color: var(--ink); }
.pay-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.err { color: var(--warn); font-size: 14px; margin: 8px 0 0; }

/* вложения */
.attach { width: 48px; height: 48px; flex-shrink: 0; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
  color: var(--navy); cursor: pointer; display: grid; place-items: center; }
.attach:hover { border-color: var(--navy); }
.attach-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; min-width: 0; background: var(--navy-soft); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px 6px 10px; font-size: 13px; line-height: 1.3; }
.chip svg { flex-shrink: 0; color: var(--navy); }
.chip .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.chip .st { color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.chip.err { background: var(--warn-soft); }
.chip.err .st { color: var(--warn); white-space: normal; }
.chip .x { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 2px; }
.chip .x:hover { color: var(--ink); }
.chip .spin { width: 11px; height: 11px; border: 2px solid var(--line); border-top-color: var(--navy); border-radius: 50%;
  animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chip-note { font-size: 12px; color: var(--warn); align-self: center; }
.msg-files { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 6px; }
.msg.user .chip { background: var(--surface); }
main.chat { position: relative; }
main.chat.dragging::after { content: "Отпустите файл, чтобы приложить"; position: absolute; inset: 10px; display: grid; place-items: center;
  border: 2px dashed var(--navy); border-radius: 16px; background: rgba(232, 238, 246, .85); color: var(--navy);
  font: 700 17px Inter, system-ui, sans-serif; pointer-events: none; z-index: 5; }
a.btn-secondary { display: inline-block; background: var(--surface); color: var(--navy); border: 1.5px solid var(--navy); border-radius: 12px;
  padding: 10.5px 16px; font: 700 15px Inter, system-ui, sans-serif; text-decoration: none; }
.mail-row { justify-content: space-between; }

/* ── планшет и телефон (≤900px) ─────────────────────────────────────
   Шапка → полоска консультанта с показателями → чат. Остальное из левой панели
   (как работает, отзывы, вопросы, ссылки) — в выдвижной шторке «О сервисе» (.side-more). */
@media (max-width: 900px) {
  :root { --bar-h: 56px; }
  html, body { overflow: hidden; }
  /* высота = видимая область (JS подставляет visualViewport: клавиатура iOS не перекрывает поле ввода) */
  .app { position: fixed; inset-inline: 0; top: var(--vv-top, 0px); height: var(--app-h, 100dvh);
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); }
  .bar { height: calc(var(--bar-h)); padding: 0 10px 0 14px; gap: 8px; }
  .logo { gap: 9px; min-width: 0; }
  .logo-mark { width: 32px; height: 32px; }
  .brand-name { font-size: 19px; white-space: nowrap; }
  .bar-label, .bar-sep { display: none; }
  .bar-btn { height: 44px; min-width: 44px; padding: 0 12px; border-radius: 12px; font-size: 13.5px; gap: 6px; color: var(--navy); }
  .bar-btn svg { width: 20px; height: 20px; }
  .bar-about { display: inline-flex; margin-left: auto; }
  .bar-new { margin-left: 0; padding: 0; width: 44px; }
  .bar-new .lbl { display: none; }
  .bar-btn:active { background: var(--navy-soft); }

  /* полоска консультанта */
  .side { grid-column: 1; grid-row: 2; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); background: var(--surface); }
  .consultant { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 1px;
    align-items: center; padding: 8px 12px; border-bottom: 0; background: linear-gradient(90deg, var(--navy-soft), var(--surface) 75%); }
  .consultant-head { display: contents; }
  .big-avatar { grid-row: 1 / span 2; width: 42px; height: 42px; box-shadow: 0 0 0 1.5px var(--gold); }
  .online { width: 11px; height: 11px; right: -1px; bottom: 0; }
  .consultant-id { grid-column: 2; grid-row: 1; display: flex; align-items: baseline; gap: 8px; min-width: 0; padding-right: 96px; }
  .consultant-name { font-size: 14.5px; margin: 0; overflow: hidden; text-overflow: ellipsis; }
  .consultant-sub { display: none; }
  .consultant-live { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-size: 12px; color: #1d7a45; white-space: nowrap; }
  .consultant-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #2fb36b; }
  /* вся полоска — кнопка «Подробнее» (растянутая область нажатия) */
  .consultant-more { grid-column: 2; grid-row: 1; justify-self: end; display: inline-flex; align-items: center; gap: 1px;
    border: 0; background: transparent; color: var(--navy); font: 600 12.5px Inter, system-ui, sans-serif; padding: 0; cursor: pointer;
    -webkit-tap-highlight-color: transparent; }
  .consultant-more::after { content: ""; position: absolute; inset: 0; }
  .consultant:active { background: var(--navy-soft); }
  .kpis { grid-column: 2; grid-row: 2; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 7px; row-gap: 0;
    border-top: 0; padding: 0; min-height: 19px; }
  .kpis > div { flex-direction: row; align-items: baseline; gap: 4px; }
  .kpis > div:not([hidden]) ~ div::before { content: "·"; color: var(--muted); margin-right: 3px; }
  .kpis b { font-size: 13.5px; }
  .kpis span { font-size: 11.5px; white-space: nowrap; }
  #ratingKpi span { display: none; }

  /* шторка «О сервисе» */
  .sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(15, 25, 40, .45);
    opacity: 0; pointer-events: none; transition: opacity .25s; }
  .side-more { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 640px; margin: 0 auto;
    max-height: calc(var(--app-h, 100dvh) - 48px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    background: var(--side); border-radius: 20px 20px 0 0; box-shadow: 0 -12px 40px rgba(15, 25, 40, .18);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateY(105%); visibility: hidden; transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .3s; }
  body.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
  body.sheet-open .side-more { transform: translateY(var(--sheet-drag, 0px)); visibility: visible; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
  body.sheet-dragging .side-more { transition: none; }
  .sheet-head { display: flex; align-items: center; position: sticky; top: 0; z-index: 1; padding: 16px 6px 8px 18px;
    background: var(--side); border-bottom: 1px solid var(--line); touch-action: none; }
  .sheet-grip { position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: #cfd3d9; }
  .sheet-title { flex: 1; margin: 0; font: 700 19px/1.3 Lora, Georgia, serif; color: var(--navy); }
  .sheet-close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted);
    display: grid; place-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .sheet-close:active { background: var(--navy-soft); }
  .side-more .side-block { padding: 16px 18px; }
  .side-more .side-block h3 { font-size: 12px; margin-bottom: 10px; }
  .steps { gap: 10px; }
  .steps li { font-size: 14.5px; padding-left: 32px; }
  .steps li::before { width: 22px; height: 22px; font-size: 12px; line-height: 22px; }
  .why { gap: 10px; }
  .why li { font-size: 14.5px; }
  .reviews { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -18px; padding: 0 18px 4px; scroll-padding-inline: 18px;
    scrollbar-width: none; overscroll-behavior-x: contain; }
  .reviews::-webkit-scrollbar { display: none; }
  .review { flex: 0 0 min(82%, 300px); scroll-snap-align: start; font-size: 14px; padding: 12px 14px; border-radius: 12px; }
  .review p { -webkit-line-clamp: 5; }
  .side-more details { font-size: 14.5px; padding: 0; }
  .side-more summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; list-style: none; }
  .side-more summary::-webkit-details-marker { display: none; }
  .side-more summary::after { content: ""; flex-shrink: 0; width: 8px; height: 8px; margin: -4px 4px 0 0; border: solid var(--navy);
    border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s; }
  .side-more details[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
  .side-more details p { margin: 0 0 12px; }
  .side-links { display: block; font-size: 13px; color: var(--muted); border-bottom: 0; }
  .side-links p { margin: 10px 0 0; }
  .side-links .side-req { font-size: 11.5px; }
  .side-cta { display: flex; align-items: center; justify-content: center; min-height: 46px; border-radius: 12px; border: 1.5px solid var(--navy);
    color: var(--navy); background: var(--surface); font-weight: 700; text-decoration: none; font-size: 15px; }

  /* чат */
  .chat { grid-column: 1; grid-row: 3; min-height: 0; }
  .messages { padding: 14px 12px 12px; gap: 14px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .msg { gap: 8px; max-width: 100%; }
  .msg.user { max-width: 88%; }
  .msg-avatar { width: 30px; height: 30px; box-shadow: 0 0 0 1.5px var(--gold); }
  .msg-name { font-size: 11.5px; margin-bottom: 3px; }
  .bubble { padding: 11px 14px; line-height: 1.5; border-radius: 16px; }
  .bubble p { margin-bottom: 8px; }
  .quick { gap: 8px; margin-top: 10px; }
  .quick button { min-height: 42px; max-width: 100%; padding: 9px 15px; border-radius: 21px; font-size: 14.5px; line-height: 1.3; text-align: left;
    white-space: normal; overflow-wrap: anywhere; -webkit-tap-highlight-color: transparent; }
  .quick button:active { background: var(--navy); color: var(--navy-ink); }
  .typing { font-size: 13.5px; }
  .err-msg { max-width: 100%; text-align: center; }
  .err-msg button { margin: 8px 0 0; min-height: 40px; }

  /* карточка документа — на всю ширину (под аватаром тоже) */
  .msg.assistant .doc { margin-left: -38px; }
  .doc { border-radius: 14px; }
  .doc-head { flex-wrap: wrap; row-gap: 2px; padding: 10px 14px; }
  .doc-head b { min-width: 0; overflow-wrap: anywhere; }
  .doc-head span.muted { color: rgba(255, 255, 255, .72); opacity: 1; }
  .paper { padding: 14px 16px; font-size: 14px; max-height: 300px; overscroll-behavior: contain; }
  .paper.full { max-height: 55vh; }
  .doc-body { padding: 14px; }
  .facts { font-size: 14px; }
  .hook { font-size: 14.5px; }
  .pay-row .price { font-size: 22px; }
  .pay-row .pay-btn { flex: 1 1 180px; min-height: 48px; }
  .paid-row .btn-primary, .paid-row .btn-secondary { flex: 1 1 140px; display: flex; align-items: center; justify-content: center;
    min-height: 48px; padding: 10px 14px; text-align: center; }
  .mail-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .mail-row .mail-btn { width: 100%; min-height: 44px; font-size: 14px; }
  .doc-body details summary { padding: 6px 0; }
  .doc-body details ol { padding-left: 20px; margin: 6px 0 0; }

  /* поле ввода */
  .dock { padding: 8px 10px calc(6px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -4px 14px rgba(20, 35, 55, .04); }
  .composer { gap: 8px; }
  .composer textarea { font-size: 16px; line-height: 1.4; min-height: 44px; max-height: 30vh; padding: 10px 14px; border-radius: 22px; }
  .composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .attach, .send { width: 44px; height: 44px; border-radius: 50%; }
  .composer-note { font-size: 11px; line-height: 1.4; margin-top: 6px; }
  .composer-note .kbd, .composer-note .br-d { display: none; }
  .composer-note .sep-m { display: inline; }
  .foot { display: none; }
  /* плашки вложений: переносятся по строкам, длинное имя — с многоточием, ширину экрана не ломают */
  .attach-row { gap: 6px; margin-bottom: 8px; max-height: min(30vh, 190px); overflow-y: auto; overscroll-behavior: contain; }
  .chip { max-width: 100%; padding: 5px 4px 5px 10px; }
  .chip .nm { max-width: none; min-width: 0; flex: 0 1 auto; }
  .chip .st { flex-shrink: 0; }
  .chip.err { flex-wrap: wrap; row-gap: 0; }
  .chip.err .nm { flex: 1 1 0; }
  .chip.err .st { order: 3; flex: 1 1 100%; padding: 0 8px 3px 22px; white-space: normal; min-width: 0; }
  .chip .x { min-width: 30px; min-height: 30px; flex-shrink: 0; }
  .chip-note { flex-basis: 100%; }
  /* клавиатура открыта: прячем всё лишнее, чтобы переписке хватило места */
  body.kb-open .side { display: none; }
  body.kb-open .dock { padding-bottom: 8px; }
}

/* телефон */
@media (max-width: 600px) {
  /* оплата — лист снизу */
  .pay-dialog { width: 100%; max-width: 100%; margin: auto 0 var(--kb, 0px); max-height: calc(var(--app-h, 100dvh) - 24px); overflow-y: auto;
    border-radius: 20px 20px 0 0; padding: 22px 18px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .pay-dialog[open] { animation: sheet-up .28s cubic-bezier(.2, .8, .2, 1); }
  .pay-dialog h3 { font-size: 21px; padding-right: 8px; }
  .pay-dialog input { min-height: 48px; }
  .pay-actions { flex-direction: column-reverse; gap: 8px; }
  .pay-actions button { width: 100%; min-height: 48px; }
  .pay-actions .ghost { border: 0; color: var(--muted); }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@media (max-width: 379px) {
  .bar-about .lbl { display: none; }
  .consultant { padding: 8px 10px; column-gap: 9px; }
  .big-avatar { width: 40px; height: 40px; }
  .kpis { column-gap: 9px; }
  .kpis > div:not([hidden]) ~ div::before { content: none; }
  .kpis b { font-size: 13px; }
  .kpis span { font-size: 11px; }
  .bar-about { padding: 0; width: 44px; }
  .brand-name { font-size: 18px; }
}
@media (max-width: 420px) {
  .consultant-more span { display: none; }
  .consultant-id { padding-right: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .side-more, .sheet-backdrop { transition: none !important; }
  .pay-dialog[open] { animation: none; }
}

/* согласие на обработку ПДн (до первого сообщения) */
.consent-row { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; line-height: 1.4; color: var(--muted);
  margin: 8px auto 0; max-width: 760px; cursor: pointer; }
.consent-row input { margin-top: 2px; width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--navy); }
.consent-row.need { color: var(--warn); animation: consent-shake .3s; }
@keyframes consent-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .consent-row.need { animation: none; } }

.foot-note { margin-top: 4px; font-size: 12px; color: var(--muted); }

/* заголовок страницы в шапке — h1 без собственных отступов */
h1.bar-label { margin: 0; font-weight: 400; line-height: 1.2; }
/* SEO-текст под спойлером внизу панели «О сервисе» */
.seo-text details { border: 0; padding: 0; }
.seo-text summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.seo-text summary::-webkit-details-marker { display: none; }
.seo-text summary::after { content: ""; width: 7px; height: 7px; flex-shrink: 0; border: solid var(--navy); border-width: 0 2px 2px 0;
  transform: rotate(45deg); margin-top: -4px; transition: transform .15s; }
.seo-text details[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.seo-text summary h2 { margin: 0; font: 700 14px/1.35 Inter, system-ui, sans-serif; color: var(--ink); }
.seo-body { font-size: 13px; line-height: 1.55; color: var(--ink); }
.seo-body p, .seo-body ul, .seo-body ol { margin: 8px 0; color: var(--ink); }
.seo-body ul, .seo-body ol { padding-left: 18px; }
.seo-body li { margin: 3px 0; }
.seo-body h3 { margin: 14px 0 4px; font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--navy); }
.seo-cta { margin-top: 8px; width: 100%; background: var(--navy); color: var(--navy-ink); border: 0; border-radius: 10px; padding: 10px 14px;
  font: 700 14px Inter, system-ui, sans-serif; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .seo-text summary::after { transition: none; } }

/* приветственный блок с иллюстрацией (до первого сообщения человека) */
.welcome-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); align-items: center; gap: 8px;
  max-width: 760px; margin-left: 56px; background: #efece5; border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 10px 16px 26px; overflow: hidden; flex-shrink: 0; }
.wh-text h2 { margin: 0 0 12px; font: 700 23px/1.25 Lora, Georgia, serif; color: var(--navy); text-wrap: balance; }
.wh-text ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wh-text li { position: relative; padding-left: 26px; font-size: 14.5px; line-height: 1.4; color: var(--ink); }
.wh-text li::before { content: ""; position: absolute; left: 2px; top: 3px; width: 13px; height: 7px; border: solid var(--gold);
  border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg); }
.wh-img img { display: block; width: 100%; height: auto; }
@media (max-width: 900px) {
  .welcome-hero { margin-left: 0; grid-template-columns: minmax(0, 1fr) 132px; padding: 12px 6px 12px 16px; gap: 4px; }
  .wh-text h2 { font-size: 17px; margin-bottom: 8px; }
  .wh-text li { font-size: 13px; padding-left: 22px; }
  .wh-text li::before { width: 11px; height: 6px; top: 4px; }
}
@media (max-width: 360px) { .welcome-hero { grid-template-columns: minmax(0, 1fr) 104px; } }

/* логотип — картинка со своим фоном и скруглением */
.logo-mark { background: none; overflow: hidden; }
.logo-mark img { display: block; width: 100%; height: 100%; }

/* ссылки на посадочные по ситуациям */
.land-links ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.land-links a { display: block; font-size: 13px; text-decoration: none; color: var(--navy); padding: 3px 0; }
.land-links a:hover { text-decoration: underline; }

/* исправления по QA 24.11 */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.doc.old { opacity: .72; }
.doc.old .paper { max-height: 140px; }
.old-badge { margin-left: 8px; background: var(--warn-soft); color: var(--warn); border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 700; }
.doc-table { border-collapse: collapse; margin: 6px 0 10px; font-size: 14px; width: 100%; }
.doc-table td { border: 1px solid #c9ccd2; padding: 4px 8px; vertical-align: top; }
.doc-table tr:first-child td { font-weight: 700; background: #f3f4f6; }
.ai-chip { display: inline-block; vertical-align: 2px; margin-left: 4px; background: var(--gold-soft); color: #8a6420; border: 1px solid #e8d4a8;
  border-radius: 6px; padding: 1px 6px; font: 700 11px/1.3 Inter, system-ui, sans-serif; letter-spacing: .04em; }
.my-chats ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.my-chats li { display: grid; gap: 1px; }
.my-chats a { font-size: 13px; color: var(--navy); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-chats a:hover { text-decoration: underline; }
.my-chats span { font-size: 11.5px; color: var(--muted); }
.my-chats li.cur a { font-weight: 700; }
