/* Hero Section */

:root {
    /* Абсолютные (Красный) */
    --coral: #ff6b6b; 
    --background-coral: rgba(255, 107, 107, 0.05);
    --border-coral: rgba(255, 107, 107, 0.3);
    --icon-background-coral: rgba(255, 107, 107, 0.1);

    /* 🔥 Относительные (Оранжевый / Предупреждение) */
    --orange-dark: #ff9f43; 
    --background-orange: rgba(255, 159, 67, 0.05);
    --border-orange: rgba(255, 159, 67, 0.3);
    --icon-background-orange: rgba(255, 159, 67, 0.1);
}

:root {
    --header-height: 80px; /* Настройте под реальную высоту вашей шапки */
    
}

.hero {
  background: linear-gradient(135deg, var(--background) 0%, var(--secondary-bg) 100%);
  padding: 3rem 0 5rem;
}

.hero-content {
  display: flex;
  justify-content: center;
  gap: 20px;
  align-items: center;
  flex:1;
  
  
}



.hero-image {
  display: flex;
  justify-content: center;
  order: 2;
}

@media (min-width: 1024px) {
  .hero-image {
    justify-content: flex-start;
    order: 1;
  }
}

.hero-image-wrapper {
  position: relative;
  width: 350px;        /* Жестко задаем ширину */
    height: 350px;       /* Жестко задаем высоту */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;    /* Белый фон, если картинка не на весь квадрат */
    border-radius: 12px; /* По желанию */
    margin: 0 auto;
     background: transparent;
}

.hero-image-blur {
  
 
}

.hero-image img {
  position: relative;
  width: 100%;
    height: 100%;
    /* object-fit: contain — сохранит пропорции и впишет картинку целиком */
    /* object-fit: cover — обрежет края, но заполнит весь квадрат (как в соцсетях) */
    object-fit: cover; 
    
    padding: 10px;

  
}

.hero-info {
  order: 1;
}

@media (min-width: 1024px) {
  .hero-info {
    order: 2;
  }
}

.mode-switch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--card);
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 2rem;
  width: fit-content;
  margin-left: auto;
}

.switch {
  position: relative;
  width: 48px;
  height: 24px;
  background: var(--border);
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.3s;
}

.switch.active {
  background: var(--primary);
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}

.switch.active .switch-thumb {
  transform: translateX(24px);
}

.tldr-card {
  background: var(--card);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  border: 2px solid var(--border);
}

.tldr-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.tldr-icon {
  background: rgba(78, 205, 196, 0.1);
  padding: 0.5rem;
  border-radius: 0.5rem;
  flex-shrink: 0;
}

.tldr-icon svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.risk-alert {
  background: rgba(255, 107, 107, 0.1);
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 107, 107, 0.2);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.status-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: var(--secondary-bg);
  border-radius: var(--radius);
  text-align: center;
}

.status-item svg {
  width: 32px;
  height: 32px;
  margin-bottom: 0.5rem;
}


.sidebar-nav {
  position: relative; /* Обязательно для абсолютного позиционирования кнопки */
  background: var(--card);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.sidebar-nav h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.sidebar-nav ul {
  list-style: none;
}

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

.sidebar-nav a {
  display: block;
  padding: 0.75rem 0.5rem;
  border-radius: 0.5rem;
  color: var(--foreground);
  text-decoration: none;
  transition: all 0.2s;
}

.sidebar-nav a:hover {
  background: rgba(78, 205, 196, 0.1);
}

.sidebar-nav a.active {
  background: var(--primary);
  color: white;
  font-weight: 500;
  box-shadow: var(--shadow);
}

.sidebar-toggle-btn {
    position: absolute;
    top: 0.5rem; /* Смещение от верхнего края */
    right: 0.5rem; /* Смещение от правого края */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--muted);
    transition: color 0.2s, transform 0.3s;
    z-index: 11; /* Чтобы кнопка была над содержимым */
}

.sidebar-toggle-btn:hover {
    color: var(--primary);
}

   




/* Sections */
section {
  scroll-margin-top: 6rem;
  margin-bottom: 4rem;
}

.instruction-section,
.indications,
.contraindications,
.dosage,
.clinical-table,
.side-effects,
.timeline-section,
.interactions,
.special,
.storage,
.related-block{
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 5rem;
    margin-bottom: 4rem;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  
}

.section-header svg {
  width: 32px;
  height: 32px;
  color: var(--primary);
  
}

/* ---------------------------------------------------- */
/* 🔥 ИСПРАВЛЕННЫЕ СТИЛИ ДЛЯ ТАБЛИЦЫ (COMPOSITION) */
/* ---------------------------------------------------- */
.card table {
  width: 100% !important; 
  border-collapse: collapse;
  table-layout: fixed; 
}

/* Стили для Заголовка */
.card thead tr {
  border-bottom: 1px solid var(--border); 
}

.card th {
  padding: 1rem 1rem 0.5rem;
  font-weight: 600;
  color: var(--muted); 
  font-size: 0.875rem;
  text-transform: uppercase;
  text-align: left; /* Базовое выравнивание для заголовков */
}

/* Стили для Ячеек */
.card td {
  padding: 1rem 1rem;
  border-bottom: 1px dashed var(--border); 
  vertical-align: middle; 
}

/* Убираем нижнюю границу у последней строки */
.card table tbody tr:last-child td {
    border-bottom: none;
}

/* 🔥 Настройка выравнивания и ширины столбцов */

/* 1. Вещество (Ширина 45%, Выравнивание СЛЕВА) */
.card table th:nth-child(1) {
    text-align: left;
}
.card table td:nth-child(1) {
    width: 60% !important; 
    text-align: left; 
}

/* 2. Количество (Ширина 30%, Выравнивание СПРАВА) */
.card table th:nth-child(2) {
    text-align: right; 
}
.card table td:nth-child(2) {
    width: 15% !important; 
    text-align: right; 
}

/* 3. Тип (Ширина 25%, Выравнивание ПО ЦЕНТРУ) */
.card table th:nth-child(3) {
    text-align: center;
}
.card table td:nth-child(3) {
    width: 25% !important; 
    text-align: center; 
}
/* ---------------------------------------------------- */
/* (Конец стилей таблицы) */
/* ---------------------------------------------------- */


/* Dosage Calculator */
.calculator {
  background: linear-gradient(135deg, var(--card) 0%, rgba(78, 205, 196, 0.05) 100%);
  padding: 2rem;
  border-radius: var(--radius);
  border: 2px solid rgba(78, 205, 196, 0.2);
  box-shadow: var(--shadow-lg);
}

.slider-group {
  margin-bottom: 2rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.slider-value {
  background: var(--secondary-bg);
  padding: 0.25rem 1rem;
  border-radius: 9999px;
  font-size: 1.125rem;
  font-weight: 500;
}

input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: var(--border);
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: var(--shadow);
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow);
}

.dosage-results {
  padding-top: 1.5rem;
  border-top: 2px solid var(--border);
  margin-top: 2rem;
}

.dosage-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 768px) {
  .dosage-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.dosage-card {
  background: var(--card);
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.dosage-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.pills-visual {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.75rem;
}

.pill {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(78, 205, 196, 0.2);
  border: 2px solid var(--primary);
}

.liquid-bar {
  height: 32px;
  background: var(--secondary-bg);
  border-radius: 0.5rem;
  overflow: hidden;
  margin-top: 0.75rem;
  position: relative;
}

.liquid-fill {
  height: 100%;
  background: rgba(78, 205, 196, 0.3);
  transition: width 0.5s ease;
}

/* Side Effects */
.side-effect-item {
  margin-bottom: 1.5rem;
}

.side-effect-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.side-effect-name {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.frequency-bar {
  height: 12px;
  background: var(--secondary-bg);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.frequency-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.5s ease;
}


/* Drug Interaction Checker */
.search-box {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.interaction-card {
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 2px solid;
  margin-bottom: 1rem;
}

.interaction-safe {
  background: rgba(107, 207, 127, 0.05);
  border-color: rgba(107, 207, 127, 0.3);
}

.interaction-caution {
  background: rgba(255, 217, 61, 0.05);
  border-color: rgba(255, 217, 61, 0.3);
}

.interaction-danger {
  background: rgba(255, 107, 107, 0.05);
  border-color: rgba(255, 107, 107, 0.3);
}

/* Mobile Navigation */
.mobile-nav-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  box-shadow: var(--shadow-xl);
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 1024px) {
  .mobile-nav-btn {
    display: none;
  }
}









.mobile-nav-menu a {
  display: block;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  color: var(--foreground);
  text-decoration: none;
  font-size: 1.125rem;
  transition: all 0.2s;
}

.mobile-nav-menu a:hover,
.mobile-nav-menu a.active {
  background: var(--primary);
  color: white;
  font-weight: 600;
  box-shadow: var(--shadow);
}

/* Footer */
footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 4rem;
}
/* ---------------------------------------------------- */
/* 🔥 СТИЛИ ДЛЯ КАРТОЧЕК ПОКАЗАНИЙ (.indication-card) */
/* ---------------------------------------------------- */

.indication-card {
    /* Наследуем базовый padding от .card (1.5rem), но здесь делаем 1.25rem */
    padding: 1.25rem; 
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

/* Эффект при наведении (замена инлайн-скриптов) */
.indication-card:hover {
    box-shadow: var(--shadow-lg);
    /* Можно добавить небольшой сдвиг или масштабирование для лучшего UX */
    transform: translateY(-2px); 
}

/* Принудительный размер для эмодзи/иконки (2.5rem) */
.indication-card .text-4xl {
    font-size: 2.5rem; 
    line-height: 1; /* Убеждаемся, что строка не слишком большая */
}

/* Размер текста заголовка (1.125rem) */
.indication-card .text-lg {
    font-size: 1.125rem; 
}

/* ---------------------------------------------------- */
/* ГЛАВНЫЙ КОНТЕЙНЕР ДЛЯ ИКОНОК */
/* ---------------------------------------------------- */
.indication-icon-lg {
    /* 1. Задаем фиксированный размер контейнера (48x48) */
    width: 50px;
    height: 50px;
    min-width: 50px; /* Гарантируем, что Flexbox не сожмет его */
    
    /* 2. Обеспечиваем центрирование внутреннего контента (SVG или Эмодзи) */
    display: flex;
    align-items: center;
    justify-content: center;
    
    margin-right: 1rem; /* Отступ от текста (например, 16px) */
}

/* ---------------------------------------------------- */
/* СТИЛИ ДЛЯ ВСТАВЛЕННОГО SVG/IMG */
/* ---------------------------------------------------- */
.indication-icon-lg img {
    /* 3. Гарантируем, что изображение впишется в контейнер 48x48 */
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

/* ---------------------------------------------------- */
/* СТИЛИ ДЛЯ ЭМОДЗИ (ТЕКСТА) */
/* ---------------------------------------------------- */
.indication-emoji-lg {
    /* 4. Задаем размер шрифта для эмодзи */
    font-size: 50px; 
    line-height: 1; /* Убираем лишний вертикальный интервал */
}

/* ---------------------------------------------------- */
/* УЛУЧШЕНИЕ: Выравнивание текста */
/* ---------------------------------------------------- */
.indication-card .flex.items-start {
    /* Чтобы текст начинался точно напротив иконки */
    align-items: center;
}

/* ---------------------------------------------------- */
/* 🔥 СТИЛИ ДЛЯ КАРТОЧЕК ПРОТИВОПОКАЗАНИЙ (CONTRAINDICATIONS) */
/* ---------------------------------------------------- */

/* Общие стили для карточки */
.contra-card {
    padding: 1.5rem;
    height: 100%; /* Для ровных колонок в сетке */
}

/* Стили для АБСОЛЮТНЫХ (КРАСНЫЙ) */
.contra-absolute {
    border: 2px solid var(--border-coral);
    background: var(--background-coral);
}
.contra-absolute .contra-icon-wrapper {
    background: var(--icon-background-coral);
}
.contra-list-absolute li::before {
    color: var(--coral); 
}

/* Стили для ОТНОСИТЕЛЬНЫХ (ОРАНЖЕВЫЙ) */
.contra-relative {
    border: 2px solid var(--border-orange);
    background: var(--background-orange);
}
.contra-relative .contra-icon-wrapper {
    background: var(--icon-background-orange);
}
.contra-relative .contra-icon-wrapper svg {
    stroke: var(--orange-dark); /* Переопределяем цвет иконки */
}
.contra-list-relative li::before {
    color: var(--orange-dark); 
}

/* Общие элементы */
.contra-icon-wrapper {
    padding: 0.5rem;
    border-radius: 0.5rem;
    line-height: 1;
}

.contra-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.contra-list li {
    color: var(--muted);
    line-height: 1.8;
    position: relative;
    padding-left: 1rem;
    font-size: 0.9375rem; 
}

/* Общий кастомный маркер */
.contra-list li::before {
    content: "•";
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
    position: absolute; /* Фиксируем позицию */
    top: 0;
    left: 0;
}

/* ---------------------------------------------------- */
/* ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ (Пример, если они не заданы в другом месте) */
/* ---------------------------------------------------- */
:root {
    --primary: #4ECDC4; /* Бирюзовый/зеленый для акцентов (цвет из вашего rgba) */
    --success-color: #38c172; /* Зеленый для успеха/подтверждения */
    --coral: #e3342f; /* Красный/коралловый для предупреждений */
    --card-bg-light: #ffffff; /* Белый фон карточки */
    --border: #e0e0e0; /* Светлая граница */
    --background: #f7f7f7; /* Фон шкалы */
    --muted: #6c757d; /* Приглушенный текст */
    --radius: 8px; /* Радиус скругления */
}

/* ---------------------------------------------------- */
/* ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ (Пример) */
/* ---------------------------------------------------- */
:root {
    --primary: #4ECDC4; /* Бирюзовый/зеленый для акцентов */
    --coral: #e3342f; /* Красный/коралловый для предупреждений */
    --card-bg-light: #ffffff; 
    --border: #e0e0e0; 
    --background: #f7f7f7; 
    --muted: #6c757d; 
    --radius: 8px; 
    --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.05); /* Легкая тень для глубины */
}

/* ---------------------------------------------------- */
/* СТИЛИ ДЛЯ КОМПОНЕНТА DOSAGE (КАЛЬКУЛЯТОР) */
/* ---------------------------------------------------- */

.calculator-card {
    background-color: var(--card-bg-light);
}

.calculator-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.calculator-icon-wrapper {
    background: rgba(78, 205, 196, 0.1); 
    padding: 0.75rem;
    border-radius: var(--radius);
}

.calculator-header h3 {
    margin: 0;
}
.calculator-header p {
    margin: 0;
    font-size: 0.875rem;
}


/* --- ГРУППА СЛАЙДЕРОВ --- */

.slider-group {
    margin-bottom: 1.5rem;
}
.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.slider-header label {
    font-weight: 500;
}
.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.5rem;
}

/* --- РЕЗУЛЬТАТЫ --- */

.dosage-results h4 {
    margin-bottom: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.dosage-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 20px;
}

.dosage-card {
    border: 1px solid var(--border);
    padding: 1.25rem;
    border-radius: var(--radius);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between; 
    transition: box-shadow 0.2s; /* Добавляем легкую анимацию */
}

/* Подсветка карточек при наведении (опционально) */
.dosage-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); 
}

.dosage-type-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.dosage-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
}

.dosage-amount .dosage-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary); 
}
.dosage-amount .text-xl {
    font-size: 1.25rem;
}

/* --- ВИЗУАЛИЗАЦИЯ ТАБЛЕТОК --- */

.pills-visual {
    min-height: 20px; 
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: auto; 
}

.pill {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary); 
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); /* Легкая тень для объема */
}

/* --- ВИЗУАЛИЗАЦИЯ ЧАСТОТЫ (УЛУЧШЕНА) --- */

/* В карточке частоты просто увеличиваем текст, убирая полосу */
#frequencyCard .dosage-amount .dosage-value {
    font-size: 3rem; /* Делаем частоту визуально более значимой */
    color: var(--primary);
}

#frequencyCard .dosage-amount .text-xl {
    font-size: 1.5rem;
}

/* --- ВИЗУАЛИЗАЦИЯ ЖИДКОСТИ (Скрыта) --- */

.liquid-bar-wrapper {
    display: flex;
    align-items: flex-end; 
    justify-content: center;
    gap: 10px;
    height: 60px; 
    margin-top: 1rem;
}

.liquid-bar {
    width: 25px;
    height: 100%;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--background);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.liquid-fill {
    width: 100%;
    background: var(--primary); 
    transition: height 0.3s ease-out;
}

.liquid-max-label {
    font-size: 0.75rem;
    color: var(--muted);
}

/* ---------------------------------------------------- */
/* 🔥 УЛУЧШЕННЫЕ СТИЛИ ДЛЯ ШКАЛЫ МАКСИМАЛЬНОЙ ДОЗЫ */
/* ---------------------------------------------------- */

.max-daily-scale {
    margin-top: 1.5rem;
    padding: 1rem 0;
}

.max-scale-bar-wrapper {
    position: relative;
    padding-top: 5px; 
    padding-bottom: 25px; /* Увеличили для меток */
}

.max-scale-bar {
    width: 100%;
    height: 14px; /* Немного толще для лучшего вида */
    background: var(--background); 
    border-radius: 7px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); /* Внутренняя тень для эффекта "контейнера" */
}

.max-scale-fill {
    height: 100%;
    width: 0%; 
    /* Плавный градиент для современного вида */
    background: linear-gradient(to right, #6ae5dd, var(--primary)); 
    transition: width 0.4s ease-out, background 0.4s ease-out;
    border-radius: 7px;
    /* Небольшая тень, имитирующая объем заполнения */
    box-shadow: 0 1px 5px rgba(78, 205, 196, 0.3); 
}

.max-scale-fill.exceeded {
    /* Градиент с красным акцентом при превышении */
    background: linear-gradient(to right, #ff7e7e, var(--coral)); 
    box-shadow: 0 1px 5px rgba(227, 52, 47, 0.4); 
}

.max-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    font-size: 0.85rem; /* Немного крупнее метки */
}

.max-mg-limit {
    font-weight: 600;
    color: var(--muted);
    /* Придаем максимальному значению акцентный цвет для лучшей заметности */
}


/* --- ПРОЧЕЕ --- */

.hidden {
    display: none !important;
}
/* ---------------------------------------------------- */
/* 🔥 СТИЛИ ДЛЯ ВЫБОРА ДОЗЫ (1 тб / 2 тб) */
/* ---------------------------------------------------- */

.dosage-select-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px; /* Отступ от визуализации таблеток */
}

.dosage-option {
    display: inline-block;
    cursor: pointer;
    border: 1px solid var(--border);
    padding: 8px 15px;
    border-radius: var(--radius);
    transition: all 0.2s;
    font-weight: 600;
    color: var(--muted);
}

.dosage-option input[type="radio"] {
    display: none; /* Скрываем стандартную радиокнопку */
}

/* Стиль при выборе */
.dosage-option input[type="radio"]:checked + span {
    background-color: rgba(78, 205, 196, 0.15); /* Светлый акцентный фон */
    color: var(--primary); 
    border-color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dosage-option:hover {
    border-color: var(--primary);
}

/* ---------------------------------------------------- */
/* 🔥 УЛУЧШЕННЫЕ СТИЛИ ДЛЯ ШКАЛЫ МАКСИМАЛЬНОЙ ДОЗЫ (если не добавили ранее) */
/* ---------------------------------------------------- */

.max-scale-bar {
    width: 100%;
    height: 14px; 
    background: var(--background); 
    border-radius: 7px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); 
}

.max-scale-fill {
    height: 100%;
    width: 0%; 
    background: linear-gradient(to right, #6ae5dd, var(--primary)); 
    transition: width 0.4s ease-out, background 0.4s ease-out;
    border-radius: 7px;
    box-shadow: 0 1px 5px rgba(78, 205, 196, 0.3); 
}

.max-scale-fill.exceeded {
    background: linear-gradient(to right, #ff7e7e, var(--coral)); 
    box-shadow: 0 1px 5px rgba(227, 52, 47, 0.4); 
}

/* Убедимся, что .hidden работает для скрытия элемента tabletsValue */
.hidden {
    display: none !important;
}

/* --- СТИЛИ ДЛЯ БЛОКОВ ПОБОЧНЫХ ЭФФЕКТОВ --- */

.side-effect-system-card {
    padding: 1.5rem;
}

.system-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: #333; /* Темный цвет для заголовка системы */
}

.effect-list {
    display: grid;
    /* Создаем сетку для выравнивания, но можно использовать flex или grid-cols-1 */
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.side-effect-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border); /* Пунктирная линия для разделения */
}

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

.frequency-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

/* --- СТИЛИ ДЛЯ ЛЕГЕНДЫ --- */

.side-effects-legend .legend-grid {
    display: flex;
    flex-wrap: wrap; 
    gap: 1.5rem 1rem; 
}
/* --- ГРАФИК КОНЦЕНТРАЦИИ --- */
.timeline-card {
    padding: 1rem; 
    background: linear-gradient(135deg, var(--card) 0%, rgba(78, 205, 196, 0.05) 100%);
}

.concentration-graph {
    position: relative; 
    height: 200px; 
    background: rgba(78, 205, 196, 0.05); 
    border-radius: var(--radius); 
    padding: 1.5rem; 
    margin-bottom: 4rem; /* Увеличиваем отступ, чтобы вместить карточки таймлайна */
}

.graph-label {
    position: absolute;
    font-size: 0.75rem;
    color: var(--muted);
}

.time-label {
    bottom: 0.5rem; 
    left: 1.5rem; 
}

.concentration-label {
    top: 6rem; 
    left: 0.5rem; 
    transform: rotate(-90deg); 
    transform-origin: left;
}

/* --- ВРЕМЕННАЯ ШКАЛА (Timeline) --- */

.timeline {
  position: relative;
  padding: 2rem 0;
}

.timeline-line {
  position: absolute;
  top: 1.5rem;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--border);
  border-radius: 9999px;
}

.timeline-progress {
  position: absolute;
  top: 1.5rem;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary);
  border-radius: 9999px;
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  max-width: 360px;
}

.timeline-dot {
  position: absolute;
  top: 0;
  width: 24px;
  height: 24px;
  background: var(--primary);
  border-radius: 50%;
  border: 4px solid var(--background);
  box-shadow: var(--shadow-lg);
  z-index: 10;
}

.timeline-card {
  margin-top: 2rem;
  
}

.toggle-button {
    /* Стилизуйте по желанию, чтобы кнопка была видна */
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    /* Расположите ее где-нибудь сверху */
    position: absolute; /* Или относительно шапки */
    top: 2rem;
    left: 1.5rem; 
    z-index: 10;
}







/* ================================================================= */
/* 🔥 БЛОК ПОХОЖИЕ ПРЕПАРАТЫ (.related-block) */
/* ================================================================= */

.related-block {
    margin-top: 4rem; /* Отступ от предыдущего раздела */
    margin-bottom: 4rem;
}

.related-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--foreground); /* Используем основной цвет текста */
}

/* --- Сетка для списка препаратов --- */
.related-list {
    /* 🔥 ИЗМЕНЕНИЕ: Используем Flexbox */
    display: flex; 
    flex-wrap: wrap; /* Разрешаем перенос на новую строку */
    gap: 1rem;
    /* Гарантируем, что элементы прижимаются к левому краю */
    justify-content: flex-start; 
}

@media (min-width: 768px) {
    .related-list {
        gap: 2rem;
    }
}

/* --- Стили для отдельной карточки-ссылки --- */
.related-item {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; 
    text-decoration: none;
    background: var(--card); 
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow); 
    transition: all 0.3s ease;
    
    /* 🔥 ИЗМЕНЕНИЕ: Задаем минимальную ширину и запрещаем растягиваться */
    min-width: 280px; /* Сохраняем минимальный размер */
    flex-grow: 0; /* ЗАПРЕЩАЕМ растягиваться */
    flex-shrink: 1; /* Разрешаем сжиматься, если не хватает места */
    flex-basis: 30%; /* Базовая ширина для 3-х колонок на больших экранах */
    
    /* Убеждаемся, что высота не вызывает проблем, меняем на auto */
    height: auto; 
}

/* Адаптивное поведение: на очень маленьких экранах item занимает всю ширину */
@media (max-width: 600px) {
    .related-item {
        min-width: 100%;
        flex-basis: 100%;
    }
}

.related-item:hover {
    border-color: var(--primary); /* Акцент при наведении */
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1); /* Усиленная тень */
    transform: translateY(-3px); /* Легкий эффект поднятия */
}

.related-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 1rem;
    line-height: 1.4;
    text-align: center;
}

/* --- Стили для изображения --- */
.related-item-img {
    width: 100%;
    height: auto;
    max-height: 200px; /* Ограничиваем высоту для единообразия */
    object-fit: contain; /* Обеспечиваем, что изображение впишется без обрезки */
    margin-top: auto; /* Прижимаем к низу */
    border-radius: var(--radius);
    opacity: 0.9;
    transition: opacity 0.3s;
}

.related-item:hover .related-item-img {
    opacity: 1;
}

.related-item-form {
    font-size: 0.9rem; /* Меньший размер */
    font-weight: 400;
    color: var(--foreground);
    margin-top: -0.5rem; /* Немного приподнимаем к названию */
    margin-bottom: 1rem;
    line-height: 1.3;
    text-align: center;
}

footer {
  width: 100%;
  background: rgb(23, 179, 138);
  background: linear-gradient(
    0deg,
    rgba(23, 179, 138, 1) 0%,
    rgba(0, 118, 119, 1) 100%
  );
  text-align: center;
  padding: 20px 0;
  flex: 0 0 auto;
}

footer p {
  color: #ffffff;
}

@media screen and (max-width: 551px) {
  footer {
    padding: 8px 0;
  }
}
   
 @font-face {
    font-family: 'Attentica';
    src: url('/assets/fonts/Attentica.woff2') format('woff2'),
         url('/assets/fonts/Attentica.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
    .warning-block {
    font-family: 'Attentica', Arial, sans-serif;
    font-size: 40px;
    color: #b3b3b3;
    text-align: center;
    margin: 20px 0;
    padding: 0 10px;
    text-transform: uppercase;
    font-weight: 500;
}

    /* Адаптивность для маленьких экранов (до 768px) */
    @media (max-width: 768px) {
        .warning-block {
            font-size: 14px; /* Уменьшаем шрифт */
            margin: 15px 0; /* Уменьшаем внешние отступы */
        }
    }

    /* Адаптивность для очень маленьких экранов (до 480px) */
    @media (max-width: 480px) {
        .warning-block {
            font-size: 12px; /* Ещё меньше шрифт для компактности */
            margin: 10px 0; /* Минимальные отступы */
        }
}
}

.warning-block {
        font-family: 'Attentica', Arial, sans-serif;
        font-size: 20px; /* Базовый размер шрифта */
        color: #b3b3b3; /* Серый цвет текста */
        text-align: center;
        margin: 20px 0;
        padding: 0 10px; /* Небольшие отступы внутри для адаптивности */
        text-transform: uppercase;
        font-weight: 300;
    }

    /* Адаптивность для маленьких экранов (до 768px) */
    @media (max-width: 768px) {
        .warning-block {
            font-size: 20px; /* Уменьшаем шрифт */
            margin: 15px 0; /* Уменьшаем внешние отступы */
        }
    }

    /* Адаптивность для очень маленьких экранов (до 480px) */
    @media (max-width: 480px) {
        .warning-block {
            font-size: 15px; /* Ещё меньше шрифт для компактности */
            margin: 10px 0; /* Минимальные отступы */
        }
}

/* 🔥 СТИЛИ ДЛЯ КНОПКИ "НАВЕРХ" */
/* ================================================================= */
.scroll-to-top-btn {
    position: fixed;
    bottom: 1.5rem; /* Отступ от нижнего края */
    right: 1.5rem; /* Отступ от правого края */
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary); /* Используем ваш акцентный цвет */
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-xl); /* Используем большую тень */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0; /* Скрываем по умолчанию */
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 900; /* Убедимся, что она выше контента */
}

/* Класс для показа кнопки */
.scroll-to-top-btn.show {
    opacity: 1;
    visibility: visible;
}
/* ================================================================= */
/* 🔥 1. ФИКСИРОВАННАЯ ШАПКА (.app-header) */
/* ================================================================= */
.app-header {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 70px; /* Фиксированная высота */
    /* Ваш градиентный фон */
    background: linear-gradient(0deg, rgba(23, 179, 138, 1) 0%, rgba(0, 118, 119, 1) 100%); 
    border-bottom: 1px solid var(--border, #e0e0e0);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.2)); 
    z-index: 1000; 
    
    display: flex;
    align-items: center;
    /* Разделяем группу лого+поиск и переключатель режимов */
    justify-content: space-between; 
    padding: 0 1.5rem;
}

/* --- ГРУППА: ЛОГОТИП + ПОИСК (.logo-search-group) --- */
.logo-search-group {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1; 
    padding-right: 2rem; 
}

/* --- Логотип --- */
.site-logo {
    display: flex;
    align-items: center;
    /* Отступ справа от картинки, чтобы отделить ее от поиска */
    padding-right: 1rem; 
}

.site-logo img {
    height: 50px; 
    width: auto;
    /* Добавляем небольшой отступ, чтобы картинка не прилипала к поиску */
    margin-right: 1rem; 
}

/* --- Поиск (.search-area) --- */
.search-area {
    /* Обеспечиваем, что поиск занимает большую часть места в группе */
    flex-grow: 1; 
    max-width: 600px;
    margin: 0;
    position: relative;
}

.header-search-form {
    display: flex;
    /* Белый фон для контраста с градиентом */
    background: #ffffff; 
    border: none;
    border-radius: var(--radius, 8px);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-search-input {
    flex-grow: 1;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    outline: none;
    background: transparent;
    color: #333;
}

.search-button {
    /* Используем акцентный цвет градиента */
    background: rgba(23, 179, 138, 1); 
    color: white;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.search-button svg {
    stroke: white;
}

/* --- Переключатель режимов (.mode-switcher) --- */
.mode-switcher {
    display: flex;
    /* Белый фон для контраста */
    background: var(--card, #ffffff); 
    border: 1px solid var(--border, #ccc);
    border-radius: var(--radius, 8px);
    overflow: hidden;
    /* Прижимаем к правому краю */
    margin-left: auto; 
}

.mode-btn {
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    background: transparent; 
    color: var(--muted-foreground, #555);
    transition: all 0.2s;
}

.mode-btn.active {
    /* Активная кнопка: используем цвет градиента */
    background: rgba(0, 118, 119, 1); 
    color: white;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}


/* ================================================================= */
/* 🔥 2. КОРРЕКЦИЯ МАКЕТА ПОД ФИКСИРОВАННУЮ ШАПКУ */
/* ================================================================= */

/* Сдвигаем Sidebar вниз на высоту шапки */
.sidebar {
    top: 70px !important; 
    height: calc(100vh - 70px) !important;
}




/* --- Адаптация для мобильных --- */
@media (max-width: 768px) {
    .app-header {
        height: 60px;
        padding: 0 1rem;
        /* Сжимаем элементы на мобильных */
        justify-content: space-between;
    }
    
    .logo-search-group {
        /* На мобильных разрешаем группе занимать только минимальное место */
        flex-grow: 0;
    }
    .search-area {
        display: none; /* Скрываем поиск на мобильных */
    }
    .site-logo {
        padding-right: 0;
        margin-right: 0;
    }
    .sidebar {
        top: 60px !important;
        height: calc(100vh - 60px) !important;
    }
    .main-layout {
        padding-top: 60px;
    }
}
.search-results-dropdown {
    /* 🔥 Скрываем контейнер по умолчанию */
    display: none; 
    
    position: absolute;
    /* Позиционируем относительно .search-area (родитель) */
    top: 55px; 
    left: 0; 
    width: 100%;
    max-height: 400px; 
    overflow-y: auto;
    background: var(--card, #ffffff); 
    border: 1px solid var(--border, #ccc);
    border-top: none; 
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-xl);
    z-index: 1001; 
    padding: 0.5rem 0;
}

.result-item a {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--foreground);
}
.result-item a:hover {
    background: var(--hover-background, #f5f5f5);
}
.result-item img {
    margin-right: 10px;
    border-radius: 4px;
}
.no-results, .search-error {
    padding: 0.5rem 1rem;
    color: var(--muted-foreground);
    font-style: italic;
}
/* ================================================================= */
/* 🔥 СТИЛИ ДЛЯ КНОПКИ ОЧИСТКИ (.clear-search-btn) */
/* ================================================================= */

.clear-search-btn {
    /* Сбрасываем стили кнопки по умолчанию */
    background: transparent;
    border: none;
    cursor: pointer;
    /* Размещаем кнопку между полем ввода и кнопкой поиска */
    padding: 0 0.5rem; 
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    
    /* Цвет крестика */
    color: var(--muted-foreground, #888); 
    transition: color 0.2s;
    
    /* Скрываем по умолчанию (для визуального контроля, JS будет управлять видимостью) */
    display: none; 
}

.clear-search-btn:hover {
    color: var(--foreground, #333);
}

.clear-search-btn svg {
    stroke: currentColor; /* Используем цвет родителя */
}

/* --- Коррекция формы (если необходимо) --- */
.header-search-form {
    /* Убедимся, что все элементы выровнены */
    align-items: center; 
}
/* 🔥 Скрываем весь контент для врачей по умолчанию (когда body не имеет класса .mode-doctor) */
.clinical-data {
    display: none;
}

/* Показываем контент, только когда body имеет класс .mode-doctor */
body.mode-doctor .clinical-data {
    display: block;
    
}

/* ---------------------------------------------------------------- */
/* Пример: Скрытие упрощенного объяснения для пациентов в режиме врача */
/* ---------------------------------------------------------------- */

/* Предположим, у вас есть блок с ID "patient-simplified-text" */
body.mode-doctor #patient-simplified-text {
    display: none;
}
/* ================================================================= */
/* 1. Условное отображение для режима врача */
/* ================================================================= */
/* Секция видна только если body имеет класс mode-doctor. */
.clinical-data {
    display: none;
}
body.mode-doctor .clinical-data {
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 0 5rem;
    margin-bottom: 50px;
}

/* ================================================================= */
/* 2. СТИЛИ ДЛЯ СПРАВОЧНЫХ ДАННЫХ ВРАЧА (.reference-grid) */
/* ================================================================= */

.reference-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Две колонки */
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.reference-grid .grid-item {
    background: var(--card-light, #f5f5f5);
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid var(--border-light, #eee);
}
.reference-grid strong {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--text-dark, #333);
    font-size: 1.05rem;
}
.reference-grid p { margin: 0; font-size: 0.9rem; }
.reference-grid .full-width { grid-column: 1 / -1; } /* Элемент во всю ширину */

/* АТХ Код */
.atc-code-tag {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.2rem 0.5rem;
    background: rgba(23, 179, 138, 0.2); 
    color: rgba(0, 118, 119, 1);
    font-weight: 700;
    border-radius: 3px;
    font-size: 0.85rem;
}

/* Латинский рецепт */
.latin-recipe-code {
    background: #fdfdfd;
    border-left: 3px solid var(--primary, #007bff);
    padding: 1.5rem 1rem;
    margin: 0;
    white-space: pre-wrap; 
    font-family: monospace;
    font-size: 1.5rem;
    line-height: 1.5rem;
}

/* ================================================================= */
/* 3. СТИЛИ ДЛЯ ИНДИКАТОРОВ СТАТУСА (Rx/OTC, ЖНВЛП) */
/* ================================================================= */
.badge-container { display: flex; gap: 8px; margin-top: 8px; }
.badge {
    padding: 4px 10px; border-radius: 20px; font-size: 0.75rem;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-rx { background-color: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.badge-otc { background-color: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.badge-jnvlp { background-color: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }

.dosage-table {
    width: 100%;
    border-collapse: collapse; /* Убираем двойные границы */
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.dosage-table thead th {
    background-color: #007677; /* Основной цвет */
    color: white;
    padding: 10px 15px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #007677; /* Граница для заголовков */
}

.dosage-table tbody td {
    padding: 12px 15px;
    /* 🔥 ЭТО ВАЖНО: четкая граница для каждой ячейки */
    border: 1px solid var(--border-light, #ddd); 
    vertical-align: top;
}

.dosage-table tbody tr:nth-child(even) {
    background-color: var(--card-light, #f8f8f8); 
}
.hidden-content {
    display: none;
}
/* ---------------------------------------------------- */
/* 1. СТИЛИ ДЛЯ КНОПКИ-ПЕРЕКЛЮЧАТЕЛЯ (.toggle-button) */
/* ---------------------------------------------------- */
.togglebutton {
    /* Базовый макет и вид */
    display: flex;
    align-items: center;
    justify-content: space-between; /* Размещает текст слева, иконку справа */
    width: 50%;
   
    
    /* Отступы и фон */
    padding: 12px 18px; 
    margin: 15px 0 0; /* Отступ сверху от предыдущей таблицы */
    
    /* Оформление */
    background-color: var(--color-light-gray, #f7f7f7); /* Светлый фон */
    border: 1px solid var(--color-border, #e0e0e0);
    border-radius: var(--border-radius-sm, 8px); /* Скругленные углы */
    
    /* Текст */
    font-weight: 600; /* Полужирный текст */
    font-size: 16px;
    color: var(--color-primary-text, #333);
    text-align: left; /* Важно для мобильных устройств */
    
    /* Взаимодействие */
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Эффект при наведении */
.togglebutton:hover {
    background-color: var(--color-hover-light, #ededed);
    border-color: var(--color-hover-border, #d0d0d0);
}

/* ---------------------------------------------------- */
/* 2. СТИЛИ ДЛЯ ИКОНКИ (ШЕВРОН) */
/* ---------------------------------------------------- */
.chevron {
    width: 20px;
    height: 20px;
    margin-left: 10px;
    /* Цвет иконки можно наследовать или задать явно */
    stroke: currentColor; 
    
    /* Анимация вращения */
    transition: transform 0.3s ease;
}

/* Поворот иконки на 180 градусов при раскрытии (aria-expanded="true" устанавливается JS) */
.togglebutton[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}

/* ---------------------------------------------------- */
/* 3. СТИЛИ ДЛЯ СКРЫТОГО КОНТЕНТА (.hidden-content) */
/* ---------------------------------------------------- */
.hidden-content {
    /* 🔥 КЛЮЧЕВОЙ СТИЛЬ: Скрывает блок по умолчанию */
    display: none; 
    
    /* Отступы, чтобы отделить от кнопки и следующего элемента */
    margin-top: 15px; 
    padding: 0;
}

/* Если в вашем JS используется класс 'active' или что-то другое для показа,
   замените его здесь, но использование 'display: none' и toggle/remove
   класса 'hidden-content' в JS является стандартной практикой. */
.hidden-content.visible {
    display: block;
}
/* ---------------------------------------------------- */
/* 1. КОНТЕЙНЕР ДЛЯ ГОРИЗОНТАЛЬНОГО РЯДА */
/* ---------------------------------------------------- */
/* Оберните цикл в контейнер с классом .timeline-items-container */
.timeline-container {
    display: flex;
    justify-content: center;
    overflow-x: auto; 
    /* 🔥 КЛЮЧ: Обеспечивает одинаковую высоту всех элементов в ряду */
    align-items: stretch; 
    gap: 20px; /* Расстояние между карточками */
    padding-top: 35px;
    
    
    
}

/* ---------------------------------------------------- */
/* 2. СТИЛИ ДЛЯ ОТДЕЛЬНОЙ КАРТОЧКИ В РЯДУ */
/* ---------------------------------------------------- */
.timeline-item-horizontal {
   
    flex-shrink: 0; 
    width: 250px; 
   
    
}

/* ---------------------------------------------------- */
/* 3. Стили для карточек внутри (если они конфликтуют) */
/* ---------------------------------------------------- */
/* Убедитесь, что внутренние стили не мешают Flexbox */
.timeline-item-horizontal .timeline-card.card {
    width: 100%; /* Карточка занимает всю ширину .timeline-item-horizontal */
    height: 100%;
    margin: 0; /* Убираем маржины */
}



/* 2. ИСПРАВЛЯЕМ Z-INDEX ДЛЯ ГЕРОЙ-СЕКЦИИ (КАРТИНКИ) */
.hero-image-wrapper {
    position: relative;
    z-index: 1; /* Самый низкий приоритет */
}

.hero-image img {
    position: relative;
    z-index: 1;
}








/* КНОПКА ВЫЗОВА МЕНЮ */
.mobile-nav-btn {
    z-index: 222001; /* Еще выше, чтобы кнопку всегда было видно */
}

/* ЧТОБЫ КОНТЕНТ НЕ ПЕРЕКРЫВАЛСЯ ФИКСИРОВАННОЙ КНОПКОЙ ВНИЗУ */
body {
    padding-bottom: 80px; /* Резервируем место под кнопку вызова меню на мобилках */
}

@media (min-width: 1024px) {
    body {
        padding-bottom: 0;
    }
}



















/* 3. Оверлей */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999998;
    display: none;
    transition: 0.3s;
}
.mobile-overlay.active {
    display: block;
}



/* Кнопка открытия на мобильных */
#mobileNavBtnnew {
    display: none; /* Скрыта на ПК */
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 65px;
    height: 65px;
    background: var(--primary, #17b38a);
    color: white;
    border-radius: 50%;
    border: none;
    z-index: 999999; /* Выше всего контента */
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    cursor: pointer;
    font-weight: bold;
    /* Центрирование текста внутри */
    align-items: center;
    justify-content: center;
    pointer-events: all !important; /* Разрешает клики */
}



    /* Переменные для легкой правки */
:root {
    --header-h: 70px; /* Укажи тут реальную высоту своей шапки */
    --side-w: 300px;
}

/* 1. ГЛАВНЫЙ КОНТЕЙНЕР */




@media (min-width: 1024px) {
    #sidebar {
        /* ГАРАНТИРУЕМ БАЗОВЫЕ СВОЙСТВА ДЛЯ АНИМАЦИИ */
        display: block !important;
        overflow: hidden; /* Важно: чтобы контент не вылезал при сужении */
        width: 300px !important;
        min-width: 300px !important;
        opacity: 1;
        visibility: visible;
        
        /* ПЛАВНОСТЬ: анимируем всё сразу */
        transition: 
            width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
            min-width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.3s ease,
            margin 0.4s ease,
            padding 0.4s ease !important;
    }

   

    /* Плавное появление кнопки открытия */
    #sidebarOpenBtn {
        opacity: 0;
        visibility: hidden;
        transform: translateX(-20px);
        transition: all 0.3s ease-out;
    }

    /* Когда сайдбар скрыт, кнопка вылетает слева */
    #sidebar.collapsed ~ #sidebarOpenBtn {
        display: flex !important;
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }
    #sidebar.collapsed {
        width: 0 !important;
        margin-left: -300px; /* Сдвигаем его за край */
        padding: 0;
        overflow: hidden;
        visibility: hidden;
        opacity: 0;
    }
}

:root {
    --h-height: 70px; /* Высота шапки */
    --sb-width: 300px; /* Ширина меню */
}







/* Кнопка Вверх */
.scroll-to-top-btn {
    position: fixed; bottom: 20px; right: 20px; z-index: 9999;
    width: 45px; height: 45px; background: #333; color: white;
    border: none; border-radius: 50%; cursor: pointer;
    opacity: 0; visibility: hidden; transition: 0.3s;
}
.scroll-to-top-btn.visible { opacity: 1; visibility: visible; }

:root {
    --header-h: 70px;
    --sidebar-w: 300px;
    --accent: #4ECDC4;
}

.app-wrapper {
    display: flex !important;
    flex-direction: row; /* Сайдбар и контент в ряд */
    min-height: 100vh;
    width: 100%;
    margin-top: var(--header-h);
}

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
}

/* САЙДБАР БЕЗ ЗАЗОРОВ */
#sidebar {
    width: var(--sidebar-w) !important;
    min-width: var(--sidebar-w) !important;
    background: #fff;
    border-right: 1px solid #eee;
    position: sticky !important;
    top: var(--header-h) !important;
    height: calc(100vh - var(--header-h)) !important;
    z-index: 100;
    
    /* Анимация задвигания */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}



/* КОНТЕНТНАЯ ЧАСТЬ */
.content-wrapper {
    
   
    width: 100%;    /* Занимает всю оставшуюся ширину */
    min-width: 0;   /* Критически важно для flex-элементов */
    display: flex;
    flex-direction: column; /* Элементы внутри пойдут сверху вниз */
    justify-content: center;
}

.main-content {
    display: flex;
    flex-direction: column; /* Элементы внутри (hero, текст) встанут в колонку */
    width: 100%;
    padding: 20px;
}

/* Стили для Hero и других блоков, чтобы они не сужались */
.main-content > * {
    width: 100%;
    display: block;
}

/* КНОПКА ОТКРЫТИЯ (выезжает, когда меню спрятано) */
#sidebarOpenBtn {
    display: none;
    position: fixed;
    left: 0;
    top: calc(var(--header-h) + 20px);
    z-index: 101;
    background: var(--accent);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    
    transform: translateX(-100%);
    transition: transform 0.3s ease-out 0.2s; /* Задержка, чтобы меню успело уйти */
}

#sidebar.collapsed ~ #sidebarOpenBtn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    transform: translateX(0);
}

/* МОБИЛКА (без изменений логики, только фикс зазоров) */
@media (max-width: 1023px) {
    
    
    .bottom-sheet-handle {
        width: 40px;
        height: 5px;
        background-color: #d1d1d1;
        border-radius: 10px;
        margin: 5px auto 15px auto;
        cursor: grab;
        touch-action: none;
        pointer-events: auto;
    }
    .sidebar-nav {
        overflow-y: auto; /* Прокрутка только внутри списка */
        padding: 0 20px 40px 20px;
        -webkit-overflow-scrolling: touch; /* Плавный скролл на iOS */
        max-height: calc(100vh - 80px);
        pointer-events: auto;
    }

    .nav-link {
        padding: 15px 0;
        border-bottom: 1px solid #f5f5f5;
        font-size: 1.1rem;
        display: block;
    }
    #sidebar.active { transform: translateY(0) !important; }
}

@media (max-width: 1023px) {
    .app-wrapper {
        flex-direction: column; /* На мобилках контент под шапкой */
    }
    body.menu-open #page-content {
        transform: scale(0.94) translateY(12px);
        border-radius: 24px;
        overflow: hidden;
        
        transform: perspective(1000px) rotateX(2deg) scale(0.98) translateY(10px);
    }
}

/* Timeline */
.timeline {
  position: relative;
  padding: 2rem 0;
}

.timeline-line {
  position: absolute;
  top: 1.5rem;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--border);
  border-radius: 9999px;
}

.timeline-progress {
  position: absolute;
  top: 1.5rem;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary);
  border-radius: 9999px;
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-dot {
  position: absolute;
  top: 0;
  width: 24px;
  height: 24px;
  background: var(--primary);
  border-radius: 50%;
  border: 4px solid var(--background);
  box-shadow: var(--shadow-lg);
  z-index: 10;
}

.timeline-card {
  margin-top: 2rem;
  width: auto;
  height: 120px;
}
.timeline-items-wrapper{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

/* Цвет фона body будет виден по краям при уменьшении сайта */
body.mode-doctor, body.mode-patient {
    background-color: #ffff; /* Черный фон для эффекта глубины */
    
}

#page-content {
    
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                border-radius 0.4s ease;
    transform-origin: center top;
    min-height: 100vh;
}
/* ================================================================= */
/* 📱 GLOBAL MOBILE ADAPTATION (ULTIMATE FIX) */
/* ================================================================= */

@media (max-width: 1023px) {
    /* Фикс №1: Убираем горизонтальный скролл всей страницы */
    html, body {
        overflow-x: hidden;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* Фикс №2: Контейнер теперь занимает всю ширину, но с мягкими отступами */
    .app-wrapper, .content-wrapper, .main-content {
        width: 100% !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important; /* Убираем flex, который может сжимать */
    }

    /* 1. Секции: выравниваем по центру с адекватными полями */
    .instruction-section, .indications, .contraindications, .dosage, 
    .clinical-table, .side-effects, .timeline-section, .interactions, 
    .special, .storage, .related-block, .clinical-data {
        padding: 0 15px !important; /* Поля справа и слева */
        margin-left: auto !important;
        margin-right: auto !important;
        width: 100% !important;
        box-sizing: border-box; /* Важно, чтобы padding не расширял блок */
    }

    /* 2. Hero-секция: картинка на всю ширину */
    .hero-content {
        flex-direction: column !important;
        padding: 20px 15px !important;
    }
    .hero-image-wrapper { 
        width: 100% !important; 
        max-width: 320px !important; 
        margin-bottom: 20px !important;
    }

    /* 3. Таблицы: ТЕПЕРЬ НЕ РАСПИРАЮТ ЭКРАН */
    .card, .table-container {
        width: 100% !important;
        overflow-x: auto !important; /* Скролл только внутри таблицы */
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }
    /* Сама таблица внутри может быть широкой, но контейнер её удержит */
    .dosage-table, .card table {
        min-width: 500px; 
    }

    /* 4. Таймлайн: делаем его полностью прокручиваемым вбок, не ломая сайт */
    .timeline-section {
        overflow-x: hidden !important;
    }
    .timeline-items-wrapper {
        display: flex !important;
        overflow-x: auto !important;
        padding-bottom: 20px;
        gap: 15px !important;
        scroll-snap-type: x mandatory;
    }
    .timeline-item-horizontal {
        min-width: 260px !important; /* Карточки не сжимаются меньше этого */
        scroll-snap-align: center;
    }

    /* 5. Убираем эффект сужения страницы при открытом меню, если он мешает */
    body.menu-open #page-content {
        transform: none !important; /* Если сайт слишком узкий, лучше отключить масштаб */
        
    }
}

@media (max-width: 1023px) {
    /* 0. ГЛОБАЛЬНЫЙ СБРОС: запрещаем всему вылезать за края */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        position: relative;
    }

    /* 1. ПЕРВЫЙ БЛОК (Hero): картинка сверху, текст снизу */
    .hero-content {
        display: flex !important;
        flex-direction: column !important; /* Стек в колонку */
        align-items: center !important;
        text-align: center !important;
        padding: 20px 10px !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    .hero-image {
        order: -1 !important; /* Гарантирует картинку сверху */
        width: 100% !important;
        max-width: 280px !important; /* Чтобы не была огромной */
        
    }

    .hero-text {
        width: 100% !important;
    }

    /* 2. БЛОКИ: СОСТАВ, РЕЦЕПТ, СХЕМЫ, ЧЕКЕР */
    /* Заставляем все "карточки" не превышать ширину экрана */
    .card, .composition-block, .checker-container, .recipe-block, .dosage-schemes {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 15px !important;
        box-sizing: border-box !important;
        overflow-wrap: break-word !important; /* Перенос длинных слов */
    }

    /* 3. РЕЦЕПТ НА ЛАТИНСКОМ */
    .latin-recipe-code {
        font-size: 0.9rem !important; /* Уменьшаем шрифт */
        white-space: pre-wrap !important; /* Перенос строк */
        word-break: break-all !important;
        width: 100% !important;
    }

    /* 4. ТАЙМЛАЙН (Фармакокинетический) */
    /* Вместо того чтобы ломать верстку, делаем его листаемым вбок */
    .timeline-container {
        width: 100% !important;
        overflow-x: auto !important; /* Горизонтальный скролл внутри блока */
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }

    .timeline-items-wrapper {
        display: flex !important;
        min-width: 600px; /* Сохраняем структуру таймлайна, но внутри скролла */
    }

    /* 5. ТАБЛИЦЫ И СХЕМЫ ДОЗИРОВАНИЯ */
    /* Чтобы таблицы не сжимались в кашу, даем им скролл */
    .dosage-table-wrapper, .table-responsive {
        width: 100% !important;
        overflow-x: auto !important;
        margin-top: 10px;
    }

    table {
        min-width: 450px; /* Минимальный порог читаемости */
    }

    /* 6. ЧЕКЕР СОВМЕСТИМОСТИ */
    .compatibility-grid {
        grid-template-columns: 1fr !important; /* Все элементы в одну колонку */
        gap: 10px !important;
    }
}

@media (min-width: 1024px) {
    #sidebar {
        display: block !important;
        width: var(--sidebar-w) !important;
        min-width: var(--sidebar-w) !important;
        background: #fff;
        border-right: 1px solid #eee;
        position: sticky !important;
        top: var(--header-h) !important;
        height: calc(100vh - var(--header-h)) !important;
        z-index: 100;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                    margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.3s ease !important;
    }

    /* Состояние "Свернуто" */
    #sidebar.collapsed {
        margin-left: calc(var(--sidebar-w) * -1) !important;
        opacity: 0;
        pointer-events: none;
    }

    /* Кнопка открытия (выезжает слева) */
    #sidebarOpenBtn {
        display: none;
        position: fixed;
        left: 0;
        top: calc(var(--header-h) + 20px);
        z-index: 101;
        background: var(--accent);
        color: white;
        border: none;
        width: 40px;
        height: 40px;
        border-radius: 0 8px 8px 0;
        cursor: pointer;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        transform: translateX(-100%);
        transition: transform 0.3s ease-out 0.2s;
    }

    #sidebar.collapsed ~ #sidebarOpenBtn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        transform: translateX(0);
    }

    .mobile-nav-btn, .mobile-overlay { display: none !important; }
}

/* ================================================================= */
/* 📱 MOBILE BOTTOM SHEET ( < 1024px) */
/* ================================================================= */
@media (max-width: 1023px) {
    /* Основной контейнер страницы, который сужается */
    #page-content {
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        transform-origin: center top;
    }

    body.menu-open #page-content {
        transform: scale(0.94) translateY(15px) !important;
        border-radius: 20px;
        pointer-events: none; /* Чтобы нельзя было кликать по контенту */
    }
    
    body.menu-open {
    position: fixed;
    overflow: hidden;
    width: 100%;
    touch-action: pan-y;
}

    /* САЙДБАР-ШТОРКА */
    #sidebar {
        display: flex !important; /* Всегда flex для структуры */
        flex-direction: column;
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100vh !important; 
        max-height: 100vh !important;
        background: #ffffff !important;
        
        /* Слой выше всего на свете */
        z-index: 999999 !important; 
        
        /* Скругление только сверху */
        border-radius: 24px 24px 0 0 !important;
        box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.2);

        /* Начальное состояние: спрятано за нижним краем */
        transform: translateY(100%) !important;
        visibility: hidden !important;
        transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.4s !important;
       
        border-radius: 24px 24px 0 0 !important; /* Сильное скругление сверху */
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15) !important;
        padding-top: 12px; /* Место для хвостика */
        /* Анимация */
        transform: translateY(100vh);
        transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        display: flex;
        flex-direction: column;
        touch-action: pan-y; /* Позволяет браузеру обрабатывать вертикальную прокрутку */
        will-change: transform; /* Оптимизация производительности анимации */

    }

    /* Состояние когда меню АКТИВНО */
    #sidebar.active {
        transform: translateY(0);
        visibility: visible !important;
    }

    /* Оверлей (затемнение) */
    .mobile-overlay {
        position: fixed !important;
        inset: 0 !important;
        background: rgba(0, 0, 0, 0.6) !important;
        z-index: 999998 !important; /* Чуть ниже сайдбара */
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: auto;
    }

    .mobile-overlay.active {
        display: block !important;
        opacity: 1 !important;
    }
    
   
}

@media (max-width: 1023px) {
    /* 1. Глобальное уменьшение шрифта для всей страницы */
    html {
        font-size: 14px; /* База, от которой считаются rem */
    }

    body {
        line-height: 1.4; /* Чуть плотнее межстрочный интервал */
    }

    /* 2. Заголовки: делаем их компактнее */
    h1 { font-size: 1.9rem !important; margin-bottom: 1rem !important; }
    h2 { font-size: 1.4rem !important; margin-top: 1.5rem !important; }
    h3 { font-size: 1.2rem !important; }

    /* 3. Текстовые блоки и карточки */
    p, li, .card-text {
        font-size: 1.1rem !important;
        margin-bottom: 0.8rem !important;
    }

    /* 4. Специальные блоки (Рецепт, Состав) */
    .latin-recipe-code, 
    .composition-list, 
    .dosage-table td {
        font-size: 0.8rem !important; /* Еще мельче для технических данных */
    }

    /* 5. Таймлайн и Чекер (Текст внутри элементов) */
    .timeline-item-title, 
    .checker-result-text {
        font-size: 0.85rem !important;
        line-height: 1.2 !important;
    }

    /* 6. Кнопки */
    .btn, .mobile-nav-btn {
        font-size: 0.9rem !important;
        padding: 10px 16px !important;
    }
}

@media (max-width: 1023px) {
    /* Контейнер состава */
    #composition .card {
        padding: 10px !important;
        overflow-x: auto !important; /* Включаем горизонтальный скролл если не влезет */
    }

    /* Заголовки внутри карточки (Действующее вещество) */
    #composition h3 {
        font-size: 1.1rem !important;
        margin-top: 15px !important;
        margin-bottom: 10px !important;
    }

    /* Таблица состава */
    #composition table {
        width: 100% !important;
        min-width: 300px; /* Минимальный порог */
        border-collapse: collapse;
    }

    /* Уменьшаем шрифт во всей таблице состава */
    #composition td, 
    #composition th {
        font-size: 0.95rem !important; /* Маленький шрифт для данных */
        padding: 8px 4px !important; /* Компактные отступы */
    }

    /* Специфические колонки */
    .composition-name {
        width: 45%; /* Даем больше места названию */
        line-height: 1.2;
        /* ВКЛЮЧАЕМ УМНЫЕ ПЕРЕНОСЫ */
        hyphens: auto;              /* Разрешает браузеру использовать словари переносов */
        -webkit-hyphens: auto;
        
        /* ЗАЩИТА ОТ ВЫЛЕТОВ */
        overflow-wrap: break-word;  /* Переносит длинные слова на новую строку */
        word-wrap: break-word;
        
        /* ВАЖНО: Убираем принудительный разрыв букв, 
           чтобы "Аспирин" не превратился в "Асп-ирин" */
        word-break: normal !important;
    }

    .composition-amount {
        width: 30%;
        white-space: nowrap; /* Чтобы "10 мг" не разрывало */
    }

    /* Бейджи (Тип: действующее/вспомогательное) */
    .badge {
        font-size: 0.7rem !important; /* Очень мелкий шрифт для бейджа */
        padding: 2px 6px !important;
        white-space: nowrap;
    }

    /* Кнопка "Показать вспомогательные вещества" */
    .togglebutton {
        width: 100% !important;
        font-size: 0.9rem !important;
        padding: 12px !important;
        justify-content: space-between;
        display: flex;
        align-items: center;
    }
    
    .timeline-time,
    .timeline-label-text{
        font-size: 16px;
    }
    /* Предположим, обертка карточек имеет Flex */
    .timeline-items-wrapper {
        display: grid !important;
        grid-template-columns: repeat(1, 1fr) !important; 
        gap: 12px !important; 
        width: 100% !important;
        
        /* Центрируем саму сетку, если она уже экрана */
        justify-content: center !important; 
        /* Выравниваем элементы по высоте (делаем их ровными) */
        align-items: stretch !important; 
        
        box-sizing: border-box;
        padding: 0 5px !important;
        overflow-x: hidden !important; /* Убираем саму возможность скролла */
        overflow-y: visible !important;
        -webkit-overflow-scrolling: auto; /* Отключаем инерционный скролл */
    }

    .timeline-card {
        /* Гарантируем, что карточки одной высоты в ряду */
        display: flex !important;
        flex-direction: column !important;
        
        /* Центрируем содержимое внутри карточки */
        align-items: center !important; 
        text-align: center !important;
        
        height: auto;
        border: 1px solid #eee;
        border-radius: 12px;
        
    }

    /* Если карточка одна в ряду (нечетная), центрируем её */
    .timeline-card:last-child:nth-child(odd) {
        grid-column: 1 / span 2; /* Растягиваем на 2 колонки */
        justify-self: center !important; /* Центрируем саму карточку */
        width: calc(100% - 20px) !important; /* Делаем чуть уже, чтобы не прилипала */
    }
    
    .concentration-graph{
        margin-bottom: 1rem;
    }
    .timeline-container{
       overflow-x: hidden !important; /* Убираем саму возможность скролла */
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .scroll-to-top-btn{
        display: none;
    }
    .hero-image{
        margin-top: 1.3rem;
    }
    .section-header h2{
        margin-top: 0 !important;
    }
    section{
        margin-bottom: 1.5rem;
    }
    .checker-container, .compatibility-grid {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important; /* Чекер не должен скроллиться вбок, он должен быть в колонку */
    }

    .compatibility-item {
        width: 100% !important;
        box-sizing: border-box;
        word-break: break-word; /* Длинные лекарства будут переноситься */
    }

    /* --- ФИКС ТАБЛИЦЫ ДОЗИРОВОК (ВРАЧАМ) --- */
    /* Ищем контейнер, в котором лежит таблица */
    .clinical-data .card, 
    .dosage-table-wrapper,
    .clinical-table {
        overflow-x: auto !important; /* ВКЛЮЧАЕМ СВАЙП */
        display: block !important;
        width: 100% !important;
        -webkit-overflow-scrolling: touch !important; /* Плавный свайп на iOS */
        position: relative;
    }

    /* Сама таблица дозировок */
    .dosage-table, 
    .clinical-table table,
    .clinical-data table {
        min-width: 600px !important; /* Таблица сохраняет структуру, чтобы врач мог её читать */
        width: auto !important;
        border-collapse: collapse;
    }

    /* Чтобы пользователь понял, что таблицу можно двигать */
    .clinical-data .card::after {
        content: '↔ свайп';
        display: block;
        text-align: right;
        font-size: 10px;
        color: #999;
        margin-top: 5px;
    }

    /* --- ОБЩИЙ ФИКС ОТСТУПОВ (чтобы края не липли) --- */
    .main-content {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .card.mb-4 {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: calc(100% - 10px) !important;
        border: none;
    }
    
    .search-input{
        max-width: 60%;
        font-size: 0.75rem;
    }
    
    .sidebar-toggle-btn{
        display: none;
    }

    
}



