/* ============================================================
   AP Law — Typography & Layout overrides
   Подключать ПОСЛЕ /assets/style.css
   Увеличивает шрифты и растягивает контейнеры на всех страницах
   так, чтобы было сопоставимо со страницей чата (chats.php)
   ============================================================ */

/* ====== БАЗОВАЯ ТИПОГРАФИКА ====== */
html { font-size: 16px; }

body {
  font-size: clamp(15.5px, 0.15vw + 15px, 17px);
  line-height: 1.65;
}

/* ====== КОНТЕЙНЕРЫ — растягиваем ====== */
.wrap { max-width: 1100px !important; }
.cabinet { max-width: 1100px !important; }
.admin-wrap { max-width: 1200px !important; }

/* ====== ЗАГОЛОВКИ — от 26 до 42px ====== */
h1 {
  font-size: clamp(26px, 1vw + 20px, 42px) !important;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
h2 {
  font-size: clamp(20px, 0.7vw + 16px, 30px) !important;
  line-height: 1.3;
}
h3 {
  font-size: clamp(18px, 0.5vw + 15px, 25px) !important;
  line-height: 1.35;
}
h4 {
  font-size: clamp(17px, 0.4vw + 14px, 22px) !important;
  line-height: 1.4;
}

/* ====== ПОДЗАГОЛОВКИ ====== */
.sub {
  font-size: clamp(15px, 0.2vw + 14px, 17.5px) !important;
  line-height: 1.6;
}

/* ====== ГЛАВНАЯ — баннер, дисклеймер, плашка приватности ====== */
.main-disclaimer {
  font-size: clamp(13.5px, 0.15vw + 13px, 15.5px) !important;
  line-height: 1.7;
}
.privacy-text {
  font-size: clamp(13.5px, 0.15vw + 13px, 15.5px) !important;
  line-height: 1.65;
}
.privacy-title { font-size: 15px !important; }

/* ====== ЛЕНТА СООБЩЕНИЙ (главная, старые карточки диалогов) ====== */
.msg.ai {
  font-size: clamp(16px, 0.5vw + 14px, 21px) !important;
  line-height: 1.75 !important;
  padding: 22px 26px !important;
}
.msg.user {
  font-size: clamp(15px, 0.3vw + 14px, 18px) !important;
  line-height: 1.65 !important;
  padding: 18px 22px !important;
}
.msg .role {
  font-size: 12px !important;
  letter-spacing: 1.3px;
}

/* Внутренние элементы markdown внутри ответов ИИ */
.msg .body h3 { font-size: clamp(18px, 0.5vw + 15px, 23px) !important; }
.msg .body h4 { font-size: clamp(17px, 0.4vw + 14px, 21px) !important; }
.msg .body p { margin: 0 0 14px; }
.msg .body li { line-height: 1.75; margin-bottom: 8px; }
.msg .body code { font-size: 0.92em; }

/* ====== ФОРМА ВОПРОСА (главная) ====== */
.ask-form textarea {
  font-size: clamp(16px, 0.3vw + 15px, 19px) !important;
  padding: 24px 26px 14px !important;
  min-height: 140px !important;
}
.attach { font-size: 14.5px !important; }
.file-name { font-size: 13px !important; }
#send-btn {
  font-size: 16px !important;
  padding: 14px 28px !important;
}

/* ====== КАБИНЕТ ПОЛЬЗОВАТЕЛЯ ====== */
.cab-text,
.cab-answer,
.cab-lawyer-text {
  font-size: clamp(15.5px, 0.4vw + 14px, 19px) !important;
  line-height: 1.75 !important;
}
.cab-label {
  font-size: 12px !important;
  letter-spacing: 1.2px;
}
.cab-older-question { font-size: 15px !important; }
.cab-older-meta { font-size: 13px !important; }
.cab-badge { font-size: 13.5px !important; }

.cab-answer h3 { font-size: clamp(17px, 0.5vw + 15px, 22px) !important; }
.cab-answer h4 { font-size: clamp(16px, 0.4vw + 14px, 20px) !important; }
.cab-answer p { margin: 0 0 12px; }
.cab-answer li { line-height: 1.75; margin-bottom: 7px; }

.cab-table th, .cab-table td {
  font-size: 14.5px !important;
  padding: 14px 18px !important;
}
.cab-table th { font-size: 13.5px !important; }

.cab-empty p { font-size: 16px !important; }

/* ====== ЮРИДИЧЕСКИЕ ДОКУМЕНТЫ (terms.php) ====== */
.legal-doc {
  font-size: clamp(15.5px, 0.3vw + 14px, 18px) !important;
  line-height: 1.75 !important;
}
.legal-doc h2 {
  font-size: clamp(19px, 0.6vw + 16px, 26px) !important;
  margin-top: 34px !important;
  margin-bottom: 14px !important;
}
.legal-doc p { margin: 0 0 14px; }
.legal-doc li { margin-bottom: 8px; }

.legal-contacts {
  font-size: 15px !important;
  line-height: 1.8;
}

/* ====== СТРАНИЦА «ОБО МНЕ» ====== */
.about-content {
  font-size: clamp(16px, 0.4vw + 15px, 19px) !important;
  line-height: 1.8 !important;
}
.about-hero-text h2 {
  font-size: clamp(22px, 0.6vw + 18px, 30px) !important;
}
.about-role { font-size: 15px !important; }

/* ====== ПРИМЕРЫ ОТВЕТОВ (examples.php) ====== */
.ex-intro {
  font-size: clamp(15px, 0.2vw + 14px, 17px) !important;
  line-height: 1.7 !important;
}
.ex-q { font-size: clamp(16px, 0.3vw + 15px, 19px) !important; }
.ex-preview { font-size: clamp(14.5px, 0.2vw + 14px, 16.5px) !important; }
.ex-body {
  font-size: clamp(15.5px, 0.3vw + 14px, 18px) !important;
  line-height: 1.75 !important;
}
.ex-body h4 {
  font-size: 13.5px !important;
  margin: 26px 0 10px !important;
}
.ex-body p { margin: 0 0 14px; }
.ex-body li { line-height: 1.75; margin-bottom: 8px; }
.ex-cta-title { font-size: clamp(19px, 0.5vw + 16px, 24px) !important; }
.ex-cta-text { font-size: clamp(15px, 0.2vw + 14px, 17px) !important; }

/* ====== ФОРМА ОБРАТНОЙ СВЯЗИ ====== */
.feedback-field label {
  font-size: 14.5px !important;
  margin-bottom: 8px;
}
.feedback-field input,
.feedback-field select,
.feedback-field textarea {
  font-size: 16px !important;
  padding: 14px 16px !important;
}
.feedback-field textarea { min-height: 200px; }
.feedback-form-wrap { padding: 32px 36px; }
.feedback-captcha label { font-size: 15px !important; }
.feedback-captcha input { font-size: 17px !important; }
.feedback-result { font-size: 15px !important; }
.feedback-ok, .feedback-error { padding: 14px 20px; }

/* ====== АДМИНКА ====== */
.card .meta { font-size: 13px !important; }
.card .q, .card .a {
  font-size: clamp(14.5px, 0.3vw + 13px, 17px) !important;
  line-height: 1.7 !important;
  padding: 16px !important;
}
.card .a h3 { font-size: clamp(16px, 0.3vw + 15px, 19px) !important; }
.card .a h4 { font-size: clamp(15px, 0.3vw + 14px, 18px) !important; }
.card .a p { margin: 0 0 12px; }
.card .a li { margin-bottom: 6px; line-height: 1.7; }
.card h3 { font-size: 16px !important; }
.card textarea { font-size: 15px !important; min-height: 220px; }
.card button { font-size: 15px !important; padding: 12px 26px !important; }
.contact-block-value { font-size: 16px !important; }
.payer-block-grid { font-size: 14.5px !important; }
.filter-tabs a { font-size: 15px !important; padding: 10px 16px !important; }

/* ====== ФУТЕР ====== */
.ftr-content { font-size: 13.5px !important; line-height: 1.75; }
.ftr-brand-name { font-size: 18px !important; }
.ftr-brand-desc { font-size: 14px !important; }
.ftr-meta-item { font-size: 13px !important; }
.ftr-links { font-size: 14px !important; }
.ftr-copy { font-size: 12.5px !important; }

/* ====== ШАПКА ====== */
.adm-link { font-size: 14px !important; }
.user-menu-title { font-size: 15px !important; }
.user-menu-desc { font-size: 13px !important; }
.user-badge-email { font-size: 13.5px !important; }

/* ====== ЛОГИН / РЕГИСТРАЦИЯ ====== */
.login-page .login-form h2 { font-size: 24px !important; }
.login-hint { font-size: 14px !important; line-height: 1.6; }
.login-page .login-form input {
  font-size: 16px !important;
  padding: 14px 16px !important;
}
.login-page .login-form button {
  font-size: 16px !important;
  padding: 14px !important;
}
.login-links { font-size: 14px !important; }
.login-error { font-size: 14px !important; padding: 12px 16px !important; }

/* ====== КНОПКИ ====== */
.cab-btn, .btn-opinion, .btn-retry, .credentials-btn, .ex-btn {
  font-size: 15.5px !important;
  padding: 14px 26px !important;
}

/* ====== АДАПТИВ ====== */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap, .cabinet, .admin-wrap {
    padding-left: 16px !important;
    padding-right: 16px !important;
    max-width: 100% !important;
  }
  h1 { font-size: 26px !important; }
  h2 { font-size: 21px !important; }

  .msg.ai { font-size: 16px !important; padding: 18px 18px !important; }
  .msg.user { font-size: 15px !important; }

  .cab-text, .cab-answer, .cab-lawyer-text {
    font-size: 16px !important;
    line-height: 1.7 !important;
  }
  .legal-doc { font-size: 16px !important; }

  .ex-body {
    padding: 0 18px 22px 18px !important;
    font-size: 16px !important;
  }
  .ex-body h4 { font-size: 12.5px !important; }
  .ex-q { font-size: 15.5px !important; }

  .feedback-form-wrap { padding: 22px 18px; }
  .about-content { font-size: 16.5px !important; }

  .ask-form textarea { font-size: 16px !important; min-height: 110px !important; }
  #send-btn { font-size: 15px !important; padding: 12px 20px !important; }
}
/* ====== Кабинет: шрифты как в чате ====== */
.cab-chat-msg { margin-bottom: 26px !important; }

.cab-chat-msg-label {
  font-size: 14px !important;
  letter-spacing: 1.2px !important;
  margin-bottom: 8px !important;
}

.cab-chat-msg-text {
  background: #fff !important;
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  padding: 20px 26px !important;
  font-size: clamp(16px, 0.5vw + 14px, 21px) !important;
  line-height: 1.75 !important;
  color: #2a2a2a !important;
}
.cab-chat-msg-text h3,
.cab-chat-msg-text h4 {
  color: var(--red) !important;
  margin: 22px 0 12px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}
.cab-chat-msg-text h3 { font-size: clamp(19px, 0.6vw + 16px, 25px) !important; }
.cab-chat-msg-text h4 { font-size: clamp(18px, 0.5vw + 15px, 23px) !important; }
.cab-chat-msg-text h3:first-child,
.cab-chat-msg-text h4:first-child { margin-top: 0 !important; }
.cab-chat-msg-text p { margin: 0 0 14px !important; }
.cab-chat-msg-text p:last-child { margin-bottom: 0 !important; }
.cab-chat-msg-text ul { margin: 12px 0 16px 24px !important; padding: 0 !important; }
.cab-chat-msg-text li { margin-bottom: 9px !important; line-height: 1.75 !important; }
.cab-chat-msg-text strong { color: var(--ink) !important; font-weight: 700 !important; }
.cab-chat-msg-text em { font-style: italic !important; }
.cab-chat-msg-text code {
  background: #f4f4f4 !important; border-radius: 4px !important;
  padding: 2px 8px !important;
  font-family: 'SF Mono', Menlo, Consolas, monospace !important;
  font-size: 0.92em !important; color: var(--red-dark) !important;
}
.cab-chat-msg-text blockquote {
  border-left: 3px solid var(--red) !important; margin: 14px 0 !important;
  padding: 12px 18px !important; background: var(--red-soft) !important;
  border-radius: 0 8px 8px 0 !important; color: #4a4a4a !important;
}

/* И блок «Заключение юриста» — тот же крупный шрифт */
.cab-chat-msg-text[style*="background:#eaf7ee"] {
  background: #eaf7ee !important;
  border-color: #c8e6c9 !important;
}