html,
body {
  height: 100%;
  overflow: hidden;
  /* Основной шрифт интерфейса — M PLUS Rounded 1c, мягкий округлый sans-serif */
  font-family: "M PLUS Rounded 1c", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif !important;
}

/* Перебиваем CSS-переменные шрифтов для этой страницы */
:root {
  --font-family-body: "M PLUS Rounded 1c", system-ui, -apple-system, sans-serif;
  --font-family-heading: "M PLUS Rounded 1c", system-ui, -apple-system, sans-serif;
}

/* Все текстовые элементы наследуют M PLUS Rounded 1c через body */
button, input, textarea, select, label, h1, h2, h3, h4, h5, h6, p, span, div {
  font-family: inherit;
}

/* ============================================================
   ЕДИНЫЙ СТИЛЬ ВСЕХ ПОДСКАЗОК В ИНТЕРФЕЙСЕ
   Применяется одинаково везде: в сайдбаре, в формах, в модалке профиля.
   Чтобы поменять размер/цвет/шрифт всех подсказок сразу — правьте ЭТОТ блок.
   Используются классы:
     .sidebar-hint        — общий класс подсказок в сайдбаре
     .tg-status           — подсказки в Telegram-блоках (формы)
     .profile-help-text   — подсказки в модалке профиля
     .subscriptions-group-note — подсказка "Эти подписки созданы в другом режиме…"
   ============================================================ */
.sidebar-hint,
.tg-status,
.profile-help-text,
.subscriptions-group-note {
  font-family: "Zen Kurenaido", sans-serif !important;
  font-size: 1.05rem !important;
  font-weight: 400 !important;
  font-style: normal;
  line-height: 1.4 !important;
  color: #8a3e00 !important;
  margin-top: 4px;
}

.navigation-wrapper {
  display: contents;
}

.navigation-container1 {
  display: contents;
}

.navigation-container2 {
  display: none;
}

.navigation-container3 {
  display: contents;
}

.navigation-container4 {
  display: none;
}

.navigation-container5 {
  display: contents;
}

.new-analysis-container1 {
  width: 100%;
  display: block;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  background: transparent !important;
}


.analysis-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.analysis-icon-button {
  border: none;
  outline: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 8px 10px;
  background-color: #f2f2f5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.analysis-icon-button svg {
  display: block;
}

.analysis-icon-button:hover {
  background-color: #e2e2ea;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.analysis-play-button {
  min-width: 40px;
  min-height: 40px;
  width: 40px;
  height: 40px;
  padding: 0 !important;
  border-radius: 999px !important;
  background-color: #ffffff !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.analysis-play-button:hover {
  background-color: #f3f4f6 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.analysis-play-icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

/* Q&A текстовая область — мягкий прямоугольник со скруглёнными углами.
   Раньше был border-radius: 999px (овал) — при росте текста края
   "обрезали" текст. Теперь как у ChatGPT: спокойный прямоугольник,
   текст всегда виден целиком. */
.analysis-query-input {
  flex: 1;
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid #dddce5;
  background-color: #ffffff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.analysis-query-input::placeholder {
  color: #a0a0b4;
}

/* :focus стилизуется через общий unified focus state выше */

.dashboard-loader {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 3;
  align-items: center;
  justify-content: center;
  padding: 24px;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: transparent;
}

.dashboard-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(440px, 100%);
  margin: auto;
  text-align: center;
  pointer-events: none;
}

.dashboard-lottie-loader {
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(-24px);
  margin-bottom: -14px;
}

.dashboard-status-text {
  min-height: 18px;
  margin-top: 3px;
  padding: 0 8px;
  font-size: 15px;
  font-weight: 350;
  line-height: 1.45;
  color: rgba(68, 68, 68, 0.92);
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(24px);

  text-shadow:
    0 0 0 rgba(255, 166, 77, 0),
    0 0 0 rgba(255, 184, 107, 0);

}

.dashboard-status-text.is-visible {
  animation: dashboardStatusIn 180ms ease forwards, dashboardStatusPulse 1s ease-in-out 180ms 1;
}

.dashboard-results-text {
  margin-top: 12px;
  font-size: 14px;
  white-space: pre-wrap;
}

/* Полоска с названием чата — деликатная: тонкая полупрозрачная обводка
   (как у блока создания подписки) + цвет текста teal (как у подсказок). */
.chat-title-bar {
  display: none;           /* по умолчанию скрыта, JS включает */
  width: auto;
  margin: 12px 24px 0 24px;
  padding: 12px 20px;

  background: rgba(255, 141, 55, 0.05);    /* совсем светлая персиковая заливка */
  color: #FF8D37;                           /* ярко-оранжевый */
  font-size: 1.05rem;
  font-weight: 600;
  border: 1px solid rgba(179, 96, 25, 0.35); /* такая же тонкая прозрачная обводка, как у subscription-block */
  border-radius: 12px;
  box-sizing: border-box;
}

/* Карточка с результатами*/
.dashboard-results-viewer {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Немного воздуха между полоской и текстом результата */
.dashboard-results-text {
  margin-top: 8px;
  padding: 24px;
  white-space: pre-wrap;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
}

.dashboard-top-block {
  padding: 0;
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dashboard-container {
  width: 100%;
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 100%;
  height: 100%;
  padding: var(--topbar-h) 24px 0 24px;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  overflow: hidden;
}


/* Главный контейнер с левой и правой колонкой */
.dashboard-layout {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
}


.analysis-disclaimer {
  display: none !important;
}

.dashboard-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
}

.dashboard-sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);

  min-height: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  background: #F3F4F6;
  font-size: 0.9rem;
  box-sizing: border-box;
  transition: width 240ms cubic-bezier(0.2, 0.9, 0.2, 1),
              flex-basis 240ms cubic-bezier(0.2, 0.9, 0.2, 1);
  overflow: hidden;
  position: relative;
  z-index: 10;
}

.sidebar-scroll-area {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 20px 28px 20px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

#sidebarContent {
  display: flex;
  flex-direction: column;
  min-height: auto;
}

.subscription-block {
  margin-bottom: 12px;
  scroll-margin-bottom: 20px;
}

.sidebar-subscriptions-body {
  min-height: 0;
}

:root {
  --sidebar-width: 320px; /* дефолт */
  --sidebar-collapsed-width: 56px;
}

/* Ручка ресайза */
.sidebar-resizer {
  position: absolute;
  top: 0;
  right: -6px;            /* чуть за границу, чтобы удобно хватать */
  width: 12px;
  height: 100%;
  cursor: col-resize;
  background: transparent;
}

/* Небольшая подсветка, когда навели */
.sidebar-resizer:hover {
  background: rgba(0,0,0,0.04);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  position: relative;
  /* Фиксированная высота 60px — точно совпадает с высотой правого хедера
     (.navigation), чтобы разделительные линии под "Рабочая панель" и под
     лого CoTel находились на одном уровне. */
  height: 60px;
  min-height: 60px;
  padding: 0 20px;
  box-sizing: border-box;
  text-align: left;
  /* Тонкая горизонтальная линия — отделяет заголовок панели от первого блока
     и совпадает по уровню с border-bottom правого хедера */
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 12px;
}

.sidebar-toggle-btn {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);

  width: 32px;
  height: 32px;
  aspect-ratio: 1 / 1;
  border-radius: 999px;

  line-height: 1;

  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: #363537;
  color: #fef3f2;
  font-size: 16px;
  padding: 0;
  transition: background-color 0.15s ease, transform 0.15s ease;
  margin-left: auto;
  z-index: 5;

}

.sidebar-toggle-btn:hover {
  background: #4b4b4d;
    transform: translateY(-50%) translateY(-1px);
}

.sidebar-title {
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  width: auto;
  max-width: calc(100% - 84px);
  margin-left: 0;
  padding: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 240ms ease, visibility 160ms ease;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* Контент НЕ исчезает через display:none — он "уезжает под границу" */
#sidebarContent {
  transition: opacity 140ms ease, transform 240ms ease, visibility 140ms ease;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* Блок с мини-иконками для свернутой панели */
.sidebar-mini-icons {
  display: none;              /* по умолчанию скрыты */
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  transition: opacity 0.18s ease, visibility 0.18s ease;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sidebar-mini-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  font-size: 18px;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.sidebar-mini-icon-btn:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
}

/* PNG-иконки внутри мини-кнопок сайдбара и тоггл-кнопки */
.sidebar-icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
  pointer-events: none; /* клик идёт по родительской кнопке */
}

/* Шестерёнка на тёмном фоне — иконка чуть меньше, чтобы не упиралась в края */
.sidebar-icon-img--on-dark {
  width: 18px;
  height: 18px;
}

/* PNG-иконка в заголовке секции (вместо ▾). Без обводки/круга — просто картинка. */
.sidebar-section-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
  margin-left: 8px;
  pointer-events: none; /* клик идёт по всему summary */
  transition: transform 0.18s ease, opacity 0.15s ease;
}

.sidebar-section details[open] > summary .sidebar-section-icon {
  /* можно при необходимости отличать состояния — пока без изменений */
  opacity: 1;
}

.sidebar-section summary:hover .sidebar-section-icon {
  transform: scale(1.06);
}

/* ============================================================ */
/* ЕДИНЫЙ HOVER ДЛЯ ВСЕХ КРУГЛЫХ ИКОНОК-КНОПОК
   Подсветка — мягкий пепельно-бирюзовый (#95FFF7 с 32% прозрачностью).
   Плюс тонкая рассеивающаяся тёмная тень вокруг кружка — отделяет иконку
   от серого фона при наведении.
   Применяется к:
   - мини-иконкам в свёрнутом сайдбаре,
   - переключателю языка (глобус),
   - кнопке отправки запроса (play),
   - кнопке добавления подписки (+),
   - кнопке быстрого выхода (quit). */
.sidebar-mini-icon-btn:hover,
.navigation .lang-switcher__button:hover,
.navigation .lang-switcher__button:focus-visible,
.analysis-play-button:hover,
.sidebar-add-subscription-btn:hover,
#quick-logout-btn:hover {
  background: rgba(149, 255, 247, 0.32) !important;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.05),    /* тонкое кольцо вокруг кружка */
    0 4px 10px rgba(15, 23, 42, 0.10),   /* мягкая рассеивающаяся тень */
    0 1px 2px rgba(43, 168, 158, 0.18) !important; /* лёгкий бирюзовый отблеск */
  transform: translateY(-1px);
}

/* ============================================================ */
/* Кнопка "быстрого выхода" в нижней панели сайдбара (с PNG quit-64).
   Делаем тот же мини-стиль: белый кружочек с лёгкой тенью. */
#quick-logout-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

#quick-logout-btn:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

/* ============================================================ */
/* ФУТЕР САЙДБАРА (карточка пользователя: аватар + email + plan + quit)
   Белая карточка с тонкой серой обводкой, скруглением 12px. */
#sidebarUserArea {
  width: calc(100% - 24px);
  margin: 8px 12px 12px 12px;
  padding: 10px 12px !important;
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  border-radius: 12px !important;
  box-sizing: border-box;
  /* НЕ ставим overflow: hidden — иначе абсолютно позиционированный
     dropdown профиля (Профиль/Справка/Выйти) обрезается. */
  overflow: visible;
  /* НЕ растёт по вертикали при открытом dropdown — он выводится absolute */
  flex: 0 0 auto;
}

/* Контейнер профиля — позиционирующая база */
#user-profile {
  position: relative;
}

/* Dropdown профиля позиционируем CSS-ом на этой странице.
   В auth.css есть старое правило .user-dropdown { left: 50%; transform: translateX(-50%); }.
   Оно конфликтует со свернутым sidebar и уводит меню за левую границу окна. */
#sidebarUserArea #user-dropdown {
  position: absolute !important;
  left: 0 !important;
  right: auto !important;
  bottom: calc(100% + 8px) !important;
  transform: none !important;

  width: 180px !important;
  min-width: 180px !important;
  max-width: calc(100vw - 24px) !important;

  z-index: 9999;
  box-sizing: border-box;
}

/* Когда sidebar свернут, меню должно открываться справа от круглой иконки,
   а не центрироваться и не уезжать влево. */
.dashboard-sidebar.collapsed #sidebarUserArea #user-dropdown,
body.sidebar-collapsed #sidebarUserArea #user-dropdown {
  left: calc(100% + 12px) !important;
  right: auto !important;
  bottom: 0 !important;
  transform: none !important;
}

/* В свёрнутом состоянии сайдбара уменьшаем margin/padding,
   чтобы карточка влезла в узкую полоску */
.dashboard-sidebar.collapsed #sidebarUserArea,
body.sidebar-collapsed #sidebarUserArea {
  margin: 8px 4px 12px 4px !important;
  padding: 6px !important;
}

/* Триггер с аватаром/email/plan: горизонтальный flex с gap */
#user-profile-trigger {
  display: flex !important;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  background: transparent !important;
  border: none !important;
}

/* Аватар-кот — круглый, поменьше */
#sidebarUserArea .user-avatar-img {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  object-fit: cover;
  flex-shrink: 0;
}

/* email + plan — компактный блок мелким текстом */
#sidebarUserArea .user-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}

#sidebarUserArea .user-email {
  font-size: 14px;
  font-weight: 600;
  color: #2A2A2A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#sidebarUserArea .user-plan {
  font-size: 12px;
  color: #7A7A7A;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

/* ============================================================ */
/* ЕДИНЫЙ СТИЛЬ ВЫПАДАЮЩИХ МЕНЮ
   Применяется и к меню профиля (Profile/Help/Sign out),
   и к переключателю языка (English/Русский) — чтобы UI был консистентным.
   Без обводки у пунктов, единый шрифт, hover: персиковый фон + оранжевый текст. */
#user-dropdown {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  width: 180px; /* компактная ширина — раньше расползалось по контейнеру */
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

#user-dropdown.hidden {
  display: none;
}

#user-dropdown button,
.navigation .lang-switcher__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border: none !important;
  background: transparent !important;
  border-radius: 6px;
  font: inherit;
  font-size: 15px !important;
  text-align: left;
  justify-content: flex-start;
  color: #2A2A2A !important;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

/* Иконка слева от названия пункта меню — как мини-иконки в сайдбаре */
.user-dropdown-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
  pointer-events: none;
}

#user-dropdown button:hover,
#user-dropdown button:focus-visible,
.navigation .lang-switcher__item:hover,
.navigation .lang-switcher__item:focus-visible {
  background: #fff3e8 !important; /* мягкий персиковый */
  color: #B36019 !important; /* тёмно-оранжевый текст */
  outline: none;
}

/* Активный язык (выбранный сейчас) — заливка ярче, текст оранжевый */
.navigation .lang-switcher__item[aria-current="true"] {
  background: rgba(249, 115, 22, 0.12) !important;
  color: #c2410c !important;
  font-weight: 600;
}

/* Свернутая панель */
.dashboard-sidebar.collapsed {
  width: var(--sidebar-collapsed-width) !important;
  flex: 0 0 var(--sidebar-collapsed-width) !important;
  min-width: var(--sidebar-collapsed-width);
  max-width: var(--sidebar-collapsed-width);

  height: 100%;
  min-height: 100%;
  padding: 0 4px;
  overflow: visible;
  align-items: center;
}

/* В свернутом состоянии шестерёнка по центру, как и остальные иконки */
.dashboard-sidebar.collapsed .sidebar-toggle-btn {
  left: 50%;
  right: auto;
  transform: translate(-50%, -50%);
}

.dashboard-sidebar.collapsed .sidebar-mini-icons {
  margin-bottom: 16px;
}

/* Футер скрываем для неавторизованного пользователя */

body.user-not-auth #sidebarUserArea {
  background: transparent !important;
  border-top-color: transparent !important;
}

body.user-not-auth #sidebarUserArea .auth-open-btn {
  margin-bottom: 0;
}

/* Прячем текст и основной контент, оставляем только шапку + мини-иконки */
/* .dashboard-sidebar.collapsed .sidebar-title,
.dashboard-sidebar.collapsed #sidebarContent {
  display: none;
} */

/* В свернутом состоянии: не убираем из DOM, а “гасим” */
.dashboard-sidebar.collapsed #sidebarContent {
  opacity: 0;
  visibility: hidden;
  pointer-events: none; /* чтобы нельзя было кликать по скрытому */
   transform: translateX(-16px); /* эффект "уходит под границу" */
}

/* Показываем колонку мини-иконок только в свернутом состоянии */
.dashboard-sidebar.collapsed .sidebar-mini-icons {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Центруем шестерёнку по вертикали, когда панель узкая (опционально) */
/*.dashboard-sidebar.collapsed .sidebar-header {
  margin-bottom: 0;
  justify-content: center;
}*/


.sidebar-text-input::placeholder {
  color: #a0a0b4;            /* как у "Введите текст запроса" */
  font-weight: 400;
}
.sidebar-text-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  font-family: inherit;
  background: #ffffff;
}

.sidebar-text-input:focus {
  outline: none;
  border-color: #6b7280;
  box-shadow: 0 0 0 1px rgba(107, 114, 128, 0.25);
}

.sidebar-hint {
  font-size: 0.8rem;
  color: #0F766E; /* deep teal (затемнённый) — второй акцентный цвет для подсказок/инфо, контраст 4.7:1 на белом */
  margin-top: 4px;
}

/* Кнопка добавления подписки — в едином стиле с мини-иконками сайдбара:
   белый кружок 32×32, без пунктира, лёгкая тень. */
.sidebar-add-subscription-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 8px auto 4px;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

/* Статус Telegram */
.tg-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.tg-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444; /* красный по умолчанию */
  display: inline-block;   /* ключевой момент — делаем его "видимым" */
  flex-shrink: 0;
}


.tg-status-dot.tg-status-on {
  background: #22c55e; /* зелёный */
}

.tg-status-dot.tg-status-off {
  background: #ef4444; /* красный */
}

/* Список чатов и история — полупрозрачно-белый, не сливается с родителем
   (важно когда родитель — кремовый tg-field в форме создания подписки). */
.sidebar-chat-list {
  margin-top: 10px;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  padding: 6px;
  max-height: 40vh;
}


/* === Панель ввода: только тонкая рамка, без заливки === */
.dashboard-input-panel {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  background: #F3F4F6;
  box-shadow: none;
}

/* === Нижняя область: без рамок/заливок = */
.dashboard-bottom-block {
  flex: 0 0 auto;
  border: 0 !important;
  background: #FFFFFF !important;
  box-shadow: none !important;
  padding: 8px 0 10px 0 !important;
  margin-top: 0;
  position: sticky;
  bottom: 0;
  z-index: 5;
}

.dashboard-main,
.dashboard-container,
.dashboard-top-block,
.dashboard-results-viewer {
  background: transparent !important;
}

/* Этот блок раньше задавал фон/высоту .navigation, но финальные настройки
   находятся ниже в файле (строка ~871, position: fixed left: var(--sidebar-w)).
   Чтобы избежать конфликтов, оставляем здесь только pointer-events. */
.navigation {
  pointer-events: none; /* КЛЮЧЕВОЕ: не перехватываем клики */
}


/* Спрячем левое/правое меню — оставим только лого по центру */
.navigation__left,
.navigation__right {
  display: none !important;
}

.navigation__toggle {
  display: none !important;
}

/* Переключатель языка: остаётся кликабельным несмотря на pointer-events:none
   у самой .navigation, и прижат к правому краю фиксированной шапки. */
.navigation .lang-switcher,
.navigation .lang-switcher * {
  pointer-events: auto !important;
}

.navigation .lang-switcher {
  position: absolute !important;
  right: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 210 !important;
}

/* Глобус-переключатель языка в стиле мини-иконок сайдбара:
   белый кружочек с лёгкой тенью, единая визуальная система. */
.navigation .lang-switcher__button {
  width: 32px;
  height: 32px;
  padding: 0 !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08) !important;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease !important;
}

/* Hover для глобуса задаётся в едином правиле выше (бирюзовый),
   здесь только outline сбрасываем */
.navigation .lang-switcher__button:focus-visible {
  outline: none;
}

.navigation .lang-switcher__globe {
  width: 18px !important;
  height: 18px !important;
}

/* Уменьшаем логотип */
.navigation__logo-text {
  font-size: 18px !important;
  letter-spacing: 0.08em;
}


/* === Лого без подложки === */
.navigation__logo {
  pointer-events: none !important;  /* убирает hover/клик */
  cursor: default !important;
  background: transparent !important;
  border-radius: 0;
  padding: 0;
}


/* Текст лого: тёмно-серый, чуть крупнее */
.navigation__logo-text {
  color: #2A2A2A !important;  /* тёмно-серый из палитры */
  font-size: 26px !important; /* было мало — увеличили */
  letter-spacing: 0.08em;
  user-select: none;
  text-decoration: none !important;
}

.navigation__logo,
.navigation__logo * {
  text-decoration: none !important;
  filter: none !important;
  box-shadow: none !important;
}

/* Котик лого*/
.navigation-logo-cat {
  width: 28px !important;
  height: 28px !important;
  position: relative;
  top: -2px;
  margin: 0 6px !important;
}

/* На всякий случай: никаких hover-эффектов на лого */
.navigation__logo:hover .navigation__logo-text {
  color: inherit !important;
}

.sidebar-chat-item {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
  line-height: 1.2;
  transition: background 0.12s ease, font-weight 0.12s ease;
}

.sidebar-chat-item:hover {
  background: rgba(149, 255, 247, 0.32); /* мягкий пепельно-бирюзовый, как у иконок */
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.05),
    0 2px 6px rgba(15, 23, 42, 0.08);
  font-weight: 500;
}

.sidebar-chat-item:active {
  background: rgba(149, 255, 247, 0.5);
}

/* === Глобальный фон = */
:root {
  --color-surface: #FFFFFF;
  --color-on-surface: #2A2A2A;
  --color-border: rgba(0, 0, 0, 0.06);
}

html, body {
  background: #FFFFFF !important;
}

/* === Правая рабочая область: без "карточек", теней и заливок === */
.dashboard-main,
.dashboard-container,
.new-analysis-container1,
.dashboard-layout,
.dashboard-top-block,
.dashboard-results-viewer,
.dashboard-results-text {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}


/* ============================================================ */
/* МИНИ-ССЫЛКА НА СООБЩЕНИЕ В TELEGRAM — рядом с цитатой в выдаче.
   LLM ставит токены [msg:ID], фронт превращает их в эту иконку.
   Оранжевая иконка (в стиле акцентов CoTel), при наведении —
   мягкая бирюзовая подсветка как у других круглых иконок-кнопок. */
.msg-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  margin: 0 2px;
  vertical-align: -7px;
  border-radius: 999px;
  color: #F97316;            /* акцентный оранжевый (tailwind orange-500) */
  text-decoration: none;
  background: transparent;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
  cursor: pointer;
  line-height: 0;
}

.msg-link:hover,
.msg-link:focus-visible {
  background: rgba(149, 255, 247, 0.32); /* тот же пепельно-бирюзовый */
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.05),
    0 2px 6px rgba(15, 23, 42, 0.10),
    0 1px 2px rgba(43, 168, 158, 0.18);
  transform: translateY(-1px);
  color: #EA580C;            /* чуть глубже оранжевый при наведении */
  outline: none;
}

.msg-link__icon {
  width: 18px;
  height: 18px;
  display: block;
  pointer-events: none;
}

/* === Дисклеймер: отодвинуть от нижней границы === */
.analysis-disclaimer {
  margin-top: 10px;
  padding: 10px 12px 14px 12px; /* добавили нижний воздух */
  font-size: 0.85rem;
  line-height: 1.3;
  color: #6b7280;
}

/* Прячем контейнер списка чатов, если он пустой */
.sidebar-chat-list:empty {
  display: none;
}

.dashboard-sidebar.collapsed { width: 56px; } /* у тебя уже есть */

:root {
  --sidebar-width: 300px;          /* дефолт (можешь поставить 320px) */
  --sidebar-collapsed-width: 56px;

  /* ЭТО ВАЖНО: ширина, от которой будет сдвигаться верхняя полоска */
  --sidebar-w: var(--sidebar-width);

  /* Высота верхнего хедера — должна СОВПАДАТЬ с высотой .sidebar-header,
     чтобы разделительные линии под "Workspace" и под логотипом CoTel
     находились на одном уровне. */
  --topbar-h: 60px;
}

body.sidebar-collapsed {
  --sidebar-w: var(--sidebar-collapsed-width);
}

/* === Верхняя фиксированная полоса с логотипом ===
   Хедер позиционируем СПРАВА от сайдбара (left: var(--sidebar-w)),
   чтобы он не перекрывал сам сайдбар при сворачивании/разворачивании.
   При смене состояния сайдбара переменная --sidebar-w меняется через
   body.sidebar-collapsed → хедер плавно сдвигается. */
.navigation {
  position: fixed !important;
  top: 0 !important;
  left: var(--sidebar-w) !important;
  right: 0 !important;
  height: var(--topbar-h) !important;
  width: auto !important;

  /* Тот же серый, что у сайдбара — единая горизонтальная полоса сверху.
     Без прозрачности и без backdrop-filter, чтобы не было "матового" эффекта
     и неравномерного цвета. */
  background: #F3F4F6 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: none !important;

  z-index: 200 !important;
  pointer-events: none; /* клики пропускаем */

  /* Плавный сдвиг при сворачивании/разворачивании сайдбара */
  transition: left 240ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

/* Центрируем контейнер под логотип */
.navigation__container {
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important; /* ВАЖНО: убирает "толстую" полосу сверху */
}

/* 1) ВАЖНО: QR не должен обрезаться родителями */
#tgAuthBlock,
#tgAuthBlock * {
  overflow: visible !important;
}

.tg-qr-block {
  margin: 6px 0 10px 0;
}

.tg-qr-divider {
  margin: 10px 0;
  height: 1px;
  background: rgba(0,0,0,0.06);
}

/* Область QR-кода — без обводки и без своего фона; границу даёт
   родительская tg-group через вертикальную оранжевую линию */
.tg-qr-area {
  margin-top: 10px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
}

.tg-qr-canvas {
  display: flex;
  justify-content: center;
  align-items: center;

  width: 100%;
  max-width: 220px;
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  box-sizing: border-box;
}

/* 3) Если QRCode.js рисует <img> или <canvas> — заставляем его ужиматься */
.tg-qr-canvas img,
.tg-qr-canvas canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.dashboard-sidebar h3 {
        font-size: 0.9rem;
        font-weight: 600;
        margin-bottom: 8px;
}

/* TG auth block (блок Telegram-авторизации внутри "Мой аккаунт Telegram")
   — без обводки, прозрачный. Подгруппы выделяются только вертикальными
   оранжевыми линиями через .tg-group. */
.tg-auth-block {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin: 6px 0 10px 0;
  padding: 6px 0 0 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Заголовок "Авторизация Telegram" — скрыт, лишний.
   ВАЖНО: только в Telegram-auth, НЕ трогаем h3 в форме создания подписки. */
.tg-auth-block:not(.subscription-block) h3 {
  display: none;
}

/* Заголовок "Создание новой подписки" — оставляем видимым */
.tg-auth-block.subscription-block h3 {
  display: block;
  margin: 0 0 14px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #2A2A2A;
}

/* Форма создания подписки — деликатная тонкая обводка
   тёмно-оранжевого цвета с прозрачностью, едва заметная. */
.tg-auth-block.subscription-block {
  background: transparent !important;
  border: 1px solid rgba(179, 96, 25, 0.35) !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
  margin: 6px 0 10px 0 !important;
  box-shadow: none !important;
}

/* .tg-group — подгруппа внутри tg-auth-block: вертикальная оранжевая
   линия слева, объединяющая кнопку + поле + подсказку под одним блоком */
.tg-group {
  border-left: 2px solid #FF8D37;
  padding: 8px 0 8px 12px;
  margin-bottom: 20px;
}

.tg-group:last-child {
  margin-bottom: 0;
}

/* Внутри .tg-group поля .tg-field уже без своей оранжевой линии,
   так как родительская группа её даёт */
.tg-auth-block:not(.subscription-block) .tg-field {
  border-left: none;
  padding-left: 0;
  margin-bottom: 8px;
}

/* Кнопки в Telegram-авторизации — outline-стиль (прозрачные с тонкой
   тёмной обводкой). Деликатнее графитовых для светлого интерфейса. */
.tg-auth-block:not(.subscription-block) .tg-button {
  margin-top: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid #2A2A2A;
  background: transparent;
  color: #2A2A2A;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  min-width: 50%; /* минимум полблока, но если текст длиннее — расширяется */
  width: auto;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.tg-auth-block:not(.subscription-block) .tg-button:hover {
  background: rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.10);
}

.tg-auth-block:not(.subscription-block) .tg-button:active {
  transform: translateY(0);
  background: rgba(15, 23, 42, 0.10);
}

/* Кнопка "Завершить сеанс" в блоке статуса Telegram —
   inline с username (зелёная точка + @username + [кнопка]), компактная,
   outline-danger в стиле "Удалить профиль". */
.tg-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tg-status-row #tgStatusText {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tg-button--logout {
  flex: 0 0 auto;
  margin-top: 0 !important;
  min-width: auto !important;
  width: auto !important;
  padding: 6px 14px !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #C0392B !important;
  border: 1px solid #C0392B !important;
  font-size: 0.85rem !important;
  font-weight: 400 !important;
  line-height: 1.2 !important;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tg-button--logout:hover {
  background: rgba(192, 57, 43, 0.08) !important;
  color: #8C2A1F !important;
}

/* Лейбл над сгруппированным блоком — как .sidebar-history-toggle
   (более лёгкий стиль, чем заголовки секций сайдбара) */
.tg-group-label {
  font-size: 0.82rem;
  color: #464f5c;
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}

/* ============================================================
   Сворачиваемые tg-group (используют <details><summary>)
   Заголовок-summary становится кликабельной полоской.
   Оранжевая линия слева сохраняется через .tg-group. */
details.tg-group--collapsible {
  /* Свёрнутое состояние компактнее — уменьшили вертикальный padding */
  padding: 2px 0 2px 12px;
}

details.tg-group--collapsible[open] {
  padding: 6px 0 8px 12px;
}

details.tg-group--collapsible > summary.tg-group-label {
  list-style: none; /* убираем дефолтный треугольник */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
  padding: 2px 0;
  user-select: none;
}

details.tg-group--collapsible > summary.tg-group-label::-webkit-details-marker {
  display: none;
}

/* Шеврон поворачивается при открытии */
.tg-group-chevron {
  font-size: 0.85rem;
  color: #6b7280;
  transition: transform 0.2s ease;
  margin-left: 8px;
}

details.tg-group--collapsible[open] > summary.tg-group-label .tg-group-chevron {
  transform: rotate(0deg);
}

details.tg-group--collapsible:not([open]) > summary.tg-group-label .tg-group-chevron {
  transform: rotate(-90deg);
}

/* Тело сворачиваемой группы — отступ сверху от заголовка */
.tg-group-body {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
}

/* (Старое правило padding-bottom удалено — теперь высота управляется
    в едином правиле details.tg-group--collapsible выше) */

/* Дополнительный отступ для подсказки под кнопкой (QR) */
.tg-status--with-gap {
  margin-top: 14px !important;
}

/* ============================================================ */
/* УНИФИЦИРОВАННЫЙ FOCUS STATE для всех инпутов и текстарей.
   Тонкая бирюзовая обводка — деликатнее, без жирного кольца. */
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
  outline: none !important;
  border-color: #95FFF7 !important;
  box-shadow:
    0 0 0 1px rgba(149, 255, 247, 0.5),
    0 1px 2px rgba(15, 23, 42, 0.05) !important;
}

/* (Дубликат правила для #user-dropdown удалён — позиционирование
    полностью контролируется JS: см. auth.js → toggleUserDropdown) */

/* Заголовок "Авторизация Telegram" внутри блока */
.tg-auth-block h3 {
  margin: 0 0 12px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #2A2A2A;
}

/* Тонкая горизонтальная линия между блоками .tg-group в Telegram-auth */
.tg-auth-block:not(.subscription-block) .tg-group:not(:last-child) {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

/* Старый разделитель .tg-qr-divider больше не нужен (заменён border-bottom на .tg-group) */
.tg-qr-divider {
  display: none !important;
}

/* === Форма создания подписки: больше отступов между блоками + горизонтальная
   линия-разделитель между ними. */
.subscription-block .tg-field {
  margin-bottom: 24px; /* 2x от стандартных 12px */
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.subscription-block .tg-field:last-of-type,
.subscription-block .tg-field:nth-last-of-type(1) {
  margin-bottom: 16px;
  padding-bottom: 0;
  border-bottom: none;
}

/* По умолчанию (развернуто): контент видим, но появление чуть с задержкой = эффект "ширмы" */
.sidebar-title,
.sidebar-scroll-area {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);

  will-change: opacity, transform, visibility;
  transition:
    transform 240ms cubic-bezier(0.2, 0.9, 0.2, 1) 120ms,
    opacity 180ms ease 120ms,
    visibility 0s linear 120ms;
}


/* Свернуто: прячем быстро (до сужения), чтобы текст не успевал сжиматься */
.dashboard-sidebar.collapsed .sidebar-title,
.dashboard-sidebar.collapsed .sidebar-scroll-area {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-24px);

  transition:
    transform 120ms ease 0ms,
    opacity 90ms ease 0ms,
    visibility 0s linear 90ms;
}


#sidebarContent {
  white-space: normal; /* оставляем нормальный текст */
}

#sidebarContent * {
  min-width: 0; /* чтобы flex-элементы не раздували блок */
}


/* ===== Subscriptions UI ===== */

.subscription-block h3 {
  margin-bottom: 8px;
}

.subscription-hint {
  margin: 4px 0 10px;
}

/* ============================================================
   ЕДИНЫЙ СТИЛЬ ДЛЯ ВСЕХ <select> на странице.
   Кастомная стрелочка через background-image, белый фон,
   правильные отступы и шрифт. Native option-list стилизуется
   ограниченно браузером — мы можем задать только cursor / padding.
   ============================================================ */
select,
.tg-select,
.sidebar-inline-setting-input[name],
#queryAiModelSelect,
#subAiModelSelect {
  width: 100%;
  padding: 10px 36px 10px 14px; /* справа отступ под стрелочку */
  border-radius: 8px !important;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  font-family: inherit;
  background-color: #ffffff;
  color: #2A2A2A;
  outline: none;
  cursor: pointer;
  box-sizing: border-box;

  /* убираем дефолтную стрелочку браузера */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  /* кастомная стрелочка через inline SVG */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 5 6 8 9 5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 12px;
}

/* Воздушнее раскрытый список — браузер ограничен в стилизации,
   но padding/font можно задать */
select option {
  padding: 10px 12px;
  background: #ffffff;
  color: #2A2A2A;
  font-size: 0.9rem;
}

/* textarea авто-рост + стиль как input */
.tg-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  background: #ffffff;
  outline: none;
  resize: none;
  line-height: 1.4;
}

.tg-textarea::placeholder {
  color: #a0a0b4;
}

.tg-textarea:focus {
  border-color: #6b7280;
  box-shadow: 0 0 0 1px rgba(107, 114, 128, 0.25);
}

.tg-field .iti {
  width: 100%;
}

.tg-field .iti__tel-input {
  width: 100% !important;
  height: 40px;
  /* padding-left увеличен (было 56px), чтобы цифры не накладывались
     на флаг и стрелку селектора страны intl-tel-input v26. */
  padding: 6px 10px 6px 76px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  background: #ffffff;
  box-sizing: border-box;
}

.tg-field .iti__selected-country-primary {
  height: 40px;
  display: flex;
  align-items: center;
}

.tg-field .iti__selected-country {
  padding-left: 10px;
}

.tg-field .iti__selected-country {
  border-radius: 999px 0 0 999px;
}

.tg-field .iti__country-list {
  z-index: 4000;
}

.subscription-actions {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-top: 12px;
}

/* Кнопки внутри формы создания подписки — графитовые, прямоугольные,
   одинаковой ширины, на всю ширину блока. В стиле сабмит-кнопок
   аутентификации (Войти / Зарегистрироваться). */
.subscription-actions .tg-button {
  flex: 1 1 0; /* равная ширина */
  margin-top: 0;
  padding: 10px 14px;
  border-radius: 8px; /* прямоугольные, не пилюля */
  border: 1px solid #2A2A2A;
  background: #2A2A2A; /* графит */
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.subscription-actions .tg-button:hover {
  background: #3a3a3c;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.subscription-actions .tg-button:active {
  transform: translateY(0);
  background: #1f1f20;
}

/* "Отмена" — вторичная: outline-стиль вместо заливки */
.subscription-actions #cancelSubscriptionBtn {
  background: transparent;
  color: #2A2A2A;
}

.subscription-actions #cancelSubscriptionBtn:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #2A2A2A;
}

/* компактнее список чатов в форме подписки */
.sidebar-chat-list--compact {
  max-height: 180px;
}

/* список подписок (пока минимально) */
.sidebar-subscriptions-list:empty {
  display: none;
}

.sidebar-subscriptions-list {
  margin-top: 6px;
  background: transparent;
  border: none;
  padding: 0;
}

.subscription-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  user-select: none;
}

.subscription-item:hover {
  background: #f3f4f6;
}

.subscription-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
  background: #22c55e; /* активна */
}

.subscription-name {
  font-size: 0.9rem;
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
   flex: 1;
  min-width: 0;
}

.subscription-actions-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.subscription-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease;
  font-size: 14px;
  line-height: 1;
}

.subscription-action-btn:hover {
  background: #f3f4f6;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.subscription-action-btn:active {
  transform: translateY(0);
}

/* future states */
.subscription-status-dot.is-paused { background: #9ca3af; }
.subscription-status-dot.is-error  { background: #ef4444; }

/* ===== Modal  ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
}

.modal-card {
  width: min(420px, 92vw);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  padding: 16px 16px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-text {
  font-size: 0.9rem;
  color: rgba(0,0,0,0.75);
  margin-bottom: 10px;
}

.modal-link {
  display: inline-flex;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

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

.data-source-hidden {
  display: none !important;
}

.analysis-query-textarea {
  width: 100%;
  min-height: 48px;
  max-height: 220px;
  resize: none;
  overflow-y: auto;
  line-height: 1.45;
  padding-top: 12px;
  padding-bottom: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

#runSubscriptionsBtn,
#dispatchBotBtn,
#adminPanelBtn {
  display: none !important;
}

/* === Неавторизованный пользователь: размытая левая панель + CTA по центру === */

body.user-not-auth .dashboard-sidebar {
  position: relative;
  overflow: hidden;
}

/* Размываем и приглушаем весь контент панели, кроме зоны кнопки входа и ресайзера */
body.user-not-auth .dashboard-sidebar > *:not(#sidebarUserArea):not(#sidebarResizer) {
  filter: blur(3px);
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

/* Зона с кнопкой превращается в центральный overlay */
body.user-not-auth #sidebarUserArea {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: transparent !important;
  border-top: none !important;
}

/* Кнопка по центру, заметнее и крупнее */
body.user-not-auth #sidebarUserArea .auth-open-btn {
  width: min(260px, 100%);
  min-height: 54px;
  padding: 14px 24px;
  margin: 0;
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.16);
  position: relative;
  z-index: 31;
}

/* В свернутом sidebar тоже не уводим кнопку вниз, а оставляем по центру */
body.user-not-auth.sidebar-collapsed #sidebarUserArea,
body.user-not-auth .dashboard-sidebar.collapsed #sidebarUserArea {
  inset: 0;
  padding: 12px;
  justify-content: center;
  align-items: center;
}

body.user-not-auth.sidebar-collapsed #sidebarUserArea .auth-open-btn,
body.user-not-auth .dashboard-sidebar.collapsed #sidebarUserArea .auth-open-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.18);
}

/* Чтобы иконка/текст кнопки корректно отображались в обоих состояниях */
body.user-not-auth .dashboard-sidebar.collapsed #sidebarUserArea .auth-open-btn .collapsed-only,
body.user-not-auth.sidebar-collapsed #sidebarUserArea .auth-open-btn .collapsed-only {
  display: inline-flex !important;
}

body.user-not-auth .dashboard-sidebar.collapsed #sidebarUserArea .auth-open-btn .expanded-only,
body.user-not-auth.sidebar-collapsed #sidebarUserArea .auth-open-btn .expanded-only {
  display: none !important;
}

/* === История чатов === */

.sidebar-history-block {
  margin-top: 8px;
}

/* Шапка блока: тоггл + опциональная кнопка действия (refresh). */
.sidebar-history-block-header {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sidebar-history-block-header .sidebar-history-toggle {
  flex: 1;
  min-width: 0;
}

.sidebar-history-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 2px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: #464f5c;
}

.sidebar-history-toggle:hover {
  color: #111827;
}

/* Кнопка "Обновить структуру" — рядом с тогглом блока чатов.
   Тот же визуальный язык, что и у других иконок-кнопок:
   мягкая бирюзовая подсветка на hover, лёгкий transform. */
.sidebar-refresh-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 999px;
  color: #6b7280;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.sidebar-refresh-btn:hover,
.sidebar-refresh-btn:focus-visible {
  background: rgba(149, 255, 247, 0.32);
  color: #111827;
  outline: none;
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.05),
    0 2px 6px rgba(15, 23, 42, 0.10),
    0 1px 2px rgba(43, 168, 158, 0.18);
}
.sidebar-refresh-btn__icon {
  width: 14px;
  height: 14px;
  display: block;
  pointer-events: none;
}
.sidebar-refresh-btn.is-loading {
  pointer-events: none;
  opacity: 0.7;
}
.sidebar-refresh-btn.is-loading .sidebar-refresh-btn__icon {
  animation: sidebar-refresh-spin 0.9s linear infinite;
}
@keyframes sidebar-refresh-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* === Папки (иерархия чатов) === */
.sidebar-folder {
  margin-top: 2px;
}
.sidebar-folder__toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 5px 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #374151;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  border-radius: 6px;
  transition: background 0.12s ease, color 0.12s ease;
}
.sidebar-folder__toggle:hover {
  background: rgba(149, 255, 247, 0.22);
  color: #111827;
}
.sidebar-folder__chevron {
  width: 10px;
  display: inline-block;
  text-align: center;
  font-size: 0.75rem;
  color: #6b7280;
  transition: transform 0.15s ease;
}
.sidebar-folder__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-folder__emoji {
  flex-shrink: 0;
  font-size: 0.95em;
  line-height: 1;
}
.sidebar-folder__count {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 500;
  color: #9ca3af;
}
.sidebar-folder__items {
  padding-left: 14px;
  margin-bottom: 2px;
}
.sidebar-folder--collapsed .sidebar-folder__items {
  display: none;
}
/* "Без папки" — менее акцентный заголовок */
.sidebar-folder--orphans .sidebar-folder__toggle {
  color: #6b7280;
  font-weight: 500;
}

.sidebar-history-body.hidden {
  display: none !important;
}

.sidebar-chat-history-list {
  margin-top: 6px;
  max-height: 320px;
  overflow-y: auto;
}

.sidebar-history-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-history-link {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  background: transparent;
  border: none;
}

.sidebar-history-remove {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.sidebar-history-remove:hover {
  background: #f3f4f6;
  color: #111827;
}


.subscriptions-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subscriptions-group + .subscriptions-group {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

/* Подзаголовки в блоке подписок — единый стиль с .sidebar-history-toggle
   ("Настройки запроса" / "История" в "Запросы к чатам") */
.subscriptions-group-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #464f5c;
  padding: 6px 2px;
}

.subscriptions-group-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.subscription-item--inactive {
  background: #f9fafb;
}

.subscription-item--inactive .subscription-name,
.subscription-item--inactive .subscription-status-dot {
  opacity: 0.52;
}

.subscription-item--inactive .subscription-actions-mini,
.subscription-item--inactive .subscription-action-btn,
.subscription-item--inactive .sub-btn-switch,
.subscription-item--inactive .sub-btn-del-other {
  opacity: 1 !important;
}

.subscription-item--inactive .sub-btn-switch,
.subscription-item--inactive .sub-btn-del-other {
  background: #ffffff;
  border: 1px solid #d1d5db;
  color: #374151 !important;
}

.subscription-item--inactive .sub-btn-switch:hover,
.subscription-item--inactive .sub-btn-del-other:hover {
  background: #f3f4f6;
}


/* Поля настроек запроса — вертикальный стек: лейбл сверху, инпут на всю
   ширину снизу. Это "Stripe-стиль" — labelled input стек, который не
   обрезает лейблы и одинаково выглядит на любой ширине сайдбара. */
.sidebar-inline-setting-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 8px 2px;
}

.sidebar-inline-setting-label {
  font-size: 0.85rem;
  color: #4b5563;
  font-weight: 500;
}

.sidebar-inline-setting-input {
  width: 100%;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  background: #ffffff;
  box-sizing: border-box;
}

select.sidebar-inline-setting-input {
  width: 100% !important;
  min-width: 0 !important;
  flex: none !important;
}

/* ============================================================
   ЕДИНЫЙ СТИЛЬ ВСЕХ ПОЛЕЙ В МОДАЛКЕ ПРОФИЛЯ
   Принудительно одинаковые: высота 38px, скругление 8px,
   мягкий прямоугольник. Применяется к ТЕКСТОВЫМ input, select И
   статическим значениям. ИСКЛЮЧАЕТ:
     - checkbox / radio (нативный маленький размер)
     - .iti__tel-input (intl-tel-input управляет padding-left под флаг) */
#profile-modal input:not([type="checkbox"]):not([type="radio"]):not(.iti__tel-input),
#profile-modal select,
#profile-modal textarea,
.profile-field input:not([type="checkbox"]):not([type="radio"]):not(.iti__tel-input),
.profile-field select,
.profile-field textarea,
.profile-field .profile-static-value {
  padding: 8px 12px !important;
  height: 38px !important;
  min-height: 38px !important;
  border-radius: 8px !important;
  border: 1px solid #d1d5db !important;
  font-size: 0.9rem !important;
  font-family: inherit !important;
  background: #ffffff !important;
  color: #2A2A2A !important;
  box-sizing: border-box !important;
  width: 100%;
  line-height: 22px !important;
  display: flex;
  align-items: center;
}

/* Телефонный инпут с intl-tel-input — НЕ трогаем padding-left,
   его выставляет сама библиотека под ширину флага+кода. Стилизуем
   только остальное, чтобы выглядело как обычный input. */
.profile-field input.iti__tel-input,
#profile-modal input.iti__tel-input {
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  padding-right: 12px !important;
  height: 38px !important;
  min-height: 38px !important;
  border-radius: 8px !important;
  border: 1px solid #d1d5db !important;
  font-size: 0.9rem !important;
  font-family: inherit !important;
  background: #ffffff !important;
  color: #2A2A2A !important;
  box-sizing: border-box !important;
  width: 100%;
}

/* Обёртка .iti (которую вешает intl-tel-input) — на всю ширину */
.profile-field .iti,
#profile-modal .iti {
  width: 100%;
  display: block;
}

/* Чекбоксы и радио — нативный размер, без растягивания */
#profile-modal input[type="checkbox"],
#profile-modal input[type="radio"],
.profile-field input[type="checkbox"],
.profile-field input[type="radio"] {
  width: 16px !important;
  height: 16px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  flex: none;
}

/* Метки полей в модалке профиля — компактнее */
.profile-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #2A2A2A;
}

/* Статичные значения (email, страна) визуально такие же как input,
   но без cursor: text (не редактируется) */
.profile-field .profile-static-value {
  cursor: default;
}

/* Подсказки в модалке профиля — тот же teal, что у sidebar-hint */
.profile-help-text {
  color: #0F766E;
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Кнопки "Сменить тариф" и "Сохранить изменения" в модалке профиля —
   единый графитовый стиль с белым текстом, одинаковая высота. */
#change-plan-btn,
.profile-plan-btn,
#save-profile-btn,
.profile-save-btn {
  background: #2A2A2A !important;
  color: #ffffff !important;
  border: 1px solid #2A2A2A !important;
  padding: 10px 18px !important;
  height: 40px !important;
  min-height: 40px !important;
  border-radius: 8px !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

/* Сохранить изменения по умолчанию СКРЫТА.
   Появляется только когда модалка получает класс .profile-dirty
   (этот класс ставится из JS при изменении полей). */
#save-profile-btn,
.profile-save-btn {
  display: none !important;
}

.profile-modal.profile-dirty #save-profile-btn,
.profile-modal.profile-dirty .profile-save-btn,
#profile-modal.profile-dirty #save-profile-btn,
#profile-modal.profile-dirty .profile-save-btn {
  display: inline-flex !important;
}

/* Дефолтное состояние для остальных кнопок (Сменить тариф) */
#change-plan-btn,
.profile-plan-btn {
  display: inline-flex;
}

#change-plan-btn:hover,
.profile-plan-btn:hover,
#save-profile-btn:hover,
.profile-save-btn:hover {
  background: #3a3a3c !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

#change-plan-btn:active,
.profile-plan-btn:active,
#save-profile-btn:active,
.profile-save-btn:active {
  transform: translateY(0);
  background: #1f1f20 !important;
}

/* ============================================================ */
/* ВКЛАДКИ В МОДАЛКЕ ПРОФИЛЯ (Лимиты / Личные данные / Настройки)
   Стиль "tab-pill": активная — оранжевая обводка + лёгкая персиковая
   заливка + тёмный текст. Неактивные — без обводки, серый текст,
   при hover — лёгкий персиковый фон. */
.profile-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 1px; /* минимальный воздух между вкладками и панелью */
}

/* Уменьшаем верхний внутренний отступ панели — вкладки прилегают плотнее */
.profile-tab-panel {
  padding-top: 12px !important;
}

.profile-tab-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: #6b7280 !important;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.profile-tab-btn:hover {
  background: rgba(255, 141, 55, 0.06) !important;
  color: #2A2A2A !important;
}

.profile-tab-btn.active {
  border-color: #FF8D37 !important;
  background: rgba(255, 141, 55, 0.1) !important;
  color: #2A2A2A !important;
}

/* === MOBILE FIX: рабочая область должна оставаться видимой справа === */
@media (max-width: 900px) {
  :root {
    --sidebar-width: min(78vw, 320px);
    --sidebar-collapsed-width: 56px;
  }

  .dashboard-layout {
    flex-direction: row !important;
    align-items: stretch !important;
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
  }

  .dashboard-sidebar {
    width: var(--sidebar-width) !important;
    flex: 0 0 var(--sidebar-width) !important;
    min-width: var(--sidebar-width) !important;
    max-width: var(--sidebar-width) !important;
    height: 100%;
    min-height: 100%;
    border-right: 1px solid rgba(0, 0, 0, 0.06) !important;
    border-bottom: none !important;
  }

  .dashboard-sidebar.collapsed {
    width: var(--sidebar-collapsed-width) !important;
    flex: 0 0 var(--sidebar-collapsed-width) !important;
    min-width: var(--sidebar-collapsed-width) !important;
    max-width: var(--sidebar-collapsed-width) !important;
  }

  .dashboard-main {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
  }

  .dashboard-container {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    height: 100%;
    min-height: 100%;
    padding: var(--topbar-h) 12px 0 12px;
    overflow: hidden;
  }

  .dashboard-top-block {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }

  .dashboard-results-viewer {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .dashboard-results-text {
    padding: 16px;
  }

  .dashboard-bottom-block {
    padding: 8px 0 calc(env(safe-area-inset-bottom) + 10px) 0 !important;
    position: sticky;
    bottom: 0;
    z-index: 20;
  }

  .dashboard-input-panel {
    border-radius: 14px;
  }

  .analysis-controls {
    gap: 8px;
    padding: 10px 12px;
  }

  .analysis-query-input,
  .analysis-query-textarea {
    min-width: 0;
    width: 100%;
    font-size: 16px; /* чтобы iPhone не делал странный zoom/focus */
  }

  .analysis-icon-button {
    flex: 0 0 auto;
  }

  .navigation {
    left: var(--sidebar-w) !important;
    right: 0 !important;
  }
}

@media (max-width: 560px) {
  :root {
    --sidebar-width: min(82vw, 300px);
  }

  .dashboard-container {
    padding: var(--topbar-h) 10px 0 10px;
  }

  .analysis-controls {
    gap: 6px;
    padding: 10px;
  }

  .analysis-play-button {
    min-width: 38px;
    min-height: 38px;
  }

  .analysis-disclaimer {
    padding: 8px 10px 12px 10px;
    font-size: 0.78rem;
  }
}

@keyframes dashboardStatusIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dashboardStatusPulse {
  0%, 100% {
    opacity: 0.82;
  }
  50% {
    opacity: 1;
  }
}

html.cotel-preboot .dashboard-sidebar {
  overflow: hidden;
}

html.cotel-preboot #sidebarContent,
html.cotel-preboot #sidebarUserArea {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

html.cotel-preboot .sidebar-scroll-area {
  overflow: hidden !important;
}

.sidebar-boot-loader {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: #F3F4F6;
  pointer-events: none;
}

html.cotel-preboot .sidebar-boot-loader {
  display: flex;
}

.sidebar-boot-loader__spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(17, 24, 39, 0.14);
  border-top-color: #6b7280;
  animation: sidebarBootSpin 0.8s linear infinite;
}


/* ============================================================ */
/* Вложенные блоки модалки профиля (Лимиты / Личные данные / Настройки) —
   тот же светлый полупрозрачный серый, что у карточки "Сменить тариф".
   Спокойный нейтральный фон, не "кричит" своим цветом. */
.profile-tab-panel {
  background: rgba(15, 23, 42, 0.04) !important; /* полупрозрачный серый */
  border: 1px solid rgba(15, 23, 42, 0.06) !important;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

/* В сетке лимитов/данных внутренние карточки оставляем белыми,
   чтобы не сливались с подложкой панели */
.profile-tab-panel .profile-limits-grid > *,
.profile-tab-panel .profile-personal-grid > * {
  background: #ffffff;
  border-radius: 8px;
}

/* Блок "Настройки профиля" (settings) — убираем лишнюю вложенную обёртку,
   чтобы не было "блока в блоке". Используем только внешний profile-tab-panel. */
.profile-tab-panel .profile-settings-block {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}

@keyframes sidebarBootSpin {
  to {
    transform: rotate(360deg);
  }
}