/* Импорт тонкого шрифта */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif !important;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  height: 100vh;
  overflow: hidden;
  /* ПОЛНОЭКРАННЫЙ режим */
  margin: 0 !important;
  padding: 0 !important;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background: linear-gradient(180deg, #3C805B 0%, #639B7C 100%);
  color: #fff;
  overflow-x: hidden;
  min-height: 100vh;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* УБИРАЕМ отступ сверху у body - каждая страница сама управляет своими отступами */
  padding-top: 0 !important;
  margin-top: 0 !important;
  /* ПРИНУДИТЕЛЬНОЕ позиционирование для полноэкранного режима */
  position: relative;
  top: 0 !important;
  left: 0 !important;
}

/* Индикатор загрузки истории чатов */
.chat-history-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.loading-chats {
  color: #3C805B;
  font-size: 14px;
  text-align: center;
  padding: 20px;
  font-weight: 500;
}

.no-chats {
  color: #3C805B;
  font-size: 14px;
  text-align: center;
  padding: 20px;
  font-weight: 500;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

.loading-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 400;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ПРИНУДИТЕЛЬНОЕ скрытие элементов Telegram для полноэкранного режима */
.tgme_page_header,
.tgme_page_action,
.tg-viewport-header,
.tg_head_main_wrap,
.tgme_head_wrap,
.tg-head,
.tg-head-main-wrap,
.tgme_head,
.tgme_head_main_wrap,
.tgme_page,
.tgme_page_wrap,
.tg_page_head,
.tg-page-head,
.telegram-header,
.tg-header,
.tgme_page_action_close,
.tg-close-btn,
.telegram-close,
[class*="tg-head"],
[class*="tgme_head"],
[class*="tgme_page"],
header[class*="tg"],
div[class*="tg-head"],
div[class*="tgme"],
.tg-app-header,
.tg-mini-app-header,
.telegram-mini-app-header,
.webapp-header,
.mini-app-header,
[class*="header"][class*="telegram"],
[class*="header"][class*="tg"],
[data-testid*="header"],
[data-testid*="toolbar"] {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  opacity: 0 !important;
  position: absolute !important;
  top: -9999px !important;
  left: -9999px !important;
  z-index: -1 !important;
  overflow: hidden !important;
  max-height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

/* Предотвращаем скролл body только когда чат активно отображается */
body.chat-overlay-visible {
  overflow: hidden;
  height: 100vh;
}

.app {
  max-width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden !important; /* Контейнер не скроллится, скроллится только .main-content */
  display: none; /* Скрыто по умолчанию, показывается через класс active */
  flex-direction: column;
  justify-content: flex-start;
  /* ОТСТУП СВЕРХУ как на других страницах - calc(env(safe-area-inset-top, 44px) + 28px) */
  padding-top: calc(env(safe-area-inset-top, 44px) + 28px) !important;
  padding-bottom: 0;
  box-sizing: border-box;
  position: relative !important;
}

.app {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.app.active {
  display: flex !important;
  opacity: 1;
  transform: translateY(0);
}

/* УБИРАЕМ мобильную версию - везде одинаково */

/* Хедер - ФИКСИРОВАННЫЕ значения */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 12px; /* ФИКСИРОВАННЫЕ отступы */
  flex-shrink: 0;
  position: static !important; /* Убираем любое позиционирование - остается в потоке документа */
}

/* Баннер тестового режима */
.free-mode-banner {
  padding: 12px 20px;
  flex-shrink: 0;
  text-align: center;
}

.free-mode-banner-text {
  font-size: 15px;
  font-weight: 700;
  color: #FEF7EC;
  line-height: 1.4;
}

/* Хедер в базе знаний - аватар всегда справа */
.knowledge-base .header {
  justify-content: space-between;
}

/* Хедер в диагностической форме - аватар всегда справа */
.diagnostic-form-overlay .header {
  justify-content: space-between;
}

/* Хедер в диагностике - аватар всегда справа */
.diagnostics-page .header {
  justify-content: space-between;
}

/* Хедер в чате — закреплён сверху при прокрутке, в тему страницы */
.chat-overlay-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  flex-shrink: 0;
  z-index: 1002;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #3C805B 0%, #639B7C 100%);
  border-bottom: 1px solid rgba(254, 247, 236, 0.12);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.chat-overlay-title {
  font-size: 18px;
  font-weight: 600;
  color: #FEF7EC;
  letter-spacing: 0.02em;
}

.chat-readonly-notice {
  background: rgba(254, 247, 236, 0.12);
  border-left: 3px solid rgba(254, 247, 236, 0.5);
  padding: 12px 16px;
  margin: 10px 0;
  color: #FEF7EC;
  font-size: 14px;
  border-radius: 0 8px 8px 0;
}

/* Совместимость: старый класс .header внутри чата */
.chat-overlay .header {
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 1002;
  position: relative;
}

.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  z-index: 10;
  pointer-events: auto !important;
  border-radius: 8px;
  transition: background-color 0.1s ease; /* Ускоренный переход */
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-tap-highlight-color: transparent; /* Убираем подсветку на мобильных */
}

.menu-btn:active {
  background: #FEF7EC;
}

.menu-btn span {
  width: 24px;
  height: 2px;
  background: #FEF7EC;
  border-radius: 2px;
  pointer-events: none;
  transition: none; /* Убираем переходы для span элементов */
}

.avatar {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50%;
  background: #FF6B3D;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  color: white;
  flex-shrink: 0;
  position: static !important; /* Убираем любое позиционирование - остается в потоке документа */
  min-width: 40px;
  min-height: 40px;
  max-width: 40px;
  max-height: 40px;
}

/* Приветствие - ФИКСИРОВАННЫЕ значения */
.welcome {
  padding: 0 20px 16px; /* ФИКСИРОВАННЫЕ отступы */
  flex-shrink: 0;
}

.welcome-title {
  font-size: 24px; /* ФИКСИРОВАННЫЙ размер */
  font-weight: 600;
  margin-bottom: 6px; /* ФИКСИРОВАННЫЙ отступ */
  color: #FEF7EC;
  line-height: 1.2;
}

.welcome-name {
  font-size: 16px; /* ФИКСИРОВАННЫЙ размер */
  color: #FEF7EC;
  opacity: 0.8;
}

/* Поиск - ФИКСИРОВАННЫЕ значения */
.search-container {
  margin: 0 20px 14px; /* ФИКСИРОВАННЫЕ отступы */
  position: relative;
  transition: opacity 0.3s ease;
  flex-shrink: 0; /* Не сжимается */
}

/* Скрываем поиск когда чат активен */
body.chat-overlay-visible .search-container {
  pointer-events: none;
  opacity: 0.3;
}

.search-input {
  width: 100%;
  padding: 14px 40px 14px 18px; /* ФИКСИРОВАННЫЕ отступы */
  border-radius: 22px; /* ФИКСИРОВАННЫЙ радиус */
  border: none;
  background: #FEF7EC;
  font-size: 14px; /* ФИКСИРОВАННЫЙ размер */
  color: #2A3F5F;
}

.search-input::placeholder {
  color: #A0A0A0;
}

.search-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Карточка рекомендаций - ФИКСИРОВАННЫЕ значения */
.recommendations-card {
  margin: 0 20px 18px; /* ФИКСИРОВАННЫЕ отступы */
  background: #FEF7EC;
  border-radius: 18px; /* ФИКСИРОВАННЫЙ радиус */
  padding: 16px; /* ФИКСИРОВАННЫЕ отступы */
  color: #333;
  flex-shrink: 0; /* Не сжимается */
}

.card-title {
  font-size: 17px; /* ФИКСИРОВАННЫЙ размер */
  font-weight: 600;
  margin-bottom: 12px; /* ФИКСИРОВАННЫЙ отступ */
  color: #2A3F5F;
  line-height: 1.3;
}

.card-content {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items: flex-start;
}

.card-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
}
.card-text {
  font-size: 12px;
  color: #8B8B8B;
  line-height: 1.4;
}

.create-program-btn {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 2px solid #2A3F5F;
  background: #FEF7EC;
  color: #2A3F5F;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.create-program-btn:active {
  background: #F3F4F6;
}

/* Скроллируемый контент главной страницы — скролл на всей странице */
.main-content {
  flex: 1;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto !important;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
  /* Обеспечиваем скролл */
  position: relative;
  width: 100%;
}

/* Синяя секция быстрых запросов — с отступами от краёв экрана */
.quick-requests-section {
  margin: 0 16px 0;
  padding: 16px 16px 120px;
  background: #2A3F5F;
  border-radius: 20px 20px 0 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

/* Список карточек — отступ от синего фона, скролл с главной */
.quick-requests-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

/* Заголовок быстрых запросов */
.quick-requests-title {
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  text-align: left;
}

/* Динамические рекомендации под сообщением */
.status-recommendations {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(245, 241, 232, 0.2);
}

.status-recommendation-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.status-recommendation-item:last-child {
  margin-bottom: 0;
}

.recommendation-text {
  font-size: 14px;
  font-weight: 700;
  color: #FEF7EC;
}

.recommendation-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: #4A8B6C;
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  width: fit-content;
}

.recommendation-btn:hover {
  background: #3d7a5c;
  transform: translateY(-1px);
}

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

/* Рекомендация подписки для бесплатных пользователей */
.subscription-recommendation {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(245, 241, 232, 0.2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subscription-recommendation-text {
  font-size: 14px;
  font-weight: 500;
  color: rgba(254, 247, 236, 0.9);
  line-height: 1.4;
}

.subscription-recommendation-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: #4A8B6C;
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  width: fit-content;
}

.subscription-recommendation-btn:hover {
  background: #3d7a5c;
  transform: translateY(-1px);
}

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

/* Additional bottom padding for "Мои анализы" and "Диагностика" pages */
#myTestsStep,
.my-tests-content,
.diagnostics-page,
.diagnostics-content {
  padding-bottom: 120px !important;
}

/* Ensure all page content areas have proper bottom padding */
.recommended-tests-sections,
.knowledge-sections {
  padding-bottom: 120px !important;
}

/* Заголовок секции для спортсменов */
.sports-section-title {
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 600;
  margin: 16px 0 12px 0;
  text-align: left;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Карточки быстрых запросов — компактные, светлые на синем фоне */
.quick-request-card {
  background: #FEF7EC;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  min-height: 44px;
}

/* УБИРАЕМ мобильную версию карточек - везде одинаково */

.quick-request-card:hover {
  background: #F8F9FA;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.quick-request-card:active {
  transform: translateY(0);
  background: #F1F3F4;
}

/* Иконка в карточке */
.quick-request-icon {
  width: 26px;
  height: 26px;
  background: rgba(42, 63, 95, 0.1);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quick-request-icon svg {
  width: 14px;
  height: 14px;
}

.quick-request-icon svg path {
  stroke: #2A3F5F;
}

/* Контент карточки */
.quick-request-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  min-width: 0;
}

/* Заголовок карточки */
.quick-request-title {
  color: #1F2937;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  text-align: left;
}

/* Подзаголовок карточки */
.quick-request-subtitle {
  color: #6B7280;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.25;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}





/* Заголовки в базе знаний */
.knowledge-section .section-title {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  color: #2A3F5F;
  line-height: 1.3;
}

/* Диагностическая форма - точно как на скриншоте */
.diagnostic-form-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(180deg, #3C805B 0%, #639B7C 100%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* ПРЕЖНИЙ ОТСТУП СВЕРХУ для кнопок Telegram (Close, стрелка, три точки) */
  padding-top: calc(env(safe-area-inset-top, 44px) + 28px) !important;
}



/* Хедер внутри слайдов */
.slide-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(12px, 2vh, 20px) 0 clamp(8px, 1.5vh, 16px);
  flex-shrink: 0;
}

/* Добавляем невидимый элемент слева для выравнивания */
.slide-header::before {
  content: '';
  width: 40px; /* Ширина аватара */
  height: 40px;
}

/* Диагностическая форма - контейнер для слайдов */
.diagnostic-form-content {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Экран вопросов - ИСПРАВЛЕННАЯ версия для мобильных */
#surveyStep {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh; /* Динамическая высота viewport для мобильных */
  background: linear-gradient(180deg, #3C805B 0%, #639B7C 100%);
  display: flex;
  flex-direction: column;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
  /* ПОЛНОСТЬЮ убираем отступ сверху */
  padding-top: 0 !important;
}

#surveyStep.hidden {
  display: none;
}

/* Экран данных - полноэкранный слайд с нижней навигацией */
#personalDataStep {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(180deg, #3C805B 0%, #639B7C 100%);
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 4vw, 24px);
  box-sizing: border-box;
  overflow-y: auto;
  padding-bottom: 160px; /* Увеличенный отступ для нижней навигации */
  /* ПОЛНОСТЬЮ убираем отступ сверху */
  padding-top: 0 !important;
}

#personalDataStep.hidden {
  display: none;
}

/* Хедер в экране вопросов */
#surveyStep .slide-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(12px, 2vh, 20px) clamp(16px, 4vw, 24px) 0;
  flex-shrink: 0;
}

/* Добавляем невидимый элемент слева для выравнивания */
#surveyStep .slide-header::before {
  content: '';
  width: 40px; /* Ширина аватара */
  height: 40px;
}

/* Убираем старый прогресс бар из хедера */
.survey-progress {
  display: none;
}

.progress-bar {
  width: 100%;
  height: clamp(6px, 1.2vw, 8px);
  background: rgba(255, 255, 255, 0.3);
  border-radius: clamp(3px, 0.6vw, 4px);
  overflow: hidden;
  margin-bottom: clamp(8px, 1.5vh, 12px);
}

.progress-fill {
  height: 100%;
  background: #FFFFFF;
  border-radius: clamp(3px, 0.6vw, 4px);
  transition: width 0.3s ease;
  width: 0%;
}

.progress-info {
  text-align: center;
}

.progress-text {
  font-size: clamp(12px, 2.8vw, 14px);
  color: #FFFFFF;
  font-weight: 500;
}

/* Контент вопроса - ИСПРАВЛЕННАЯ версия без избыточных отступов */
.survey-question {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 0;
  margin-bottom: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  /* УБИРАЕМ padding-bottom: 200px - он создавал огромный отступ */
  padding-bottom: 120px; /* Только минимальный отступ для навигации */
  /* Поддержка динамической высоты viewport */
  max-height: calc(100vh - 120px);
  max-height: calc(100dvh - 120px);
}

/* Навигация вопросов - ИСПРАВЛЕННАЯ позиция для мобильных */
.survey-navigation {
  position: fixed;
  bottom: 140px; /* MUCH HIGHER - above the bottom nav panel */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  z-index: 50;
  pointer-events: none;
  gap: 160px; /* ФИКСИРОВАННОЕ расстояние для мобильных */
  width: auto;
}

@media (max-width: 480px) {
  .survey-navigation {
    gap: 120px; /* Для очень маленьких экранов */
  }
}

.survey-navigation .nav-circle-btn {
  pointer-events: auto; /* Включаем события только для кнопок */
}

/* Нижняя навигация в экране ввода данных */
#personalDataStep .bottom-nav {
  position: fixed;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: rgba(74, 107, 93, 0.45);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 12px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  z-index: 100;
  border-radius: 24px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

#surveyStep .bottom-nav {
  position: fixed;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: rgba(74, 107, 93, 0.45);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 12px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  z-index: 100;
  border-radius: 24px;
  flex-shrink: 0;
  bottom: max(12px, env(keyboard-inset-height, 0px) + 12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Заголовок формы */
.form-main-title {
  font-size: clamp(18px, 4.5vw, 22px);
  font-weight: 600;
  color: #FEF7EC;
  margin: clamp(16px, 3vh, 24px) 0 clamp(24px, 5vh, 32px) 0;
  line-height: 1.3;
  text-align: left;
}

/* Выбор пола - белое заполнение с зазором */
.gender-selection {
  display: flex;
  gap: clamp(20px, 5vw, 32px);
  margin-bottom: clamp(24px, 5vh, 32px);
  align-items: center;
}

.gender-option {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 12px);
  cursor: pointer;
}

.gender-option input[type="radio"] {
  display: none;
}

.gender-radio {
  width: clamp(18px, 4.5vw, 22px);
  height: clamp(18px, 4.5vw, 22px);
  border: 2px solid #FEF7EC;
  border-radius: 50%;
  position: relative;
  transition: all 0.3s;
  flex-shrink: 0;
  background: transparent;
}

.gender-option input[type="radio"]:checked + .gender-radio {
  background: #FFFFFF;
  border: 2px solid transparent;
  box-shadow: 0 0 0 2px #FEF7EC;
}

.gender-option input[type="radio"]:checked + .gender-radio::after {
  display: none;
}

.gender-text {
  font-size: clamp(14px, 3.5vw, 16px);
  color: #FEF7EC;
  font-weight: 500;
}

/* Поля формы */
.form-fields {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vh, 20px);
  margin-bottom: clamp(32px, 6vh, 48px);
}

.form-field {
  display: flex;
  flex-direction: column;
}

.field-label {
  font-size: clamp(13px, 3vw, 15px);
  color: #FEF7EC;
  margin-bottom: clamp(6px, 1.5vh, 8px);
  font-weight: 500;
}

.field-input {
  width: 100%;
  padding: clamp(12px, 3vw, 16px);
  border: none;
  border-radius: clamp(8px, 2vw, 12px);
  font-size: clamp(14px, 3.5vw, 16px);
  color: #333;
  background: rgba(245, 241, 232, 0.95);
  transition: all 0.3s;
  box-sizing: border-box;
}

.field-input:focus {
  outline: none;
  background: #FEF7EC;
  box-shadow: 0 0 0 2px rgba(254, 247, 236, 0.5);
}

.field-input::placeholder {
  color: #999;
  font-size: clamp(13px, 3vw, 15px);
}

/* Навигация формы */
.form-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: clamp(24px, 5vh, 32px) 0;
  padding: 0 clamp(20px, 5vw, 40px);
}

.nav-circle-btn {
  width: clamp(50px, 12vw, 60px);
  height: clamp(50px, 12vw, 60px);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  background: #FEF7EC;
}

.nav-circle-btn-active {
  background: #FEF7EC !important;
}

.nav-circle-btn-primary {
  background: #FEF7EC !important;
}

.nav-circle-btn svg {
  stroke: #000000 !important;
}

.nav-circle-btn svg path {
  stroke: #000000 !important;
}

.nav-circle-btn:hover {
  transform: scale(1.05);
}

.nav-circle-btn:active {
  transform: scale(0.95);
}



/* Убираем старый прогресс бар из хедера */
.survey-progress {
  display: none;
}

/* Заголовки сверху слева */
.question-titles {
  padding: 0 clamp(16px, 4vw, 24px);
  margin-bottom: clamp(16px, 3vh, 20px);
}

.main-title {
  font-size: clamp(16px, 4vw, 20px);
  font-weight: 600;
  color: #FFFFFF;
  margin: 0 0 clamp(4px, 1vh, 6px) 0;
  line-height: 1.2;
}

.sub-title {
  font-size: clamp(14px, 3.5vw, 16px);
  font-weight: 500;
  color: #FFFFFF;
  margin: 0;
  line-height: 1.2;
  opacity: 0.9;
}

/* Объединенная карточка с прогрессом и вопросом */
.question-progress-card {
  background: #FEF7EC;
  border-radius: clamp(12px, 3vw, 16px);
  padding: clamp(16px, 4vw, 20px);
  margin: 0 clamp(16px, 4vw, 24px) clamp(16px, 3vh, 20px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Секция прогресса внутри карточки */
.progress-section {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 12px);
  margin-bottom: clamp(12px, 2.5vh, 16px);
}

.progress-counter {
  font-size: clamp(11px, 2.5vw, 13px);
  color: #666666;
  font-weight: 500;
  flex-shrink: 0;
}

.progress-bar-inline {
  flex: 1;
  height: clamp(4px, 1vw, 6px);
  background: rgba(102, 102, 102, 0.2);
  border-radius: clamp(2px, 0.5vw, 3px);
  overflow: hidden;
}

.progress-fill-inline {
  height: 100%;
  background: #4A8B6C;
  border-radius: clamp(2px, 0.5vw, 3px);
  transition: width 0.3s ease;
}

/* Секция с текстом вопроса */
.question-text-section {
  border-top: 1px solid rgba(102, 102, 102, 0.1);
  padding-top: clamp(12px, 2.5vh, 16px);
}

.question-text {
  font-size: clamp(14px, 3.5vw, 16px);
  font-weight: 500;
  color: #666666;
  margin: 0;
  line-height: 1.4;
  text-align: left;
}

/* Убираем старые стили заголовков и карточек */
.question-header,
.question-card {
  display: none;
}

/* Опции ответов - ФИКСИРОВАННЫЕ отступы для мобильных */
.survey-options {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.5vh, 12px);
  margin: 0 20px clamp(8px, 1.5vh, 12px); /* ФИКСИРОВАННЫЕ отступы 20px */
  overflow: hidden;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .survey-options {
    margin: 0 16px clamp(8px, 1.5vh, 12px); /* Для очень маленьких экранов */
  }
}

.survey-option {
  display: flex;
  align-items: flex-start;
  gap: clamp(14px, 3.5vw, 18px);
  padding: clamp(14px, 3.5vw, 18px);
  background: #FEF7EC;
  border-radius: clamp(12px, 3vw, 16px);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  justify-content: space-between; /* Размещаем элементы по краям */
}

.survey-option:hover {
  background: rgba(245, 241, 232, 0.95);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.survey-option.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.survey-option input[type="radio"] {
  display: none;
}

/* Радио-кнопки в квизе - синее заполнение с правильным зазором */
.survey-option input[type="radio"]:checked + .option-text {
  color: #333333;
  font-weight: 700;
}

.survey-option input[type="radio"]:checked ~ .option-radio {
  background: #2A3F5F !important;
  border: 2px solid transparent !important;
  box-shadow: 0 0 0 2px #2A3F5F !important;
}

.survey-option input[type="radio"]:checked ~ .option-radio::after {
  display: none;
}

.option-radio {
  width: clamp(20px, 5vw, 24px);
  height: clamp(20px, 5vw, 24px);
  border: 2px solid #CCCCCC;
  border-radius: 50%;
  position: relative;
  transition: all 0.3s ease;
  flex-shrink: 0;
  margin-top: 1px;
  order: 2; /* Перемещаем радио-кнопку вправо */
  background: transparent;
}

.option-radio::after {
  display: none;
}

.option-text {
  font-size: clamp(14px, 3.5vw, 16px);
  color: #333333;
  line-height: 1.3;
  transition: all 0.3s ease;
  font-weight: 600; /* Делаем текст жирным */
  flex: 1;
  order: 1; /* Текст остается слева */
}

/* Свой вариант ответа - ФИКСИРОВАННЫЕ отступы для мобильных */
.custom-answer-section {
  margin-top: clamp(16px, 3vh, 20px);
  padding: 0 20px; /* ФИКСИРОВАННЫЕ отступы 20px как у карточки */
  flex-shrink: 0;
  margin-bottom: clamp(160px, 28vh, 180px);
}

@media (max-width: 480px) {
  .custom-answer-section {
    padding: 0 16px; /* Для очень маленьких экранов */
  }
}

.custom-answer-label {
  display: block;
  font-size: clamp(14px, 3.5vw, 16px);
  color: #FFFFFF;
  margin-bottom: clamp(8px, 1.5vh, 10px);
  font-weight: 600;
}

.custom-answer-input {
  width: 100%;
  padding: clamp(14px, 3.5vw, 18px);
  border: none;
  border-radius: clamp(12px, 3vw, 16px);
  font-size: clamp(14px, 3.5vw, 16px);
  color: #333333;
  background: #FFFFFF;
  transition: all 0.3s;
  box-sizing: border-box;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.custom-answer-input:focus {
  outline: none;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(60, 128, 91, 0.2), 0 2px 6px rgba(0, 0, 0, 0.08);
}

.custom-answer-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #F0F0F0;
}

.custom-answer-input::placeholder {
  color: #999999;
  font-size: clamp(10px, 2.5vw, 12px);
}





/* Нижняя навигация - зеленый прозрачный фон */
.bottom-nav {
  position: fixed;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: rgba(74, 107, 93, 0.45);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 12px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  z-index: 100;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.app .bottom-nav {
  background: rgba(74, 107, 93, 0.45);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.bottom-nav.blue-bg {
  background: rgba(74, 107, 93, 0.45);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 4px;
  font-size: 11px;
  transition: opacity 0.2s;
  flex: 1;
  max-width: 80px;
}

.nav-item.active {
  opacity: 0.6;
}

/* Иконки черные */
.nav-item svg {
  width: 24px;
  height: 24px;
  stroke: #000000;
  color: #000000;
}

.nav-item svg path,
.nav-item svg rect,
.nav-item svg circle {
  stroke: #000000;
}

/* Текст белый */
.nav-item span {
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
  color: #FFFFFF;
}


/* Боковое меню */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 80%;
  max-width: 360px;
  height: 100vh;
  background: #FAF8F3;
  z-index: 9999;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  will-change: transform; /* Оптимизация для GPU */
  /* ПРЕЖНИЙ ОТСТУП СВЕРХУ для кнопок Telegram (Close, стрелка, три точки) */
  padding-top: calc(env(safe-area-inset-top, 44px) + 28px) !important;
}

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

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #F0EDE6;
}

.sidebar-header-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.new-chat-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.new-chat-btn:hover {
  background: rgba(59, 79, 107, 0.1);
}

.new-chat-btn:active {
  background: rgba(59, 79, 107, 0.2);
}

.sidebar-title {
  font-size: 20px;
  font-weight: 600;
  color: #1F2937;
}

.sidebar-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.history-section {
  margin-bottom: 24px;
}

.history-period {
  font-size: 14px;
  font-weight: 500;
  color: #D1C7B7;
  margin-bottom: 12px;
}

.history-item {
  padding: 16px 20px;
  background: transparent;
  border-radius: 0;
  margin-bottom: 0;
  font-size: 15px;
  color: #4B5563;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  border: none;
  text-align: left;
}

.history-item:active {
  background: rgba(0, 0, 0, 0.03);
}

/* Спиннер загрузки в истории чатов */
.history-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
}

.history-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(59, 79, 107, 0.2);
  border-top: 3px solid #3B4F6B;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.sidebar-footer {
  padding: 16px 20px 24px;
  border-top: 1px solid #F0EDE6;
  position: relative;
}

.sidebar-instruction-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: rgba(60, 128, 91, 0.1);
  border: none;
  border-radius: 12px;
  color: #3C805B;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.sidebar-instruction-btn:active {
  background: rgba(60, 128, 91, 0.2);
  transform: scale(0.98);
}

.sidebar-instruction-btn svg {
  flex-shrink: 0;
}

.sidebar-user {
  position: relative;
  width: 100%;
  height: 60px;
}

.sidebar-avatar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px !important;
  height: 40px !important;
  border-radius: 50%;
  background: #6366F1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  color: white;
  flex-shrink: 0;
  min-width: 40px;
  min-height: 40px;
  max-width: 40px;
  max-height: 40px;
}

.sidebar-username {
  position: absolute;
  bottom: 16px;
  right: 0;
  font-size: 16px;
  font-weight: 500;
  color: #1F2937;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity; /* Оптимизация для GPU */
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: all;
}




/* Страница рекомендуемых анализов */
.recommended-tests-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(180deg, #3C805B 0%, #639B7C 100%);
  z-index: 500;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  /* ПРЕЖНИЙ ОТСТУП СВЕРХУ для кнопок Telegram (Close, стрелка, три точки) */
  padding-top: calc(env(safe-area-inset-top, 44px) + 28px) !important;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.recommended-tests-page.active {
  display: flex;
  opacity: 1;
  transform: translateX(0);
}

.recommended-tests-header {
  padding: 0 clamp(16px, 4vw, 24px) clamp(16px, 3vh, 24px);
  flex-shrink: 0;
}

.recommended-tests-title {
  font-size: clamp(24px, 6vw, 32px);
  font-weight: 600;
  margin: 0;
  color: #FEF7EC;
  line-height: 1.2;
}

.recommended-tests-sections {
  flex: 1;
  padding: 0 clamp(16px, 4vw, 24px);
  overflow-y: auto;
  overflow-x: hidden;
  /* БЕЗОПАСНЫЙ отступ снизу - никогда не налезает на навигацию */
  padding-bottom: 120px !important;
}

/* Рекомендуемые анализы - СВОРАЧИВАЕМЫЕ РАЗДЕЛЫ */
.recommended-section {
  background: #FEF7EC;
  border-radius: clamp(16px, 4vw, 20px);
  margin-bottom: clamp(16px, 3vh, 20px);
  overflow: hidden;
}

.recommended-section-header {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 16px);
  padding: clamp(16px, 4vw, 20px);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.recommended-section-header:hover {
  background: rgba(49, 103, 74, 0.05);
}

.recommended-section-content {
  display: none; /* Скрыто по умолчанию */
  padding: 0 clamp(16px, 4vw, 20px) clamp(16px, 4vw, 20px);
}

.recommended-section.expanded .recommended-section-content {
  display: block; /* Показываем при раскрытии */
}

/* Кнопка раскрытия */
.recommended-expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  border-radius: 50%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.recommended-expand-btn:hover {
  background: rgba(49, 103, 74, 0.1);
}

.recommended-expand-btn:active {
  background: rgba(49, 103, 74, 0.2);
}

.recommended-unified-block {
  background: #FEF7EC;
  border-radius: clamp(16px, 4vw, 20px);
  overflow: hidden;
}

/* Заголовок "Анализы для спортсменов" */
.sports-analyses-title {
  font-size: clamp(18px, 4.5vw, 22px);
  font-weight: 600;
  color: #31674A;
  margin: 0;
  padding: clamp(16px, 4vw, 20px) clamp(16px, 4vw, 20px) clamp(8px, 2vw, 12px);
  border-bottom: 1px solid rgba(49, 103, 74, 0.1);
}

.sports-block {
  margin-top: clamp(24px, 5vw, 32px);
  margin-bottom: clamp(16px, 4vw, 24px);
}

.recommended-section-header {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 16px);
  padding: clamp(16px, 4vw, 20px);
}

.recommended-section-icon {
  width: clamp(32px, 8vw, 40px);
  height: clamp(32px, 8vw, 40px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.recommended-section-icon.cross {
  background: rgba(49, 103, 74, 0.1);
}

.recommended-section-icon.heart {
  background: rgba(49, 103, 74, 0.1);
}

.recommended-section-icon.respiratory {
  background: rgba(49, 103, 74, 0.1);
}

.recommended-section-icon.digestive {
  background: rgba(49, 103, 74, 0.1);
}

.recommended-section-icon.immune {
  background: rgba(49, 103, 74, 0.1);
}

.recommended-section-icon.endocrine {
  background: rgba(49, 103, 74, 0.1);
}

.recommended-section-icon.musculoskeletal {
  background: rgba(49, 103, 74, 0.1);
}

.recommended-section-icon.urinary {
  background: rgba(49, 103, 74, 0.1);
}

.recommended-section-icon.reproductive {
  background: rgba(49, 103, 74, 0.1);
}

.recommended-section-icon.integumentary {
  background: rgba(49, 103, 74, 0.1);
}

.recommended-section-icon.lymphatic {
  background: rgba(49, 103, 74, 0.1);
}

.recommended-section-icon.sensory {
  background: rgba(49, 103, 74, 0.1);
}

.recommended-section-icon.general {
  background: rgba(49, 103, 74, 0.1);
}

/* Кнопки действий в рекомендуемых анализах */
.recommended-actions {
  padding: clamp(16px, 4vw, 20px);
  padding-top: clamp(20px, 5vw, 28px);
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 3vw, 16px);
  border-top: 1px solid rgba(49, 103, 74, 0.1);
  margin-top: clamp(8px, 2vw, 12px);
}

.recommended-action-btn {
  width: 100%;
  padding: clamp(14px, 3.5vw, 18px);
  border-radius: clamp(20px, 5vw, 28px);
  border: 2px solid #000000 !important;
  background: transparent;
  color: #000000;
  font-size: clamp(14px, 3.5vw, 16px);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.recommended-action-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.recommended-action-btn:active {
  background: rgba(0, 0, 0, 0.1);
  transform: scale(0.98);
}

.recommended-section-title {
  font-size: clamp(16px, 4vw, 18px);
  font-weight: 600;
  color: #31674A;
  margin: 0;
  line-height: 1.3;
  flex: 1;
}

.recommended-section-content {
  padding: 0 clamp(16px, 4vw, 20px) clamp(16px, 4vw, 20px);
}

.recommended-test-item {
  font-size: clamp(14px, 3.5vw, 16px);
  color: #666666;
  line-height: 1.4;
  margin-bottom: clamp(8px, 2vh, 12px);
  padding-left: clamp(16px, 4vw, 20px);
  position: relative;
}

.recommended-test-item:before {
  content: "•";
  position: absolute;
  left: 0;
  color: #666666;
  font-weight: bold;
}

.recommended-test-item:last-child {
  margin-bottom: 0;
}

/* База знаний */
.knowledge-base {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(180deg, #3C805B 0%, #639B7C 100%);
  z-index: 500;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  /* ПРЕЖНИЙ ОТСТУП СВЕРХУ для кнопок Telegram (Close, стрелка, три точки) */
  padding-top: calc(env(safe-area-inset-top, 44px) + 28px) !important;
}

.knowledge-base {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.knowledge-base.active {
  display: flex;
  opacity: 1;
  transform: translateX(0);
}

/* Чат как оверлей на главной странице */
.chat-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(180deg, #3C805B 0%, #639B7C 100%);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden; /* Убираем скролл у контейнера */
  /* ПРЕЖНИЙ ОТСТУП СВЕРХУ для кнопок Telegram (Close, стрелка, три точки) */
  padding-top: calc(env(safe-area-inset-top, 44px) + 28px) !important;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.chat-overlay.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}



.chat-messages {
  flex: 1;
  padding: 20px 0;
  overflow-y: visible;
  overflow-x: hidden;
  margin-top: 0;
  /* Убираем webkit scrollbar для чистого вида */
  -webkit-overflow-scrolling: touch;
}

/* Контейнер для сообщений с ограниченной шириной */
.chat-messages-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  box-sizing: border-box;
}

/* БЕЗОПАСНЫЙ отступ снизу - никогда не налезает на навигацию */
.chat-messages-container {
  padding-bottom: calc(220px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Скрываем скроллбар в webkit браузерах */
.chat-messages::-webkit-scrollbar {
  width: 0px;
  background: transparent;
}

.bot-message, .user-message {
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.user-message {
  flex-direction: row-reverse;
}

.bot-avatar, .user-avatar {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 600;
  font-size: 16px;
  min-width: 40px;
  min-height: 40px;
  max-width: 40px;
  max-height: 40px;
}

.bot-avatar {
  background: #FEF7EC;
}

.user-avatar {
  background: #FF6B3D;
  color: white;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.message-bubble {
  max-width: calc(100% - 60px); /* Учитываем аватар + gap */
  min-width: 60px;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(245, 241, 232, 0.15);
  border: 1px solid rgba(245, 241, 232, 0.3);
  word-wrap: break-word;
  word-break: break-word; /* Принудительный перенос длинных слов */
  overflow-wrap: break-word;
  box-sizing: border-box;
}

.user-message .message-bubble {
  background: rgba(255, 107, 61, 0.15);
  border: 1px solid rgba(255, 107, 61, 0.3);
}

.message-text {
  font-size: 15px;
  color: #FEF7EC;
  line-height: 1.5;
  margin: 0;
  word-wrap: break-word;
  word-break: break-word;
}

.message-text strong {
  font-weight: 700;
}

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

.message-text br + br {
  display: block;
  content: '';
  margin-top: 8px;
}

/* Кнопка в сообщении бота */
.message-button {
  display: inline-block;
  margin-top: 12px;
  padding: 12px 24px;
  background: transparent;
  border: 2px solid #FEF7EC;
  border-radius: 20px;
  color: #FEF7EC;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.message-button:hover {
  background: rgba(245, 241, 232, 0.1);
}

.message-button:active {
  background: rgba(245, 241, 232, 0.2);
  transform: scale(0.98);
}

 .typing-text {
   color: rgba(245, 241, 232, 0.9);
   font-size: 15px;
   padding: 6px 2px;
   min-height: 24px;
   display: flex;
   align-items: center;
 }

 .ai-actions {
   margin-top: 12px;
   width: 100%;
}

.ai-actions-row {
   display: flex;
   gap: 8px;
   width: 100%;
}

/* Контейнер кнопок действий ИИ */
.ai-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #4A8B6C !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-action-btn:hover {
  background: #3d7a5c !important;
  transform: translateY(-1px);
}

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

.ai-action-btn-old {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(100, 100, 100, 0.25) !important;
  color: #333 !important;
  border: 1px solid rgba(100, 100, 100, 0.35) !important;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  flex: 1;
  justify-content: flex-start;
  backdrop-filter: blur(10px);
}

.ai-action-btn:hover {
  background: rgba(100, 100, 100, 0.35) !important;
  border-color: rgba(100, 100, 100, 0.45) !important;
}

.ai-action-btn:active {
  background: rgba(100, 100, 100, 0.45) !important;
  transform: scale(0.98);
}

.ai-action-btn svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.chat-input-container {
  position: absolute;
  bottom: 110px; /* Увеличиваем отступ от навигации */
  left: 12px;
  right: 12px;
  background: #FEF7EC;
  border-radius: 28px;
  padding: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1001;
  flex-shrink: 0;
  min-height: 48px; /* Минимальная высота */
}

/* Навигация в чате */
.chat-overlay .bottom-nav {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: rgba(74, 107, 93, 0.45);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  border-radius: 24px;
  flex-shrink: 0;
  min-height: 80px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.chat-input {
  flex: 1;
  padding: 14px 20px;
  border: none;
  background: transparent;
  font-size: 16px;
  color: #2A3F5F;
  outline: none;
}

.chat-input::placeholder {
  color: #A0A0A0;
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.chat-send-btn:active {
  background: rgba(0, 0, 0, 0.05);
}

.knowledge-header {
  padding: 0 clamp(16px, 4vw, 24px) clamp(16px, 3vh, 24px);
  flex-shrink: 0;
}

.knowledge-title {
  font-size: clamp(24px, 6vw, 32px);
  font-weight: 600;
  margin-bottom: clamp(8px, 2vh, 12px);
  color: #FEF7EC;
  line-height: 1.2;
}

.knowledge-subtitle {
  font-size: clamp(16px, 4vw, 20px);
  color: #FEF7EC;
  opacity: 0.8;
}

.knowledge-sections {
  flex: 1;
  padding: 0 clamp(16px, 4vw, 24px);
  overflow-y: auto;
  overflow-x: hidden;
  /* БЕЗОПАСНЫЙ отступ снизу - никогда не налезает на навигацию */
  padding-bottom: 120px !important;
}

.knowledge-section {
  background: #FEF7EC;
  border-radius: 24px;
  margin-bottom: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.section-header {
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
  padding: 20px 24px;
  gap: 16px;
}

.section-header:hover {
  background-color: rgba(229, 231, 235, 0.3);
  border-radius: 8px;
}

.section-icon {
  width: 48px;
  height: 48px;
  background: #E5E7EB;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px;
  border-radius: 50%;
  transition: all 0.3s ease;
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.expand-btn:hover {
  background: #E5E7EB;
}

.section-content {
  padding: 0 24px 24px;
  display: none;
}

.knowledge-section.expanded .section-content {
  display: block;
}

.knowledge-section.expanded .expand-btn svg {
  /* Убираем поворот - иконки меняются через JavaScript */
  transform: none;
}

.section-description {
  font-size: 15px;
  color: #8B8B8B;
  line-height: 1.5;
  margin-bottom: 16px;
}

.subsection {
  font-size: 15px;
  color: #8B8B8B;
  line-height: 1.5;
  margin-bottom: 8px;
  padding-left: 16px;
  position: relative;
}

.subsection:before {
  content: "-";
  position: absolute;
  left: 0;
  color: #8B8B8B;
}



/* Выбор пола */
.gender-selection {
  display: flex;
  gap: clamp(20px, 5vw, 32px);
  margin-bottom: clamp(24px, 5vh, 32px);
}

.gender-option {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gender-option input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: #FEF7EC;
}

.gender-option label {
  font-size: clamp(14px, 3.5vw, 16px);
  color: #FEF7EC;
  cursor: pointer;
}

/* Поля формы */
.form-fields {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vh, 20px);
  margin-bottom: clamp(32px, 6vh, 40px);
}

.diagnostics-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(180deg, #3C805B 0%, #639B7C 100%);
  z-index: 500;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  /* ПРЕЖНИЙ ОТСТУП СВЕРХУ для кнопок Telegram (Close, стрелка, три точки) */
  padding-top: calc(env(safe-area-inset-top, 44px) + 28px) !important;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.diagnostics-page.active {
  display: flex;
  opacity: 1;
  transform: translateX(0);
}

.diagnostics-content {
  flex: 1;
  padding: 0 clamp(16px, 4vw, 24px) clamp(16px, 3vh, 24px);
  overflow-y: auto;
  overflow-x: hidden;
  /* БЕЗОПАСНЫЙ отступ снизу - никогда не налезает на навигацию */
  padding-bottom: 120px !important;
}

/* Карточка персональной диагностики */
.personal-diagnostics-card {
  background: #FEF7EC;
  border-radius: clamp(16px, 4vw, 20px);
  padding: clamp(16px, 4vw, 20px);
  margin-bottom: clamp(20px, 4vh, 28px);
  color: #333;
}

.diagnostics-title {
  font-size: clamp(18px, 4.5vw, 22px);
  font-weight: 600;
  color: #3B4F6B;
  margin-bottom: clamp(6px, 1.5vh, 8px);
  line-height: 1.3;
}

.diagnostics-subtitle {
  font-size: clamp(13px, 3vw, 15px);
  color: #8B8B8B;
  margin-bottom: clamp(16px, 3vh, 20px);
  line-height: 1.4;
}

.diagnostics-description {
  display: flex;
  gap: clamp(12px, 3vw, 16px);
  margin-bottom: clamp(20px, 4vh, 24px);
  align-items: flex-start;
}

.description-icon {
  flex-shrink: 0;
  width: clamp(20px, 5vw, 24px);
  height: clamp(20px, 5vw, 24px);
}

.description-text {
  font-size: clamp(12px, 2.8vw, 14px);
  color: #666;
  line-height: 1.5;
  margin: 0;
}

.fill-form-btn {
  width: 100%;
  padding: clamp(12px, 3vw, 16px);
  border-radius: clamp(12px, 3vw, 16px);
  border: 2px solid #2A3F5F;
  background: #FEF7EC;
  color: #2A3F5F;
  font-size: clamp(14px, 3.5vw, 16px);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: clamp(16px, 3vh, 20px);
}

.fill-form-btn:hover {
  background: #2A3F5F;
  color: #FEF7EC;
}

/* Дата последнего прохождения диагностики */
.quiz-completion-date {
  text-align: center;
  margin-bottom: 16px;
}

.completion-date-text {
  font-size: 13px;
  color: #5A6B7D;
  font-weight: 500;
}

#quizDateValue {
  font-weight: 600;
  color: #2A3F5F;
}

/* Карточка повторного прохождения диагностики (на странице Здоровье) */
.retake-diagnostic-card {
  background: linear-gradient(135deg, #4A8B6C 0%, #3D7A5D 100%);
  border-radius: 16px;
  padding: 16px 20px;
  margin-top: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.retake-diagnostic-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 139, 108, 0.3);
}

.retake-card-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.retake-card-text {
  flex: 1;
}

.retake-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #FEF7EC;
  margin: 0 0 4px 0;
}

.retake-card-subtitle {
  font-size: 13px;
  color: rgba(254, 247, 236, 0.7);
  margin: 0;
}

.retake-card-arrow {
  flex-shrink: 0;
  margin-left: 12px;
}

/* Модальное окно повторного прохождения */
.retake-quiz-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 20px;
}

.retake-quiz-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.retake-quiz-modal {
  background: #FEF7EC;
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.retake-quiz-modal-overlay.active .retake-quiz-modal {
  transform: scale(1);
}

.retake-quiz-modal-icon {
  margin-bottom: 16px;
}

.retake-quiz-modal-icon svg {
  color: #F59E0B;
}

.retake-quiz-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #2A3F5F;
  margin-bottom: 12px;
}

.retake-quiz-modal-text {
  font-size: 14px;
  color: #5A6B7D;
  line-height: 1.5;
  margin-bottom: 24px;
}

.retake-quiz-modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.retake-quiz-confirm-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: #4A8B6C;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.retake-quiz-confirm-btn:hover {
  background: #3D7A5D;
}

.retake-quiz-cancel-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #D1D5DB;
  background: transparent;
  color: #5A6B7D;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.retake-quiz-cancel-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Модальное окно для блокированных функций (требуется подписка) */
.subscription-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 20px;
}

.subscription-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.subscription-modal {
  background: #FEF7EC;
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.subscription-modal-overlay.active .subscription-modal {
  transform: scale(1);
}

.subscription-modal-icon {
  margin-bottom: 16px;
}

.subscription-modal-icon svg {
  color: #F59E0B;
}

.subscription-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #2A3F5F;
  margin-bottom: 12px;
}

.subscription-modal-text {
  font-size: 14px;
  color: #5A6B7D;
  line-height: 1.5;
  margin-bottom: 12px;
}

.subscription-modal-footer-text {
  font-size: 13px;
  color: #6B7280;
  line-height: 1.5;
  margin-bottom: 24px;
  font-weight: 500;
}

.subscription-modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.subscription-modal-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.subscription-modal-btn-primary {
  background: #4A8B6C;
  color: #FFFFFF;
}

.subscription-modal-btn-primary:hover {
  background: #3D7A5D;
  transform: translateY(-1px);
}

.subscription-modal-btn-cancel {
  background: transparent;
  color: #4A8B6C;
  border: 2px solid #4A8B6C;
}

.subscription-modal-btn-cancel:hover {
  background: rgba(74, 139, 108, 0.1);
}

.diagnostics-features {
  margin-bottom: clamp(16px, 3vh, 20px);
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: clamp(8px, 2vw, 12px);
  margin-bottom: clamp(8px, 2vh, 12px);
}

.feature-item svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.feature-item span {
  font-size: clamp(12px, 2.8vw, 14px);
  color: #666;
  line-height: 1.4;
}

.my-tests-btn {
  width: 100%;
  padding: clamp(10px, 2.5vw, 14px);
  border-radius: clamp(10px, 2.5vw, 14px);
  border: 1px solid #2A3F5F;
  background: transparent;
  color: #2A3F5F;
  font-size: clamp(13px, 3vw, 15px);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.my-tests-btn:hover {
  background: rgba(42, 63, 95, 0.1);
}

/* Заголовок результатов */
.results-header {
  margin-bottom: clamp(16px, 3vh, 20px);
}

.results-title {
  font-size: clamp(16px, 4vw, 20px);
  font-weight: 600;
  color: #FEF7EC;
  margin: 0;
  line-height: 1.3;
}

/* Карточки результатов */
.results-cards {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2vh, 12px);
}

.result-card {
  background: #FEF7EC;
  border-radius: clamp(12px, 3vw, 16px);
  padding: clamp(12px, 3vw, 16px);
  display: flex;
  align-items: flex-start;
  gap: clamp(12px, 3vw, 16px);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.result-card:active {
  transform: scale(0.98);
}

.result-icon {
  flex-shrink: 0;
  width: clamp(20px, 5vw, 24px);
  height: clamp(20px, 5vw, 24px);
}

.result-content {
  flex: 1;
}

.result-title {
  font-size: clamp(13px, 3.2vw, 15px);
  font-weight: 600;
  color: #2A3F5F;
  margin: 0 0 clamp(2px, 0.5vh, 4px) 0;
  line-height: 1.3;
}

.result-subtitle {
  font-size: clamp(11px, 2.5vw, 13px);
  color: #8B8B8B;
  margin: 0;
  line-height: 1.4;
}
/* Адаптивные стили для экрана вопросов */

/* Заголовки сверху слева - увеличенные для мобильных */
.question-titles {
  padding: 0 clamp(16px, 4vw, 24px);
  margin-bottom: clamp(16px, 4vh, 20px);
  flex-shrink: 0;
}

.main-title {
  font-size: clamp(20px, 5vw, 24px);
  font-weight: 600;
  color: #FFFFFF;
  margin: 0 0 clamp(6px, 1.5vh, 8px) 0;
  line-height: 1.2;
}

.sub-title {
  font-size: clamp(16px, 4vw, 18px);
  font-weight: 500;
  color: #FFFFFF;
  margin: 0;
  line-height: 1.2;
  opacity: 0.9;
}

/* Объединенная карточка - ФИКСИРОВАННЫЕ отступы для мобильных */
.question-progress-card {
  background: #FEF7EC;
  border-radius: clamp(16px, 4vw, 20px);
  padding: clamp(18px, 4.5vw, 24px);
  margin: 0 20px clamp(18px, 4vh, 24px); /* ФИКСИРОВАННЫЕ отступы 20px */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .question-progress-card {
    margin: 0 16px clamp(18px, 4vh, 24px); /* Для очень маленьких экранов */
  }
}

/* Секция прогресса - увеличенная для мобильных */
.progress-section {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 16px);
  margin-bottom: clamp(16px, 3vh, 20px);
}

.progress-counter {
  font-size: clamp(14px, 3.5vw, 16px);
  color: #666666;
  font-weight: 500;
  flex-shrink: 0;
}

.progress-bar-inline {
  flex: 1;
  height: clamp(6px, 1.5vw, 8px);
  background: rgba(102, 102, 102, 0.2);
  border-radius: clamp(3px, 0.8vw, 4px);
  overflow: hidden;
}

.progress-fill-inline {
  height: 100%;
  background: #4A8B6C;
  border-radius: clamp(3px, 0.8vw, 4px);
  transition: width 0.3s ease;
}

/* Секция с текстом вопроса - увеличенная для мобильных */
.question-text-section {
  border-top: 1px solid rgba(102, 102, 102, 0.1);
  padding-top: clamp(16px, 3vh, 20px);
}

.question-text {
  font-size: clamp(16px, 4vw, 18px);
  font-weight: 500;
  color: #666666;
  margin: 0;
  line-height: 1.4;
  text-align: left;
}

/* Убираем старые стили заголовков и карточек */
.question-header,
.question-card {
  display: none;
}

/* Медиа-запросы для лучшей адаптивности */
@media (max-width: 480px) {
  .question-titles {
    margin-bottom: clamp(8px, 2vh, 12px);
  }
  
  .question-progress-card {
    padding: clamp(12px, 3vw, 16px);
    margin: 0 clamp(12px, 3vw, 20px) clamp(10px, 2vh, 14px);
  }
  
  .progress-section {
    margin-bottom: clamp(8px, 1.5vh, 12px);
  }
  
  .survey-options {
    gap: clamp(4px, 1vh, 6px);
    margin: 0 clamp(12px, 3vw, 20px) 0;
    padding: clamp(12px, 3vw, 16px);
  }
  
  .survey-option {
    padding: clamp(8px, 2vw, 12px);
  }
  
  .custom-answer-section {
    margin-top: clamp(6px, 1.2vh, 10px);
  }
}

@media (min-width: 768px) {
  #surveyStep {
    max-width: 480px;
    margin: 0 auto;
    left: 50%;
    transform: translateX(-50%);
  }
  
  .survey-navigation {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
  }
  
  #surveyStep .bottom-nav {
    max-width: 456px;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ========================================= */
/* НОВЫЕ СТИЛИ ДЛЯ КВИЗА - ПОЛНАЯ ПЕРЕЗАПИСЬ */
/* ========================================= */

/* Заголовки квиза - увеличенные и с большим расстоянием */
.quiz-titles {
  padding: 0 24px;
  margin-bottom: 16px; /* УВЕЛИЧИВАЕМ отступ снизу */
  flex-shrink: 0;
}

.quiz-main-title {
  font-size: 22px; /* УВЕЛИЧИВАЕМ размер */
  font-weight: 500; /* ДЕЛАЕМ мягче - было 600 */
  color: #FFFFFF;
  margin: 0 0 12px 0; /* УВЕЛИЧИВАЕМ отступ между заголовками */
  line-height: 1.3; /* УВЕЛИЧИВАЕМ межстрочный интервал */
}

.quiz-sub-title {
  font-size: 16px; /* УВЕЛИЧИВАЕМ размер */
  font-weight: 400; /* ДЕЛАЕМ мягче - было 500 */
  color: #FFFFFF;
  margin: 0;
  line-height: 1.3; /* УВЕЛИЧИВАЕМ межстрочный интервал */
  opacity: 0.85; /* НЕМНОГО УМЕНЬШАЕМ прозрачность для мягкости */
}

/* Карточка с прогрессом и вопросом - с учетом увеличенных заголовков */
.quiz-question-card {
  background: #FEF7EC;
  border-radius: 16px;
  padding: 14px; /* УМЕНЬШАЕМ padding */
  margin: 0 24px 8px; /* НЕМНОГО УВЕЛИЧИВАЕМ отступ снизу */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

/* Прогресс внутри карточки - компактнее */
.quiz-progress-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px; /* УМЕНЬШАЕМ отступ */
}

.quiz-progress-counter {
  font-size: 13px; /* УМЕНЬШАЕМ размер */
  color: #666666;
  font-weight: 500;
  flex-shrink: 0;
}

.quiz-progress-bar {
  flex: 1;
  height: 5px; /* УМЕНЬШАЕМ высоту */
  background: rgba(102, 102, 102, 0.2);
  border-radius: 3px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: #FF8C42; /* ОРАНЖЕВЫЙ цвет как на скриншоте */
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Текст вопроса - компактнее */
.quiz-question-section {
  border-top: 1px solid rgba(102, 102, 102, 0.1);
  padding-top: 10px; /* УМЕНЬШАЕМ отступ */
}

.quiz-question-text {
  font-size: 13px; /* УМЕНЬШАЕМ размер */
  font-weight: 500;
  color: #666666;
  margin: 0;
  line-height: 1.2; /* УМЕНЬШАЕМ межстрочный интервал */
}

/* Опции ответов - увеличиваем расстояние между кнопками еще больше */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px; /* УВЕЛИЧИВАЕМ расстояние между кнопками */
  margin: 0 24px 12px; /* УВЕЛИЧИВАЕМ отступ снизу */
  flex-shrink: 0;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 10px; /* УМЕНЬШАЕМ padding */
  background: #FEF7EC;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.quiz-option:hover {
  background: rgba(245, 241, 232, 0.95);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.quiz-option.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.quiz-option input[type="radio"] {
  display: none;
}

.quiz-option-text {
  font-size: 13px; /* УМЕНЬШАЕМ размер */
  color: #333333;
  line-height: 1.2; /* УМЕНЬШАЕМ межстрочный интервал */
  font-weight: 600;
  flex: 1;
  order: 1;
}

.quiz-option-radio {
  width: 18px; /* УМЕНЬШАЕМ размер */
  height: 18px; /* УМЕНЬШАЕМ размер */
  border: 2px solid #CCCCCC;
  border-radius: 50%;
  position: relative;
  transition: all 0.3s ease;
  flex-shrink: 0;
  margin-top: 1px;
  order: 2;
  background: transparent;
}

/* Выбранная опция */
.quiz-option input[type="radio"]:checked + .quiz-option-text {
  color: #333333;
  font-weight: 700;
}

.quiz-option input[type="radio"]:checked ~ .quiz-option-radio {
  background: #2A3F5F;
  border: 2px solid transparent;
  box-shadow: 0 0 0 2px #2A3F5F;
}

/* ========================================= */
/* ПОЛЕ ВВОДА СООБЩЕНИЯ В КВИЗЕ - ПОЛНАЯ ПЕРЕЗАПИСЬ */
/* ========================================= */

/* Контейнер для поля ввода - увеличиваем отступ */
.quiz-custom-answer {
  position: relative;
  width: 100%;
  padding: 0 24px;
  margin-top: 12px; /* УВЕЛИЧИВАЕМ отступ сверху */
  margin-bottom: 0;
  flex-shrink: 0;
  z-index: 10;
}

/* Лейбл для поля ввода - увеличиваем */
.quiz-custom-label {
  display: block;
  font-size: 14px; /* УВЕЛИЧИВАЕМ размер */
  color: #FFFFFF;
  margin-bottom: 8px; /* УВЕЛИЧИВАЕМ отступ */
  font-weight: 600;
  line-height: 1.2; /* УВЕЛИЧИВАЕМ межстрочный интервал */
}

/* Само поле ввода - увеличиваем размер */
.quiz-custom-input {
  width: 100%;
  height: 52px; /* УВЕЛИЧИВАЕМ высоту */
  padding: 16px; /* УВЕЛИЧИВАЕМ padding */
  border: none;
  border-radius: 12px;
  font-size: 14px; /* УВЕЛИЧИВАЕМ размер шрифта */
  color: #333333;
  background: #FFFFFF;
  transition: all 0.3s ease;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-family: inherit;
  outline: none;
  resize: none;
  overflow: hidden;
}

/* Фокус на поле ввода */
.quiz-custom-input:focus {
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(60, 128, 91, 0.3), 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

/* Отключенное состояние */
.quiz-custom-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #F5F5F5;
  color: #999999;
}

/* Плейсхолдер */
.quiz-custom-input::placeholder {
  color: #999999;
  font-size: 13px;
  opacity: 0.8;
}

/* Адаптивные стили для мобильных - увеличиваем поле ввода */
@media (max-width: 480px) {
  .quiz-custom-answer {
    padding: 0 16px;
    margin-top: 10px;
  }
  
  .quiz-custom-input {
    height: 48px; /* УВЕЛИЧИВАЕМ высоту для мобильных */
    padding: 14px; /* УВЕЛИЧИВАЕМ padding */
    font-size: 14px; /* УВЕЛИЧИВАЕМ размер шрифта */
  }
  
  .quiz-custom-label {
    font-size: 13px;
    margin-bottom: 7px; /* УВЕЛИЧИВАЕМ отступ */
  }
}

/* Навигация квиза - фиксированная позиция с учетом клавиатуры */
.quiz-navigation {
  position: fixed;
  bottom: 140px; /* MUCH HIGHER - above the bottom nav panel */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 140px;
  z-index: 50;
}

.quiz-nav-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  background: #FEF7EC;
  pointer-events: auto;
}

.quiz-nav-btn:hover {
  transform: scale(1.05);
}

.quiz-nav-btn:active {
  transform: scale(0.95);
}

.quiz-nav-btn svg {
  stroke: #000000;
}

.quiz-nav-btn svg path {
  stroke: #000000;
}

/* Медиа-запросы для мобильных - с поддержкой клавиатуры */
@media (max-width: 480px) {
  .quiz-titles {
    padding: 0 16px;
    margin-bottom: 12px; /* УВЕЛИЧИВАЕМ отступ для мобильных */
  }
  
  .quiz-main-title {
    font-size: 20px; /* УВЕЛИЧИВАЕМ размер для мобильных */
    margin: 0 0 10px 0; /* УВЕЛИЧИВАЕМ отступ между заголовками */
  }

  .quiz-sub-title {
    font-size: 15px; /* УВЕЛИЧИВАЕМ размер для мобильных */
  }
  
  .quiz-question-card {
    padding: 12px;
    margin: 0 16px 8px; /* УВЕЛИЧИВАЕМ отступ */
  }
  
  .quiz-options {
    gap: 10px; /* УВЕЛИЧИВАЕМ расстояние между кнопками на мобильных */
    margin: 0 16px 10px; /* УВЕЛИЧИВАЕМ отступ */
  }
  
  .quiz-option {
    padding: 9px;
  }
  
  .quiz-navigation {
    gap: 120px;
    bottom: 140px; /* MUCH HIGHER - above the bottom nav panel */
  }
  
  .quiz-nav-btn {
    width: 50px;
    height: 50px;
  }
  
  /* ИСПРАВЛЕННЫЕ стили для survey-question на мобильных */
  .survey-question {
    padding-bottom: 100px; /* УМЕНЬШАЕМ отступ */
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
  }
  
  #surveyStep .bottom-nav {
    bottom: max(12px, env(keyboard-inset-height, 0px) + 12px);
  }
  
  /* Дополнительная поддержка для iOS Safari */
  #surveyStep {
    height: 100vh;
    height: -webkit-fill-available;
    /* ДОБАВЛЯЕМ принудительный сброс viewport при проблемах с клавиатурой */
    min-height: 100vh;
    min-height: -webkit-fill-available;
  }
  
  /* БЕЗОПАСНЫЙ отступ снизу - никогда не налезает на навигацию */
  .knowledge-sections {
    padding-bottom: 120px !important;
  }
  
  .diagnostics-content {
    padding-bottom: 120px !important;
  }
}

/* ========================================= */
/* СТИЛИ ДЛЯ ДОПОЛНИТЕЛЬНЫХ ВОПРОСОВ */
/* ========================================= */

/* Экран дополнительных вопросов - как personalDataStep */
#additionalQuestionsStep {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(180deg, #3C805B 0%, #639B7C 100%);
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 4vw, 24px);
  box-sizing: border-box;
  overflow-y: auto;
  padding-bottom: 160px; /* Увеличенный отступ для нижней навигации */
}

#additionalQuestionsStep.hidden {
  display: none;
}

/* Контейнер дополнительных вопросов */
.additional-questions-container {
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 5vh, 32px);
  margin-bottom: clamp(32px, 6vh, 48px);
}

/* Блок одного вопроса */
.additional-question-block {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2.5vh, 16px);
}

/* Карточка вопроса с прогрессом внутри */
.question-card-small {
  background: #FEF7EC;
  border-radius: clamp(12px, 3vw, 16px);
  padding: clamp(14px, 3.5vw, 18px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2.5vh, 16px);
}

/* Прогресс вопроса внутри карточки */
.question-progress {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 16px);
}

.progress-number {
  font-size: clamp(13px, 3vw, 15px);
  color: #666666;
  font-weight: 500;
  flex-shrink: 0;
}

.progress-bar-small {
  flex: 1;
  height: clamp(4px, 1vw, 6px);
  background: rgba(102, 102, 102, 0.2);
  border-radius: clamp(2px, 0.5vw, 3px);
  overflow: hidden;
}

.progress-fill-small {
  height: 100%;
  background: #FF8C42; /* Оранжевый цвет как в квизе */
  border-radius: clamp(2px, 0.5vw, 3px);
  transition: width 0.3s ease;
}

.question-text-small {
  font-size: clamp(14px, 3.5vw, 16px);
  font-weight: 500;
  color: #666666;
  margin: 0;
  line-height: 1.4;
  text-align: center;
}

/* Поле ответа */
.answer-field {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2vh, 12px);
}

.answer-label {
  font-size: clamp(13px, 3vw, 15px);
  color: #FFFFFF;
  font-weight: 500;
}

.answer-textarea {
  width: 100%;
  min-height: clamp(80px, 15vh, 120px);
  padding: clamp(12px, 3vw, 16px);
  border: none;
  border-radius: clamp(8px, 2vw, 12px);
  font-size: clamp(14px, 3.5vw, 16px);
  color: #333;
  background: rgba(245, 241, 232, 0.95);
  transition: all 0.3s;
  box-sizing: border-box;
  resize: vertical;
  font-family: inherit;
}

.answer-textarea:focus {
  outline: none;
  background: #FEF7EC;
  box-shadow: 0 0 0 2px rgba(254, 247, 236, 0.5);
}

.answer-textarea::placeholder {
  color: #999;
  font-size: clamp(13px, 3vw, 15px);
}

/* Кнопка "Создать программу" */
.create-program-final-btn {
  padding: clamp(12px, 3vw, 16px) clamp(24px, 6vw, 32px);
  border-radius: clamp(20px, 5vw, 24px);
  border: none;
  background: #FEF7EC;
  color: #2A3F5F;
  font-size: clamp(14px, 3.5vw, 16px);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.create-program-final-btn:hover {
  transform: scale(1.02);
  background: #FFFFFF;
}

.create-program-final-btn:active {
  transform: scale(0.98);
}

/* Адаптивные стили для мобильных */
@media (max-width: 480px) {
  .additional-questions-container {
    gap: clamp(16px, 4vh, 24px);
  }
  
  .additional-question-block {
    gap: clamp(8px, 2vh, 12px);
  }
  
  .answer-textarea {
    min-height: clamp(60px, 12vh, 100px);
  }
}

/* Импорт тонкого шрифта */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

/* ========================================
   СТРАНИЦА "МОИ АНАЛИЗЫ"
   ======================================== */

/* Основной контейнер страницы анализов */
#myTestsStep {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Контейнер для скроллируемого контента */
.my-tests-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 clamp(16px, 4vw, 20px);
  /* БЕЗОПАСНЫЙ отступ снизу - никогда не налезает на навигацию */
  padding-bottom: 120px !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.my-tests-content::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.my-tests-title {
  font-size: clamp(24px, 6vw, 32px);
  font-weight: 600;
  color: #F8F6F0;
  margin: clamp(20px, 5vh, 32px) 0 clamp(8px, 2vh, 12px) 0;
  text-align: left;
  line-height: 1.2;
}

.my-tests-subtitle {
  font-size: clamp(13px, 3.2vw, 15px);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: clamp(24px, 6vh, 32px);
  text-align: left;
}

/* Секция загрузки файлов */
.file-upload-section {
  margin-bottom: clamp(24px, 6vh, 32px);
}

.file-upload-card {
  background: #F8F6F0;
  border-radius: clamp(16px, 4vw, 20px);
  padding: clamp(24px, 6vw, 32px);
  text-align: center;
  border: 2px dashed #B0B0B0;
  position: relative;
}

.upload-icon {
  margin-bottom: clamp(16px, 4vh, 20px);
  display: flex;
  justify-content: center;
}

.upload-icon svg {
  width: clamp(24px, 6vw, 28px);
  height: clamp(24px, 6vw, 28px);
  background: #E5E7EB;
  border-radius: 50%;
  padding: clamp(12px, 3vw, 16px);
  box-sizing: content-box;
}

.upload-title {
  font-size: clamp(16px, 4vw, 18px);
  font-weight: 600;
  color: #4A8B6C;
  margin-bottom: clamp(8px, 2vh, 12px);
}

.upload-subtitle {
  font-size: clamp(12px, 3vw, 14px);
  font-weight: 400;
  color: #6B7280;
  margin-bottom: clamp(20px, 5vh, 24px);
}

.upload-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(12px, 3vw, 16px);
  justify-content: center;
}

.upload-btn-primary {
  background: #4A8B6C;
  color: white;
  border: none;
  border-radius: clamp(12px, 3vw, 16px);
  padding: clamp(12px, 3vw, 16px) clamp(20px, 5vw, 24px);
  font-size: clamp(14px, 3.5vw, 16px);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-btn-primary:hover {
  background: #3A7A5C;
  transform: translateY(-1px);
}

.upload-btn-secondary {
  background: transparent;
  color: #4A8B6C;
  border: 2px solid #4A8B6C;
  border-radius: clamp(12px, 3vw, 16px);
  padding: clamp(10px, 2.5vw, 14px) clamp(18px, 4.5vw, 22px);
  font-size: clamp(14px, 3.5vw, 16px);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-btn-secondary:hover {
  background: #4A8B6C;
  color: white;
  transform: translateY(-1px);
}

/* Секция типов анализов */
.test-type-section {
  margin-bottom: clamp(24px, 6vh, 32px);
}

.section-title {
  font-size: clamp(14px, 3.5vw, 16px);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: clamp(16px, 4vh, 20px);
}

.test-type-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: clamp(12px, 3vw, 16px);
  margin-bottom: clamp(8px, 2vw, 12px);
}

#myTestsStep .test-type-btn {
  background: transparent !important;
  color: rgba(255, 255, 255, 0.9) !important;
  border: 2px solid rgba(255, 255, 255, 0.4) !important;
  border-radius: clamp(20px, 5vw, 25px) !important;
  padding: clamp(14px, 3.5vw, 18px) !important;
  font-size: clamp(11px, 2.8vw, 13px) !important;
  font-weight: 300 !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  height: clamp(44px, 11vw, 52px) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

#myTestsStep .test-type-btn.active {
  background: #2A3F5F !important;
  color: #FFFFFF !important;
  border-color: #2A3F5F !important;
  box-shadow: 0 2px 8px rgba(42, 63, 95, 0.3) !important;
}

#myTestsStep .test-type-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.6) !important;
  transform: translateY(-1px);
}

#myTestsStep .test-type-btn.active:hover {
  background: #1E2D42 !important;
  border-color: #1E2D42 !important;
  transform: translateY(-1px);
}

/* Секция загруженных анализов */
.uploaded-tests-section {
  margin-bottom: clamp(24px, 6vh, 32px);
}

.uploaded-tests-list {
  background: #2A3F5F;
  border-radius: clamp(18px, 4.5vw, 24px);
  padding: clamp(14px, 3.5vw, 18px);
  margin: 0 -clamp(16px, 4vw, 24px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.uploaded-tests-title {
  color: #B0BCC9;
  font-size: clamp(16px, 4vw, 20px);
  font-weight: 600;
  margin: 0 0 clamp(10px, 2.5vw, 14px) 0;
  line-height: 1.2;
  flex-shrink: 0;
}

/* Индикатор загрузки анализов */
.tests-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  gap: 12px;
}

.tests-loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top: 3px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.tests-loading p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  margin: 0;
}

.no-tests-message {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  padding: 16px 0;
  margin: 0;
}

.test-item {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 16px);
  padding: clamp(12px, 3vw, 16px) 0;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.test-item:hover {
  opacity: 0.85;
}

.test-item:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

.test-info {
  flex: 1;
  min-width: 0;
}

.test-name {
  font-size: clamp(14px, 3.5vw, 16px);
  font-weight: 500;
  color: #FFFFFF;
  margin: 0 0 clamp(4px, 1vw, 6px) 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.test-type {
  font-size: clamp(12px, 3vw, 14px);
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

.test-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Галочка - без фона, белый цвет */
.test-check-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.test-check-btn svg {
  stroke: #FEF7EC;
}

.test-check-btn svg path {
  stroke: #FEF7EC;
}

/* Кнопка удаления - молочный кружок */
.test-delete-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #F9EBE5;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.test-delete-btn:hover {
  opacity: 0.85;
}

.test-delete-btn:active {
  transform: scale(0.95);
}

/* Секция рекомендаций */
.recommendations-section {
  margin-bottom: clamp(20px, 5vh, 28px);
}

.recommendations-btn {
  width: 100%;
  background: #FEF7EC;
  border: none;
  border-radius: clamp(16px, 4vw, 20px);
  padding: clamp(16px, 4vw, 20px);
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 16px);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  position: relative;
}

.recommendations-btn:hover {
  background: #F5F0E8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.recommendations-btn svg:first-child {
  color: #4A8B6C;
  flex-shrink: 0;
  width: clamp(20px, 5vw, 24px);
  height: clamp(20px, 5vw, 24px);
}

.recommendations-btn span {
  flex: 1;
  font-size: clamp(14px, 3.5vw, 16px);
  font-weight: 500;
  color: #374151;
}

.help-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: clamp(6px, 1.5vw, 8px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2A3F5F;
  flex-shrink: 0;
  width: clamp(28px, 7vw, 32px);
  height: clamp(28px, 7vw, 32px);
  border-radius: 50%;
  transition: all 0.2s ease;
  position: relative;
  z-index: 10;
}

.help-icon:hover {
  background: rgba(42, 63, 95, 0.1);
  transform: scale(1.1);
}

.help-icon svg {
  width: 100%;
  height: 100%;
}

/* Модальное окно */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(80px, 15vh, 120px) clamp(20px, 5vw, 40px) clamp(20px, 5vw, 40px);
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #31674A;
  border: 2px solid white;
  border-radius: clamp(16px, 4vw, 20px);
  padding: clamp(20px, 5vw, 24px);
  max-width: 400px;
  width: 100%;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-close {
  position: absolute;
  top: clamp(12px, 3vw, 16px);
  right: clamp(12px, 3vw, 16px);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: white;
  font-size: 18px;
  line-height: 1;
  font-weight: 300;
}

.modal-text {
  margin-bottom: 0;
  padding-right: clamp(32px, 8vw, 40px);
}

.modal-text p {
  font-family: 'Roboto', sans-serif;
  font-size: clamp(14px, 3.5vw, 16px);
  line-height: 1.5;
  color: white;
  font-weight: normal;
  margin: 0;
}

/* Адаптивность для мобильных */
@media (max-width: 480px) {
  .upload-buttons {
    grid-template-columns: 1fr 1fr;
    gap: clamp(10px, 2.5vw, 14px);
  }
  
  .upload-btn-primary,
  .upload-btn-secondary {
    width: 100%;
  }

  .test-type-buttons {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  
  .test-name {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.3;
  }
}

/* ИСПРАВЛЕНИЕ АВАТАРА - СТАТИЧНАЯ ПОЗИЦИЯ */
.static-avatar {
  position: fixed !important;
  /* ПРЕЖНИЙ УВЕЛИЧЕННЫЙ ОТСТУП СВЕРХУ чтобы аватарка полностью влазила в отступ */
  top: calc(env(safe-area-inset-top, 44px) + 58px) !important;
  right: 20px !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 50%;
  background: #FF6B3D;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  color: white;
  z-index: 1001;
  min-width: 40px;
  min-height: 40px;
  max-width: 40px;
  max-height: 40px;
  flex-shrink: 0;
}

/* МОДАЛЬНОЕ ОКНО ДЛЯ ИЗОБРАЖЕНИЙ */
.image-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.image-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.image-modal-close {
  position: absolute;
  top: -40px;
  right: -10px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  transition: all 0.2s ease;
  z-index: 3001;
}

.image-modal-close:hover {
  background: white;
  transform: scale(1.1);
}

.modal-image {
  max-width: 100%;
  max-height: calc(90vh - 60px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modal-image-title {
  color: white;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  margin: 0;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 20px;
  max-width: 100%;
  word-break: break-word;
}
/* ========================================
   СТРАНИЦА "ЗДОРОВЬЕ"
   ======================================== */

.health-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(180deg, #3C805B 0%, #639B7C 100%);
  z-index: 500;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  /* ПРЕЖНИЙ ОТСТУП СВЕРХУ для кнопок Telegram (Close, стрелка, три точки) */
  padding-top: calc(env(safe-area-inset-top, 44px) + 28px) !important;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.health-page.active {
  display: flex;
  opacity: 1;
  transform: translateX(0);
}

.health-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 clamp(16px, 4vw, 20px);
  /* БЕЗОПАСНЫЙ отступ снизу - никогда не налезает на навигацию */
  padding-bottom: 120px !important;
  -webkit-overflow-scrolling: touch;
}

/* Карточка приоритетных целей */
.priority-goals-card {
  background: #FEF7EC;
  border-radius: clamp(16px, 4vw, 20px);
  padding: clamp(16px, 4vw, 20px);
  margin-bottom: clamp(16px, 3vh, 20px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Новый заголовок с оранжевым шариком */
.goals-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.orange-bullet {
  color: #FF6B3D; /* Оранжевый цвет */
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.goals-title {
  font-size: clamp(16px, 4vw, 18px);
  font-weight: 600;
  color: #2A3F5F;
  margin: 0;
  line-height: 1.3;
}

/* Контент с целями */
.goals-content {
  margin: 0;
}

.goals-text {
  font-size: clamp(14px, 3.5vw, 16px);
  color: #666666;
  line-height: 1.5;
  margin: 0;
}

.card-header {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 12px);
  margin-bottom: clamp(12px, 2.5vh, 16px);
}

.goals-icon {
  flex-shrink: 0;
}

.goals-title {
  font-size: clamp(16px, 4vw, 18px);
  font-weight: 600;
  color: #6B7280;
  margin: 0;
  font-family: 'Inter', sans-serif;
}

.goals-list {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2vh, 12px);
}

.goal-item {
  display: flex;
  align-items: flex-start;
  gap: clamp(8px, 2vw, 12px);
}

.goal-bullet {
  font-size: clamp(12px, 3vw, 14px);
  flex-shrink: 0;
  margin-top: 2px;
}

.goal-bullet.yellow {
  color: #F59E0B;
}

.goal-bullet.red {
  color: #EF4444;
}

.goal-bullet.green {
  color: #10B981;
}

.goal-text {
  font-size: clamp(12px, 3vw, 14px);
  color: #374151;
  line-height: 1.4;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
}

/* Секция рекомендаций */
.recommendations-section {
  margin-bottom: clamp(16px, 3vh, 20px);
}

.recommendations-title {
  font-size: clamp(18px, 4.5vw, 22px);
  font-weight: 600;
  color: #FFFFFF;
  margin: 0 0 clamp(12px, 2.5vh, 16px) 0;
  font-family: 'Inter', sans-serif;
}

.recommendation-item {
  display: flex;
  align-items: flex-start;
  gap: clamp(12px, 3vw, 16px);
  background: #FEF7EC;
  border-radius: clamp(12px, 3vw, 16px);
  padding: clamp(12px, 3vw, 16px);
  margin-bottom: clamp(8px, 2vh, 12px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.recommendation-item.expanded {
  flex-direction: column;
  align-items: stretch;
}

.rec-icon {
  flex-shrink: 0;
  width: clamp(32px, 8vw, 40px);
  height: clamp(32px, 8vw, 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.rec-content {
  flex: 1;
  min-width: 0;
}

.rec-title {
  font-size: clamp(14px, 3.5vw, 16px);
  font-weight: 600;
  color: #2A3F5F;
  margin: 0 0 clamp(4px, 1vh, 6px) 0;
  line-height: 1.3;
  font-family: 'Inter', sans-serif;
}

.rec-description {
  font-size: clamp(11px, 2.8vw, 13px);
  color: #6B7280;
  margin: 0;
  line-height: 1.4;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
}

.rec-add-btn {
  flex-shrink: 0;
  width: clamp(28px, 7vw, 32px);
  height: clamp(28px, 7vw, 32px);
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #2A3F5F;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-top: 2px;
}

.rec-add-btn:hover {
  background: rgba(42, 63, 95, 0.1);
  transform: scale(1.1);
}

.rec-add-btn:active {
  background: rgba(42, 63, 95, 0.2);
  transform: scale(0.95);
}

.recommendation-item.expanded .rec-details {
  margin-top: clamp(8px, 2vh, 10px);
  font-size: clamp(13px, 3.4vw, 15px);
  color: #374151;
  line-height: 1.5;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: clamp(8px, 2vh, 10px);
  font-family: 'Inter', sans-serif;
}

/* Секция куратора - объединенный блок */
.curator-section {
  background: #FEF7EC;
  border-radius: clamp(16px, 4vw, 20px);
  padding: clamp(16px, 4vw, 20px);
  margin-bottom: clamp(16px, 3vh, 20px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.curator-card {
  display: flex;
  align-items: flex-start;
  gap: clamp(12px, 3vw, 16px);
  margin-bottom: clamp(16px, 3vh, 20px);
}

.curator-icon {
  flex-shrink: 0;
  width: clamp(32px, 8vw, 40px);
  height: clamp(32px, 8vw, 40px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.curator-content {
  flex: 1;
}

.curator-title {
  font-size: clamp(16px, 4vw, 18px);
  font-weight: 600;
  color: #6B7280;
  margin: 0 0 clamp(6px, 1.5vh, 8px) 0;
  line-height: 1.3;
  font-family: 'Inter', sans-serif;
}

.curator-description {
  font-size: clamp(13px, 3.2vw, 15px);
  color: #6B7280;
  margin: 0;
  line-height: 1.4;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
}

.health-page .create-program-btn {
  width: 100%;
  padding: clamp(14px, 3.5vw, 18px);
  border-radius: clamp(20px, 5vw, 24px);
  border: 2px solid #2A3F5F;
  background: transparent;
  color: #2A3F5F;
  font-size: clamp(14px, 3.5vw, 16px);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
  margin: 0;
}

.health-page .create-program-btn:hover {
  background: #2A3F5F;
  color: #FFFFFF;
  transform: translateY(-1px);
}

.health-page .create-program-btn:active {
  transform: translateY(0);
}

/* Адаптивность для мобильных */
@media (max-width: 480px) {
  .health-content {
    padding-bottom: 120px !important;
  }
  
  .recommendation-item {
    gap: clamp(10px, 2.5vw, 14px);
    padding: clamp(10px, 2.5vw, 14px);
  }
  
  .curator-section {
    padding: clamp(14px, 3.5vw, 18px);
  }
  
  .curator-card {
    gap: clamp(10px, 2.5vw, 14px);
    margin-bottom: clamp(14px, 2.8vh, 18px);
  }
}

/* ========================================
   СТРАНИЦА "ДНЕВНИК"
   ======================================== */

.diary-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(180deg, #3C805B 0%, #639B7C 100%);
  z-index: 500;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  /* ПРЕЖНИЙ ОТСТУП СВЕРХУ для кнопок Telegram (Close, стрелка, три точки) */
  padding-top: calc(env(safe-area-inset-top, 44px) + 28px) !important;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.diary-page.active {
  display: flex;
  opacity: 1;
  transform: translateX(0);
}

/* Калитка Дневника: показывается, если quiz_completed === false */
.diary-gate {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 120px;
  text-align: center;
}

.diary-gate.hidden {
  display: none;
}

.diary-gate-title {
  font-size: clamp(26px, 6vw, 32px);
  font-weight: 600;
  color: #FFFFFF;
  margin: 0 0 20px;
  line-height: 1.2;
}

.diary-gate-text {
  font-size: clamp(15px, 3.8vw, 17px);
  color: #FFFFFF;
  line-height: 1.45;
  margin: 0 0 28px;
  max-width: 340px;
  opacity: 0.95;
}

.diary-gate-btn {
  padding: 14px 28px;
  border-radius: 24px;
  border: 2px solid #FFFFFF;
  background: transparent;
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.diary-gate-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.diary-gate-btn:active {
  background: rgba(255, 255, 255, 0.25);
}

#diaryContentBlock.hidden {
  display: none !important;
}

.diary-content {
  flex: 1;
  overflow: hidden;
  padding: 0 clamp(16px, 4vw, 20px);
  /* БЕЗОПАСНЫЙ отступ снизу - никогда не налезает на навигацию */
  padding-bottom: 120px !important;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px - 100px);
  box-sizing: border-box;
}

.diary-title {
  font-size: clamp(22px, 5.5vw, 28px);
  font-weight: 600;
  color: #FFFFFF;
  margin: clamp(16px, 4vh, 24px) 0 clamp(6px, 1.5vh, 10px) 0;
  text-align: left;
  line-height: 1.2;
  font-family: 'Inter', sans-serif;
  flex-shrink: 0;
}

.diary-subtitle {
  font-size: clamp(12px, 3vw, 14px);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: clamp(18px, 4.5vh, 26px);
  text-align: left;
  font-family: 'Inter', sans-serif;
  flex-shrink: 0;
}

/* Календарь дней недели */
.diary-calendar {
  display: flex;
  gap: clamp(6px, 1.5vw, 10px);
  margin-bottom: clamp(18px, 4.5vh, 26px);
  overflow-x: auto;
  padding: 0 clamp(16px, 4vw, 20px); /* Добавляем отступы как у контента */
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}

.diary-day {
  flex: 1; /* Кнопки растягиваются равномерно */
  min-width: clamp(46px, 11.5vw, 54px); /* Возвращаем прежнюю ширину */
  height: clamp(72px, 18vw, 82px); /* Увеличиваем высоту для вытянутости */
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: clamp(36px, 9vw, 41px); /* Увеличиваем радиус пропорционально высоте */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: transparent;
}

.diary-day.active {
  background: #2A3F5F;
  border-color: #2A3F5F;
}

.diary-day:hover:not(.active) {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.1);
}

.day-name {
  font-size: clamp(10px, 2.5vw, 12px);
  font-weight: 500;
  color: #FFFFFF;
  margin-bottom: 2px;
  font-family: 'Inter', sans-serif;
}

.day-number {
  font-size: clamp(14px, 3.5vw, 16px);
  font-weight: 600;
  color: #FFFFFF;
  font-family: 'Inter', sans-serif;
}

/* Карточка записей */
.diary-entries-card {
  background: #FEF7EC;
  border-radius: clamp(15px, 3.8vw, 19px);
  padding: clamp(14px, 3.5vw, 18px);
  margin-bottom: clamp(16px, 4vh, 24px); /* Добавляем отступ снизу */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  /* ДОБАВЛЯЕМ ФИКСИРОВАННУЮ ВЫСОТУ ДЛЯ СКРОЛЛА */
  height: clamp(300px, 50vh, 400px);
}

.entries-title {
  font-size: clamp(15px, 3.8vw, 17px);
  font-weight: 600;
  color: #6B7280;
  margin: 0 0 clamp(14px, 3.5vh, 18px) 0;
  font-family: 'Inter', sans-serif;
  flex-shrink: 0;
}

.diary-entries {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2.5vh, 14px);
  flex: 1;
  overflow-y: auto; /* ДОБАВЛЯЕМ СКРОЛЛ */
  overflow-x: hidden;
  padding-right: 6px; /* Отступ для скроллбара */
}

/* Стили скроллбара для записей дневника */
.diary-entries::-webkit-scrollbar {
  width: 4px;
}

.diary-entries::-webkit-scrollbar-track {
  background: rgba(107, 114, 128, 0.1);
  border-radius: 2px;
}

.diary-entries::-webkit-scrollbar-thumb {
  background: rgba(107, 114, 128, 0.3);
  border-radius: 2px;
}

.diary-entries::-webkit-scrollbar-thumb:hover {
  background: rgba(107, 114, 128, 0.5);
}

.diary-entry {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3.5vw, 18px);
  padding: clamp(6px, 1.5vw, 10px) 0;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 7px;
  flex-shrink: 0;
}

.diary-entry:hover {
  background: rgba(107, 114, 128, 0.05);
  padding-left: clamp(6px, 1.5vw, 10px);
  padding-right: clamp(6px, 1.5vw, 10px);
}

.entry-time {
  font-size: clamp(12px, 3vw, 14px);
  font-weight: 500;
  color: #6B7280;
  min-width: clamp(38px, 9.5vw, 46px);
  font-family: 'Inter', sans-serif;
}

.entry-text {
  font-size: clamp(13px, 3.2vw, 15px);
  font-weight: 700; /* Делаем синий текст жирным */
  color: #2A3F5F;
  flex: 1;
  font-family: 'Inter', sans-serif;
}

/* Модальное окно для записей */
.diary-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 5vw, 40px);
  box-sizing: border-box;
}

.diary-modal-overlay.active {
  display: flex;
}

.diary-modal-content {
  background: #FEF7EC;
  border-radius: clamp(16px, 4vw, 20px);
  padding: 0;
  max-width: 400px;
  width: 100%;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.diary-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(16px, 4vw, 20px) clamp(16px, 4vw, 20px) 0;
}

.diary-modal-title {
  font-size: clamp(16px, 4vw, 18px);
  font-weight: 600;
  color: #374151;
  margin: 0;
  font-family: 'Inter', sans-serif;
}

.diary-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #6B7280;
  font-size: 20px;
  line-height: 1;
  font-weight: 300;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.diary-modal-body {
  padding: clamp(16px, 4vw, 20px);
}

.diary-modal-input {
  width: 100%;
  padding: clamp(12px, 3vw, 16px);
  border: 1px solid #D1D5DB;
  border-radius: clamp(8px, 2vw, 12px);
  font-size: clamp(14px, 3.5vw, 16px);
  color: #374151;
  background: #FFFFFF;
  transition: all 0.2s ease;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

.diary-modal-input:focus {
  outline: none;
  border-color: #2A3F5F;
  box-shadow: 0 0 0 3px rgba(42, 63, 95, 0.1);
}

.diary-modal-input::placeholder {
  color: #9CA3AF;
  font-size: clamp(13px, 3.2vw, 15px);
}

.diary-modal-footer {
  padding: 0 clamp(16px, 4vw, 20px) clamp(16px, 4vw, 20px);
}

.diary-modal-btn {
  width: 100%;
  padding: clamp(12px, 3vw, 16px);
  border-radius: clamp(12px, 3vw, 16px);
  border: none;
  background: #2A3F5F;
  color: #FFFFFF;
  font-size: clamp(14px, 3.5vw, 16px);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.diary-modal-btn:hover {
  background: #1E2D42;
  transform: translateY(-1px);
}

.diary-modal-btn:active {
  background: #1A2332;
  transform: translateY(0);
}

/* Новые стили для полей модального окна */
.modal-field {
  margin-bottom: clamp(16px, 4vw, 20px);
}

.modal-label {
  display: block;
  font-size: clamp(13px, 3.2vw, 15px);
  font-weight: 600;
  color: #2A3F5F;
  margin-bottom: clamp(6px, 1.5vw, 8px);
}

.time-selector {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 12px);
  margin-bottom: clamp(12px, 3vw, 16px);
}

.time-select {
  padding: clamp(8px, 2vw, 12px);
  border: 2px solid #E5E7EB;
  border-radius: clamp(8px, 2vw, 12px);
  font-size: clamp(14px, 3.5vw, 16px);
  color: #2A3F5F;
  background: white;
  min-width: clamp(60px, 15vw, 80px);
  text-align: center;
}

.time-select:focus {
  outline: none;
  border-color: #2A3F5F;
  box-shadow: 0 0 0 3px rgba(42, 63, 95, 0.1);
}

.time-separator {
  font-size: clamp(16px, 4vw, 20px);
  font-weight: 600;
  color: #2A3F5F;
}

/* Стили для заголовка записей с кнопками */
.entries-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: clamp(12px, 3vw, 16px);
}

.header-buttons {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 12px);
}

.add-entry-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: clamp(6px, 1.5vw, 8px);
  border-radius: clamp(6px, 1.5vw, 8px);
  color: #6B7280;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-entry-btn:hover {
  background: rgba(107, 114, 128, 0.1);
  color: #2A3F5F;
}

.add-entry-btn:active {
  background: rgba(107, 114, 128, 0.2);
  transform: scale(0.95);
}

.edit-mode-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: clamp(6px, 1.5vw, 8px);
  border-radius: clamp(6px, 1.5vw, 8px);
  color: #6B7280;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.edit-mode-btn:hover {
  background: rgba(107, 114, 128, 0.1);
  color: #2A3F5F;
}

.edit-mode-btn:active {
  background: rgba(107, 114, 128, 0.2);
  transform: scale(0.95);
}

.edit-mode-btn.active {
  background: #2A3F5F;
  color: white;
}

/* Стили для режима редактирования записей */
.diary-entries.edit-mode .diary-entry {
  cursor: pointer;
  border: 2px dashed #E5E7EB;
  background: #F9FAFB;
  position: relative;
  padding-right: clamp(30px, 8vw, 35px); /* Место для крестика */
  transition: all 0.2s ease;
  pointer-events: auto; /* Убеждаемся что события работают */
}

.diary-entries.edit-mode .diary-entry:hover {
  border-color: #2A3F5F;
  background: #F3F4F6;
}

.diary-entries.edit-mode .diary-entry.selected {
  border-color: #2A3F5F;
  background: #E5E7EB;
  box-shadow: 0 0 0 2px rgba(42, 63, 95, 0.2);
}

/* Простой синий крестик для удаления */
.delete-entry-x {
  position: absolute;
  right: clamp(8px, 2vw, 12px);
  top: 50%;
  transform: translateY(-50%);
  color: #2A3F5F; /* Основной синий цвет как у других элементов */
  font-size: clamp(18px, 4.5vw, 22px);
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
  user-select: none;
}

.delete-entry-x:hover {
  color: #1E2D42; /* Темнее при наведении */
}

/* Модальное окно для страницы здоровья */
.health-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  box-sizing: border-box;
}

.health-modal-overlay.active {
  display: flex;
}

.health-modal-content {
  background: #4A8B6C; /* Зеленый фон как на скриншоте */
  border: 2px solid white; /* Тонкая белая рамка */
  border-radius: 20px;
  padding: 30px;
  max-width: 350px;
  width: 100%;
  position: relative;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.health-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  color: white;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.health-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.health-modal-body {
  padding: 10px 0;
}

.health-modal-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: white;
  margin: 0 0 20px 0;
  line-height: 1.2;
}

.health-modal-text {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: white;
  margin: 0 0 25px 0;
  line-height: 1.4;
  opacity: 0.9;
}

.health-modal-btn {
  background: white;
  color: #4A8B6C;
  border: none;
  border-radius: 25px;
  padding: 12px 30px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Montserrat', sans-serif;
  width: 100%;
  max-width: 200px;
}

.health-modal-btn:hover {
  background: #f0f0f0;
  transform: translateY(-1px);
}

.health-modal-btn:active {
  background: #e0e0e0;
  transform: translateY(0);
}

/* Адаптивность для мобильных */
@media (max-width: 480px) {
  .diary-content {
    height: calc(100vh - 50px - 90px);
    padding-bottom: 120px !important; /* БЕЗОПАСНЫЙ отступ снизу */
  }
  
  .diary-title {
    font-size: clamp(20px, 5vw, 24px);
    margin: clamp(12px, 3vh, 18px) 0 clamp(4px, 1vh, 8px) 0;
  }
  
  .diary-subtitle {
    font-size: clamp(11px, 2.8vw, 13px);
    margin-bottom: clamp(14px, 3.5vh, 20px);
  }
  
  .diary-calendar {
    gap: clamp(4px, 1vw, 8px);
    margin-bottom: clamp(14px, 3.5vh, 20px);
    padding: 0 clamp(16px, 4vw, 20px); /* Сохраняем отступы для мобильных */
  }
  
  .diary-day {
    flex: 1; /* Растягиваем на всю ширину */
    min-width: clamp(42px, 10.5vw, 50px); /* Возвращаем прежнюю ширину */
    height: clamp(68px, 17vw, 78px); /* Увеличиваем высоту для мобильных */
    border-radius: clamp(34px, 8.5vw, 39px); /* Увеличиваем радиус пропорционально */
  }
  
  .day-name {
    font-size: clamp(9px, 2.2vw, 11px);
  }
  
  .day-number {
    font-size: clamp(12px, 3vw, 14px);
  }
  
  .diary-entries-card {
    padding: clamp(12px, 3vw, 16px);
    margin-bottom: clamp(20px, 5vh, 28px); /* Больше отступ для мобильных */
  }
  
  .entries-title {
    font-size: clamp(14px, 3.5vw, 16px);
    margin-bottom: clamp(10px, 2.5vh, 14px);
  }
  
  .diary-entries {
    gap: clamp(8px, 2vh, 12px);
  }
  
  .diary-entry {
    gap: clamp(12px, 3vw, 16px);
    padding: clamp(4px, 1vw, 8px) 0;
  }
  
  .entry-time {
    font-size: clamp(11px, 2.8vw, 13px);
    min-width: clamp(34px, 8.5vw, 42px);
  }
  
  .entry-text {
    font-size: clamp(12px, 3vw, 14px);
    font-weight: 700; /* Жирный шрифт для мобильных тоже */
  }
  
  .add-entry-btn {
    width: clamp(34px, 8.5vw, 42px);
    height: clamp(34px, 8.5vw, 42px);
    bottom: clamp(10px, 2.5vw, 14px);
    right: clamp(10px, 2.5vw, 14px);
  }
}


/* ========================================
   НОВЫЙ ПРИВЕТСТВЕННЫЙ ЭКРАН - ПОЛНОСТЬЮ ОТДЕЛЬНЫЙ
   ======================================== */

.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(180deg, #3C805B 0%, #639B7C 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  overflow-y: auto;
  /* ПОЛНАЯ ИЗОЛЯЦИЯ */
  pointer-events: all;
  user-select: none;
  /* АНИМАЦИЯ ПЛАВНОГО ИСЧЕЗНОВЕНИЯ */
  opacity: 1;
  transition: opacity 0.8s ease-out;
}

.splash-screen.fade-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease-out;
}

.splash-screen.hidden {
  display: none !important;
}

/* Спиннер загрузки на splash screen */
.splash-loader {
  width: 28px;
  height: 28px;
  margin: 16px auto 0;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.splash-content {
  max-width: 100%;
  width: 100%;
  padding: 20px 16px;
  text-align: center;
  box-sizing: border-box;
}

.splash-title {
  font-size: 18px;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
  line-height: 1.25;
}

.splash-subtitle {
  font-size: 12px;
  line-height: 1.5;
  color: #FEF7EC;
  opacity: 0.9;
  margin-bottom: 16px;
}

/* Блоки УТП */
.splash-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  text-align: left;
}

.splash-feature {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.splash-feature-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.splash-feature-icon svg {
  width: 18px;
  height: 18px;
}

.splash-feature-content {
  flex: 1;
}

.splash-feature-title {
  font-size: 13px;
  font-weight: 600;
  color: white;
  margin-bottom: 2px;
  line-height: 1.2;
}

.splash-feature-text {
  font-size: 11px;
  line-height: 1.4;
  color: rgba(254, 247, 236, 0.85);
  margin-bottom: 0;
}

.splash-feature-result {
  font-size: 10px;
  line-height: 1.3;
  color: rgba(254, 247, 236, 0.95);
  background: rgba(255, 255, 255, 0.1);
  padding: 5px 8px;
  border-radius: 6px;
  margin-top: 5px;
}

.splash-feature-result strong {
  color: white;
}

/* CTA блок */
.splash-cta {
  margin-top: 12px;
}

.splash-cta-text {
  font-size: 12px;
  color: rgba(254, 247, 236, 0.9);
  margin-bottom: 10px;
  font-weight: 500;
}

.splash-cta-btn {
  background: white;
  color: #3C805B;
  border: none;
  border-radius: 12px;
  padding: 12px 32px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.splash-cta-btn:active {
  transform: scale(0.98);
  background: #f5f5f5;
}


@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 0.8;
    transform: translateY(0);
  }
}

/* АНИМАЦИЯ ЗАГРУЗКИ ЧАТА */
.chat-loading-animation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  height: 100%;
  min-height: 300px;
}

.chat-loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  height: 100%;
  min-height: 400px;
}

.chat-loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(74, 139, 108, 0.2);
  border-top: 4px solid #4A8B6C;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.chat-loading-text {
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  font-weight: 500;
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top: 3px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.loading-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error-message {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  text-align: center;
  min-height: 200px;
}

/* ГЛАВНОЕ ПРИЛОЖЕНИЕ ИЗНАЧАЛЬНО СКРЫТО */
/* Удалено дублирующее определение .app - используется основное определение выше */

/* ========================================
   АДМИНСКАЯ ПАНЕЛЬ
   ======================================== */

.admin-page {
  display: none !important;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  background: linear-gradient(180deg, #3C805B 0%, #639B7C 100%);
  padding-top: calc(env(safe-area-inset-top, 44px) + 28px);
  position: relative;
  z-index: 1000;
  width: 100%;
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.admin-page.active {
  display: flex !important;
  opacity: 1;
  transform: translateY(0);
}

.admin-content {
  flex: 1;
  padding: 0 20px 20px;
  overflow-y: auto !important;
  overflow-x: hidden;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 100px;
}

.admin-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
}

.admin-loading .loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(254, 247, 236, 0.2);
  border-top-color: #FEF7EC;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.admin-loading .loading-text {
  color: #FEF7EC;
  font-size: 16px;
  font-weight: 500;
}

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

.admin-title {
  font-size: 22px;
  font-weight: 600;
  color: #FEF7EC;
  margin: 0 0 16px 0;
  padding: 0 20px;
}

.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-user-item {
  background: #FEF7EC;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-user-item:active {
  transform: scale(0.98);
}

.admin-user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  cursor: pointer;
  gap: 12px;
}

.admin-user-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.admin-user-name {
  font-size: 16px;
  font-weight: 600;
  color: #3B4F6B;
}

.admin-user-status {
  font-size: 13px;
  color: #8B8B8B;
}

.admin-expand-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #3C805B;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
  color: #FEF7EC;
  position: relative;
  margin-left: auto;
}

.admin-expand-btn:hover {
  background: #2d6346;
}

.admin-expand-btn:active {
  background: #245236;
}

.admin-expand-btn svg {
  position: absolute;
  transition: opacity 0.2s ease;
}

.admin-user-item.expanded .admin-expand-btn {
  background: #2d6346;
}

.admin-user-submenu {
  width: 100%;
  margin-top: 0;
  display: none;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(59, 79, 107, 0.1);
}

.admin-user-item.expanded .admin-user-submenu {
  display: flex;
}

.admin-submenu-item {
  background: rgba(60, 128, 91, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: none;
  cursor: pointer;
  color: #3B4F6B;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.admin-submenu-item:active {
  background: rgba(60, 128, 91, 0.15);
}

.admin-submenu-item-danger {
  background: rgba(220, 53, 69, 0.08);
  color: #dc3545;
}

.admin-submenu-item-danger:active {
  background: rgba(220, 53, 69, 0.15);
}

.admin-submenu-item-danger .admin-submenu-icon {
  color: #dc3545;
}

.admin-submenu-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-submenu-icon {
  color: #3C805B;
  flex-shrink: 0;
}

.admin-submenu-item svg:last-child {
  color: #8B8B8B;
}

.admin-section-title {
  font-size: 20px;
  font-weight: 600;
  color: #FEF7EC;
  margin-bottom: 20px;
}

.admin-message,
.admin-error {
  padding: 20px;
  text-align: center;
  color: #3B4F6B;
  font-size: 15px;
  background: #FEF7EC;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.admin-error {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.1);
}

.admin-quiz-item {
  background: #FEF7EC;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.admin-quiz-question {
  color: #3B4F6B;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.4;
}

.admin-quiz-answer {
  color: #666;
  font-size: 14px;
}

.admin-quiz-input {
  width: 100%;
  margin-top: 8px;
  padding: 12px 16px;
  background: #FFFFFF;
  border: 1px solid rgba(59, 79, 107, 0.2);
  border-radius: 12px;
  color: #3B4F6B;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}

.admin-quiz-input:focus {
  border-color: #3C805B;
  box-shadow: 0 0 0 3px rgba(60, 128, 91, 0.1);
}

.admin-quiz-input::placeholder {
  color: #999;
}

.admin-quiz-textarea {
  width: 100%;
  margin-top: 8px;
  padding: 12px 16px;
  background: #FFFFFF;
  border: 1px solid rgba(59, 79, 107, 0.2);
  border-radius: 12px;
  color: #3B4F6B;
  font-size: 14px;
  font-family: inherit;
  min-height: 100px;
  resize: vertical;
  box-sizing: border-box;
}

.admin-quiz-textarea:focus {
  outline: none;
  border-color: #3C805B;
  box-shadow: 0 0 0 3px rgba(60, 128, 91, 0.1);
}

.admin-quiz-textarea::placeholder {
  color: #999;
}

.admin-analysis-item {
  background: #FEF7EC;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: opacity 0.2s;
}

.admin-analysis-image {
  width: 100%;
  margin-bottom: 12px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.2s;
}

.admin-analysis-image:hover {
  opacity: 0.9;
}

.admin-analysis-image img {
  width: 100%;
  height: auto;
  display: block;
}

.admin-analysis-info {
  margin-bottom: 12px;
}

.admin-analysis-name {
  color: #3B4F6B;
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}

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

.admin-analysis-category {
  flex: 1;
  padding: 10px 14px;
  background: #FFFFFF;
  border: 1px solid rgba(59, 79, 107, 0.2);
  border-radius: 12px;
  color: #3B4F6B;
  font-size: 14px;
  outline: none;
}

.admin-analysis-category:focus {
  border-color: #3C805B;
  box-shadow: 0 0 0 3px rgba(60, 128, 91, 0.1);
}

.admin-analysis-category option {
  background: #FFFFFF;
  color: #3B4F6B;
}

.admin-analysis-delete {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(220, 53, 69, 0.1);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #dc3545;
  transition: background 0.2s;
}

.admin-analysis-delete:active {
  background: rgba(220, 53, 69, 0.2);
}

.admin-nav-buttons {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 20px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px) + 80px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  z-index: 10;
  background: linear-gradient(180deg, transparent 0%, rgba(60, 128, 91, 0.95) 20%);
}

.admin-view-header {
  padding: 16px 20px;
}

.admin-view-title {
  font-size: 18px;
  font-weight: 600;
  color: #FEF7EC;
  margin: 0;
}

.admin-quiz-view,
.admin-analyses-view,
.admin-subscription-view {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}

.admin-quiz-answers,
.admin-analyses-list {
  padding: 0 20px;
  padding-bottom: 100px;
  flex: 1;
}

/* Стили для формы редактирования подписки */
.admin-subscription-content {
  padding: 0 20px;
  padding-bottom: 100px;
  flex: 1;
}

/* Информация о текущей подписке */
.admin-subscription-current-info {
  background: #FEF7EC;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.admin-subscription-current-title {
  font-size: 16px;
  font-weight: 600;
  color: #3B4F6B;
  margin: 0 0 16px 0;
}

.admin-subscription-current-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-subscription-current-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(59, 79, 107, 0.1);
}

.admin-subscription-current-row:last-child {
  border-bottom: none;
}

.admin-subscription-current-label {
  font-size: 14px;
  font-weight: 500;
  color: #8B8B8B;
}

.admin-subscription-current-value {
  font-size: 14px;
  font-weight: 600;
  color: #3B4F6B;
}

.admin-subscription-status-active {
  color: #3C805B !important;
}

.admin-subscription-status-inactive {
  color: #dc3545 !important;
}

/* Блок изменений подписки */
.admin-subscription-form {
  background: #FEF7EC;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.admin-subscription-form-title {
  font-size: 16px;
  font-weight: 600;
  color: #3B4F6B;
  margin: 0;
}

.admin-subscription-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-subscription-label {
  font-size: 14px;
  font-weight: 600;
  color: #3B4F6B;
}

.admin-subscription-select {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(59, 79, 107, 0.2);
  background: #FFFFFF;
  color: #3B4F6B;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
}

.admin-subscription-select:focus {
  border-color: #3C805B;
  box-shadow: 0 0 0 3px rgba(60, 128, 91, 0.1);
}

.admin-subscription-select option {
  background: #FFFFFF;
  color: #3B4F6B;
}

.admin-subscription-date-input {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(59, 79, 107, 0.2);
  background: #FFFFFF;
  color: #3B4F6B;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
}

.admin-subscription-date-input:focus {
  border-color: #3C805B;
  box-shadow: 0 0 0 3px rgba(60, 128, 91, 0.1);
}

.admin-subscription-date-input::-webkit-calendar-picker-indicator {
  opacity: 0.7;
  cursor: pointer;
}

.admin-subscription-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(60, 128, 91, 0.08);
}

.admin-subscription-info-label {
  font-size: 13px;
  font-weight: 500;
  color: #8B8B8B;
}

.admin-subscription-info-value {
  font-size: 15px;
  font-weight: 600;
  color: #3B4F6B;
}

/* ========== ADMIN HEALTH ========== */
.admin-health-view {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.admin-health-content {
  padding: 0 20px;
  padding-bottom: 100px;
}

.admin-health-form {
  background: #FEF7EC;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.admin-health-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-health-label {
  font-size: 14px;
  font-weight: 600;
  color: #3B4F6B;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-field-icon {
  color: #3C805B;
  flex-shrink: 0;
}

.admin-health-textarea {
  background: #FFFFFF;
  border: 1px solid rgba(59, 79, 107, 0.2);
  border-radius: 12px;
  padding: 12px;
  color: #3B4F6B;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}

.admin-health-textarea:focus {
  outline: none;
  border-color: #3C805B;
  box-shadow: 0 0 0 3px rgba(60, 128, 91, 0.1);
}

.admin-health-info {
  padding: 12px;
  background: rgba(60, 128, 91, 0.08);
  border-radius: 8px;
  margin-top: 8px;
}

.admin-health-info small {
  font-size: 12px;
  color: #666;
  word-break: break-word;
}

/* ========== ADMIN DIARY ========== */
.admin-diary-view {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.admin-diary-content {
  padding: 0 20px;
  padding-bottom: 100px;
}

.admin-diary-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-diary-date-group {
  background: #FEF7EC;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.admin-diary-date-header {
  font-size: 14px;
  font-weight: 600;
  color: #3B4F6B;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(59, 79, 107, 0.1);
  text-transform: capitalize;
}

.admin-diary-entry {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity 0.3s;
  border: 1px solid rgba(59, 79, 107, 0.1);
}

.admin-diary-entry-deleted {
  opacity: 0.3;
  pointer-events: none;
}

.admin-diary-entry-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-diary-time-input {
  width: 90px;
  padding: 8px 10px;
  background: #FFFFFF;
  border: 1px solid rgba(59, 79, 107, 0.2);
  border-radius: 8px;
  color: #3B4F6B;
  font-size: 14px;
  font-family: inherit;
}

.admin-diary-title-input {
  flex: 1;
  padding: 8px 12px;
  background: #FFFFFF;
  border: 1px solid rgba(59, 79, 107, 0.2);
  border-radius: 8px;
  color: #3B4F6B;
  font-size: 14px;
  font-family: inherit;
}

.admin-diary-notes-input {
  width: 100%;
  padding: 8px 12px;
  background: rgba(60, 128, 91, 0.05);
  border: 1px solid rgba(59, 79, 107, 0.1);
  border-radius: 8px;
  color: #666;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  box-sizing: border-box;
}

.admin-diary-time-input:focus,
.admin-diary-title-input:focus,
.admin-diary-notes-input:focus {
  outline: none;
  border-color: #3C805B;
  box-shadow: 0 0 0 3px rgba(60, 128, 91, 0.1);
}

.admin-diary-delete-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  background: rgba(220, 53, 69, 0.1);
  border: none;
  border-radius: 8px;
  color: #dc3545;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.admin-diary-delete-btn:hover {
  background: rgba(220, 53, 69, 0.2);
}

.admin-add-diary-btn {
  padding: 14px 20px;
  background: #FEF7EC;
  border: 2px dashed #3C805B;
  border-radius: 12px;
  color: #3C805B;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 12px;
}

.admin-add-diary-btn:active {
  background: rgba(60, 128, 91, 0.1);
}

/* Форма добавления записи */
.admin-diary-add-form {
  background: #FEF7EC;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.admin-diary-add-form h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #3B4F6B;
}

.admin-diary-add-row {
  display: flex;
  gap: 8px;
}

.admin-diary-date-add,
.admin-diary-time-add {
  padding: 10px 12px;
  background: #FFFFFF;
  border: 1px solid rgba(59, 79, 107, 0.2);
  border-radius: 8px;
  color: #3B4F6B;
  font-size: 14px;
  font-family: inherit;
}

.admin-diary-date-add {
  flex: 1;
}

.admin-diary-title-add,
.admin-diary-notes-add {
  width: 100%;
  padding: 10px 12px;
  background: #FFFFFF;
  border: 1px solid rgba(59, 79, 107, 0.2);
  border-radius: 8px;
  color: #3B4F6B;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
}

.admin-diary-notes-add {
  resize: none;
}

.admin-diary-add-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.admin-diary-add-cancel,
.admin-diary-add-confirm {
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.admin-diary-add-cancel {
  background: rgba(59, 79, 107, 0.1);
  color: #3B4F6B;
}

.admin-diary-add-confirm {
  background: #3C805B;
  color: #FEF7EC;
}

.admin-diary-add-cancel:hover {
  background: rgba(59, 79, 107, 0.2);
}

.admin-diary-add-confirm:hover {
  background: #2d6346;
}

.admin-nav-btn {
  padding: 14px 24px;
  border-radius: 24px;
  border: none !important;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  box-shadow: none;
  outline: none;
}

.admin-back-btn {
  background: #FEF7EC;
  color: #000000;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  border: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: none;
  outline: none;
}

.admin-back-btn svg {
  stroke: #000000;
}

.admin-back-btn:active {
  opacity: 0.8;
  transform: scale(0.95);
}

.admin-save-btn {
  background: #FEF7EC;
  color: #2A3F5F;
  border: none !important;
  border-radius: 24px;
  font-weight: 600;
  padding: 12px 20px;
  font-size: 15px;
  white-space: nowrap;
  min-width: auto;
  width: auto;
  box-shadow: none;
  outline: none;
  margin-left: auto; /* Прижимаем к правому краю */
  flex-shrink: 0;
}

.admin-save-btn:active {
  opacity: 0.8;
  transform: scale(0.98);
}

.admin-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Админская вкладка в навигации */
.admin-nav-item {
  display: none;
}

.admin-nav-item.active {
  display: flex;
}

/* Контейнер кнопки сохранения в основном контенте админки */
.admin-content-save-container {
  padding: 12px 20px;
  display: flex;
  justify-content: flex-end;
  border-bottom: 1px solid rgba(254, 247, 236, 0.2);
}

/* Модальное окно для выдачи админских прав */
.admin-grant-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.admin-grant-modal-overlay.active {
  display: flex;
}

.admin-grant-modal-content {
  background: #FEF7EC;
  border-radius: 20px;
  padding: 0;
  max-width: 400px;
  width: 100%;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.admin-grant-modal-header {
  padding: 20px 20px 0;
}

.admin-grant-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  margin: 0;
  font-family: 'Inter', sans-serif;
}

.admin-grant-modal-body {
  padding: 20px;
}

.admin-grant-modal-warning {
  font-size: 15px;
  color: #6B7280;
  line-height: 1.5;
  margin: 0;
  font-family: 'Inter', sans-serif;
}

.admin-grant-modal-footer {
  padding: 0 20px 20px;
  display: flex;
  gap: 12px;
}

.admin-grant-modal-btn {
  flex: 1;
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.admin-grant-modal-btn-cancel {
  background: #F3F4F6;
  color: #374151;
}

.admin-grant-modal-btn-cancel:active {
  background: #E5E7EB;
  transform: scale(0.98);
}

.admin-grant-modal-btn-continue {
  background: #2A3F5F;
  color: #FFFFFF;
}

.admin-grant-modal-btn-continue:active {
  background: #1E2D42;
  transform: scale(0.98);
}

/* ========================================
   ОНБОРДИНГ / ИНСТРУКЦИЯ
======================================== */

.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: transparent;
  z-index: 10000000; /* Выше чем splash-screen (999999) */
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  pointer-events: all; /* Блокируем ВСЕ клики */
}

.onboarding-overlay.active {
  display: flex;
}

/* Только tooltip и финальный экран кликабельны */
.onboarding-tooltip,
.onboarding-final {
  pointer-events: auto;
}

/* Подсветка элемента */
.onboarding-highlight {
  position: relative;
  z-index: 10000001 !important; /* Выше overlay */
  box-shadow: 
    0 0 0 4px #3C805B,
    0 0 0 8px rgba(60, 128, 91, 0.5),
    0 0 0 9999px rgba(0, 0, 0, 0.65);
  border-radius: 12px;
  background: white !important;
  animation: onboardingPulse 1.5s ease-in-out infinite;
  pointer-events: none !important; /* НЕ кликабельны во время инструкции */
}

@keyframes onboardingPulse {
  0%, 100% {
    box-shadow: 
      0 0 0 4px #3C805B,
      0 0 0 8px rgba(60, 128, 91, 0.5),
      0 0 0 9999px rgba(0, 0, 0, 0.65);
  }
  50% {
    box-shadow: 
      0 0 0 5px #4A9D6E,
      0 0 0 10px rgba(60, 128, 91, 0.6),
      0 0 0 9999px rgba(0, 0, 0, 0.65);
  }
}

/* Текст и иконки навигации при выделении */
.onboarding-highlight .nav-text {
  color: #3C805B !important;
}

.onboarding-highlight svg {
  stroke: #3C805B !important;
}

/* Полоски меню при выделении */
#menuBtn.onboarding-highlight span,
.menu-btn.onboarding-highlight span,
.onboarding-highlight.menu-btn span {
  background: #2C2C2C !important;
}

/* Контент навигации при выделении */
.onboarding-highlight.nav-item span,
.nav-item.onboarding-highlight span {
  color: #3C805B !important;
}

/* Тултип инструкции */
.onboarding-tooltip {
  background: #FEF7EC;
  border-radius: 16px;
  padding: 20px;
  max-width: 320px;
  width: calc(100% - 32px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  position: fixed;
  z-index: 10000002; /* Выше overlay и highlight */
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: onboardingSlideIn 0.4s ease-out;
}

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

/* Анимация смены слайда */
.onboarding-tooltip.slide-animate {
  animation: onboardingSlideChange 0.35s ease-out;
}

@keyframes onboardingSlideChange {
  0% {
    opacity: 0.7;
    transform: scale(0.97);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Позиция по центру */
.onboarding-tooltip.position-center {
  left: 50% !important;
  top: 50% !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
}

/* Позиция над навигацией */
.onboarding-tooltip.position-above-nav {
  left: 16px !important;
  right: 16px !important;
  bottom: 100px !important;
  top: auto !important;
  transform: none !important;
  max-width: none;
  width: auto;
  animation: onboardingSlideUp 0.4s ease-out;
}

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

.onboarding-tooltip.position-above-nav::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: var(--arrow-left, 50%);
  transform: translateX(-50%);
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 14px solid #FEF7EC;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Позиция под элементом */
.onboarding-tooltip.position-below-element {
  left: 16px !important;
  right: 16px !important;
  top: var(--tooltip-top, 80px) !important;
  bottom: auto !important;
  transform: none !important;
  max-width: none;
  width: auto;
}

.onboarding-tooltip.position-below-element::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 40px;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-bottom: 14px solid #FEF7EC;
  filter: drop-shadow(0 -2px 4px rgba(0, 0, 0, 0.1));
}

@keyframes onboardingFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.onboarding-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.onboarding-skip {
  background: none;
  border: none;
  color: #3C805B;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  transition: opacity 0.2s;
}

.onboarding-skip:active {
  opacity: 0.7;
}

.onboarding-close {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(60, 128, 91, 0.1);
  border-radius: 50%;
  font-size: 18px;
  color: #3B4F6B;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.onboarding-close:active {
  background: rgba(60, 128, 91, 0.2);
  transform: scale(0.95);
}

.onboarding-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.onboarding-title {
  font-size: 18px;
  font-weight: 600;
  color: #3B4F6B;
  margin-bottom: 8px;
}

.onboarding-text {
  font-size: 14px;
  line-height: 1.5;
  color: #5A6B7D;
  margin-bottom: 20px;
}

.onboarding-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.onboarding-step {
  font-size: 13px;
  color: #8B9AAD;
}

.onboarding-buttons {
  display: flex;
  gap: 8px;
}

.onboarding-btn {
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.onboarding-btn-back {
  background: transparent;
  color: #5A6B7D;
}

.onboarding-btn-back:active {
  background: rgba(60, 128, 91, 0.1);
}

.onboarding-btn-back:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.onboarding-btn-next,
.onboarding-btn-finish {
  background: linear-gradient(135deg, #3C805B 0%, #639B7C 100%);
  color: white;
}

.onboarding-btn-next:active,
.onboarding-btn-finish:active {
  transform: scale(0.98);
  opacity: 0.9;
}

/* Финальный экран */
.onboarding-final {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  z-index: 10000003; /* Выше всего */
  background: rgba(0, 0, 0, 0.65);
}

.onboarding-final-content {
  background: #FEF7EC;
  border-radius: 20px;
  padding: 32px 24px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: onboardingFadeIn 0.3s ease;
}

.onboarding-final-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.onboarding-final-title {
  font-size: 22px;
  font-weight: 600;
  color: #3B4F6B;
  margin-bottom: 12px;
}

.onboarding-final-text {
  font-size: 14px;
  line-height: 1.5;
  color: #5A6B7D;
  margin-bottom: 24px;
}

/* Кнопки финального экрана */
.onboarding-final-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.onboarding-btn-secondary {
  width: 100%;
  padding: 12px 20px;
  font-size: 14px;
  background: transparent;
  color: #3C805B;
  border: 2px solid #3C805B;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.onboarding-btn-secondary:hover {
  background: rgba(60, 128, 91, 0.1);
}

.onboarding-btn-secondary:active {
  transform: scale(0.98);
}

.onboarding-btn-finish {
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
}
