/* =========================
   APP LAYOUT
   ========================= */

.app-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-areas: "sidebar main";
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: #ffffff;
}

.sidebar {
  grid-area: sidebar;
}

.chatbox {
  grid-area: main;
}

/* =========================
   SIDEBAR
   ========================= */

.sidebar {
  grid-area: sidebar;
}

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: #f9fafb !important;
  /* border-right: 1px solid #e5e7eb; — removed for seamless look */

  height: 100vh;
  /* важно: высота на весь экран */
  overflow-y: hidden;
  /* фикс старого бага — основная прокрутка в чат-боксе */
}

.sidebar-logo {
  display: flex;
  align-items: center;
  width: 40px;
  height: 40px;
  margin: 0.5rem 0 0.75rem 0.25rem;
  color: #111827;
  transition: transform 0.2s ease;
}

.sidebar-logo:hover {
  transform: scale(1.05);
}

.sidebar-logo img {
  width: 28px;
  height: 28px;
}

/* ---- Верхняя навигация (Chat / History) ---- */

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.5rem;
}

.sidebar-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0rem 0.85rem;
  border-radius: 0.7rem;
  border: none;
  background: transparent;
  color: #111827;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;

  width: 226px;
  /* как было изначально */
  height: 36px;
  /* как было изначально */
  margin-left: 0;
  /* без смещения, как в начале */
}

.sidebar-nav-item:hover,
.sidebar-nav-item.active {
  background: #F3F4F5;
}

.sidebar-nav-item img {
  width: 19px;
  height: 19px;
  opacity: 0.85;
  filter: brightness(0) saturate(100%) contrast(1.2);
}

.sidebar-nav-item:hover img,
.sidebar-nav-item.active img {
  transform: scale(1.03);
}

/* ---- Блок истории чатов ---- */

.sidebar-history-block {
  position: relative;
  margin-top: 0.05rem;
  /* зона чатов заканчивается выше аватарки */
}

.sidebar-history-lines {
  position: absolute;
  top: 0.35rem;
  bottom: 72px;
  /* линия теперь КОНЧАЕТСЯ выше fade */
  left: 0;
  right: 0;
  pointer-events: none;
}

/* линия с плавным затуханием сверху и снизу */
.sidebar-history-line {
  background: #e2e2de;
}

/* Область скролла для чатов (между логотипом и аватаркой) */
.chat-list-wrapper {
  position: relative;
  overflow: hidden;
  padding-top: 2px;
  max-height: calc(100vh - 200px);

  /* УБРАЛИ МАСКИ - они тоже создавали затемнение */
}

/* Список чатов: именно ОН скроллится */

.chat-list {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 2px 0 0;
  /* убираем padding-bottom */
  display: flex;
  flex-direction: column;
  gap: 0.1rem;

  /* ← ВОТ ЭТО! Высота до fade-зоны (64px аватар + 32px fade) */
  max-height: calc(100vh - 190px - 96px);

  overflow-y: auto;
  padding-right: 2px;

  scrollbar-gutter: stable;
}

.chat-list-wrapper {
  max-height: calc(100vh - 200px);
}

.chat-list::-webkit-scrollbar {
  width: 6px;
}

.chat-list-item {
  position: relative;
  display: flex;
  align-items: center;

  width: 100%;
  /* ← теперь во ВЕСЬ сайдбар */
  height: 36px;

  padding: 0 0.85rem;
  /* такие же отступы как у Chat */
  border-radius: 0.7rem;

  margin-left: 0;
  /* ← убрать сдвиг */
  margin-right: 0;
  margin-top: 2px;

  background: transparent;
  color: #111827;
  font-size: 0.85rem;
  font-weight: 500;

  cursor: pointer;
  transition: background 0.2s ease;
}

.chat-list-item:hover,
.chat-list-item.active {
  background: #F3F4F5;
}

.chat-list-item-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ====== SCROLLBAR FIX (убрать фон дорожки) ====== */

/* Firefox */
.chat-list {
  scrollbar-width: thin;
  scrollbar-color: #c7c7c7 transparent;
}

/* Chrome / Edge / Safari */
.chat-list::-webkit-scrollbar {
  width: 6px;
}

.chat-list::-webkit-scrollbar-track {
  background: transparent !important;
  /* больше не нужен margin-bottom */
}

.chat-list::-webkit-scrollbar-thumb {
  background: #c7c7c7;
  border-radius: 999px;
}

.chat-list::-webkit-scrollbar-thumb:hover {
  background: #b3b3b3;
}

/* ---- Низ сайдбара (аватар) ---- */

.sidebar-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  /* ← ВОТ ЭТО! Прижали к низу */

  height: 64px;
  background: #FAFAFC;
  /* обычный цвет сайдбара */

  display: flex;
  align-items: center;
  padding-left: 16px;
  padding-right: 16px;

  z-index: 50;
  /* всегда поверх fade/линии */
}

.sidebar-user-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.sidebar-user-btn:hover {
  background: #F3F4F5;
  box-shadow: none;
}

.sidebar-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #8595a4;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  transition: transform 0.2s ease;
}

.sidebar-user-btn:hover .sidebar-avatar {
  transform: scale(1.02);
}

/* ---- Низ сайдбара (аватар) ---- */

.sidebar-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  /* ← ВОТ ЭТО! Прижали к низу */

  height: 64px;
  background: #f9fafb;
  /* обычный цвет сайдбара */

  display: flex;
  align-items: center;
  padding-left: 16px;
  padding-right: 16px;

  z-index: 50;
  /* всегда поверх fade/линии */
}

.sidebar-user-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.sidebar-user-btn:hover {
  background: #F3F4F5;
  box-shadow: none;
}

.sidebar-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #8595a4;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  transition: transform 0.2s ease;
}

.sidebar-user-btn:hover .sidebar-avatar {
  transform: scale(1.02);
}

/* ---- Низ сайдбара (аватар) ---- */

.sidebar-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  /* ← ВОТ ЭТО! Прижали к низу */

  height: 64px;
  background: #FAFAFC;
  /* обычный цвет сайдбара */

  display: flex;
  align-items: center;
  padding-left: 16px;
  padding-right: 16px;

  z-index: 50;
  /* всегда поверх fade/линии */
}

/* fade сверху — чаты плавно уходят под область логотипа / History */

.sidebar-user-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.sidebar-user-btn:hover {
  background: #F3F4F5;
  box-shadow: none;
}

.sidebar-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #8595a4;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  transition: transform 0.2s ease;
}

.sidebar-user-btn:hover .sidebar-avatar {
  transform: scale(1.02);
}

/* =========================
   CHATBOX
   ========================= */

.chatbox {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  overflow: hidden;
}

/* =========================
   LANDING PAGE
   ========================= */

.landing-container {
  flex: 1;
  display: flex;
  align-items: center;
  /* остаётся по центру вертикально */
  justify-content: center;
  padding: 0rem;
  /* убираем лишние внутренние отступы */
  transform: translateY(-4vh);
  /* ← ВОТ ЧТО ПОДНИМАЕТ ВСЁ ВВЕРХ */
}

.landing-inner {
  width: 100%;
  max-width: 800px;
  text-align: center;
}

.landing-greeting {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1.5rem 0;
  color: #1D1D1F;
  letter-spacing: -0.02em;
}

.landing-form {
  margin-bottom: 2rem;
}

/* ============================
   REAL META-STYLE EXPANSION (CLEAN GROK)
   ============================ */

.landing-input-wrapper,
.chat-input-wrapper {
  /* Размер: не увеличиваем, оставляем как было или чуть компактнее */
  width: 100%;
  max-width: 760px;
  /* Было 790px, чуть уменьшил для аккуратности */

  /* Форма "Пилюли" как у Grok */
  background: #ffffff;
  border-radius: 32px;

  /* Чистая тень + тонкая граница для выделения */
  border: none;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04), 0 0 1px rgba(0, 0, 0, 0.1);

  /* Без анимаций */
  transition: none;

  /* Flexbox: выравнивание */
  display: flex;
  align-items: flex-end;
  /* Прижимаем кнопки к низу */
  padding: 10px 10px 8px 10px !important;
  /* Внутренние отступы */
  gap: 8px;
  /* Расстояние между элементами */
  margin: 0 auto;
}


/* --- Кнопка Скрепки (Слева) --- */
.input-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  /* Запрещаем сжиматься */

  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease;
  padding: 0;

  /* Выравнивание: */
  margin-bottom: 2px;
}

.input-icon-btn:hover {
  background: #f3f4f6;
}

.input-icon-btn img {
  width: 20px;
  height: 20px;
  opacity: 0.6;
}

.input-icon-btn:hover img {
  opacity: 1;
}

/* --- Поле ввода (Центр) --- */
.landing-input-wrapper textarea,
.chat-input-wrapper textarea {
  flex: 1;
  /* Занимает всё место */
  border: none;
  background: transparent;

  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: #111827;

  padding: 8px 4px;
  /* Отступы текста внутри */
  margin: 0;

  resize: none;
  outline: none;

  min-height: 40px;
  /* Высота одной строки */
  max-height: 200px;
  overflow-y: auto;
}

.landing-input-wrapper textarea::placeholder,
.chat-input-wrapper textarea::placeholder {
  color: #9ca3af;
}

/* --- ПРАВАЯ КНОПКА (ОТПРАВИТЬ) --- */
.send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;

  width: 38px;
  height: 38px;

  /* Extelity Brand Blue */
  background: #2B8FFF !important;

  /* 2. Убираем границы и стандартные стили */
  border: none !important;
  outline: none !important;
  border-radius: 50%;

  cursor: pointer;
  margin-bottom: 2px;
}

/* 3. ЖЕСТКО КРАСИМ ИКОНКУ В БЕЛЫЙ */
.send-btn svg {
  stroke: #ffffff !important;
  /* Линии белые */
  color: #ffffff !important;
  /* Цвет текста белый */
  fill: none !important;
  /* Убираем заливку */
  filter: none !important;
  /* ВАЖНО: Отключаем инверсию, если она осталась */
}

/* При наведении */
.send-btn:hover {
  background: #1A7FEF !important;
}

/* Отключенная кнопка — синий градиент с opacity */
.send-btn:disabled {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #6366f1 100%) !important;
  opacity: 0.5;
  cursor: not-allowed;
}

/* Цвет иконки в отключенной кнопке (белый для контраста с градиентом) */
.send-btn:disabled svg {
  stroke: #ffffff !important;
}

/* Состояние загрузки - светлее чтобы показать неактивность */
.send-btn.is-loading {
  background: #93C5FD !important;
  opacity: 1 !important;
  cursor: not-allowed;
}

.send-btn.is-loading:hover {
  background: #93C5FD !important;
}

/* Иконка stop.svg остаётся белой */
.send-btn.is-loading img {
  filter: none !important;
  opacity: 1 !important;
}

/* =========================
   AI DISCLAIMER
   ========================= */

.ai-disclaimer {
  text-align: center;
  font-size: 0.7rem;
  color: #a1a1aa;
  padding: 0;
  margin-top: 12px;
  letter-spacing: 0.01em;
}

/* =========================
   MESSAGES
   ========================= */

.messages-container {
  position: absolute;
  top: 0;
  bottom: 0;
  /* ← тянем контейнер до самого низа, под панель */
  left: 0;
  right: 0;

  /* Скроллим весь main, полоса у правого края */
  overflow-y: auto;
  overflow-x: hidden;

  display: flex;
  flex-direction: column;

  /* тонкий аккуратный скролл для Firefox */
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

/* Внутренний скролл сообщений */
#messages-inner {
  flex: 1;
  /* тут уже НЕ скроллим, только внутренние отступы */
  padding: 40px 0 140px;
  /* ← снизу запас под панель + зона полупрозрачности */
  max-width: 790px;
  margin: 0 auto;
  width: 100%;
}

/* Колонка сообщений, чтобы был красивый gap */
.messages-inner {
  width: 790px;
  /* ширина такая же, как панель ввода */
  max-width: 790px;
  margin: 0 auto;
  /* центрируем */
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* Обёртка одного сообщения (нужна для выравнивания влево/вправо) */
.message-wrapper {
  width: 100%;
  display: flex;
}

.message-wrapper.assistant {
  justify-content: flex-start;
}

.message-wrapper.assistant:hover .message-actions {
  opacity: 1;
  pointer-events: auto;
}

.message-wrapper.user {
  justify-content: flex-end;
}

/* Базовый блок сообщения */
.message {
  position: relative;
  display: block;
  align-items: center;
  justify-content: flex-start;

  max-width: 70%;
  padding: 10px 16px;
  border-radius: 18px;

  overflow-wrap: break-word;
  word-break: break-word;
}

/* ---------- Ассистент: синий блок + вертикальная полоска слева ---------- */

.message-assistant {
  background: transparent;
  color: #15110e;

  padding: 0;
  max-width: 80%;
  border: none;
  box-shadow: none;
}

.message-assistant::before,
.message-wrapper.assistant::before {
  content: none !important;
  display: none !important;
}

/* ---------- Пользователь: светлая пилюля #f2f2f0 ---------- */

.message-user {
  background: #F3F4F5;
  color: #15110e;

  padding: 10px 16px;

  /* ВАЖНО: фиксированный радиус, а не 9999px и не 50%  */
  border-radius: 18px;
  /* верх и низ — дуги, середина — прямая */

  box-shadow: none;
  border: 1px solid #f9fafb;
}

.messages-inner {
  width: 790px;
  /* ширина такая же, как панель ввода */
  max-width: 790px;
  margin: 0 auto;
  /* центрируем */
  display: flex;
  flex-direction: column;
  row-gap: 0.6rem;
  /* вертикальный отступ между сообщениями */
  gap: 0.6rem;
}

/* Анимация появления сообщения */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Контент внутри сообщения */
.message-content {
  font-family: universalSans, Inter, Roboto, "Open Sans", Arial,
    ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";

  font-size: 16px;
  font-weight: 400;
  line-height: 28px;
  letter-spacing: -0.1px;

  color: inherit;
  margin: 0;

  overflow-wrap: break-word;
  word-break: break-word;
}

/* Ассистенту выключаем pre-wrap т.к. теперь рендерим HTML (Markdown) */
.message-assistant .message-content {
  white-space: normal;
}

/* Пользователю — обычный text-flow: пробелы не ломают форму пилюли */
.message-user .message-content {
  white-space: normal;
}

/* Кнопки действий над сообщением (копировать и т.п.) */
.message-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 0.3rem;
  /* было 0.5rem — ближе к тексту */
  gap: 0.25rem;
  margin-left: 0.15rem;
  /* чуть ближе к пузырю */

  /* по умолчанию скрыто */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.message-user .message-actions {
  display: none !important;
}

.message-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  padding: 0;
  margin-bottom: 0;

  background: transparent;
  cursor: pointer;
  color: #636363;
  transition: background 0.2s ease;
}

.message-action-btn:hover {
  background: #F3F4F5;
}

.message-action-btn.is-active {
  color: #ffffff;
  border-color: #15110e;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.18),
    0 8px 22px rgba(15, 23, 42, 0.35);
  transform: translateY(-0.5px);
}

.message-action-btn img {
  width: 14px;
  height: 14px;
  display: block;
}


.message-user .message-actions {
  display: none;
}

.message-assistant .message-actions {
  display: flex;
}

.message-wrapper.assistant .message-actions {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

/* Всегда показываем у последнего сообщения ассистента */
.message-wrapper.assistant.is-latest .message-actions,
.message-wrapper.assistant:hover .message-actions {
  opacity: 1;
  pointer-events: auto;
}

/* Regenerate button only visible on latest message */
.message-wrapper.assistant .message-action-btn[data-action="regenerate"] {
  display: none;
}

.message-wrapper.assistant.is-latest .message-action-btn[data-action="regenerate"] {
  display: flex;
}

.message-timestamp {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-left: 0.5rem;
}

/* Кнопка удаления чата */
.chat-delete-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease;
  flex-shrink: 0;
  margin-left: 4px;
}

.chat-list-item:hover .chat-delete-btn {
  display: flex;
}

.chat-delete-btn:hover {
  background: #e5e5e3;
}

.chat-delete-btn img {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.chat-delete-btn:hover img {
  opacity: 0.9;
}

/* ===========================
   DELETE MODAL
   =========================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.15s ease;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  background: #ffffff;
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.2s ease;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 12px 0;
}

.modal-text {
  font-size: 0.95rem;
  color: #6b7280;
  margin: 0 0 24px 0;
  line-height: 1.5;
}

.modal-chat-name {
  font-weight: 600;
  color: #111827;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-btn {
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-btn-cancel {
  background: #f3f4f6;
  color: #374151;
}

.modal-btn-cancel:hover {
  background: #e5e7eb;
}

.modal-btn-delete {
  background: #dc2626;
  color: #ffffff;
}

.modal-btn-delete:hover {
  background: #b91c1c;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================
   CHAT INPUT FORM
   ========================= */

.chat-input-form {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;

  padding: 1.2rem 1.5rem 1rem;

  /* мягкая полупрозрачность вокруг панели */
  background: linear-gradient(to top,
      rgba(250, 250, 248, 0.75) 0%,
      /* у самой панели полупрозрачный слой */
      rgba(250, 250, 248, 0.45) 40%,
      /* чуть легче выше */
      rgba(250, 250, 248, 0.00) 100%
      /* полностью прозрачный сверху */
    );
}

/* ===== Заголовок History (Meta-style) ===== */

.sidebar-section-title {
  display: inline-flex !important;
  width: auto !important;
  max-width: max-content !important;

  align-items: center;
  gap: 4px;

  font-size: 0.78rem;
  font-weight: 500;
  color: #6b7280;

  padding: 0.18rem 0.45rem;
  border-radius: 0.5rem;

  /* --- ВОТ ЭТО ИСПРАВЛЯЕТ ТВОЙ ОТСТУП --- */
  margin-top: 2rem;
  /* ← регулирует расстояние от Chat */
  /* -------------------------------------- */

  margin-left: 0.35rem;

  user-select: none;
  transition: background 0.15s ease;
}

.sidebar-section-title:hover {
  background: #f3f3f3 !important;
  cursor: pointer;
}

/* =========================
   UTILITIES
   ========================= */

.hidden {
  display: none !important;
}

.messages-container::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
  width: 6px;
  /* тоньше */
}

.messages-container::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 999px;
  /* аккуратная “пилюля” */
}

.messages-container::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover {
  background: #b0b8c2;
}

.messages-container::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "sidebar"
      "main";
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    flex-direction: row;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .sidebar-logo {
    margin-bottom: 2rem;
  }

  .sidebar-nav {
    flex-direction: row;
    margin-bottom: 0;
    margin-right: auto;
  }

  .sidebar-bottom {
    margin-top: auto;
  }

  .landing-container,
  .messages-container,
  .chat-input-form {
    padding-inline: 1rem;
  }

  .landing-greeting {
    font-size: 1.75rem;
  }

  .landing-input-wrapper,
  .chat-input-wrapper {
    width: 100%;
    max-width: 900px;
  }
}

/* ==== OVERRIDE: assistant message as plain text, no blue bubble / stripe ==== */

/* Выравнивание оставляем слева */
.message-wrapper.assistant {
  justify-content: flex-start;
}

/* Блок ассистента: прозрачный фон + правильный цвет текста */
.message-assistant {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
  max-width: 80%;
  color: #15110e !important;
  /* нужный цвет текста */
}

/* Полоски/хвостики выключаем */
.message-assistant::before,
.message-wrapper.assistant::before {
  content: none !important;
  display: none !important;
}

.message-wrapper.assistant.is-latest .message-actions {
  opacity: 1;
  pointer-events: auto;
}

/* Контент ассистента: без фона, наследует цвет #15110e */
.message-assistant .message-content {
  background: transparent;
  white-space: pre-wrap;
  color: inherit;
}

/* Стрелка справа у History */
.chat-toggle-arrow {
  margin-left: 6px;
  opacity: 0.55;
  /* ✅ ВСЕГДА ВИДНА */
  transform: rotate(0deg);
  transition: opacity 0.2s ease, transform 0.25s ease;
}

/* При наведении становится ярче */
.sidebar-section-title:hover .chat-toggle-arrow {
  opacity: 0.85;
}

.chat-arrow-open {
  transform: rotate(0deg);
  opacity: 0.55;
}

.chat-arrow-closed {
  transform: rotate(-90deg);
  opacity: 0.55;
}

/* При наведении на закрытую/открытую тоже ярче */
.sidebar-section-title:hover .chat-arrow-open,
.sidebar-section-title:hover .chat-arrow-closed {
  opacity: 0.85;
}

/* ===========================
   USER PROFILE MENU
   =========================== */

.user-menu {
  position: absolute;
  bottom: 72px;
  left: 16px;
  width: 240px;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  padding: 8px;
  z-index: 100;
  animation: slideUpFade 0.2s ease;
}

.user-menu.hidden {
  display: none;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #111827;
  font-size: 0.875rem;
}

.user-menu-header img {
  width: 20px;
  height: 20px;
  opacity: 1;
  filter: brightness(0) saturate(100%);
}

.user-menu-email {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.user-menu-divider {
  display: none;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #111827;
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: left;
}

.user-menu-item:hover {
  background: #f3f4f6;
}

.user-menu-item img {
  width: 20px;
  height: 20px;
  opacity: 0.85;
}

.user-menu-item span {
  flex: 1;
}

.user-menu-arrow {
  opacity: 0.5;
  margin-left: auto;
}

.user-menu-item:hover .user-menu-arrow {
  opacity: 0.8;
  transform: translateX(2px);
}

/* User Menu Footer (Terms & Privacy) */
.user-menu-footer {
  padding: 8px 12px 12px 12px;
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}

.user-menu-footer-link {
  font-size: 0.7rem;
  color: #6b7280;
  text-decoration: none;
  transition: color 0.15s ease;
}

.user-menu-footer-link:hover {
  color: #6b7280;
  text-decoration: underline;
}

.user-menu-footer-dot {
  font-size: 0.7rem;
  color: #6b7280;
}


/* =========================
   SETTINGS MODAL
   ========================= */

#settings-modal.modal-overlay {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.settings-modal-container {
  position: relative;
  width: 900px;
  max-width: 95%;
  height: 500px;
  max-height: 80vh;

  background: #ffffff;
  border-radius: 24px;

  display: flex;
  flex-direction: column;
  overflow: hidden;

  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.18),
    0 12px 30px rgba(0, 0, 0, 0.10);

  animation: slideUp 0.25s ease;
}

.settings-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;

  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.settings-close-btn:hover {
  background: #f3f4f6;
}

.settings-close-btn img {
  width: 18px;
  height: 18px;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

.settings-close-btn:hover img {
  opacity: 0.8;
}

.settings-modal-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar Navigation */
.settings-sidebar {
  width: 220px;
  flex-shrink: 0;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #F9FAFB;
}

.settings-sidebar-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 16px 8px;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: #111112;
  text-align: left;
  width: 100%;
  outline: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.settings-nav-item:focus {
  outline: none;
}

.settings-nav-item:hover {
  background: #F3F4F5;
}

.settings-nav-item.active {
  background: #F3F4F5;
  color: #111112;
}

.settings-nav-item:active {
  color: #111112;
}

.settings-nav-item.active:focus {
  outline: none;
}

.settings-nav-item.active img {
  opacity: 1;
}

.settings-nav-item img {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  opacity: 1;
  filter: brightness(0);
  transition: filter 0.15s ease, opacity 0.15s ease;
}

/* Content Area */
.settings-content {
  flex: 1;
  padding: 24px 32px;
  overflow-y: auto;
}

.settings-section {
  display: none;
}

.settings-section.active {
  display: block;
}

.settings-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 20px 0;
}

/* Coming Soon */
.settings-coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
}

.coming-soon-icon {
  margin-bottom: 16px;
  opacity: 0.4;
}

.coming-soon-icon svg {
  stroke: #9ca3af;
}

.settings-coming-soon h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 8px 0;
}

.settings-coming-soon p {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0;
  max-width: 280px;
}

/* Data & Privacy Section */
.settings-privacy-content {
  padding: 10px 0;
}

.privacy-intro {
  font-size: 0.95rem;
  color: #4b5563;
  margin: 0 0 24px 0;
  line-height: 1.6;
}

.privacy-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.privacy-link {
  display: flex;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 500;
  color: #111827;
  text-decoration: none;
  padding: 12px 18px;
  background: #f5f5f5;
  border-radius: 10px;
  transition: background 0.15s ease;
  width: 100%;
}

.privacy-link:hover {
  background: #e5e5e5;
}

.privacy-note {
  font-size: 0.9rem;
  color: #9ca3af;
  margin: 0;
  font-style: italic;
}

/* About Section */
.settings-about-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 0;
}

.about-logo {
  margin-bottom: 16px;
}

.about-logo img {
  width: 64px;
  height: 64px;
}

.about-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 4px 0;
}

.about-version {
  font-size: 0.85rem;
  color: #6b7280;
  margin: 0 0 24px 0;
}

.about-description {
  max-width: 400px;
  margin-bottom: 24px;
}

.about-description p {
  font-size: 0.9rem;
  color: #4b5563;
  line-height: 1.6;
  margin: 0 0 12px 0;
}

.about-description p:last-child {
  margin-bottom: 0;
}

.about-highlight {
  font-size: 1.1rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 16px !important;
}

/* What it's for section */
.about-what-for {
  max-width: 400px;
  text-align: center;
  margin-bottom: 24px;
}

.about-what-for h5 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 12px 0;
}

.about-what-for ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.about-what-for li {
  font-size: 0.875rem;
  color: #6b7280;
  padding: 3px 0;
  line-height: 1.5;
}

.about-links {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.about-link {
  font-size: 0.9rem;
  color: #111827;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 16px;
  background: #f5f5f5;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.about-link:hover {
  background: #e5e5e5;
}

.about-copyright {
  font-size: 0.8rem;
  color: #9ca3af;
  margin: 0;
}

/* Help Section */
.settings-help-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.help-contact {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0 0 8px 0;
}

.help-contact a {
  color: #111827;
  font-weight: 500;
  text-decoration: none;
}

.help-contact a:hover {
  text-decoration: underline;
}

.help-item {
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.help-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.help-item-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 6px 0;
}

.help-item-text {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.6;
  margin: 0;
}

.help-shortcuts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.help-shortcut {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  color: #6b7280;
}

.help-shortcut kbd {
  display: inline-block;
  padding: 4px 10px;
  background: #f5f5f5;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: #374151;
}

/* =========================
   TYPING INDICATOR
   ========================= */

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}

.typing-indicator .dot {
  width: 6px;
  height: 6px;
  background: #9ca3af;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-indicator .dot:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-indicator .dot:nth-child(2) {
  animation-delay: -0.16s;
}

.typing-indicator .dot:nth-child(3) {
  animation-delay: 0s;
}

@keyframes typingBounce {

  0%,
  80%,
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Error styling for message */
.message-error {
  color: #dc2626;
  font-style: italic;
}

/* =========================
   MARKDOWN STYLES
   ========================= */

.message-content p {
  margin: 0;
  line-height: 1.4;
}

/* Hide empty paragraphs that might cause extra spacing */
.message-content p:empty {
  display: none;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content strong {
  font-weight: 600;
  color: inherit;
}

.message-content em {
  font-style: italic;
}

.message-content ul,
.message-content ol {
  margin: 0;
  padding-left: 1.2rem;
}

.message-content li {
  margin-bottom: 0;
  line-height: 1.35;
}

/* Fix for potential nested p tags in li causing huge gaps */
.message-content li p {
  margin: 0;
}

.message-content li:last-child {
  margin-bottom: 0;
}

.message-content li::marker {
  color: inherit;
}

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4 {
  font-weight: 600;
  margin: 0.3rem 0 0.1rem 0;
  color: inherit;
  line-height: 1.2;
}

/* First heading should not have top margin if it's the first element */
.message-content>*:first-child {
  margin-top: 0 !important;
}

.message-content h1 {
  font-size: 1.25rem;
}

.message-content h2 {
  font-size: 1.1rem;
}

.message-content h3 {
  font-size: 1rem;
}

.message-content a {
  color: #2563eb;
  text-decoration: none;
}

.message-content a:hover {
  text-decoration: underline;
}

.message-content blockquote {
  border-left: 3px solid #e5e7eb;
  padding-left: 1rem;
  margin: 0.4rem 0;
  color: #4b5563;
  font-style: italic;
}

.message-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85em;
  background-color: #f3f4f6;
  padding: 0.1rem 0.3rem;
  border-radius: 0.25rem;
  color: #1f2937;
}

.message-content pre {
  background-color: #1f2937;
  color: #f9fafb;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 0.4rem 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9em;
  line-height: 1.5;
}

.message-content pre code {
  background-color: transparent;
  padding: 0;
  color: inherit;
  border-radius: 0;
}

.message-content hr {
  display: none !important;
  margin: 0 !important;
  height: 0 !important;
  border: none !important;
}

/* ==========================================================
   MOBILE RESPONSIVE - Адаптация чата под телефоны
   ========================================================== */

/* === Кнопка меню (только на мобильных) === */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;

  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;

  align-items: center;
  justify-content: center;
}

.mobile-menu-btn:hover {
  background: #ffffff;
}

.mobile-menu-btn:active {
  transform: scale(0.95);
}

.mobile-menu-btn img {
  width: 20px;
  height: 20px;
  opacity: 0.7;
  transform: rotate(-90deg);
  transition: transform 0.3s ease;
}

.mobile-menu-btn.active img {
  transform: rotate(0deg);
}

/* === Overlay под сайдбаром === */
.mobile-sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 150;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-sidebar-overlay.visible {
  opacity: 1;
}

@media (max-width: 768px) {

  /* === Показываем кнопку меню === */
  .mobile-menu-btn {
    display: flex;
  }

  .mobile-sidebar-overlay {
    display: block;
    pointer-events: none;
  }

  .mobile-sidebar-overlay.visible {
    pointer-events: auto;
  }

  /* === Layout === */
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "main";
    position: relative;
  }

  /* === Сайдбар выдвигается слева === */
  .sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 160;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    background: #f9fafb;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  /* === Chatbox на весь экран === */
  .chatbox {
    width: 100%;
    height: 100dvh;
  }

  /* === Landing Page — текст по центру, панель внизу === */
  .landing-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    padding: 60px 1rem 0;
    transform: none;
  }

  .landing-inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
    max-width: 100%;
    padding: 0;
    width: 100%;
  }

  .landing-greeting {
    font-size: 1.25rem;
    margin-bottom: 0;
    padding: 0 1rem;
    text-align: center;
  }

  /* === Landing форма === */
  .landing-form {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 1rem 1rem;
    margin: 0;
    background: linear-gradient(to top,
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 255, 255, 0.95) 60%,
        rgba(255, 255, 255, 0) 100%);
    z-index: 100;
  }

  /* === Панель ввода на Landing === */
  .landing-input-wrapper {
    max-width: 100%;
    margin: 0;
    border-radius: 26px;
    padding: 8px 10px 8px 10px !important;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
  }

  .landing-input-wrapper textarea {
    font-size: 16px;
    min-height: 38px;
    padding: 8px 4px;
  }

  .input-icon-btn {
    width: 34px;
    height: 34px;
    margin-bottom: 0;
  }

  .input-icon-btn img {
    width: 18px;
    height: 18px;
  }

  .send-btn {
    width: 36px;
    height: 36px;
    margin-bottom: 0;
  }

  /* === Сообщения на мобильных === */
  .messages-container {
    padding: 0;
    padding-top: 50px;
  }

  #messages-inner,
  .messages-inner {
    width: 100%;
    max-width: 100%;
    padding: 16px 12px 130px;
    margin: 0;
  }

  .messages-inner {
    gap: 0.5rem;
  }

  .message {
    max-width: 88%;
    padding: 8px 14px;
    border-radius: 16px;
  }

  .message-assistant {
    max-width: 95%;
  }

  .message-user {
    padding: 8px 14px;
    border-radius: 16px;
  }

  .message-content {
    font-size: 15px;
    line-height: 24px;
  }

  /* === Панель ввода чата (фиксирована внизу) === */
  .chat-input-form {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 1rem 1rem;
    background: linear-gradient(to top,
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 255, 255, 0.95) 60%,
        rgba(255, 255, 255, 0) 100%);
    z-index: 100;
  }

  .chat-input-wrapper {
    max-width: 100%;
    border-radius: 26px;
    padding: 8px 10px 8px 10px !important;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
  }

  .chat-input-wrapper textarea {
    font-size: 16px;
    min-height: 38px;
    padding: 8px 4px;
    max-height: 120px;
  }

  .ai-disclaimer {
    font-size: 0.65rem;
    margin-top: 8px;
  }

  /* === Кнопки действий сообщений === */
  .message-actions {
    opacity: 0.7;
    padding: 4px 0;
  }

  .message-action-btn {
    width: 28px;
    height: 28px;
  }

  .message-action-btn img {
    width: 14px;
    height: 14px;
  }

  /* === Код-блоки на мобильных === */
  .message-content pre {
    padding: 0.75rem;
    font-size: 0.8em;
    border-radius: 0.4rem;
  }

  .message-content code {
    font-size: 0.8em;
    padding: 0.1rem 0.25rem;
  }

  /* === Modal на мобильных === */
  .modal-content {
    width: 90%;
    max-width: 90%;
    margin: 1rem;
  }

  /* === Sidebar элементы на мобильных === */
  .sidebar {
    padding: 1rem;
    padding-bottom: 80px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .sidebar-logo {
    display: flex;
    margin-bottom: 0.75rem;
  }

  .sidebar-nav {
    margin-bottom: 0.5rem;
  }

  .sidebar-section-title {
    display: inline-flex !important;
    margin-top: 1rem;
  }

  .sidebar-history-block {
    display: block;
    margin-top: 0.5rem;
    overflow: visible;
  }

  .chat-list-wrapper {
    max-height: none;
    overflow: visible;
  }

  .chat-list {
    max-height: calc(100vh - 280px);
    overflow-y: auto;
  }

  .sidebar-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 280px;
    height: 64px;
    background: #f9fafb;
    z-index: 170;
    padding-left: 16px;
    display: flex;
    align-items: center;
  }

  /* === User Menu на мобильных === */
  .user-menu {
    z-index: 300;
    position: fixed;
    bottom: 70px;
    left: 16px;
    right: auto;
    max-width: 250px;
  }

  /* === Settings Modal на мобильных - полноэкранный === */
  .modal-overlay {
    z-index: 400;
  }

  .settings-modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    margin: 0;
    background: #ffffff;
  }

  .settings-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 20;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .settings-modal-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
  }

  .settings-sidebar {
    display: flex;
    flex-direction: row;
    flex-shrink: 0;
    overflow-x: auto;
    padding: 12px 16px;
    padding-top: 56px;
    padding-right: 50px;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    gap: 6px;
    background: #fafafa;
    /* Показываем что можно скроллить */
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
  }

  .settings-sidebar::-webkit-scrollbar {
    height: 0;
  }

  .settings-sidebar-title {
    display: none;
  }

  .settings-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    min-width: 36px;
    height: 36px;
  }

  .settings-nav-item.active {
    background: #2B8FFF;
    border-color: #2B8FFF;
  }

  .settings-nav-item.active img {
    filter: brightness(0) invert(1);
  }

  .settings-nav-item img {
    width: 20px;
    height: 20px;
  }

  .settings-nav-item span {
    display: none;
  }

  .settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    padding-bottom: 40px;
  }

  .settings-section {
    padding: 0;
    max-width: 100%;
  }

  .settings-section-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }

  .settings-about-content {
    padding: 0;
    text-align: center;
  }

  .about-logo {
    margin-bottom: 1rem;
  }

  .about-logo img {
    width: 56px;
    height: 56px;
  }

  .about-name {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  .about-description {
    margin-bottom: 1.5rem;
  }

  .about-description p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #4b5563;
  }

  .about-what-for {
    text-align: left;
    margin-bottom: 1.5rem;
  }

  .about-what-for h5 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  .about-what-for ul {
    font-size: 0.9rem;
    padding-left: 1.25rem;
  }

  .about-what-for li {
    margin-bottom: 0.25rem;
    color: #4b5563;
  }

  .about-links {
    margin-bottom: 1rem;
  }

  .about-link {
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    background: #f3f4f6;
    display: inline-block;
  }

  .about-copyright {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 1.5rem;
  }

  /* Help section на мобильных */
  .settings-help-content {
    padding: 0;
  }

  .help-item {
    margin-bottom: 1.25rem;
  }

  .help-item-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  .help-item-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #4b5563;
  }

  /* Privacy section на мобильных */
  .settings-privacy-content {
    padding: 0;
  }

  .privacy-intro {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }

  .privacy-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .privacy-link {
    padding: 0.75rem 1rem;
    background: #f3f4f6;
    border-radius: 10px;
    font-size: 0.9rem;
  }

  /* Coming soon на мобильных */
  .settings-coming-soon {
    padding: 2rem 1rem;
    text-align: center;
  }

  .settings-coming-soon h4 {
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem;
  }

  .settings-coming-soon p {
    font-size: 0.9rem;
    color: #6b7280;
  }
}

/* === Очень маленькие экраны (iPhone SE и т.д.) === */
@media (max-width: 380px) {
  .mobile-menu-btn {
    width: 36px;
    height: 36px;
    top: 12px;
    left: 12px;
  }

  .mobile-menu-btn img {
    width: 18px;
    height: 18px;
  }

  .landing-greeting {
    font-size: 1.125rem;
  }

  .landing-input-wrapper,
  .chat-input-wrapper {
    border-radius: 22px;
    padding: 6px 8px 6px 8px !important;
  }

  .message-content {
    font-size: 14px;
    line-height: 22px;
  }

  #messages-inner,
  .messages-inner {
    padding: 12px 8px 120px;
  }

  .sidebar {
    width: 260px;
  }

  .sidebar-bottom {
    width: 260px;
  }

  .chat-list {
    max-height: calc(100vh - 260px);
  }

  .user-menu {
    max-width: 240px;
  }
}

/* === Когда клавиатура открыта === */
@media (max-height: 500px) and (max-width: 768px) {
  .landing-container {
    padding-top: 50px;
  }

  .landing-greeting {
    font-size: 1rem;
  }

  .landing-form,
  .chat-input-form {
    padding: 0.5rem 0.75rem 0.5rem;
  }

  .ai-disclaimer {
    display: none;
  }

  .mobile-menu-btn {
    top: 8px;
    left: 8px;
    width: 32px;
    height: 32px;
  }
}