/* ================= ROOT VARIABLES ================= */
:root {
  /* Colors */
  --blue-950: #071b3a;
  --blue-900: #0b2a55;
  --blue-700: #1e4fa3;
  --blue-accent: #2f7df6;
  --blue-100: #eef5ff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --bg-gray: #f8fafc;
  --border-color: #e2e8f0;
  
  /* Fonts */
  --font-heading: 'Merriweather Sans', sans-serif;
  --font-body: 'Montserrat', sans-serif;
  
  /* Layout */
  --header-height: 70px;
  --input-height: 90px;
  
  /* Shadows */
  --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ================= RESET ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background: var(--bg-gray);
  color: var(--text-dark);
  overflow: hidden;
  height: 100vh;
}

/* ================= WELCOME MODAL ================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-container {
  background: white;
  border-radius: 16px;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.08);
  animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-content {
  padding: 0;
}

.modal-header {
  padding: 48px 48px 32px;
  border-bottom: 1px solid #e5e7eb;
  text-align: center;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 12px 0;
  line-height: 1.3;
  text-align: center;
}

.modal-subhead {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 500;
  margin: 0;
  line-height: 1.5;
  text-align: center;
}

.modal-body {
  padding: 32px 48px;
}

.modal-intro {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-dark);
  margin-bottom: 20px;
  text-align: left;
}

.modal-intro strong {
  color: var(--blue-accent);
  font-weight: 600;
}

.modal-section {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  padding: 24px;
  border-radius: 8px;
  margin: 24px 0;
  text-align: left;
}

.modal-section-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 12px 0;
  text-align: left;
}

.modal-section p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dark);
  margin: 0 0 16px 0;
  text-align: left;
}

.modal-details {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 16px;
  margin-top: 16px;
}

.modal-details summary {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.modal-details summary::-webkit-details-marker {
  display: none;
}

.details-toggle {
  color: var(--blue-accent);
  font-weight: 600;
  font-size: 13px;
}

.modal-details[open] .details-toggle::after {
  content: ' ▲';
}

.modal-details:not([open]) .details-toggle::after {
  content: ' ▼';
}

.details-content {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.details-content pre {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 16px;
  overflow-x: auto;
  margin: 0;
}

.details-content code {
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #374151;
}

.modal-notice {
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  padding: 20px 24px;
  margin: 24px 0;
  text-align: left;
}

.modal-notice h4 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: #92400e;
  margin: 0 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
}

.modal-notice p {
  font-size: 14px;
  line-height: 1.6;
  color: #78350f;
  margin: 0 0 8px 0;
  text-align: left;
}

.modal-notice p:last-child {
  margin-bottom: 0;
}

.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 32px 0 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 1;
}

.scroll-indicator.hidden {
  opacity: 0;
  pointer-events: none;
}

.scroll-arrow {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--blue-accent), var(--blue-700));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-bottom: 8px;
  animation: bounce 2s infinite;
  box-shadow: 0 4px 12px rgba(47, 125, 246, 0.3);
  transition: all 0.3s ease;
}

.scroll-indicator:hover .scroll-arrow {
  transform: translateY(4px);
  box-shadow: 0 6px 16px rgba(47, 125, 246, 0.4);
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(-4px);
  }
}

.scroll-indicator span {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
}

.modal-consent {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.consent-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--blue-accent);
}

.consent-label span {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dark);
  text-align: left;
}

.modal-footer {
  padding: 24px 48px 48px;
  display: flex;
  justify-content: center;
}

.modal-btn-primary {
  background: linear-gradient(135deg, var(--blue-accent), var(--blue-700));
  color: white;
  border: none;
  padding: 14px 48px;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(47, 125, 246, 0.25);
}

.modal-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(47, 125, 246, 0.35);
}

.modal-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.modal-btn-primary:disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
}

/* Modal Scrollbar */
.modal-container::-webkit-scrollbar {
  width: 6px;
}

.modal-container::-webkit-scrollbar-track {
  background: transparent;
}

.modal-container::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.modal-container::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ================= HEADER ================= */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: #122867;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.logo-img {
  height: 36px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

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

.age-selector-wrapper,
.course-selector-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.age-selector-wrapper::before {
  content: '\f19d';  /* Graduation cap icon for grades */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: 16px;
  color: white;
  font-size: 14px;
  pointer-events: none;
  z-index: 1;
}

.course-selector-wrapper::before {
  content: '\f02d';  /* Book icon for courses */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: 16px;
  color: white;
  font-size: 14px;
  pointer-events: none;
  z-index: 1;
}

.age-select,
.course-select {
  padding: 12px 40px 12px 42px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: white;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.age-select:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.course-select:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.age-select:focus,
.course-select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.age-select option,
.course-select option {
  background: var(--blue-900);
  color: white;
  padding: 12px;
  font-weight: 500;
}

.settings-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  font-size: 18px;
}

.settings-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

/* ================= SETTINGS SIDEBAR ================= */
.settings-sidebar {
  position: fixed;
  top: 0;
  right: -320px;
  width: 320px;
  height: 100vh;
  background: white;
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
  z-index: 200;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.settings-sidebar.open {
  right: 0;
}

.settings-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-header h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--text-dark);
}

.close-settings {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-gray);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-muted);
}

.close-settings:hover {
  background: var(--blue-100);
  color: var(--blue-accent);
}

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

.settings-info {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.model-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-gray);
  border-radius: 12px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.model-toggle:hover {
  background: var(--blue-100);
}

.model-toggle.disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.model-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
}

.toggle-slider {
  width: 48px;
  height: 26px;
  background: #cbd5e1;
  border-radius: 13px;
  position: relative;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: all 0.3s ease;
}

.model-toggle input[type="checkbox"]:checked + .toggle-slider {
  background: var(--blue-accent);
}

.model-toggle input[type="checkbox"]:checked + .toggle-slider::before {
  left: 25px;
}

.model-info-inline {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.model-info-inline .model-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
}

.model-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--blue-accent);
  background: var(--blue-100);
  padding: 4px 10px;
  border-radius: 12px;
}

/* ================= CHAT CONTAINER ================= */
.chat-container {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: var(--input-height);
  display: flex;
  flex-direction: column;
  background: white;
}

/* ================= CHAT MESSAGES ================= */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  scroll-behavior: smooth;
}

/* Welcome Message */
.welcome-message {
  text-align: center;
  max-width: 700px;
  margin: 60px auto;
  padding: 0 24px;
}

.welcome-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--blue-accent), var(--blue-700));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: white;
  font-size: 32px;
}

.welcome-message h2 {
  font-family: var(--font-heading);
  font-size: 28px;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.welcome-message > p {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.welcome-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.example-btn {
  padding: 12px 20px;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.example-btn:hover {
  border-color: var(--blue-accent);
  background: var(--blue-100);
  color: var(--blue-accent);
  transform: translateY(-2px);
}

.example-btn i {
  font-size: 16px;
}

/* ================= CONVERSATION ROW (TABLE VIEW) ================= */
.conversation-row {
  margin-bottom: 0;
  animation: slideInUp 0.4s ease;
}

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

/* User Question */
.user-question-bar {
  background: var(--bg-gray);
  padding: 16px 24px;
  border-bottom: 2px solid var(--border-color);
}

.user-question-text {
  max-width: 1400px;
  margin: 0 auto;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-question-text i {
  color: var(--blue-accent);
  font-size: 18px;
}

/* Responses Table */
.responses-table {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--border-color);
}

.response-column {
  border-right: 1px solid var(--border-color);
  padding: 24px;
  min-height: 200px;
  background: white;
  transition: all 0.3s ease;
}

/* Emphasize EduChat column */
.response-column:first-child {
  background: linear-gradient(135deg, #f0f7ff 0%, #e6f2ff 100%);
  border: 2px solid #2f7df6;
  border-right: 2px solid #2f7df6;
  box-shadow: 0 0 20px rgba(47, 125, 246, 0.15);
  position: relative;
}

.response-column:last-child {
  border-right: none;
}

.response-column:hover {
  background: var(--bg-gray);
}

.response-column:first-child:hover {
  background: linear-gradient(135deg, #e6f2ff 0%, #dceeff 100%);
}

/* Column Header */
.column-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
}

.model-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
  flex-shrink: 0;
}

.model-icon.educhat {
  background: linear-gradient(135deg, #2f7df6, #1e4fa3);
}

.model-icon.openai {
  background: linear-gradient(135deg, #10a37f, #0d8a6c);
}

.model-icon.gemini {
  background: linear-gradient(135deg, #4285f4, #34a853);
}

.model-icon.grok {
  background: linear-gradient(135deg, #000000, #333333);
}

.model-name-header {
  flex: 1;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
}

/* Response Content */
.response-content {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-dark);
  word-wrap: break-word;
}

.response-content p {
  margin-bottom: 12px;
}

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

/* Markdown Formatting */
.response-content h1,
.response-content h2,
.response-content h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-dark);
  margin-top: 16px;
  margin-bottom: 10px;
}

.response-content h1 {
  font-size: 20px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 8px;
}

.response-content h2 {
  font-size: 18px;
}

.response-content h3 {
  font-size: 16px;
}

.response-content ul,
.response-content ol {
  margin: 12px 0;
  padding-left: 24px;
}

.response-content li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.response-content strong {
  font-weight: 600;
  color: var(--text-dark);
}

.response-content em {
  font-style: italic;
  color: var(--text-muted);
}

.response-content code {
  background: var(--bg-gray);
  color: var(--blue-accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

.response-content pre {
  background: var(--bg-gray);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
  overflow-x: auto;
}

.response-content pre code {
  background: none;
  padding: 0;
  color: var(--text-dark);
}

.response-content blockquote {
  border-left: 4px solid var(--blue-accent);
  background: var(--blue-100);
  padding: 12px 16px;
  margin: 12px 0;
  font-style: italic;
  color: var(--text-muted);
}

.response-content a {
  color: var(--blue-accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.response-content a:hover {
  color: var(--blue-700);
  text-decoration: underline;
}

/* Loading State */
.response-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
}

.loading-dots {
  display: flex;
  gap: 4px;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  background: var(--blue-accent);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Error State */
.response-error {
  color: #dc2626;
  font-size: 13px;
  padding: 12px;
  background: #fee2e2;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.response-error i {
  font-size: 16px;
}

/* Ban State */
.response-banned {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 2px solid #f59e0b;
  padding: 16px;
  border-radius: 12px;
}

.ban-icon-inline {
  width: 40px;
  height: 40px;
  background: #f59e0b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  margin: 0 auto 12px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}

.ban-title {
  font-weight: 600;
  color: #92400e;
  margin-bottom: 8px;
  font-size: 14px;
  text-align: center;
}

.ban-message {
  font-size: 13px;
  color: #78350f;
  line-height: 1.6;
  margin-bottom: 12px;
}

.ban-reason {
  background: white;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: #78350f;
  margin-bottom: 12px;
  border-left: 3px solid #f59e0b;
}

.ban-reason strong {
  display: block;
  margin-bottom: 6px;
  color: #92400e;
}

.unban-button {
  width: 100%;
  padding: 10px 16px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.unban-button:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* ================= CHAT INPUT ================= */
.chat-input-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 20%, white 100%);
  padding: 24px;
  z-index: 50;
}

.chat-input-wrapper {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 0;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 26px;
  padding: 4px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 0 0 rgba(47, 125, 246, 0),
              0 2px 12px rgba(0, 0, 0, 0.08);
  position: relative;
}

.chat-input-wrapper:focus-within {
  border-color: var(--blue-accent);
  box-shadow: 0 0 0 3px rgba(47, 125, 246, 0.12),
              0 8px 24px rgba(47, 125, 246, 0.15);
}

.chat-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-dark);
  resize: none;
  outline: none;
  max-height: 200px;
  line-height: 1.6;
  padding: 14px 20px;
  min-height: 24px;
}

.chat-input::placeholder {
  color: var(--text-light);
  font-weight: 400;
}

.send-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border: none;
  background: linear-gradient(135deg, var(--blue-accent), var(--blue-700));
  color: white;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  font-size: 18px;
  margin: 2px;
  box-shadow: 0 2px 8px rgba(47, 125, 246, 0.25);
}

.send-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--blue-700), var(--blue-900));
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(47, 125, 246, 0.35);
}

.send-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.send-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background: var(--text-light);
}

.send-btn:disabled:hover {
  transform: none;
}

.input-hint {
  max-width: 900px;
  margin: 12px auto 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  font-weight: 400;
}

/* ================= SCROLLBAR ================= */
.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1200px) {
  .responses-table {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .responses-table {
    grid-template-columns: 1fr;
  }
  
  .response-column {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .response-column:last-child {
    border-bottom: none;
  }
}

@media (max-width: 600px) {
  :root {
    --header-height: 60px;
    --input-height: 80px;
  }
  
  .modal-container {
    max-height: 90vh;
    border-radius: 12px;
    margin: 10px;
  }
  
  .modal-header {
    padding: 32px 24px 24px;
  }
  
  .modal-title {
    font-size: 20px;
  }
  
  .modal-subhead {
    font-size: 14px;
  }
  
  .modal-body {
    padding: 24px;
  }
  
  .modal-intro {
    font-size: 14px;
  }
  
  .modal-section {
    padding: 16px;
  }
  
  .modal-section-title {
    font-size: 15px;
  }
  
  .modal-notice {
    padding: 16px 20px;
  }
  
  .modal-footer {
    padding: 20px 24px 32px;
  }
  
  .modal-btn-primary {
    width: 100%;
    padding: 12px 24px;
    font-size: 14px;
  }
  
  .header-inner {
    padding: 0 16px;
  }
  
  .logo-img {
    height: 28px;
  }
  
  .age-select {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .settings-btn {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }
  
  .user-question-bar {
    padding: 12px 16px;
  }
  
  .response-column {
    padding: 16px;
  }
  
  .chat-input-container {
    padding: 16px 12px;
  }
  
  .chat-input-wrapper {
    border-radius: 22px;
  }
  
  .chat-input {
    padding: 12px 16px;
    font-size: 14px;
  }
  
  .send-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    font-size: 14px;
  }
  
  .welcome-icon {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }
  
  .welcome-message h2 {
    font-size: 22px;
  }
  
  .welcome-examples {
    flex-direction: column;
  }
  
  .example-btn {
    width: 100%;
    justify-content: center;
  }
}
