/* Публичный сайт для граждан (/site/*). Тёмная тема, те же CSS-переменные,
   что в Mini App. Без внешних CDN, шрифтов и картинок. */

:root {
  color-scheme: dark;
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1c1f26;
  --accent: #6ea8fe;
  --accent-2: #8b5cf6;
  --text: #e8eaee;
  --muted: #9aa3b2;
  --border: #2a2f3a;
  --green: #22c55e;
  --gold: #f5c451;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --container: 1120px;
  /* Тема шапки и подвала: в тёмной они темнее фона, в светлой — светлее. */
  --header-bg: rgba(15, 17, 21, .92);
  --footer-bg: var(--panel);
  --accent-ink: #06101f;
}

/* Светлая тема. Выбор хранится в localStorage и cookie (lt_theme) и ставится
   атрибутом на <html> до первой отрисовки — без вспышки тёмного фона. */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7fb;
  --panel: #ffffff;
  --panel-2: #eef1f7;
  --accent: #2563eb;
  --accent-2: #7c3aed;
  --text: #111827;
  --muted: #56607a;
  --border: #d9dfeb;
  --green: #15803d;
  --gold: #b45309;
  --shadow: 0 10px 30px rgba(17, 24, 39, .08);
  --header-bg: rgba(246, 247, 251, .92);
  --footer-bg: #eef1f7;
  --accent-ink: #ffffff;
}
html[data-theme="light"] .brand-mark,
html[data-theme="light"] .btn-primary,
html[data-theme="light"] .step-num,
html[data-theme="light"] .svg-avatar { color: var(--accent-ink); }
html[data-theme="light"] .ask-card textarea::placeholder,
html[data-theme="light"] .chat-compose textarea::placeholder { color: #7b869e; }
html[data-theme="light"] .sheet { background: #fff; color: #111; }
html[data-theme="light"] .mock-msg,
html[data-theme="light"] .chat-msg-bot { background: var(--panel-2); }
/* Кнопка темы: компактная, не ломает шапку на телефоне. */
.theme-toggle {
  margin-left: 6px; width: 44px; height: 44px; flex: 0 0 auto;
  display: inline-grid; place-items: center; cursor: pointer;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--panel); color: var(--text); font-size: 17px; line-height: 1;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle .theme-icon-light { display: none; }
html[data-theme="light"] .theme-toggle .theme-icon-dark { display: none; }
html[data-theme="light"] .theme-toggle .theme-icon-light { display: inline; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(28px, 5vw, 44px); letter-spacing: -.02em; }
h2 { font-size: clamp(22px, 3.4vw, 32px); letter-spacing: -.01em; }
h3 { font-size: 19px; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.section { padding: 48px 0; }
.section-head { max-width: 720px; margin-bottom: 24px; }
.muted { color: var(--muted); }
.eyebrow { color: var(--accent); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }

/* --- header --- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06101f; font-weight: 900;
}
.site-nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: nowrap; }
.site-nav a {
  color: var(--muted); padding: 7px 9px; border-radius: 10px; font-size: 14px; min-height: 44px;
  display: inline-flex; align-items: center; white-space: nowrap;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); background: var(--panel); text-decoration: none; }
.header-cta { margin-left: 8px; white-space: nowrap; }
/* Второстепенные пункты меню скрываем, пока не хватает ширины. */
@media (max-width: 1199px) {
  .site-nav .nav-wide { display: none; }
}
.burger {
  display: none; margin-left: auto; width: 46px; height: 46px; border: 1px solid var(--border);
  background: var(--panel); border-radius: 12px; color: var(--text); font-size: 20px; cursor: pointer;
}

/* --- buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 20px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-weight: 600; font-size: 15px; cursor: pointer;
}
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06101f; border: 0; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }

/* --- cards & grid --- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; transition: border-color .2s, transform .2s, box-shadow .2s; }
.card:hover { border-color: #3a4150; transform: translateY(-2px); box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 13px; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); }
.badge.accent { color: var(--accent); border-color: rgba(110, 168, 254, .4); background: rgba(110, 168, 254, .1); }
.chip { display: inline-block; padding: 8px 14px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font-size: 14px; cursor: pointer; min-height: 40px; }
.chip:hover { border-color: var(--accent); }
.chip.active { background: rgba(110, 168, 254, .14); border-color: var(--accent); color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* --- hero --- */
.hero { padding: 56px 0 32px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: center; }
.hero h1 span { background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0; }
.trust { display: flex; flex-wrap: wrap; gap: 10px; }

/* CSS-мокап телефона */
.mock-phone { width: 100%; max-width: 320px; margin: 0 auto; border: 1px solid var(--border); border-radius: 28px; padding: 12px; background: var(--panel); box-shadow: var(--shadow); }
.mock-screen { background: var(--bg); border-radius: 20px; padding: 14px; }
.mock-msg { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; font-size: 14px; }
.mock-msg.user { background: rgba(110, 168, 254, .14); border-color: rgba(110, 168, 254, .4); margin-left: 32px; }
.mock-cursor { display: inline-block; width: 8px; height: 14px; background: var(--accent); animation: blink 1s steps(1) infinite; vertical-align: middle; }
@keyframes blink { 50% { opacity: 0; } }

/* --- steps, numbers --- */
.step-num { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06101f; font-weight: 800; margin-bottom: 12px; }
.stat .value { font-size: 34px; font-weight: 800; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat .label { color: var(--muted); font-size: 14px; }

/* --- faq accordion --- */
.faq-item { border: 1px solid var(--border); border-radius: 14px; background: var(--panel); margin-bottom: 10px; }
.faq-item > summary, .legal-section > summary {
  cursor: pointer; padding: 16px 18px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px;
}
.faq-item > summary::-webkit-details-marker, .legal-section > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after, .legal-section > summary::after { content: "+"; color: var(--accent); font-weight: 800; }
.faq-item[open] > summary::after, .legal-section[open] > summary::after { content: "–"; }
.faq-item .faq-body, .legal-section .legal-body { padding: 0 18px 16px; color: var(--muted); }

/* --- timeline --- */
.timeline { position: relative; margin-left: 12px; padding-left: 26px; border-left: 2px solid var(--border); }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-item::before { content: ""; position: absolute; left: -34px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(110, 168, 254, .16); }
.timeline-year { font-weight: 800; color: var(--accent); }
.timeline-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-top: 6px; }

/* --- tables --- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.compare { width: 100%; border-collapse: collapse; min-width: 560px; }
table.compare th, table.compare td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; font-size: 14px; }
table.compare th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; background: var(--panel-2); }
table.compare tr:last-child td { border-bottom: 0; }
.yes { color: var(--green); } .no { color: var(--muted); }

/* --- footer --- */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 36px 0 24px; background: var(--footer-bg); }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.footer-grid h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 10px; }
.footer-grid a { display: block; color: var(--text); padding: 4px 0; font-size: 14px; }
.footer-bottom { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
/* BUG-10: юридический текст и переключатель языка читаются без прищура. */
.footer-legal { color: #a8b0c0; }
.lang-switch { text-align: center; padding: 12px 0; color: #a8b0c0; font-size: 14px; }
.lang-switch a { color: var(--accent); }

/* --- таблица на мобильных: подсказка о горизонтальном скролле --- */
.table-hint { display: none; }

/* --- misc --- */
.notice { border: 1px solid rgba(245, 196, 81, .4); background: rgba(245, 196, 81, .1); color: var(--gold); border-radius: 14px; padding: 14px 16px; }
.danger { border-color: rgba(239, 68, 68, .4); background: rgba(239, 68, 68, .1); color: #fca5a5; }
.soon { border: 1px dashed var(--border); border-radius: 14px; padding: 14px 16px; color: var(--muted); }
.pricing-card { display: flex; flex-direction: column; }
.pricing-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
/* 5 тарифов: 3 в первом ряду, 2 по центру во втором (без «сиротской» ячейки). */
.pricing-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.pricing-grid > .pricing-card { flex: 1 1 300px; max-width: 360px; }
.pricing-price { font-size: 30px; font-weight: 800; }
.list-check { list-style: none; padding: 0; margin: 0 0 16px; }
.list-check li { padding-left: 26px; position: relative; margin-bottom: 8px; }
.list-check li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.search-input { width: 100%; min-height: 48px; padding: 12px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border); color: var(--text); font-size: 15px; }
.empty-state { text-align: center; color: var(--muted); padding: 32px; border: 1px dashed var(--border); border-radius: 14px; }
.svg-avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #06101f; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.breadcrumbs { color: var(--muted); font-size: 13px; margin-bottom: 8px; }

/* --- mobile --- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .site-nav { display: none; }
  .site-nav.open { display: flex; position: absolute; top: 60px; left: 0; right: 0; background: var(--panel); border-bottom: 1px solid var(--border); padding: 12px; flex-direction: column; flex-wrap: nowrap; }
  .site-nav.open a { min-height: 48px; }
  .burger { display: inline-flex; align-items: center; justify-content: center; }
  .header-cta { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .pricing-grid > .pricing-card { flex-basis: 100%; max-width: none; }
  .table-hint { display: block; margin: 8px 0 0; color: var(--muted); font-size: 13px; }
  table.compare { min-width: 520px; }
  table.compare th:first-child, table.compare td:first-child {
    position: sticky; left: 0; z-index: 1; background: var(--bg);
  }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 32px 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !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;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-sub { font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: .02em; }

/* --- рабочий стол: вопрос в центре внимания --- */
.hero-lead { max-width: 820px; margin-bottom: 18px; }
.hero-lead .badge { font-size: 15px; padding: 7px 16px; font-weight: 600; }
.hero-accent {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: clamp(16px, 2.1vw, 19px); color: var(--muted); margin: 10px 0 0; max-width: 700px; }
.hero-trust {
  display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 16px;
  color: var(--muted); font-size: 13.5px;
}
.hero-trust b { color: var(--text); font-weight: 700; }
.ask-label { display: block; font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.ws-hero { padding: 32px 0 8px; }
.ws-hero h1 { font-size: clamp(26px, 3.8vw, 42px); margin: 8px 0 10px; max-width: 760px; }
.ws-hero .muted { max-width: 620px; margin-bottom: 0; }
.ws-row { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 20px; }
.ws-row h2 { margin-bottom: 0; }
.ws-status { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; white-space: nowrap; }
.ws-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(34, 197, 94, .15); }

.ask-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); margin-top: 16px;
}
.ask-field { position: relative; }
.ask-card textarea {
  width: 100%; min-height: 112px; resize: vertical; display: block;
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px 62px; font: inherit; line-height: 1.55;
}
.ask-card textarea::placeholder, .chat-compose textarea::placeholder { color: #6f7889; }
.ask-card textarea:focus { outline: 2px solid rgba(110, 168, 254, .5); outline-offset: 1px; border-color: transparent; }
.ask-submit { position: absolute; right: 10px; bottom: 10px; min-height: 44px; padding: 0 18px; }
.ask-submit-arrow { font-size: 17px; line-height: 1; }
.ask-submit-text { white-space: nowrap; }
.ask-examples { display: flex; align-items: center; gap: 8px; margin-top: 12px; min-width: 0; }
.ask-examples-label { color: var(--muted); font-size: 13px; white-space: nowrap; }
.ask-examples .chips { flex: 1; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.ask-examples .chips::-webkit-scrollbar { display: none; }
.ask-examples .chip { white-space: nowrap; flex: 0 0 auto; }
.ask-hint { font-size: 12.5px; margin: 10px 2px 0; }

.tool-card { display: block; color: inherit; text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.tool-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.tool-card h3 { margin-bottom: 6px; }
.tool-card p { margin: 0; }
.area-card { display: block; color: inherit; text-decoration: none; }
.area-card:hover { border-color: var(--accent); text-decoration: none; }

.bot-card {
  display: grid; grid-template-columns: 1.4fr .6fr; gap: 24px; align-items: center;
  background: linear-gradient(135deg, rgba(110, 168, 254, .12), rgba(139, 92, 246, .12));
  border: 1px solid rgba(110, 168, 254, .35); border-radius: var(--radius);
  padding: 26px;
}
.bot-card-text { min-width: 0; }
.bot-card h2 { margin-bottom: 8px; }
.bot-card-note { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }

/* --- чат: на весь экран, как в мессенджере --- */
.chat-page { padding: 14px 0 0; }
.chat-page .container { max-width: 900px; }
.chat-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; }
.chat-head h1 { margin: 0 0 2px; font-size: clamp(20px, 2.6vw, 26px); }
.chat-head .muted { font-size: 13.5px; margin: 0; }
.chat-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chat-head-actions .btn { min-height: 40px; padding: 8px 14px; font-size: 14px; }

.chat-shell {
  display: flex; flex-direction: column;
  height: calc(100vh - 240px); height: calc(100dvh - 240px);
  min-height: 420px; max-height: 780px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.chat-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.chat-empty { color: var(--muted); }
.chat-empty .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chat-empty .chips::-webkit-scrollbar { display: none; }
.chat-empty .chip { flex: 0 0 auto; white-space: nowrap; }

.chat-msg { font-size: 15px; line-height: 1.6; max-width: 100%; }
.chat-msg-user {
  align-self: flex-end; max-width: min(85%, 560px);
  background: rgba(110, 168, 254, .18); border: 1px solid rgba(110, 168, 254, .4);
  border-radius: 14px 4px 14px 14px; padding: 10px 14px; white-space: pre-wrap;
}
.chat-msg-bot {
  align-self: flex-start; width: 100%;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 4px 14px 14px 14px; padding: 12px 14px;
}
.chat-answer { overflow-wrap: anywhere; }
.chat-para { margin: 0 0 10px; }
.chat-para:last-child { margin-bottom: 0; }
.chat-list { padding-left: 4px; }
.chat-typing { display: inline-flex; gap: 5px; align-items: center; padding: 4px 2px; }
.chat-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: .35; animation: chat-blink 1.2s infinite ease-in-out; }
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes chat-blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

.chat-sources-box { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 10px; }
.chat-sources-toggle {
  background: var(--bg); color: var(--accent); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 13px; cursor: pointer;
}
.chat-sources-toggle:hover { border-color: var(--accent); }
.chat-sources { margin-top: 10px; display: grid; gap: 8px; }
.chat-source { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.chat-source-title { font-weight: 600; }
.chat-source-meta, .chat-source-note { font-size: 12.5px; margin-top: 2px; }
.chat-source a { font-size: 13px; display: inline-block; margin-top: 4px; }
.chat-msg-actions { margin-top: 10px; font-size: 13px; }
.chat-error { border: 1px solid rgba(239, 68, 68, .4); background: rgba(239, 68, 68, .08); border-radius: 12px; padding: 12px 14px; }
.chat-error p { margin: 0 0 10px; }

/* Гость исчерпал бесплатные консультации: не ошибка, а следующий шаг. */
.chat-limit-card {
  border: 1px solid rgba(110, 168, 254, .45);
  background: linear-gradient(180deg, rgba(110, 168, 254, .14), rgba(110, 168, 254, .05));
  border-radius: 14px; padding: 18px 18px 14px;
}
.chat-limit-title { margin: 0 0 8px; font-weight: 700; font-size: 16px; }
.chat-limit-lead { margin: 0 0 14px; color: var(--text); opacity: .92; line-height: 1.55; }
.chat-limit-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.chat-limit-actions .btn { text-decoration: none; }
.chat-limit-note { margin: 12px 0 0; font-size: 13px; }
@media (max-width: 480px) {
  .chat-limit-card { padding: 14px 14px 12px; }
  .chat-limit-actions .btn { width: 100%; justify-content: center; }
}

.chat-compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px; border-top: 1px solid var(--border); background: var(--panel-2); }
.chat-compose textarea {
  flex: 1; min-height: 46px; max-height: 150px; resize: none; display: block;
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; font: inherit; line-height: 1.5;
}
.chat-compose textarea:focus { outline: 2px solid rgba(110, 168, 254, .5); outline-offset: 1px; }
.chat-compose .btn { min-height: 46px; padding: 0 20px; }
.chat-send-icon { display: none; font-size: 18px; line-height: 1; }
.chat-note { margin: 8px 2px 12px; font-size: 12.5px; }

@media (max-width: 900px) {
  .bot-card { grid-template-columns: 1fr; padding: 20px; }
}

@media (max-width: 768px) {
  .ws-hero { padding: 18px 0 4px; }
  .ws-hero h1 { font-size: 25px; margin: 6px 0 8px; }
  .ws-hero .muted { font-size: 14.5px; }
  .ws-status { font-size: 12px; padding: 5px 10px; }
  .ask-card { padding: 12px; margin-top: 12px; }
  .ask-card textarea { min-height: 96px; padding: 12px 14px; }
  .ask-submit { position: static; width: 100%; margin-top: 10px; }
  .ask-submit-arrow { display: none; }
  .ask-examples { flex-direction: column; align-items: stretch; gap: 6px; }
  .ask-examples-label { display: none; }
  .ask-hint { font-size: 12px; }

  .chat-page { padding: 10px 0 0; }
  .chat-page .container { padding: 0 10px; }
  .chat-page .breadcrumbs, .chat-head .muted { display: none; }
  .chat-head { margin-bottom: 8px; }
  .chat-head-actions .btn:last-child { display: none; }
  .chat-shell {
    height: calc(100vh - 128px); height: calc(100dvh - 128px);
    min-height: 0; max-height: none;
  }
  .chat-log { padding: 12px; gap: 8px; }
  .chat-msg { font-size: 14.5px; }
  .chat-msg-user { max-width: 92%; }
  .chat-compose { padding: 8px; gap: 6px; }
  .chat-compose textarea { min-height: 44px; padding: 11px 12px; border-radius: 22px; }
  .chat-compose .btn { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; }
  .chat-send-text { display: none; }
  .chat-send-icon { display: inline; }
  .chat-note { display: none; }
}

/* --- Бланки (/site/blanks) --- */
.blank-hero { padding: 28px 0 8px; }
.blank-hero h1 { font-size: clamp(24px, 4vw, 38px); margin: 8px 0 10px; }
.blank-hero .search-input { margin: 14px 0 10px; }
.blank-card { display: flex; flex-direction: column; gap: 6px; }
.blank-card h3 { margin: 6px 0 0; font-size: 18px; }
.blank-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.blank-kind { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--green); }
.blank-kind.is-free { color: var(--gold); }
.blank-deadline { margin: 0; font-size: 13px; color: var(--muted); }
.blank-card-foot { display: flex; justify-content: space-between; gap: 8px; margin: auto 0 0; font-size: 13px; }

.blank-head { padding-bottom: 8px; }
.blank-head-row { max-width: 820px; }
.blank-head h1 { margin: 10px 0; font-size: clamp(23px, 3.6vw, 34px); }
.blank-meta {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px; margin: 18px 0 0;
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel);
}
.blank-meta dt { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.blank-meta dd { margin: 3px 0 0; font-size: 14.5px; }

.blank-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 22px; align-items: start; }
.blank-form { display: flex; flex-direction: column; gap: 18px; }
.blank-progress { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.blank-progress-bar { flex: 1; height: 6px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.blank-progress-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s ease; }
.blank-group { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.blank-group legend { font-weight: 700; padding: 0; margin-bottom: 2px; font-size: 16px; }
.blank-page { margin-left: 8px; font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.blank-field { display: flex; flex-direction: column; gap: 5px; }
.blank-field label { font-size: 14px; }
.blank-req { color: var(--accent); }
.blank-hint { margin: 0; font-size: 12px; color: var(--muted); }
.blank-checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.blank-checkbox input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--accent); }
.blank-form .search-input { margin: 0; width: 100%; }
.blank-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.blank-status { margin: 0; font-size: 13.5px; color: var(--green); }

.blank-preview { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 8px; }
.blank-preview-head { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sheet {
  background: #fff; color: #1b1b1b; border-radius: 6px; padding: 22px 20px;
  box-shadow: var(--shadow); font-family: "Times New Roman", Georgia, serif;
  font-size: 12.5px; line-height: 1.45; max-height: calc(100vh - 130px); overflow: auto;
}
.sheet-top { display: flex; justify-content: space-between; gap: 12px; font-size: 10.5px; color: #444; }
.sheet-code { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: #444; }
.sheet-approved { text-align: right; max-width: 60%; }
.sheet-title { font-size: 14px; text-align: center; margin: 14px 0 12px; letter-spacing: .02em; }
.sheet-section { margin-bottom: 12px; }
.sheet-page { text-align: right; font-size: 10px; color: #666; }
.sheet-section-title { font-weight: 700; font-size: 11.5px; margin: 6px 0; }
.sheet-row { display: grid; grid-template-columns: 1.05fr 1fr; border: 1px solid #bbb; border-bottom: 0; }
.sheet-row:last-child { border-bottom: 1px solid #bbb; }
.sheet-label { padding: 4px 6px; font-size: 10.5px; color: #333; border-right: 1px solid #bbb; }
.sheet-value { padding: 4px 6px; font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sheet-body p { margin: 0 0 8px; text-align: justify; }
.sheet-subtitle { font-size: 12.5px; text-align: center; margin: 10px 0; }
.sheet-body p:first-child { margin-top: 0; }

.blank-legal { margin-top: 28px; }
.blank-legal ul { margin: 0 0 14px; padding-left: 20px; color: var(--muted); }
.blank-legal li { margin-bottom: 4px; font-size: 14px; }

@media (max-width: 1023px) {
  .blank-layout { grid-template-columns: 1fr; }
  .blank-preview { position: static; }
  .sheet { max-height: none; }
}
@media (max-width: 768px) {
  .blank-meta { grid-template-columns: 1fr; padding: 14px; }
  .blank-preview { display: none; }
  .blank-form { padding: 14px; }
  .blank-actions .btn { flex: 1; }
}

/* Бланк, предложенный по тексту ответа в чате. */
.chat-blank {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 10px; font-size: 13px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
}
.chat-blank:hover { border-color: var(--accent); text-decoration: none; }

/* --- Справочник источников (/site/blanks/sources) --- */
.src-block { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); padding: 18px; margin-bottom: 16px; }
.src-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.src-head h2 { margin: 0; font-size: 21px; }
.src-authority { font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.src-note { margin: 6px 0 0; font-size: 13.5px; }
.src-ours { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 4px; }
.src-ours-label { font-size: 12px; color: var(--muted); }
.chip-link { text-decoration: none; }
.src-rows { margin-top: 10px; display: flex; flex-direction: column; }
.src-row {
  display: flex; justify-content: space-between; gap: 14px; align-items: flex-start;
  padding: 12px 0; border-top: 1px solid var(--border); color: var(--text);
}
.src-row:first-child { border-top: 0; }
.src-row:hover { text-decoration: none; }
.src-row:hover .src-row-title { color: var(--accent); }
.src-row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.src-row-title { font-size: 15px; font-weight: 600; }
.src-row-how { font-size: 12.5px; color: var(--muted); }
.src-row-note { font-size: 12px; color: var(--muted); }
.src-row-side { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.src-status { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.src-status.src-ok { color: var(--green); border-color: rgba(34, 197, 94, .4); }
.src-status.src-online { color: var(--accent); border-color: rgba(110, 168, 254, .4); }
.src-status.src-blocked { color: var(--gold); border-color: rgba(245, 196, 81, .4); }
.src-open { color: var(--muted); }
.src-portal { margin: 12px 0 0; font-size: 13px; }
@media (max-width: 768px) {
  .src-row { flex-direction: column; gap: 6px; }
  .src-row-side { align-self: flex-start; }
}
.blank-hero-links { margin: 10px 0 0; font-size: 14px; }

/* --- Ситуации (/site/situations) --- */
.sit-card { display: flex; flex-direction: column; gap: 8px; }
.sit-card h3 { margin: 2px 0 0; font-size: 18px; }
.sit-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sit-icon { font-size: 22px; line-height: 1; }
.sit-card-foot { display: flex; justify-content: space-between; gap: 8px; margin: auto 0 0; font-size: 13px; }
.sit-meta {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 22px;
  margin: 18px 0 0; padding: 16px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--panel);
}
.sit-meta-item { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.sit-meta-label { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sit-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, .85fr); gap: 26px; align-items: start; }
.sit-steps { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.sit-step { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); padding: 16px 18px; }
.sit-step-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sit-step-head h3 { margin: 0; font-size: 17px; }
.sit-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 26px;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 700;
}
.sit-step-term { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.sit-step-doc { margin-top: 10px; display: inline-flex; }
.sit-step-links { margin: 10px 0 0; font-size: 13px; }
.sit-errors { margin: 12px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; }
.sit-errors li::marker { color: var(--gold); }
.sit-doc { display: flex; flex-direction: column; gap: 6px; }
.sit-doc h3 { margin: 4px 0 0; font-size: 16px; }
.sit-practice { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.sit-case {
  margin: 0; padding: 16px 18px; border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--panel);
}
.sit-case blockquote { margin: 0; font-size: 14.5px; line-height: 1.55; }
.sit-case figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; font-size: 12.5px; }
.sit-case-id { font-weight: 600; }
.sit-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }
.sit-note p { margin: 8px 0 0; font-size: 14.5px; }
.sit-related { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
@media (max-width: 1000px) {
  .sit-layout { grid-template-columns: minmax(0, 1fr); }
  .sit-side { position: static; }
  .sit-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --- Дополнительные блоки страницы документа --- */
.blank-tips, .blank-attach, .blank-practice, .blank-related, .blank-legal {
  margin-top: 30px; padding: 18px 20px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--panel);
}
.blank-tips h2, .blank-attach h2, .blank-practice h2,
.blank-related h2, .blank-legal h2 { margin: 0 0 10px; font-size: 19px; }
.blank-tips ul, .blank-attach ul, .blank-legal ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; font-size: 14.5px; }
.blank-practice .sit-case { margin-top: 12px; }

/* --- Ошибки (/site/mistakes) --- */
.defect { margin-bottom: 16px; }
.defect-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.defect-head h2 { margin: 0; font-size: 20px; }
.defect-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 14px 0 0; }
.defect-cols h3 { margin: 0 0 6px; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.defect-cols p { margin: 0; font-size: 14.5px; }
.defect-docs { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.defect .sit-case { margin-top: 12px; }
@media (max-width: 768px) { .defect-cols { grid-template-columns: minmax(0, 1fr); } }

/* --- Пометка о сверке с официальной формой --- */
.blank-verified {
  margin-top: 22px; padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid rgba(34, 197, 94, .35); background: rgba(34, 197, 94, .08);
  font-size: 13.5px; line-height: 1.5;
}
.blank-verified strong { color: var(--green); }

/* --- Бланки: доступ после регистрации --- */
.tool-card p + .tool-link { margin-top: 0; }
.tool-link { color: var(--accent); font-size: 14px; font-weight: 600; margin-top: 8px; display: block; }
.blank-gate {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  margin: 18px 0 4px;
  border-radius: 14px;
  border: 1px solid rgba(110, 168, 254, 0.35);
  background: rgba(110, 168, 254, 0.08);
}
.blank-gate-icon { font-size: 22px; line-height: 1.1; }
.blank-gate-body strong { display: block; margin-bottom: 4px; }
.blank-gate-body p { margin: 6px 0 0; }
.blank-gate-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px !important; }
.blank-gate-inline {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(110, 168, 254, 0.1);
  font-size: 0.93rem;
}
.blank-form .search-input[readonly],
.blank-form select.search-input:disabled,
.blank-form input.search-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}


/* Шапка: на 1024–1400 px вкладок больше, чем места. Позволяем меню
   сжиматься и прятать кнопку Telegram, чтобы не появлялся горизонтальный
   скролл. Бургер показывается при <=820px как раньше. */
.site-header .container { min-width: 0; }
.site-nav { min-width: 0; flex-wrap: wrap; row-gap: 4px; }
@media (max-width: 1400px) { .site-header .header-cta { display: none; } }
@media (max-width: 1100px) { .site-header .site-nav a { padding-inline: 8px; font-size: 14px; } }
/* --- Экстренная помощь, пример ответа, тарифы, доверие (UX-этап) --------- */
.emergency-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border-radius: var(--radius);
  border: 1px solid #b45309;
  background: linear-gradient(90deg, rgba(180, 83, 9, .18), rgba(180, 83, 9, .06));
  text-decoration: none;
  color: var(--text);
  transition: transform .15s, border-color .15s;
}
.emergency-banner:hover { transform: translateY(-1px); border-color: #f59e0b; }
.emergency-banner-mark { font-size: 30px; line-height: 1; }
.emergency-banner-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.emergency-banner-title { font-weight: 700; font-size: 17px; }
.emergency-banner-sub { font-size: 14px; color: var(--muted); }
.emergency-banner-cta {
  margin-left: auto; white-space: nowrap; font-weight: 600;
  color: #f59e0b; font-size: 15px;
}

.answer-demo {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.answer-demo-q {
  font-size: 16px; line-height: 1.55; padding-bottom: 16px;
  border-bottom: 1px solid var(--border); margin-bottom: 18px;
}
.answer-demo-label {
  display: block; font-size: 12.5px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin-bottom: 6px;
}
.answer-demo-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: demo; }
.answer-demo-steps li {
  position: relative; padding-left: 40px; counter-increment: demo;
}
.answer-demo-steps li::before {
  content: counter(demo);
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.answer-demo-steps b { display: block; margin-bottom: 3px; }
.answer-demo-steps .muted { font-size: 14.5px; line-height: 1.55; display: block; }
.answer-demo-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

.trust-note {
  margin-top: 18px; padding: 20px 24px;
  background: var(--panel-2); border-radius: var(--radius);
  border-left: 3px solid var(--accent);
}
.trust-note h3 { margin: 0 0 8px; font-size: 17px; }
.trust-note p { margin: 0; font-size: 14.5px; line-height: 1.6; }

.plans-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: stretch;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.plans-compare-item { display: flex; flex-direction: column; gap: 10px; }
.plans-compare-item h3 { margin: 0; font-size: 18px; }
.plans-compare-item p { margin: 0; font-size: 14.5px; line-height: 1.55; }
.plans-compare-vs { display: flex; align-items: center; color: var(--muted); font-size: 22px; }
.plans-compare-footer {
  grid-column: 1 / -1; padding-top: 16px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end;
}

@media (max-width: 820px) {
  .emergency-banner { flex-wrap: wrap; gap: 10px; }
  .emergency-banner-cta { margin-left: 0; }
  .plans-compare { grid-template-columns: 1fr; }
  .plans-compare-vs { display: none; }
  .plans-compare-footer { justify-content: flex-start; }
}

/* --- Посадочные под микрозапрос (SEO-этап 1) ------------------------------ */
.qq-hero { padding-bottom: 8px; }
.qq-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
  margin-top: 14px;
}
.qq-title {
  font-size: 34px;
  line-height: 1.18;
  margin: 12px 0 14px;
  max-width: 22ch;
  text-wrap: balance;
}
.qq-answer {
  font-size: 17px;
  line-height: 1.62;
  color: var(--text);
  margin: 0 0 20px;
  max-width: 68ch;
}
/* Короткий ответ — главное на странице: подсветка слева, чтобы глаз
   зацепился до того, как человек начнёт читать шаги. */
.qq-answer { border-left: 3px solid var(--accent); padding-left: 16px; }

.qq-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.qq-chat-form { margin: 0; }
.qq-chat-btn { font-size: 16px; padding: 12px 22px; }
.qq-chat-hint { margin: 10px 0 0; font-size: 13.5px; line-height: 1.5; max-width: 62ch; }

.qq-laws {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
}
.qq-laws-title { font-size: 15px; margin: 0 0 12px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); }
.qq-law { padding: 10px 0; border-top: 1px solid var(--border); }
.qq-law:first-of-type { border-top: 0; padding-top: 0; }
.qq-law-code {
  display: inline-block;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 4px;
}
.qq-law-full { display: block; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.qq-laws-note { font-size: 12px; line-height: 1.45; margin: 12px 0 0; }

.qq-steps { margin-top: 18px; max-width: 860px; }
.qq-cta-row { margin-top: 22px; }

.qq-doc-grid { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; }
.qq-doc { display: flex; flex-direction: column; gap: 10px; flex: 0 1 420px; min-width: 0; max-width: 100%; }
.qq-doc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.qq-doc h3 { margin: 0; font-size: 18px; }
.qq-doc-code { font-size: 12.5px; }
/* Предпросмотр: «бумага» — моноширинный шрифт, светлый фон, обрезка.
   Не интерактивен: настоящий бланк открывается по кнопке. */
/* Светлая тема: предпросмотр на светлом фоне иначе сливается. */
html[data-theme="light"] .qq-doc-preview { background: #f3f5fa; color: #4b5563; }
.qq-doc-preview {
  margin: 0;
  padding: 14px 16px;
  background: var(--panel-2);
  border: 1px dashed var(--border);
  border-radius: 10px;
  font-family: "SFMono-Regular", ui-monospace, "Consolas", monospace;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  white-space: pre-wrap;
  max-height: 210px;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent);
  mask-image: linear-gradient(180deg, #000 62%, transparent);
}
.qq-doc-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; }

.qq-faq { max-width: 860px; margin-top: 14px; }
.qq-faq .faq-item summary { font-weight: 600; }

.qq-related { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-top: 14px; }
.qq-related-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.qq-related-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.qq-related-q { font-weight: 600; color: var(--text); line-height: 1.45; }
.qq-related-more { font-size: 13px; color: var(--accent); }

@media (max-width: 900px) {
  .qq-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .qq-title { font-size: 26px; max-width: none; }
  .qq-answer { font-size: 16px; }
  .qq-law-full { font-size: 13px; }
}

/* --- Навигация: пять пунктов + «Ещё» ------------------------------------- */
.nav-more { position: relative; display: inline-flex; }
.nav-more-toggle {
  background: none; border: 0; cursor: pointer;
  font: inherit; color: var(--text);
  padding: 8px 10px; border-radius: 8px;
  display: inline-flex; align-items: center; gap: 4px;
}
.nav-more-toggle:hover { background: var(--panel-2); }
.nav-more-panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60;
  min-width: 260px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .28);
  padding: 8px;
  display: flex; flex-direction: column;
}
.nav-more-panel[hidden] { display: none; }
.nav-more-panel a {
  padding: 9px 12px; border-radius: 8px; text-decoration: none;
  color: var(--text); font-size: 14.5px; white-space: nowrap;
}
.nav-more-panel a:hover { background: var(--panel-2); color: var(--accent); }

/* Ссылка «Проверить на частые ошибки» после скачивания бланка. */
.blank-check-link {
  display: inline-block;
  margin-left: 6px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.blank-check-link:hover { text-decoration: underline; }

/* --- chat UX: чипсы-сценарии, скрепка, компактный футер, плашки доверия ---
   Префикс .chat-, чтобы не задеть стили других страниц. Все правила ниже
   идут после базовых, поэтому переопределяют их при равной специфичности. */

/* 1. Чипсы-сценарии: переносятся по строкам, ничего не уезжает за экран. */
.chat-empty .chips { flex-wrap: wrap; overflow-x: visible; }
.chat-empty .chip { white-space: normal; text-align: left; }

/* 3.1. Единственная Telegram-кнопка рядом с «Новый диалог». */
.chat-tg-short { display: none; }

/* 2. Кнопка «прикрепить файл» с замком и поповером. */
.chat-attach-wrap { position: relative; flex: 0 0 auto; }
.chat-attach {
  position: relative; width: 46px; height: 46px; flex: 0 0 auto;
  display: inline-grid; place-items: center; cursor: pointer;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  font-size: 18px; line-height: 1; padding: 0;
}
.chat-attach:hover, .chat-attach[aria-expanded="true"] { border-color: var(--accent); }
.chat-attach-icon { font-size: 18px; }
.chat-attach-lock {
  position: absolute; right: -3px; bottom: -3px;
  font-size: 10px; line-height: 1.2; padding: 0 1px;
  background: var(--panel); border-radius: 6px;
}
.chat-attach-pop {
  position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 40;
  width: min(320px, calc(100vw - 24px));
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow);
}
.chat-attach-pop[hidden] { display: none; }
.chat-attach-text { margin: 0 0 10px; font-size: 13px; line-height: 1.5; }
.chat-attach-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* Поповер внутри формы: не даём кнопкам превратиться в «кружки» на мобильном. */
.chat-attach-actions .btn {
  width: auto; min-width: 0; height: auto; min-height: 40px;
  padding: 0 16px; border-radius: 12px; font-size: 14px; justify-content: center;
}

/* 3.2. Компактный футер на /site/chat: одна строка вместо четырёх колонок. */
.chat-footer-compact { margin-top: 16px; padding: 12px 0; }
.chat-footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted);
}
.chat-footer-note { min-width: 0; }
.chat-footer-links { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.chat-footer-links a { color: var(--muted); text-decoration: none; }
.chat-footer-links a:hover { color: var(--accent); text-decoration: underline; }

/* 4. Плашки доверия под полем ввода. */
.chat-trust {
  display: flex; flex-wrap: wrap; gap: 4px 16px;
  margin: 0 2px 12px; font-size: 12px; color: var(--muted);
}
.chat-trust-item { display: inline-flex; align-items: center; gap: 5px; }

@media (max-width: 768px) {
  /* Telegram-кнопку в шапке чата показываем и на телефоне (короткий текст). */
  .chat-head-actions .chat-tg:last-child { display: inline-flex; }
  .chat-tg-long { display: none; }
  .chat-tg-short { display: inline; }

  .chat-attach { width: 40px; height: 40px; border-radius: 20px; }
  .chat-attach-icon { font-size: 16px; }

  .chat-trust { font-size: 11.5px; gap: 2px 12px; margin: 6px 2px 8px; }
  .chat-footer-inner { font-size: 12px; }
  .chat-footer-links { gap: 4px 12px; }
}

@media (max-width: 480px) {
  .chat-attach-pop { padding: 10px 12px; }
  .chat-attach-actions .btn { width: 100%; }
}
