/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Gemini-inspired Dark Theme Palette */
  --background: #131314;
  --surface: #282a2c;
  --primary: #2d2e30;
  --accent: #5865F2; 
  --text-primary: #e3e3e3;
  --text-secondary: #bdc1c6;
  --text-muted: #969ba1;
  --border: #3c4043;
  --error: #f28b82;
  --gold: #fdd663;
  --text-h1: #3180fe;
}

body {
  display: flex;
  flex-direction: row;
  width: 100vw;
  font-family: system-ui, -apple-system, "Inter", "Roboto", sans-serif; /* Новий стек шрифтів */
  font-size: 16px; /* Новий базовий розмір */
  line-height: 1.55; /* Нова висота рядка */
  background: var(--background);
  color: var(--text-primary);
  overflow-x: hidden;
}

.wrapper {
  display: flex;
  width: 100%;
}

/* Animated starry background */
.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(135deg, var(--background) 0%, var(--primary) 100%);
}

.stars::before,
.stars::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--gold);
  border-radius: 50%;
  animation: twinkle 3s infinite;
}

.stars::before {
  top: 20%;
  left: 30%;
  animation-delay: 0s;
}

.stars::after {
  top: 60%;
  left: 70%;
  animation-delay: 1.5s;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Sidebar styles - DESKTOP */
.navigation-container {
  display: flex;
  position: fixed;
  overflow-x: hidden;
  overflow-y: auto;
  flex-direction: column;
  justify-content: flex-start;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 320px; 
  height: 100vh;
  background-color: var(--surface);
  border-right: 1px solid var(--border);
  transition: left 0.3s ease; 
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.navigation-container::-webkit-scrollbar {
  display: none;
}

.top-section {
  display: none;
}

.main-section {
  display: flex;
  opacity: 1; 
  flex-direction: column;
  gap: 15px;
  width: 100%;
  padding: 5px 10px 10px 10px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  min-height: 0;
}

.main-section::-webkit-scrollbar {
  display: none;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  min-height: 60px;
  flex-shrink: 0;
  position: relative;
  padding: 0 1rem;
}

.sidebar-title {
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.sidebar-close-mobile {
  display: none;
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 2rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.sidebar-close-mobile:hover {
  background: var(--border);
  color: var(--text-primary);
}

.sidebar-close-mobile:active {
  transform: scale(0.95);
}

.new-chat-sidebar {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 1rem;
  min-height: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}

.new-chat-sidebar:hover {
  background: var(--purple);
}

.new-chat-sidebar:active {
  transform: scale(0.98);
}

/* === Sidebar Footer === */
.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-footer .login-btn,
.sidebar-footer .logout-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
}

/* === СТИЛІ ДЛЯ СЛАЙДЕРА МОВИ === */
.lang-slider {
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--primary);
    border: 1px solid var(--border);
    border-radius: 22px; /* Робить його овальним */
    padding: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden; /* Ховаємо фон, що виходить за межі */
    width: 100%;
    height: 44px; /* Фіксована висота як у кнопок */
    -webkit-tap-highlight-color: transparent; /* Прибирає підсвітку при кліку на мобільних */
}

.lang-slider-bg {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px); /* Половина ширини контейнера */
    height: calc(100% - 8px); /* Висота контейнера з відступами */
    background: var(--accent);
    border-radius: 18px; /* Скруглення фону */
    transition: left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Плавна анімація */
    z-index: 1;
}

.lang-slider.ru-active .lang-slider-bg {
    left: 50%; /* Зміщуємо фон на другу позицію */
}

.lang-option {
    flex: 1;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    z-index: 2;
    transition: color 0.3s ease;
    user-select: none; /* Забороняємо виділення тексту */
}

/* Стилі для активної мови - робимо текст білим */
.lang-slider:not(.ru-active) .lang-option[data-lang="uk"],
.lang-slider.ru-active .lang-option[data-lang="ru"] {
    color: white;
}

.logout-btn {
  background: #b63434;
  color: white;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 1rem;
  min-height: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}

.logout-btn:hover {
  background: var(--error);
}

.logout-btn:active {
  transform: scale(0.98);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--primarydark);
  border-radius: 8px;
  min-height: 70px;
  flex-shrink: 0;
}

.user-avatar {
  width: 50px;
  height: 50px;
  min-width: 50px;
  min-height: 50px;
  border-radius: 50%;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
  color: var(--primary);
  overflow: hidden;
  flex-shrink: 0;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.875rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-history-title {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  flex-shrink: 0;
  padding: 0 0.5rem;
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  min-height: 0;
}

.chat-history::-webkit-scrollbar {
  display: none;
}

.chat-history-item {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.75rem;
  background: var(--primarydark);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-bottom: 0.5rem;
  min-height: 48px;
}

.chat-content {
  flex: 1;
  cursor: pointer;
  min-width: 0;
}

.chat-history-item:hover {
  background: var(--secondary);
}

.chat-actions {
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.chat-history-item:hover .chat-actions {
  opacity: 1;
}

.rename-chat-btn,
.delete-chat-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s;
  font-size: 0.875rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rename-chat-btn:hover {
  background: var(--accent);
  color: white;
}

.delete-chat-btn:hover {
  background: var(--error);
  color: white;
}

.chat-rename-input {
  background: var(--background);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  width: 100%;
  outline: none;
}

.chat-rename-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.chat-title {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-title:hover {
  color: var(--accent);
}

/* Header styles */
.header {
  /* background: var(--surface);
  border-bottom: 1px solid var(--border); */
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  width: 100%;
  margin: 0 auto;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background-color 0.2s;
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 32px;
  height: 32px;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.menu-btn:hover {
  background: var(--border);
}

.menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all 0.3s;
}

.menu-btn-mobile {
  display: none;
}

.menu-btn-desktop {
  display: none;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Work Sans", sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}

/* Сховати лого в хедері на десктопі */
.logo-header {
    display: none;
}

.zodiac-icon {
  font-size: 1.5rem;
  color: var(--gold);
}

.login-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

.login-btn:hover {
  background: var(--purple);
}

/* === ОСНОВНІ СТИЛІ КОНТЕЙНЕРІВ ЧАТУ (ПОЧАТОК) === */

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    margin-left: 320px; 
    position: relative;
    z-index: 1;
    
}

.chat-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Початковий стан: все по центру */
    transition: justify-content 0.3s ease;
}

.main-content {
    width: 100%;
    max-width: 720px;
    padding: 1rem;
}

.main-content::-webkit-scrollbar {
  display: none;
}

.welcome-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.welcome-title {
  font-family: "Work Sans", sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--text-h1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.welcome-subtitle {
  font-size: 1.125rem; 
  color: var(--text-secondary);
  margin-top: 0.75rem;
  max-width: 550px;
  line-height: 1.6;
  transition: opacity 0.3s ease;
}

.suggested-questions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
    max-width: 720px;
}

.question-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem;
    width: calc(50% - 1rem);
    max-width: 250px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    color: var(--text-primary);
}

.question-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.question-card strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.question-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

/* Messages */
.messages-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chat-container.chat-active .messages-container {
    &::-webkit-scrollbar {
        display: none;
    }

    scrollbar-width: none;
    
    -ms-overflow-style: none;
}

.message {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

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

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.message.user .message-avatar {
  background: var(--accent);
  color: white;
}

.message.assistant .message-avatar {
  background: var(--gold);
  color: var(--primary);
}

.message-content {
  background: var(--surface);
  padding: 1rem 1.25rem;
  border-radius: 16px;
  width: fit-content;
  max-width: calc(100% - 60px);
  word-wrap: break-word;
}

.message.user .message-content {
  background: var(--accent);
  color: white;
}

.message-text {
  line-height: 1.6;
}

.message-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Typing indicator */
.typing-indicator {
  display: none;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
}

.typing-indicator.show {
  display: flex;
}

.typing-dots {
  display: flex;
  gap: 4px;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-radius: 16px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

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

@keyframes typing {
  0%,
  80%,
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Input area */
.input-container {
  padding: 1rem;
  width: 100%;
  flex-shrink: 0;
}

/* === СТИЛІ ДЛЯ ПЛАШКИ КОНФІДЕНЦІЙНОСТІ === */
.confidentiality-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem; /* Відстань між іконкою і текстом */
    padding: 0 1rem;
    margin: 0 auto 0.75rem;
    max-width: 720px;
    font-size: 0.8125rem; /* 13px */
    color: var(--text-muted);
    text-align: center;
}

.confidentiality-notice svg {
    flex-shrink: 0; /* Забороняємо іконці стискатися */
}

.input-wrapper {
  display: flex;
  background: var(--surface);
  border-radius: 28px;
  padding: 0.5rem;
  gap: 0.5rem;
  align-items: flex-end;
  max-width: 720px;
  margin: 0 auto;
  border: 1px solid var(--surface);
  transition: border-color 0.2s;
}
.input-wrapper:focus-within {
  border-color: var(--border);
}
.message-input {
  flex: 1;
  background: transparent;
  padding: 0.75rem 1rem;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  resize: none;
  min-height: 24px;
  max-height: 160px;
}

.message-input::-webkit-scrollbar {
  width: 6px;
}

.message-input::-webkit-scrollbar-track {
  background: var(--background);
  border-radius: 3px;
}

.message-input::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.message-input::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.message-input:focus {
  outline: none;
}

.send-btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 10px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    
    /* Початковий стан: кнопка з текстом */
    width: fit-content;
    padding: 0 1.25rem; /* 20px */
}

.send-btn:hover:not(:disabled) {
    background: var(--text-h1);
}

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

/* Текст всередині кнопки (видимий за замовчуванням) */
.send-btn-text {
    display: inline;
    font-weight: 600;
    white-space: nowrap;
}

/* Іконка всередині кнопки (прихована за замовчуванням) */
.send-btn-icon {
    display: none;
    width: 20px;
    height: 20px;
}

/* === СТИЛІ ДЛЯ АКТИВНОГО ЧАТУ (ВИПРАВЛЕНО) === */

.chat-container.chat-active .chat-body {
    justify-content: space-between;
}

.chat-container.chat-active .welcome-container {
    display: none;
}

.chat-container.chat-active .main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden; 
    padding: 0;
    min-height: 0;
}

.chat-container.chat-active .messages-container {
    flex-grow: 1; 
    overflow-y: scroll; 
    padding: 1rem;
    height: 250px;
}

.chat-container.chat-active .send-btn {
    /* ...кнопка стискається до розміру іконки */
    width: 50px;
    padding: 0;
}

.chat-container.chat-active .send-btn-text {
    /* ...текст зникає */
    display: none;
}

.chat-container.chat-active .send-btn-icon {
    /* ...а іконка з'являється */
    display: inline;
}

/* Authentication modal */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.auth-overlay.show {
  display: flex;
}

.auth-modal {
  background: var(--surface);
  border-radius: 16px;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  position: relative;
  border: 1px solid var(--border);
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.close-btn:hover {
  background: var(--border);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-title {
  font-family: "Work Sans", sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.auth-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.google-signin-btn,
.apple-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
}

.google-signin-btn {
  background: white;
  color: #1f2937;
}

.google-signin-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  transform: translateY(-1px);
}

.apple-signin-btn {
  background: #000000;
  color: white;
  border-color: #000000;
}

.apple-signin-btn:hover {
  background: #1a1a1a;
  transform: translateY(-1px);
}

.google-signin-btn:active,
.apple-signin-btn:active {
  transform: translateY(0);
}

.demo-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
  margin-top: 0.5rem;
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
}


/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for keyboard navigation */
button:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* === СТИЛІ ДЛЯ КНОПКИ ПРОКРУЧУВАННЯ ВНИЗ === */
.scroll-to-bottom-btn {
    position: absolute;
    /* Позиціонуємо її над полем вводу */
    bottom: 100px; 
    left: 50%;
    transform: translateX(-50%);

    /* Стилі */
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);

    /* Анімація */
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none; /* Кнопка неактивна, коли невидима */
    z-index: 10;
}

.scroll-to-bottom-btn:hover {
    background: var(--primary);
    border-color: var(--accent);
}

/* Клас, який робить кнопку видимою */
.scroll-to-bottom-btn.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto; /* Робимо кнопку активною */
}

/* =============================================== */
/* === УНІВЕРСАЛЬНІ СТИЛІ ДЛЯ МОБІЛЬНИХ ПРИСТРОЇВ === */
/* =============================================== */
@media (max-width: 768px) {
  body {
    /* ЗАБОРОНЯЄМО СКРОЛ ВСІЄЇ СТОРІНКИ */
    overflow: hidden;
    height: 100%;
  }

  /* ГОЛОВНИЙ КОНТЕЙНЕР ЧАТУ */
  .chat-container {
    /* Встановлюємо висоту через JS, але маємо запасний варіант */
    height: 100vh; 
    height: 100dvh;
    margin-left: 0;
    overflow: hidden; /* Важливо: сам контейнер не скролиться */
  }

  .chat-body {
        /* Наказуємо цьому блоку розтягнутись на весь вільний простір після хедера */
        flex: 1;
        /* Важливий трюк для правильної роботи overflow у вкладених flex-контейнерах */
        min-height: 0;
        /* Переконуємось, що він не скролиться сам по собі */
        overflow: hidden; 
    }

  /* БЛОК ПРИВІТАННЯ ТА ПОВІДОМЛЕНЬ */
  .main-content {
    flex: 1; /* Найважливіше: цей блок займає весь вільний простір */
    overflow-y: auto; /* Тільки цей блок має вертикальний скрол */
    padding: 1rem;
    min-height: 0; /* Обов'язково для правильної роботи flexbox */
  }

  /* КОНТЕЙНЕР ПОЛЯ ВВОДУ */
  .input-container {
    flex-shrink: 0; /* Забороняємо контейнеру стискатись */
    padding: 0.75rem 1rem;
  }
  
  /* САЙДБАР */
  .navigation-container {
    width: 280px;
    left: -280px;
    height: 100%; /* Займає всю висоту батьківського елемента */
    height: 100dvh;
    overflow-y: auto; /* Дозволяємо сайдбару скролитись, щоб бачити всі кнопки */
  }
  
  /* --- Інші стилі, що залишились --- */
  .menu-btn-mobile { display: flex; }
  .menu-btn-desktop { display: none; }
  .sidebar-close-mobile { display: flex; }
  .navigation-container.open { left: 0; }
  .logo-sidebar { display: none; }
  .logo-header { display: flex; }
  .sidebar-header { justify-content: flex-end; }
  .top-section { display: flex; position: static; border: none; background: transparent; }
  .main-section { margin-top: 0; padding: 10px; }
  .sidebar-overlay.show { display: block; }
  .welcome-title { font-size: 2rem; }
  .welcome-subtitle { font-size: 1rem; }
  .welcome-container { display: flex; flex-direction: column; align-items: center; text-align: center; }
  .messages-container { padding: 0; }

  .message-input::placeholder {
        font-size: 0.9rem; /* Трохи менше стандартного (16px -> ~14.5px) */
    }
}
