/* ========== CSS VARIABLES ========== */
:root {
  --bg-primary: #fafafa;
  --bg-secondary: #f2f3f5;
  --bg-tertiary: #e8eaed;
  --bg-chat: #fafafa;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --border: #e2e4e9;
  --border-light: #eff0f3;
  --accent: #c0392b;
  --accent-light: #e74c3c;
  --accent-glow: rgba(192, 57, 43, 0.15);
  --accent-bg: rgba(192, 57, 43, 0.06);
  --user-msg-bg: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
  --user-msg-text: #ffffff;
  --bot-msg-bg: #f0f1f4;
  --bot-msg-text: #1a1a2e;
  --input-bg: #ffffff;
  --glass-bg: rgba(250, 250, 250, 0.85);
  --glass-border: rgba(255, 255, 255, 0.5);
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 20px rgba(192, 57, 43, 0.08);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ========== GLOBAL ========== */
html, body {
  background: var(--bg-primary);
  color: var(--text-primary);
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  position: fixed;
  overflow: hidden;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== WRAPPER ========== */
.chat-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-chat);
  position: relative;
}

/* ========== HEADER (Glassmorphism) ========== */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
  z-index: 100;
  padding-top: env(safe-area-inset-top, 0);
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 84px;
}

.header-left {
  justify-content: flex-start;
}

.header-right {
  justify-content: flex-end;
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}



.icon-button {
  background: none;
  border: none;
  cursor: pointer;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.icon-button:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.icon-button:active {
  transform: scale(0.93);
}

/* ========== DARK MODE ICON BUTTON ========== */
.dark-mode-btn {
  position: relative;
}

.dark-mode-btn .icon-sun,
.dark-mode-btn .icon-moon {
  transition: opacity 0.25s ease, transform 0.3s ease;
  position: absolute;
}

.dark-mode-btn .icon-sun {
  opacity: 1;
  transform: rotate(0deg);
}

.dark-mode-btn .icon-moon {
  opacity: 0;
  transform: rotate(-90deg);
}

.dark-mode .dark-mode-btn .icon-sun {
  opacity: 0;
  transform: rotate(90deg);
}

.dark-mode .dark-mode-btn .icon-moon {
  opacity: 1;
  transform: rotate(0deg);
}

/* ========== HEADER LOGO ========== */
.header-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
}

/* ========== LOGO LIGHT/DARK SWITCH ========== */
.logo-light {
  display: block;
}

.logo-dark {
  display: none;
}

.dark-mode .logo-light {
  display: none;
}

.dark-mode .logo-dark {
  display: block;
}

/* ========== WELCOME SCREEN ========== */
.welcome-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.welcome-screen.hidden {
  display: none;
}

.welcome-content {
  text-align: center;
  max-width: 380px;
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.welcome-logo {
  width: 100px;
  height: 100px;
  margin: 0 auto 24px;
  background: transparent;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  position: relative;
  border: none;
}

.welcome-logo img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.welcome-logo-glow {
  position: absolute;
  inset: -4px;
  border-radius: calc(var(--radius-lg) + 4px);
  background: transparent;
  border: 2px solid transparent;
  animation: logoRing 4s ease-in-out infinite;
}

@keyframes logoRing {
  0%, 100% {
    border-color: rgba(192, 57, 43, 0);
    transform: scale(1);
  }
  50% {
    border-color: rgba(192, 57, 43, 0.15);
    transform: scale(1.03);
  }
}

.welcome-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.welcome-subtitle {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 32px;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.welcome-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.chip {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 13px;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
}

.chip svg {
  color: var(--text-tertiary);
  transition: color var(--transition);
  flex-shrink: 0;
}

.chip:hover {
  background: var(--accent-bg);
  border-color: rgba(192, 57, 43, 0.25);
  color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.chip:hover svg {
  color: var(--accent);
}

.chip:active {
  transform: translateY(0) scale(0.97);
  box-shadow: none;
}

/* ========== CHAT MESSAGES ========== */
.chat-container {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px 16px 12px;
  background: var(--bg-chat);
  scroll-behavior: smooth;
}

.chat-container.active {
  display: flex;
}

.chat-container::-webkit-scrollbar {
  width: 6px;
}
.chat-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}
.chat-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.22);
}
.dark-mode .chat-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}
.dark-mode .chat-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.message {
  max-width: 85%;
  margin: 5px 0;
  padding: 12px 16px;
  line-height: 1.6;
  word-wrap: break-word;
  white-space: pre-wrap;
  font-size: 14px;
  animation: msgFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.user-message {
  background: var(--user-msg-bg);
  color: var(--user-msg-text);
  align-self: flex-end;
  border-radius: var(--radius-lg) var(--radius-lg) 6px var(--radius-lg);
  margin-left: auto;
  font-weight: 400;
  box-shadow: 0 2px 8px rgba(192, 57, 43, 0.15);
}

.bot-message {
  background: var(--bot-msg-bg);
  color: var(--bot-msg-text);
  align-self: flex-start;
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 6px;
  margin-right: auto;
  border: 1px solid var(--border-light);
}

.bot-message p {
  margin: 0;
  line-height: 1.6;
}

.bot-message code {
  background: rgba(0,0,0,0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Loading dots */
.bot-message.loading {
  background: transparent !important;
  border: none !important;
  padding: 12px 0;
}

.dot-loader {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 4px;
}

.dot-loader span {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: dotBounce 1.4s ease-in-out infinite;
}

.dot-loader span:nth-child(1) { animation-delay: 0s; }
.dot-loader span:nth-child(2) { animation-delay: 0.16s; }
.dot-loader span:nth-child(3) { animation-delay: 0.32s; }

@keyframes dotBounce {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(0.8) translateY(0);
  }
  40% {
    opacity: 1;
    transform: scale(1) translateY(-4px);
  }
}

/* ========== INPUT AREA (Glassmorphism) ========== */
.input-area {
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0));
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.input-box {
  display: flex;
  align-items: flex-end;
  background: var(--input-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 5px 5px 5px 18px;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-xs);
}

.input-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-sm);
}

#userInput {
  flex: 1;
  resize: none;
  overflow-y: auto;
  max-height: 120px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font);
  line-height: 1.5;
  padding: 8px 0;
  min-height: 36px;
}

#userInput::placeholder {
  color: var(--text-tertiary);
  font-size: 14px;
}

.send-button {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent) 0%, #a93226 100%);
  border: none;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all var(--transition);
  margin-bottom: 2px;
  box-shadow: 0 2px 8px rgba(192, 57, 43, 0.2);
}

.send-button:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(192, 57, 43, 0.3);
}

.send-button:active {
  transform: scale(0.93);
  box-shadow: 0 1px 4px rgba(192, 57, 43, 0.15);
}

.send-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.disclaimer {
  text-align: center;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 8px;
  font-weight: 400;
}

/* ========== MODAL OVERLAY ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  animation: overlayFadeIn 0.2s ease;
}

.modal-overlay.hidden {
  display: none;
}

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

/* ========== MODAL CARD (small popups) ========== */
.modal-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  width: 360px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  animation: cardSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--border-light);
}

@keyframes cardSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.modal-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  line-height: 1.5;
}

.modal-card-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 18px;
  background: var(--accent-bg);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.modal-card-icon.warning {
  background: rgba(234, 88, 12, 0.08);
  color: #ea580c;
}

.modal-card-icon.success {
  background: rgba(22, 163, 74, 0.08);
  color: #16a34a;
}

.modal-card-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

/* Buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #a93226 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(192, 57, 43, 0.15);
}
.btn-primary:hover {
  box-shadow: 0 4px 14px rgba(192, 57, 43, 0.25);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 1px 4px rgba(192, 57, 43, 0.1);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ========== REPORT TEXTAREA ========== */
.report-textarea {
  width: 100%;
  margin: 14px 0 6px;
  border: 1.5px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  font-family: var(--font);
  resize: none;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.report-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ========== MODAL PANEL (settings sidebar) ========== */
.modal-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 380px;
  height: 100%;
  background: var(--bg-primary);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  animation: panelSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-lg);
  border-right: 1px solid var(--border-light);
}

@keyframes panelSlideIn {
  from { transform: translateX(-100%); opacity: 0.8; }
  to { transform: translateX(0); opacity: 1; }
}

.modal-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  padding-top: calc(18px + env(safe-area-inset-top, 0));
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-panel-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

/* ========== SETTINGS LIST ========== */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 12px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  transition: all var(--transition);
  width: 100%;
  text-align: left;
}

.settings-item:hover {
  background: var(--bg-secondary);
}

.settings-item.no-hover {
  cursor: default;
}
.settings-item.no-hover:hover {
  background: none;
}

.settings-item span {
  flex: 1;
}

.settings-item-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: all var(--transition);
}

.settings-item:hover .settings-item-icon {
  color: var(--text-primary);
}

.settings-item-icon.warning {
  background: rgba(234, 88, 12, 0.08);
  color: #ea580c;
}

.settings-chevron {
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: transform var(--transition);
}

.settings-item:hover .settings-chevron {
  transform: translateX(2px);
}

/* ========== TOGGLE (Dark mode) ========== */
.toggle {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.toggle input {
  display: none;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 13px;
  transition: background var(--transition);
  cursor: pointer;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ========== BACK BUTTON ========== */
.back-button {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  padding: 4px 0;
  margin-bottom: 16px;
  transition: opacity var(--transition);
}

.back-button:hover {
  opacity: 0.7;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

/* ========== PRIVACY SCROLL ========== */
.privacy-scroll {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 18px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.privacy-scroll::-webkit-scrollbar {
  width: 6px;
}
.privacy-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}
.privacy-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.22);
}
.dark-mode .privacy-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}
.dark-mode .privacy-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.privacy-scroll strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ========== CONTACT CARDS ========== */
.contact-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  transition: all var(--transition);
}

.contact-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.contact-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.contact-card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.contact-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.contact-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.contact-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ========== SETTINGS HEADER BADGE ========== */
.settings-header-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 1px solid rgba(192, 57, 43, 0.12);
  margin-left: 8px;
}

/* ========== POWERED BY FOOTER ========== */
.powered-by-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border-light);
}

.version-text {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 400;
  letter-spacing: 0.3px;
}

.powered-link {
  display: flex;
  text-decoration: none;
}

.powered-logo {
  height: 18px;
  width: auto;
  object-fit: contain;
  opacity: 0.4;
  transition: opacity var(--transition);
}

.powered-link:hover .powered-logo {
  opacity: 0.7;
}

/* ========== SCROLLBAR (global - light mode) ========== */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* Scrollbar dark mode */
.dark-mode ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
}
.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}
.dark-mode * {
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

/* ========== RESPONSIVE - TABLET ========== */
@media (min-width: 641px) {
  .chat-header {
    padding: 0 24px;
  }

  .input-area {
    padding: 12px 24px calc(16px + env(safe-area-inset-bottom, 0));
  }

  .input-box {
    max-width: 720px;
    margin: 0 auto;
  }

  .disclaimer {
    max-width: 720px;
    margin: 8px auto 0;
  }

  .chat-container {
    padding: 24px 32px 16px;
  }

  .message {
    max-width: 70%;
  }

  .welcome-content {
    max-width: 480px;
  }

  .welcome-title {
    font-size: 30px;
  }

  .welcome-logo {
    width: 100px;
    height: 100px;
    margin-bottom: 28px;
  }

  .welcome-logo img {
    width: 56px;
    height: 56px;
  }
}

/* ========== RESPONSIVE - PC ========== */
@media (min-width: 1024px) {
  .chat-header {
    padding: 0 32px;
  }

  .chat-container {
    padding: 28px calc((100% - 768px) / 2) 16px;
  }

  .chat-container .message {
    max-width: 75%;
  }

  .input-box {
    max-width: 768px;
  }

  .disclaimer {
    max-width: 768px;
  }

  .input-area {
    padding: 14px 32px calc(18px + env(safe-area-inset-bottom, 0));
  }

  .welcome-content {
    max-width: 560px;
  }

  .welcome-title {
    font-size: 34px;
  }

  .welcome-subtitle {
    font-size: 15px;
    margin-bottom: 40px;
  }

  .welcome-logo {
    width: 110px;
    height: 110px;
    margin-bottom: 32px;
  }

  .welcome-logo img {
    width: 64px;
    height: 64px;
  }

  .chip {
    padding: 12px 22px;
    font-size: 14px;
  }

  .modal-panel {
    max-width: 420px;
  }

  #userInput {
    font-size: 15px;
  }

  .message {
    font-size: 15px;
    padding: 14px 18px;
  }
}

/* ========== RESPONSIVE - WIDE ========== */
@media (min-width: 1440px) {
  .chat-container {
    padding: 28px calc((100% - 860px) / 2) 16px;
  }

  .chat-container .message {
    max-width: 70%;
  }

  .input-box {
    max-width: 860px;
  }

  .disclaimer {
    max-width: 860px;
  }
}

/* ========== DARK MODE ========== */
.dark-mode {
  --bg-primary: #0c0c0f;
  --bg-secondary: #16161a;
  --bg-tertiary: #1f1f25;
  --bg-chat: #0c0c0f;
  --text-primary: #eeeef0;
  --text-secondary: #9898a0;
  --text-tertiary: #5c5c66;
  --border: #26262e;
  --border-light: #1c1c22;
  --accent: #e74c3c;
  --accent-light: #f15c4d;
  --accent-glow: rgba(231, 76, 60, 0.18);
  --accent-bg: rgba(231, 76, 60, 0.1);
  --user-msg-bg: linear-gradient(135deg, #c0392b 0%, #962d22 100%);
  --user-msg-text: #ffffff;
  --bot-msg-bg: #16161a;
  --bot-msg-text: #dcdce0;
  --input-bg: #16161a;
  --glass-bg: rgba(12, 12, 15, 0.88);
  --glass-border: rgba(255, 255, 255, 0.06);
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px rgba(231, 76, 60, 0.12);
}

.dark-mode .modal-card {
  border-color: var(--border);
}

.dark-mode .modal-card-icon.warning {
  background: rgba(234, 88, 12, 0.1);
}

.dark-mode .modal-card-icon.success {
  background: rgba(22, 163, 74, 0.1);
}

.dark-mode .report-textarea {
  background: var(--bg-tertiary);
  border-color: var(--border);
  color: var(--text-primary);
}

.dark-mode .privacy-scroll {
  background: var(--bg-tertiary);
  border-color: var(--border);
}

.dark-mode .contact-card {
  background: var(--bg-secondary);
  border-color: var(--border);
}

.dark-mode .toggle-slider::before {
  background: #d8d8d8;
}

.dark-mode .bot-message {
  border-color: var(--border);
}

.dark-mode .bot-message code {
  background: rgba(255,255,255,0.06);
}

.dark-mode .modal-panel {
  border-right-color: var(--border);
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ========== TOUCH OPTIMIZATION ========== */
@media (hover: none) and (pointer: coarse) {
  .chip:hover {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-primary);
    box-shadow: none;
    transform: none;
  }

  .chip:hover svg {
    color: var(--text-tertiary);
  }

  .chip:active {
    background: var(--accent-bg);
    border-color: rgba(192, 57, 43, 0.25);
    color: var(--accent);
  }

  .chip:active svg {
    color: var(--accent);
  }

  .icon-button:hover {
    background: none;
  }
  .icon-button:active {
    background: var(--bg-tertiary);
  }

  .settings-item:hover {
    background: none;
  }
  .settings-item:active {
    background: var(--bg-secondary);
  }

  .settings-item:hover .settings-chevron {
    transform: none;
  }

  .settings-item:hover .settings-item-icon {
    color: var(--text-secondary);
  }

  .contact-card:hover {
    border-color: var(--border-light);
    box-shadow: none;
  }

  .btn-primary:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.15);
  }

  .send-button:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.2);
  }
}
