/* ==========================================
   Design System: Organic Electronics Theme
   ========================================== */

:root {
  /* Color Palette */
  --bg-deep: #05080c;
  --bg-forest: #08120a;
  
  --panel-glass: rgba(13, 22, 16, 0.45);
  --panel-glass-border: rgba(82, 183, 136, 0.12);
  --panel-glass-hover: rgba(13, 22, 16, 0.65);
  --panel-glass-active: rgba(82, 183, 136, 0.2);
  
  --accent-glow: #52b788;
  --accent-cyan: #0891b2;
  --accent-teal: #0d9488;
  
  --text-main: #f1faee;
  --text-secondary: #95d5b2;
  --text-muted: #6b9071;
  --text-code: #84cc16;
  
  --shadow-glow: 0 0 30px rgba(82, 183, 136, 0.15);
  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --font-sans: 'Inter', sans-serif;
  --font-serif: 'Playfair Display', serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  line-height: 1.5;
}

/* Aurora Backdrop Animation */
.aurora-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, var(--bg-forest) 0%, var(--bg-deep) 100%);
}

.aurora-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.18;
  mix-blend-mode: screen;
}

.aurora-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 80%);
  top: -10%;
  left: 20%;
  animation: drift-orb 15s infinite alternate ease-in-out;
}

.aurora-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 80%);
  bottom: 10%;
  right: 15%;
  animation: drift-orb 18s infinite alternate-reverse ease-in-out;
}

.aurora-3 {
  width: 700px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-teal) 0%, transparent 80%);
  top: 40%;
  left: -10%;
  animation: drift-orb 22s infinite alternate ease-in-out;
}

@keyframes drift-orb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, 30px) scale(1.1); }
  100% { transform: translate(-30px, -50px) scale(0.9); }
}

/* Main Container Grid */
.app-container {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: 100vh;
  width: 100vw;
  position: relative;
  z-index: 10;
  backdrop-filter: blur(5px);
}

/* Common Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
  background: var(--panel-glass-border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Sidebar Source Manager */
.sidebar-panel {
  background: var(--panel-glass);
  border-right: 1px solid var(--panel-glass-border);
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
  gap: 24px;
  box-shadow: var(--shadow-card);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  color: var(--accent-glow);
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 0 8px rgba(82, 183, 136, 0.4));
}

.logo-area h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.source-count-badge {
  background: rgba(82, 183, 136, 0.12);
  border: 1px solid var(--panel-glass-border);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* File Upload Zone */
.drop-zone {
  border: 2px dashed rgba(82, 183, 136, 0.25);
  background: rgba(13, 22, 16, 0.2);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent-glow);
  background: rgba(82, 183, 136, 0.06);
  box-shadow: var(--shadow-glow);
}

.upload-icon {
  width: 42px;
  height: 42px;
  color: var(--text-secondary);
  opacity: 0.8;
  margin-bottom: 4px;
}

.drop-text-main {
  font-size: 14px;
  font-weight: 500;
}

.drop-text-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Utility buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-glow) 0%, var(--accent-teal) 100%);
  color: #030a05;
  font-weight: 600;
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 15px rgba(82, 183, 136, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-glass-border);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: rgba(82, 183, 136, 0.08);
  border-color: var(--accent-glow);
}

.btn-icon-only {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 8px;
  flex-shrink: 0;
}

.btn-icon-only i {
  width: 18px;
  height: 18px;
}

/* Web Import Section */
.web-import-section h3, .sources-list-container h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.input-group {
  display: flex;
  gap: 8px;
}

.input-group input {
  flex: 1;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--panel-glass-border);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font-sans);
  transition: var(--transition-smooth);
}

.input-group input:focus {
  outline: none;
  border-color: var(--accent-glow);
  box-shadow: 0 0 10px rgba(82, 183, 136, 0.15);
}

/* Active Source List */
.sources-list-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sources-empty-state {
  border: 1px dashed rgba(82, 183, 136, 0.1);
  border-radius: 12px;
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty-icon {
  width: 24px;
  height: 24px;
  opacity: 0.5;
}

.sources-list {
  list-style: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
}

.source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(13, 22, 16, 0.25);
  border: 1px solid var(--panel-glass-border);
  border-radius: 10px;
  transition: var(--transition-smooth);
}

.source-item:hover {
  background: var(--panel-glass-hover);
  border-color: rgba(82, 183, 136, 0.25);
}

.source-details {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.source-details i {
  width: 16px;
  height: 16px;
  color: var(--accent-glow);
  flex-shrink: 0;
}

.source-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.source-title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-status {
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.source-status.indexing {
  color: var(--accent-cyan);
}

.source-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.source-delete-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* Main Workspace */
.main-workspace {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Header bar */
.app-header {
  height: 70px;
  border-bottom: 1px solid var(--panel-glass-border);
  background: rgba(5, 8, 12, 0.4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px;
}

.routing-status-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
  position: relative;
}

.status-indicator.ready {
  background-color: var(--accent-glow);
  box-shadow: 0 0 8px var(--accent-glow);
}

.status-indicator.working {
  background-color: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulse-working 1s infinite alternate;
}

@keyframes pulse-working {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.3); opacity: 1; }
}

.status-text {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

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

/* Toggle API Source Switch */
.toggle-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.toggle-switch-wrapper {
  position: relative;
  display: inline-block;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--panel-glass-border);
  border-radius: 20px;
  width: 210px;
  height: 32px;
  overflow: hidden;
}

.toggle-switch-input {
  display: none;
}

.toggle-switch-label {
  position: absolute;
  inset: 0;
  display: flex;
  cursor: pointer;
}

.toggle-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 2;
  transition: var(--transition-smooth);
}

.toggle-gemini {
  color: var(--bg-deep);
}

.toggle-9router {
  color: var(--text-muted);
}

.toggle-switch-label::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  bottom: 2px;
  width: calc(50% - 2px);
  background: linear-gradient(135deg, var(--accent-glow) 0%, var(--accent-teal) 100%);
  border-radius: 16px;
  transition: var(--transition-smooth);
  z-index: 1;
}

.toggle-switch-input:checked + .toggle-switch-label::before {
  left: calc(50% + 0px);
}

.toggle-switch-input:checked + .toggle-switch-label .toggle-gemini {
  color: var(--text-muted);
}

.toggle-switch-input:checked + .toggle-switch-label .toggle-9router {
  color: var(--bg-deep);
}

.btn-with-icon {
  padding-left: 12px;
}

.btn-with-icon i {
  width: 15px;
  height: 15px;
}

/* Chat container & Panel styling */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 32px;
  overflow: hidden;
  position: relative;
}

.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  gap: 20px;
}

.empty-visual {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: rgba(82, 183, 136, 0.05);
  border: 1px solid var(--panel-glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.sparkle-icon {
  width: 32px;
  height: 32px;
  color: var(--accent-glow);
  filter: drop-shadow(0 0 10px rgba(82, 183, 136, 0.3));
}

.chat-empty-state h2 {
  font-family: var(--font-sans);
  font-size: 32px;
  font-weight: 700;
}

.chat-empty-state p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

/* Suggested Queries */
.suggested-queries-box {
  margin-top: 32px;
  width: 100%;
  text-align: left;
}

.suggested-queries-box h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.suggestions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.suggestion-card {
  background: rgba(13, 22, 16, 0.2);
  border: 1px solid var(--panel-glass-border);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: left;
  line-height: 1.4;
}

.suggestion-card:hover {
  background: var(--panel-glass-hover);
  border-color: var(--accent-glow);
  transform: translateY(-2px);
}

/* Chat Feed */
.chat-feed {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-right: 12px;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

.message-wrapper {
  display: flex;
  gap: 16px;
  opacity: 0;
  transform: translateY(20px);
}

.message-wrapper.visible {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.4s ease-out;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.message-avatar-user {
  background: rgba(82, 183, 136, 0.12);
  border: 1px solid var(--panel-glass-border);
  color: var(--text-secondary);
}

.message-avatar-assistant {
  background: linear-gradient(135deg, var(--accent-glow) 0%, var(--accent-teal) 100%);
  color: #030a05;
}

.message-avatar i {
  width: 16px;
  height: 16px;
}

.message-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.message-sender {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.message-body {
  font-size: 17.5px;
  line-height: 1.7;
  color: var(--text-main);
}

/* Markdown styling inside messages */
.message-body p {
  margin-bottom: 16px;
}
.message-body p:last-child {
  margin-bottom: 0;
}

.message-body code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: monospace;
  color: var(--text-code);
}

.message-body pre {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-glass-border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin: 12px 0;
}

.message-body pre code {
  background: transparent;
  padding: 0;
  color: #f1faee;
}

.message-body h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 16px 0 8px;
}

.message-body ul, .message-body ol {
  margin: 8px 0 16px 20px;
}

/* Grounding Citations */
.citations-wrapper {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.citation-chip {
  background: rgba(82, 183, 136, 0.06);
  border: 1px solid rgba(82, 183, 136, 0.2);
  border-radius: 6px;
  font-size: 11px;
  padding: 4px 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.citation-chip:hover {
  background: rgba(82, 183, 136, 0.15);
  border-color: var(--accent-glow);
}

.citation-panel {
  background: rgba(13, 22, 16, 0.4);
  border: 1px solid var(--panel-glass-border);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.6;
  margin-top: 8px;
  display: none;
  animation: slideDown 0.25s ease-out;
}

.citation-panel-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.citation-quote {
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 16px;
  color: var(--text-main);
  opacity: 0.9;
  border-left: 3px solid var(--accent-glow);
  padding-left: 12px;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Follow-up suggestions */
.follow-ups-container {
  max-width: 800px;
  width: 100%;
  margin: 16px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  animation: fadeIn 0.5s ease-out;
}

.follow-up-pill {
  background: transparent;
  border: 1px solid var(--panel-glass-border);
  color: var(--text-secondary);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.follow-up-pill:hover {
  background: rgba(82, 183, 136, 0.08);
  border-color: var(--accent-glow);
  color: var(--text-main);
}

/* Typing Indicator Animation */
.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  height: 24px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-glow);
  animation: typing-wave 1s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-wave {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Bottom Input Panel */
.input-panel {
  max-width: 800px;
  width: 100%;
  margin: 20px auto 0;
  position: relative;
}

.chat-form {
  background: rgba(5, 8, 12, 0.7);
  border: 1px solid var(--panel-glass-border);
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: var(--shadow-card);
}

.textarea-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.textarea-wrapper textarea {
  flex: 1;
  background: transparent;
  border: none;
  resize: none;
  color: var(--text-main);
  font-size: 14px;
  font-family: var(--font-sans);
  padding: 8px 0;
  max-height: 140px;
}

.textarea-wrapper textarea:focus {
  outline: none;
}

.input-actions {
  display: flex;
  gap: 8px;
}

.btn-send {
  background: linear-gradient(135deg, var(--accent-glow) 0%, var(--accent-teal) 100%);
  color: #030a05;
}

/* Indexing Progress Bar overlay */
.indexing-progress-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  background: rgba(5, 8, 12, 0.95);
  border: 1px solid var(--panel-glass-border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 10;
}

.progress-bar-inner {
  height: 4px;
  background: linear-gradient(90deg, var(--accent-cyan) 0%, var(--accent-glow) 100%);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  animation: pulse-progress 1s infinite alternate;
}

@keyframes pulse-progress {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

/* Modals & Overlays */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-card {
  background: var(--panel-glass);
  border: 1px solid var(--panel-glass-border);
  box-shadow: var(--shadow-card);
  width: 500px;
  border-radius: 20px;
  overflow: hidden;
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleUp {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-close-btn:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-group h3 {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.form-field label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.form-field input, .form-field select {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-glass-border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
}

.form-field input:focus, .form-field select:focus {
  outline: none;
  border-color: var(--accent-glow);
}

.field-help {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--panel-glass-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Animations Helper */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==========================================
   Light Theme Override (Paper / White Mode)
   ========================================== */
body.light-theme {
  --bg-deep: #fafaf9; /* Stone 50 */
  --bg-forest: #f5f5f4; /* Stone 100 */
  
  --panel-glass: rgba(255, 255, 255, 0.8);
  --panel-glass-border: rgba(22, 101, 52, 0.16);
  --panel-glass-hover: rgba(255, 255, 255, 0.95);
  --panel-glass-active: rgba(22, 101, 52, 0.12);
  
  --accent-glow: #16a34a; /* Green 600 */
  --accent-cyan: #0891b2;
  --accent-teal: #0d9488;
  
  --text-main: #1c1917; /* Stone 900 */
  --text-secondary: #166534; /* Green 800 */
  --text-muted: #57534e; /* Stone 600 */
  --text-code: #15803d;
  
  --shadow-glow: 0 0 20px rgba(22, 163, 74, 0.08);
  --shadow-card: 0 8px 32px 0 rgba(28, 25, 23, 0.06);
}

body.light-theme .aurora-orb {
  opacity: 0.06;
  mix-blend-mode: multiply;
}

body.light-theme ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

body.light-theme ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

body.light-theme .chat-form {
  background: rgba(255, 255, 255, 0.95);
}

body.light-theme .drop-zone {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(22, 101, 52, 0.2);
}

body.light-theme .drop-zone:hover, body.light-theme .drop-zone.drag-over {
  background: rgba(22, 163, 74, 0.04);
}

body.light-theme .suggestion-card {
  background: rgba(255, 255, 255, 0.5);
}

body.light-theme .source-item {
  background: rgba(255, 255, 255, 0.6);
}

body.light-theme .btn-secondary {
  background: rgba(255, 255, 255, 0.8);
}

/* ==========================================
   Privacy Notice Banner
   ========================================== */

@keyframes bannerSlideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes bannerSlideDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(100%);
    opacity: 0;
  }
}

.privacy-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 0 24px 24px;
  pointer-events: none;
  animation: bannerSlideUp 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.privacy-banner.dismissing {
  animation: bannerSlideDown 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.privacy-banner-inner {
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 20px;
  background: rgba(8, 18, 10, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(82, 183, 136, 0.25);
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(82, 183, 136, 0.06);
}

.privacy-banner-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(82, 183, 136, 0.12);
  border-radius: 50%;
  color: var(--accent-glow);
}

.privacy-banner-icon svg {
  width: 18px;
  height: 18px;
}

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

.privacy-banner-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.privacy-banner-body {
  font-size: 0.82rem;
  color: rgba(241, 250, 238, 0.65);
  line-height: 1.5;
}

.privacy-banner-body strong {
  color: var(--text-main);
  font-weight: 500;
}

.privacy-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.privacy-learn-link {
  font-size: 0.78rem;
  color: var(--accent-glow);
  text-decoration: none;
  letter-spacing: 0.02em;
  opacity: 0.8;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.privacy-learn-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.privacy-dismiss-btn {
  padding: 7px 18px;
  background: rgba(82, 183, 136, 0.15);
  border: 1px solid rgba(82, 183, 136, 0.3);
  border-radius: 8px;
  color: var(--accent-glow);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: var(--transition-smooth);
  white-space: nowrap;
  font-family: var(--font-sans);
}

.privacy-dismiss-btn:hover {
  background: rgba(82, 183, 136, 0.28);
  border-color: rgba(82, 183, 136, 0.5);
  color: #fff;
}

/* Light theme override */
body.light-theme .privacy-banner-inner {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(82, 183, 136, 0.3);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
}

body.light-theme .privacy-banner-title {
  color: #2d6a4f;
}

body.light-theme .privacy-banner-body {
  color: rgba(30, 30, 30, 0.7);
}

body.light-theme .privacy-banner-body strong {
  color: #1b1b1b;
}

/* Mobile */
@media (max-width: 640px) {
  .privacy-banner {
    padding: 0 12px 12px;
  }

  .privacy-banner-inner {
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 16px;
  }

  .privacy-banner-actions {
    width: 100%;
    justify-content: flex-end;
  }
}


