:root {
  /* Epsilon Dark Theme - matching epsilontg.com */

  /* Backgrounds */
  --bg: #0B1120;
  --bg-white: #111827;
  --bg-2: #111827;
  --bg-3: #1A2332;
  --bg-4: #1E293B;
  --bg-hover: #1E293B;
  --bg-input: #0F172A;

  /* Primary (ETS Corporate Orange) */
  --accent: #E8632B;
  --accent-hover: #D4561F;
  --accent-light: rgba(232, 99, 43, 0.12);
  --accent-2: #FF6933;

  /* Text Colors */
  --fg: #E2E8F0;
  --fg-gray: #94A3B8;
  --fg-dark: #E2E8F0;
  --fg-inverse: #0B1120;
  --muted: #64748B;
  --muted-2: #475569;
  --text-dark: #E2E8F0;
  --text-gray: #94A3B8;

  /* Legacy compatibility */
  --charcoal: #1A2332;
  --bg-black: #0B1120;

  /* Borders */
  --border: #1E293B;
  --border-accent: rgba(232, 99, 43, 0.25);

  /* Shadows */
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-lg: rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box }
html, body { height: 100% }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

.app { 
  width: 100%;
  padding: 0 20px;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.hero {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-white);
}

.brand {
  font-family: "Playfair Display", serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--accent);
  margin-bottom: 6px;
}

.tagline {
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.2px;
}

.chat { 
  flex: 1;
  overflow-y: auto;
  padding: 24px 12px 120px 12px;
  scroll-behavior: smooth;
}

.chat::-webkit-scrollbar {
  width: 8px;
}

.chat::-webkit-scrollbar-track {
  background: transparent;
}

.chat::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

.chat::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.msg { 
  display: flex; 
  gap: 12px; 
  margin: 20px 0;
  animation: fadeIn 0.3s ease-in;
}

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

.msg-user { 
  justify-content: flex-end;
}

.msg .bubble {
  max-width: 720px;
  color: var(--fg);
  background: var(--bg-white);
  border: 1px solid var(--border);
  padding: 16px 20px;
  border-radius: 16px;
  box-shadow: 0 2px 8px var(--shadow);
  white-space: pre-line;
  word-wrap: break-word;
  line-height: 1.65;
  font-size: 15px;
}

.msg-user .bubble {
  /* User query card - ETS blue theme */
  background: var(--accent);
  color: var(--fg-inverse);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 20px 24px;
  font-size: 16px;
  line-height: 1.6;
  box-shadow: 0 2px 8px rgba(232, 99, 43, 0.25);
}

.msg-assistant .title { 
  color: var(--muted); 
  font-size: 13px; 
  font-weight: 500;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.processing {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  color: var(--fg);
  font-size: 14px;
  padding: 10px 16px;
  background: var(--bg-3);
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px var(--shadow);
  animation: slideIn 0.3s ease-out;
}

.processing-bubble {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px var(--shadow);
}

/* Tool Card Styles - RIGHT aligned with assistant messages */
.tool-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 24px;
  margin: 16px auto 16px 0;
  max-width: 720px;
  animation: slideInUp 0.4s ease-out;
}

.tool-card-header {
  font-size: 20px;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 12px;
}

.tool-card-content {
  font-size: 15px;
  line-height: 1.7;
  color: var(--fg);
}

.tool-card.tool-error {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.25);
}

.tool-card.tool-error .tool-card-header {
  color: #f87171;
}

.tool-card.tool-error .tool-card-content {
  color: #fca5a5;
}

/* Tool Processing indicator - "Tool name..." with animated dots - RIGHT aligned */
.tool-processing {
  font-size: 14px;
  color: var(--muted);
  margin: 4px auto 4px 0;
  padding: 4px 0;
  max-width: 720px;
  text-align: left;
  animation: fadeIn 0.3s ease-in;
}

.tool-processing-name {
  font-weight: 500;
  color: var(--fg);
}

.tool-processing-dots::after {
  content: '';
  animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
  0% { content: '.'; }
  33% { content: '..'; }
  66% { content: '...'; }
  100% { content: '.'; }
}

.tool-status-icon {
  margin-right: 8px;
  font-weight: 600;
}

.tool-processing.tool-completed {
  color: var(--accent);
}

.tool-processing.tool-completed .tool-status-icon {
  color: var(--accent);
}

.tool-processing.tool-completed .tool-processing-name {
  color: var(--accent);
}

.tool-progress-text {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  font-style: italic;
  transition: opacity 0.2s ease;
}

/* Dynamic Tool Category Colors - ETS Light Theme Professional Palette */

/* Search - Primary ETS Orange */
.tool-processing.tool-search {
  background: rgba(232, 99, 43, 0.06);
  border: 1px solid rgba(232, 99, 43, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 4px 0;
}

.tool-processing.tool-search .tool-processing-name {
  color: #E8632B;
}

.tool-processing.tool-search.tool-completed .tool-status-icon,
.tool-processing.tool-search.tool-completed .tool-processing-name {
  color: #E8632B;
}

/* Validation - Teal */
.tool-processing.tool-validation {
  background: rgba(13, 148, 136, 0.06);
  border: 1px solid rgba(13, 148, 136, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 4px 0;
}

.tool-processing.tool-validation .tool-processing-name {
  color: #0d9488;
}

.tool-processing.tool-validation.tool-completed .tool-status-icon,
.tool-processing.tool-validation.tool-completed .tool-processing-name {
  color: #0f766e;
}

/* Extraction - Emerald Green (semantic: data extraction) */
.tool-processing.tool-extraction {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 4px 0;
}

.tool-processing.tool-extraction .tool-processing-name {
  color: #059669;
}

.tool-processing.tool-extraction.tool-completed .tool-status-icon,
.tool-processing.tool-extraction.tool-completed .tool-processing-name {
  color: #047857;
}

/* Analysis - Slate Blue (semantic: inspection/thinking) */
.tool-processing.tool-analysis {
  background: rgba(71, 85, 105, 0.06);
  border: 1px solid rgba(71, 85, 105, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 4px 0;
}

.tool-processing.tool-analysis .tool-processing-name {
  color: #475569;
}

.tool-processing.tool-analysis.tool-completed .tool-status-icon,
.tool-processing.tool-analysis.tool-completed .tool-processing-name {
  color: #334155;
}

/* Database - Indigo */
.tool-processing.tool-database {
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 4px 0;
}

.tool-processing.tool-database .tool-processing-name {
  color: #4f46e5;
}

.tool-processing.tool-database.tool-completed .tool-status-icon,
.tool-processing.tool-database.tool-completed .tool-processing-name {
  color: #4338ca;
}

/* Report - Sky Blue */
.tool-processing.tool-report {
  background: rgba(14, 165, 233, 0.06);
  border: 1px solid rgba(14, 165, 233, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 4px 0;
}

.tool-processing.tool-report .tool-processing-name {
  color: #0284c7;
}

.tool-processing.tool-report.tool-completed .tool-status-icon,
.tool-processing.tool-report.tool-completed .tool-processing-name {
  color: #0369a1;
}

/* Default - Neutral Gray */
.tool-processing.tool-default {
  background: rgba(100, 116, 139, 0.06);
  border: 1px solid rgba(100, 116, 139, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 4px 0;
}

.tool-processing.tool-default .tool-processing-name {
  color: #64748b;
}

.tool-processing.tool-default.tool-completed .tool-status-icon,
.tool-processing.tool-default.tool-completed .tool-processing-name {
  color: #475569;
}

.tool-processing.tool-error-inline {
  color: #ef4444;
}

.tool-processing.tool-error-inline .tool-status-icon {
  color: #ef4444;
}

.tool-processing.tool-error-inline .tool-processing-name {
  color: #ef4444;
}

.tool-processing.tool-confirmation {
  color: #b45309;
  background: rgba(217, 119, 6, 0.08);
  border: 1px solid rgba(217, 119, 6, 0.25);
  border-radius: 8px;
  padding: 8px 12px;
  animation: confirmPulse 2s ease-in-out infinite;
}

.tool-processing.tool-confirmation .tool-status-icon {
  color: #d97706;
}

.tool-processing.tool-confirmation .tool-processing-name {
  color: #b45309;
}

@keyframes confirmPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(217, 119, 6, 0); }
}

.confirmation-waiting-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin: 12px auto 12px 0;
  max-width: 720px;
  background: rgba(217, 119, 6, 0.08);
  border: 1px solid rgba(217, 119, 6, 0.25);
  border-radius: 12px;
  color: #b45309;
  font-size: 14px;
  font-weight: 500;
  animation: confirmPulse 2s ease-in-out infinite;
}

.confirmation-waiting-indicator svg {
  flex-shrink: 0;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.input-highlight {
  animation: inputPulse 1.5s ease-in-out infinite;
}

@keyframes inputPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.15); }
}

.tool-expandable {
  background: rgba(232, 99, 43, 0.04);
  border: 1px solid rgba(232, 99, 43, 0.12);
  border-radius: 8px;
  padding: 0;
  margin: 8px auto 8px 0;
  max-width: 720px;
}

.tool-expandable .tool-header {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.tool-expandable .tool-header:hover {
  background: rgba(232, 99, 43, 0.08);
}

.tool-expand-icon {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.tool-expand-icon.expanded {
  transform: rotate(0deg);
}

.tool-content-panel {
  border-top: 1px solid var(--border);
  padding: 16px;
  background: var(--bg-3);
  border-radius: 0 0 8px 8px;
  max-height: 500px;
  overflow-y: auto;
}

.tool-content-inner {
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg);
}

.tool-content-inner h2, .tool-content-inner h3 {
  color: var(--accent);
  margin: 16px 0 8px 0;
  font-size: 15px;
}

.tool-content-inner h2:first-child, .tool-content-inner h3:first-child {
  margin-top: 0;
}

.tool-content-inner table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 12px;
}

.tool-content-inner th, .tool-content-inner td {
  padding: 8px 10px;
  border: 1px solid var(--border);
  text-align: left;
}

.tool-content-inner th {
  background: rgba(232, 99, 43, 0.08);
  color: var(--accent);
  font-weight: 600;
}

.tool-content-inner td {
  background: var(--bg-white);
}

.tool-content-inner ul, .tool-content-inner ol {
  margin: 8px 0;
  padding-left: 20px;
}

.tool-content-inner li {
  margin: 4px 0;
}

.tool-content-panel::-webkit-scrollbar {
  width: 6px;
}

.tool-content-panel::-webkit-scrollbar-track {
  background: transparent;
}

.tool-content-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

.md-table-wrapper {
  overflow-x: auto;
  margin: 8px 0 16px 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-white);
}

.md-table a {
  color: var(--accent);
  text-decoration: none;
}

.md-table a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.md-table th {
  text-align: left;
  padding: 12px 16px;
  background: rgba(232, 99, 43, 0.08);
  color: var(--accent);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.md-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
}

.md-table tr:last-child td {
  border-bottom: none;
}

.md-table tr:hover {
  background: var(--bg-hover);
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

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

/* Message Container Styles - User LEFT, Assistant RIGHT */
.message-container {
  margin: 24px 0;
  max-width: 720px;
  animation: slideInUp 0.4s ease-out;
}

/* User messages - LEFT aligned */
.user-message-container {
  margin-left: auto;
  margin-right: 0;
}

/* Assistant messages - RIGHT aligned */
.assistant-message-container {
  margin-right: auto;
  margin-left: 0;
  position: relative;
}

.message-label {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
  padding-left: 4px;
}

.message-label strong {
  font-weight: 600;
  color: var(--accent);
}

/* User message bubble - LEFT side */
.user-bubble {
  background: var(--bg-3);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 16px 16px 4px 16px;
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
  box-shadow: 0 4px 16px var(--shadow);
}

/* Answer card - RIGHT side, ETS charcoal style */
.answer-card {
  background: var(--bg-2);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 16px 16px 16px 4px;
  padding: 20px 24px;
  font-size: 15px;
  line-height: 1.7;
  box-shadow: 0 4px 16px var(--shadow);
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Inline Assistant Message Style */
.assistant-inline {
  background: transparent;
  border: none;
  box-shadow: none;
}

.assistant-content {
  color: var(--fg);
  font-size: 15px;
  line-height: 1.7;
  word-wrap: break-word;
}

.assistant-content .assistant-label {
  display: inline;
  margin-right: 4px;
}

.assistant-content .assistant-text {
  display: inline;
}

.assistant-text > p.md-para:first-child {
  display: inline;
}

.assistant-label {
  color: var(--accent);
  font-weight: 600;
}

.assistant-text {
  color: var(--fg);
}

.assistant-text h1,
.assistant-text h2,
.assistant-text h3,
.assistant-text h4 {
  margin: 16px 0 8px 0;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.3;
}

.assistant-text h1:first-child,
.assistant-text h2:first-child,
.assistant-text h3:first-child,
.assistant-text h4:first-child {
  margin-top: 0;
}

.assistant-text h4 {
  font-size: 15px;
}

.assistant-text a,
.answer-card a,
.bubble a {
  color: #60a5fa;
  text-decoration: none;
}

.assistant-text a:hover,
.answer-card a:hover,
.bubble a:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.assistant-text strong {
  font-weight: 600;
  color: var(--fg);
}

.assistant-text code {
  background: rgba(232, 99, 43, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
  font-size: 13px;
  color: #FF8A5C;
  border: 1px solid rgba(232, 99, 43, 0.25);
}

.assistant-text a {
  color: var(--accent-2);
  text-decoration: underline;
  text-decoration-color: rgba(96, 165, 250, 0.3);
}

@keyframes card-slide-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.processing strong {
  color: var(--accent-2);
  font-weight: 600;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(232, 99, 43, 0.3);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin { 
  to { transform: rotate(360deg); } 
}

.composer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(180deg, transparent 0%, var(--bg) 40%, var(--bg) 100%);
  backdrop-filter: blur(12px);
  z-index: 100;
}

.composer form {
  display: flex;
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 8px;
  box-shadow: 0 8px 32px var(--shadow),
              0 0 0 1px rgba(255,255,255,.03) inset;
  transition: all 0.3s ease;
}

.composer form:focus-within {
  border-color: rgba(232, 99, 43, 0.5);
  box-shadow: 0 8px 40px rgba(232, 99, 43, 0.15),
              0 0 0 1px rgba(232, 99, 43, 0.3) inset;
  transform: translateY(-2px);
}

.composer input { 
  flex: 1; 
  background: transparent; 
  color: var(--fg); 
  border: 0; 
  outline: none; 
  font-size: 16px; 
  padding: 16px 20px;
  font-family: inherit;
  line-height: 1.4;
}

.composer input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.composer button {
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 18px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(232, 99, 43, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
}

.composer button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(232, 99, 43, 0.4);
}

.composer button:active {
  transform: translateY(0);
}

.composer button:disabled { 
  opacity: .5; 
  cursor: not-allowed;
  transform: none;
}

.composer button svg {
  transition: transform 0.2s ease;
}

.composer button:hover svg {
  transform: translateX(2px);
}

#new-session-btn {
  background: var(--bg-white);
  border: 1px solid var(--border);
  color: var(--muted);
  min-width: 48px;
  padding: 14px 16px;
  margin-left: 4px;
  box-shadow: 0 2px 8px var(--shadow);
}

#new-session-btn:hover {
  background: var(--bg-hover);
  border-color: rgba(232, 99, 43, 0.2);
  color: var(--fg);
  box-shadow: 0 4px 12px var(--shadow);
}

#new-session-btn svg {
  transform: none;
}

#new-session-btn:hover svg {
  transform: rotate(180deg);
}

#upload-btn {
  background: var(--bg-white);
  border: 1px solid var(--border);
  color: var(--fg);
  min-width: 48px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px var(--shadow);
}

#upload-btn:hover {
  background: var(--bg-hover);
  border-color: rgba(232, 99, 43, 0.2);
}

#upload-btn svg {
  transform: none;
}

#upload-btn:hover svg {
  transform: none;
}

.attachment-bar {
  max-width: 1100px;
  margin: 12px auto 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.attachment-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 6px 12px;
  color: var(--fg);
  font-size: 13px;
}

.attachment-pill button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

.attachment-pill button:hover {
  color: var(--fg);
}

.result {
  margin: 16px 0;
  padding: 18px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 2px 12px var(--shadow);
}

.result .meta { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 12px; 
  align-items: center; 
  margin-bottom: 14px; 
  color: var(--muted);
  font-size: 14px;
}

.result .sql-btn {
  margin-left: auto;
  background: rgba(232, 99, 43, 0.1);
  border: 1px solid rgba(232, 99, 43, 0.2);
  color: var(--accent);
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.2s ease;
}

.result .sql-btn:hover {
  background: rgba(232, 99, 43, 0.15);
  border-color: rgba(232, 99, 43, 0.3);
}

.result .viz { 
  margin: 14px 0;
}

.result .table { 
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.result table { 
  border-collapse: collapse; 
  width: 100%;
  font-size: 14px;
}

.result th {
  text-align: left;
  padding: 10px 12px;
  background: rgba(232, 99, 43, 0.08);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--accent);
}

.result td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.result tr:last-child td {
  border-bottom: none;
}

.result tr:hover {
  background: var(--bg-hover);
}

.pill {
  display: inline-block;
  background: rgba(232, 99, 43, 0.1);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(232, 99, 43, 0.2);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal[hidden] { 
  display: none;
}

.modal-content {
  width: min(850px, calc(100% - 40px));
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  color: var(--fg);
  box-shadow: 0 8px 40px var(--shadow-lg);
  position: relative;
}

.modal .close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal .close:hover {
  background: var(--bg-hover);
  border-color: rgba(232, 99, 43, 0.2);
}

.modal pre {
  background: #1e293b;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid #334155;
  color: #e2e8f0;
}

/* Simple bar chart */
.bar { 
  display: grid; 
  grid-template-columns: 140px 1fr 90px; 
  gap: 12px; 
  align-items: center; 
  margin: 10px 0;
  font-size: 14px;
}

.bar .track {
  height: 14px;
  background: var(--bg-3);
  border-radius: 8px;
  position: relative;
  border: 1px solid var(--border);
  overflow: hidden;
}

.bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  border-radius: 7px;
  box-shadow: 0 0 10px rgba(232, 99, 43, 0.3);
  transition: width 0.3s ease;
}

/* Welcome message */
.welcome-message {
  text-align: center;
  padding: 60px 20px;
  max-width: 600px;
  margin: 0 auto;
  animation: fadeIn 0.6s ease-in;
}

.welcome-icon {
  font-size: 64px;
  margin-bottom: 20px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.welcome-message h2 {
  font-family: "Playfair Display", serif;
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 16px 0;
  background: linear-gradient(135deg, #E2E8F0 0%, #E8632B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-message p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
}

/* Chart container */
.chart-container {
  margin: 16px 0;
  padding: 20px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 2px 12px var(--shadow);
}

.chart-container canvas {
  max-width: 100%;
  height: auto !important;
}

.chart-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-2);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Image display */
.image-container {
  margin: 16px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px var(--shadow);
}

.image-container img {
  width: 100%;
  height: auto;
  display: block;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.image-grid-item {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.image-grid-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(232, 99, 43, 0.2);
}

.image-grid-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

/* Enhanced image section styles */
.image-section-header {
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--accent-2);
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.reference-images-grid {
  margin-top: 16px;
}

.reference-image-wrapper {
  box-shadow: 0 2px 12px var(--shadow);
  transition: all 0.3s ease;
  min-height: 200px;
}

.reference-image-wrapper:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(232, 99, 43, 0.2);
}

/* Enhanced welcome message */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.feature-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(232, 99, 43, 0.15);
  border-color: rgba(232, 99, 43, 0.3);
}

.feature-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.feature-text {
  font-size: 14px;
  line-height: 1.4;
}

.feature-text strong {
  color: var(--fg);
  font-weight: 600;
}

.feature-text span {
  color: var(--muted);
  font-size: 13px;
}

/* Enhanced modal styles */
.image-modal-content {
  max-width: 95vw;
  max-height: 95vh;
  padding: 0;
  overflow: hidden;
}

.image-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--accent);
  background: var(--bg-3);
}

.image-modal-body {
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

/* Responsive improvements */
@media (max-width: 768px) {
  .reference-images-grid {
    grid-template-columns: 1fr !important;
  }
  
  .feature-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .feature-item {
    padding: 12px;
  }
  
  .welcome-message {
    padding: 40px 16px;
  }
  
  .welcome-message h2 {
    font-size: 24px;
  }
  
  .welcome-message p {
    font-size: 15px;
  }
}

/* Loading states */
.reference-image-wrapper img {
  transition: opacity 0.3s ease;
}

.reference-image-wrapper img[src=""] {
  opacity: 0;
}

.reference-image-wrapper::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.reference-image-wrapper.loading::before {
  opacity: 1;
}

/* Accessibility improvements */
.reference-image-wrapper:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.modal .close:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

.reference-images-grid {
  animation: slideInUp 0.4s ease-out;
}

.feature-grid {
  animation: slideInUp 0.6s ease-out;
}

/* ========== NEW ENHANCEMENTS ========== */

/* Drag and Drop Zone */
#drop-zone {
  position: fixed;
  inset: 0;
  background: rgba(11, 17, 32, 0.95);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.drop-zone-content {
  text-align: center;
  padding: 60px;
  border: 3px dashed var(--accent);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(232, 99, 43, 0.1) 0%, rgba(232, 99, 43, 0.05) 100%);
  animation: pulse 2s ease-in-out infinite;
}

.drop-zone-content svg {
  color: var(--accent);
  margin-bottom: 20px;
  animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.drop-zone-text {
  font-size: 24px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 8px;
}

.drop-zone-subtext {
  font-size: 14px;
  color: var(--muted);
}

/* Upload Progress */
.upload-progress-container {
  background: linear-gradient(135deg, rgba(232, 99, 43, 0.1) 0%, rgba(232, 99, 43, 0.05) 100%);
  border: 1px solid rgba(232, 99, 43, 0.25);
  border-radius: 16px;
  padding: 16px 20px;
  margin: 16px 0;
  transition: all 0.3s ease;
  animation: slideIn 0.3s ease-out;
}

.upload-progress-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--fg);
  font-size: 15px;
  font-weight: 500;
}

.upload-progress-header svg {
  color: var(--accent);
  flex-shrink: 0;
}

.upload-file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-progress-bar {
  height: 8px;
  background: var(--bg-3);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  border-radius: 999px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(232, 99, 43, 0.4);
}

.upload-progress-text {
  text-align: right;
  font-size: 13px;
  color: var(--accent-2);
  font-weight: 600;
}

/* Copy Button */
.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.msg:hover .copy-btn,
.answer-wrapper:hover .copy-btn,
.assistant-inline:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  background: var(--bg-hover);
  border-color: rgba(232, 99, 43, 0.3);
  color: var(--fg);
  transform: scale(1.05);
}

.copy-btn:active {
  transform: scale(0.95);
}

.copy-btn.copied {
  background: rgba(52, 211, 153, 0.15);
  border-color: rgba(52, 211, 153, 0.3);
  color: #34D399;
}

/* Message Timestamps */
.message-timestamp {
  font-size: 11px;
  color: var(--muted);
  opacity: 0;
  margin-top: 4px;
  transition: opacity 0.2s ease;
  text-align: right;
}

.msg:hover .message-timestamp,
.answer-wrapper:hover .message-timestamp,
.assistant-inline:hover .message-timestamp {
  opacity: 0.7;
}

.answer-wrapper {
  position: relative;
  margin: 24px 0;
}

/* Scroll to Bottom Button */
.scroll-to-bottom {
  position: fixed;
  bottom: 140px;
  right: 40px;
  width: 48px;
  height: 48px;
  background: var(--accent);
  border: 1px solid rgba(232, 99, 43, 0.2);
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(232, 99, 43, 0.3);
  transition: all 0.3s ease;
  z-index: 99;
}

.scroll-to-bottom:hover {
  background: var(--accent-hover);
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(232, 99, 43, 0.4);
}

.scroll-to-bottom:active {
  transform: translateY(-1px);
}

.scroll-to-bottom.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

/* Enhanced Message Formatting */
.answer-card code,
.bubble code {
  background: rgba(232, 99, 43, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
  font-size: 13px;
  color: #FF8A5C;
  border: 1px solid rgba(232, 99, 43, 0.25);
}

.answer-card pre,
.bubble pre {
  background: #1e293b;
  padding: 16px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 12px 0;
  border: 1px solid #334155;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.answer-card pre code,
.bubble pre code {
  background: none;
  padding: 0;
  border: none;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.6;
}

.answer-card ul,
.answer-card ol,
.bubble ul,
.bubble ol {
  margin: 12px 0;
  padding-left: 24px;
}

.answer-card li,
.bubble li {
  margin: 6px 0;
  line-height: 1.6;
}

.answer-card ul {
  list-style-type: disc;
}

.answer-card ol {
  list-style-type: decimal;
}

.answer-card a,
.bubble a {
  color: var(--accent-2);
  text-decoration: underline;
  text-decoration-color: rgba(96, 165, 250, 0.3);
  transition: all 0.2s ease;
}

.answer-card a:hover,
.bubble a:hover {
  color: #93c5fd;
  text-decoration-color: rgba(147, 197, 253, 0.6);
}

.answer-card h1,
.answer-card h2,
.answer-card h3,
.answer-card h4,
.bubble h1,
.bubble h2,
.bubble h3,
.bubble h4 {
  margin: 8px 0 4px 0;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.3;
}

.answer-card h1:first-child,
.answer-card h2:first-child,
.answer-card h3:first-child,
.answer-card h4:first-child,
.bubble h1:first-child,
.bubble h2:first-child,
.bubble h3:first-child,
.bubble h4:first-child {
  margin-top: 0;
}

.answer-card p,
.bubble p,
.assistant-text p {
  margin: 2px 0;
}

.md-para {
  display: block;
  margin: 8px 0;
}

.md-para:first-child {
  margin-top: 0;
}

.md-para:last-child {
  margin-bottom: 0;
}

.md-para:empty {
  display: none;
}

.answer-card h1,
.bubble h1 {
  font-size: 20px;
}

.answer-card h2,
.bubble h2 {
  font-size: 18px;
}

.answer-card h3,
.bubble h3 {
  font-size: 16px;
}

.answer-card h4,
.bubble h4 {
  font-size: 15px;
}

.answer-card strong,
.bubble strong {
  font-weight: 600;
  color: var(--fg);
}

.answer-card em,
.bubble em {
  font-style: italic;
  color: var(--accent-2);
}

/* Loading Skeleton */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 16px;
  margin: 8px 0;
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-text.medium {
  width: 80%;
}

.skeleton-text.long {
  width: 95%;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
  .app {
    padding: 0 12px;
  }

  .hero {
    padding: 20px 0 16px;
  }

  .brand {
    font-size: 22px;
  }

  .tagline {
    font-size: 14px;
  }

  .chat {
    padding: 16px 12px 100px 12px;
  }

  .msg .bubble {
    max-width: 100%;
    padding: 14px 16px;
    font-size: 14px;
  }

  .answer-card {
    margin: 16px 0;
    padding: 16px;
    font-size: 14px;
  }

  .composer {
    padding: 12px;
  }

  .composer form {
    padding: 6px;
    border-radius: 20px;
  }

  .composer input {
    font-size: 15px;
    padding: 12px 14px;
  }

  .composer button {
    padding: 12px 14px;
    min-width: 44px;
    border-radius: 16px;
  }

  #new-session-btn,
  #upload-btn {
    min-width: 40px;
    padding: 10px 12px;
  }

  .scroll-to-bottom {
    bottom: 120px;
    right: 20px;
    width: 44px;
    height: 44px;
  }

  .copy-btn {
    opacity: 1;
  }

  .message-timestamp {
    opacity: 0.7;
    font-size: 10px;
  }

  .upload-progress-container {
    padding: 12px 16px;
  }

  .drop-zone-content {
    padding: 40px;
  }

  .drop-zone-text {
    font-size: 20px;
  }

  .processing-header {
    flex-wrap: wrap;
  }

  .agent-name {
    font-size: 16px;
  }

  .welcome-icon {
    font-size: 48px;
  }
}

/* Smooth transitions for all interactive elements */
button, a, .copy-btn, .attachment-pill button {
  -webkit-tap-highlight-color: transparent;
}

/* Improve touch targets on mobile */
@media (hover: none) and (pointer: coarse) {
  .composer button,
  .copy-btn,
  .scroll-to-bottom {
    min-width: 44px;
    min-height: 44px;
  }
}

/* ========== UPLOAD SCREEN STYLES ========== */

.upload-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.upload-container {
  text-align: center;
  max-width: 500px;
  width: 100%;
}

.upload-icon {
  color: var(--accent);
  margin-bottom: 24px;
  animation: float 3s ease-in-out infinite;
}

.upload-logo {
  margin-bottom: 24px;
  animation: float 3s ease-in-out infinite;
}

.ets-logo {
  height: 64px;
  width: auto;
  transition: opacity 0.3s ease;
}

.ets-logo:not([src]), .ets-logo[src=""] {
  display: none;
}

.chat-logo:not([src]), .chat-logo[src=""] {
  display: none;
}

.upload-title {
  font-family: "Playfair Display", serif;
  font-size: 36px;
  font-weight: 700;
  background: linear-gradient(135deg, #E2E8F0 0%, #E8632B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 8px 0;
}

.upload-subtitle {
  color: var(--muted);
  font-size: 16px;
  margin: 0 0 40px 0;
}

.upload-dropzone {
  background: var(--bg-white);
  border: 2px dashed rgba(232, 99, 43, 0.3);
  border-radius: 20px;
  padding: 48px 32px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(232, 99, 43, 0.08) 0%, rgba(232, 99, 43, 0.03) 100%);
  transform: scale(1.02);
}

.dropzone-content {
  pointer-events: none;
}

.dropzone-icon {
  color: var(--accent);
  margin-bottom: 20px;
}

.dropzone-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 8px 0;
}

.dropzone-subtext {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 16px 0;
}

.browse-btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(232, 99, 43, 0.3);
}

.browse-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(232, 99, 43, 0.4);
}

.dropzone-formats {
  color: var(--muted);
  font-size: 13px;
  margin: 16px 0 0 0;
  opacity: 0.7;
}

.upload-progress {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-top: 20px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
}

.progress-filename {
  color: var(--fg);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 80%;
}

.progress-percent {
  color: var(--accent-2);
  font-weight: 600;
}

.progress-bar {
  height: 8px;
  background: var(--bg-3);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  border-radius: 999px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(232, 99, 43, 0.4);
}

.upload-success {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 16px;
  padding: 20px 24px;
  margin-top: 20px;
  animation: slideIn 0.3s ease-out;
}

.success-icon {
  color: #34D399;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-text {
  color: #34D399;
  font-size: 16px;
  font-weight: 600;
}

/* ========== CHAT SCREEN STYLES ========== */

.chat-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.chat-logo {
  height: 36px;
  width: auto;
}

.chat-brand {
  font-family: "Playfair Display", serif;
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #E2E8F0 0%, #E8632B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.chat-file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  background: var(--bg-white);
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.chat-file-info svg {
  color: var(--accent);
  flex-shrink: 0;
}

.new-session-btn {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.new-session-btn:hover {
  background: var(--bg-hover);
  border-color: rgba(232, 99, 43, 0.2);
  color: var(--fg);
}

.new-session-btn svg {
  transition: transform 0.3s ease;
}

.new-session-btn:hover svg {
  transform: rotate(180deg);
}

/* Mobile Responsive for Upload Screen */
@media (max-width: 768px) {
  .upload-container {
    padding: 20px;
  }

  .upload-title {
    font-size: 28px;
  }

  .upload-subtitle {
    font-size: 14px;
    margin-bottom: 32px;
  }

  .upload-dropzone {
    padding: 32px 20px;
  }

  .dropzone-text {
    font-size: 16px;
  }

  .browse-btn {
    padding: 12px 24px;
    font-size: 14px;
  }

  .chat-header {
    flex-wrap: wrap;
    gap: 12px;
  }

  .chat-brand {
    font-size: 18px;
  }

  .chat-logo {
    height: 28px;
  }

  .ets-logo {
    height: 48px;
  }

  .chat-file-info {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .new-session-btn {
    font-size: 13px;
    padding: 8px 12px;
  }
}

/* Todos Panel Styles */
.todos-panel {
  position: fixed;
  top: 70px;
  right: 20px;
  width: 280px;
  max-height: 400px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 8px 32px var(--shadow);
  z-index: 100;
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.todos-panel.hiding {
  opacity: 0;
  transform: translateX(20px);
}

.todos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}

.todos-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--fg);
}

.todos-count {
  font-size: 12px;
  color: var(--accent);
  background: rgba(232, 99, 43, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.todos-list {
  padding: 8px;
  max-height: 340px;
  overflow-y: auto;
}

.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: background 0.15s ease;
}

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

.todo-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-top: 1px;
}

.todo-content {
  font-size: 13px;
  line-height: 1.4;
  color: var(--fg);
}

.todo-pending .todo-icon {
  color: var(--muted);
}

.todo-pending .todo-content {
  color: var(--muted);
}

.todo-in-progress .todo-icon {
  color: var(--accent);
  animation: todoPulse 1.5s ease-in-out infinite;
}

.todo-in-progress .todo-content {
  color: var(--fg);
}

.todo-completed .todo-icon {
  color: #34D399;
}

.todo-completed .todo-content {
  color: var(--muted);
  text-decoration: line-through;
}

@keyframes todoPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Adjust chat when todos panel is visible */
.chat-screen.has-todos .chat {
  margin-right: 300px;
}

@media (max-width: 768px) {
  .todos-panel {
    position: relative;
    top: 0;
    right: 0;
    width: 100%;
    max-height: 200px;
    margin-bottom: 16px;
    border-radius: 8px;
  }

  .chat-screen.has-todos .chat {
    margin-right: 0;
  }
}

/* ========== SUGGESTION CHIPS ========== */

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 28px;
}

.suggestion-chip {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.suggestion-chip:hover {
  background: var(--accent-light);
  border-color: rgba(232, 99, 43, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(232, 99, 43, 0.15);
}

.suggestion-chip:active {
  transform: translateY(0);
}

/* ========== CITATION STYLES ========== */

.citations-container {
  margin: 16px auto 16px 0;
  max-width: 720px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  animation: slideInUp 0.4s ease-out;
  box-shadow: 0 2px 8px var(--shadow);
}

.citations-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease;
  user-select: none;
}

.citations-header:hover {
  background: var(--bg-4);
}

.citations-icon {
  display: flex;
  align-items: center;
  color: var(--accent);
}

.citations-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

.citations-toggle {
  margin-left: auto;
  display: flex;
  align-items: center;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.citations-toggle.rotated {
  transform: rotate(180deg);
}

.citations-list {
  max-height: 500px;
  overflow-y: auto;
  transition: max-height 0.3s ease;
}

.citations-list.collapsed {
  max-height: 0;
  overflow: hidden;
}

.citation-card {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.citation-card:last-child {
  border-bottom: none;
}

.citation-card.citation-clickable {
  cursor: pointer;
}

.citation-card.citation-clickable:hover {
  background: var(--accent-light);
}

.citation-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.citation-file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--bg-3);
  border-radius: 8px;
}

.citation-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.citation-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.citation-meta {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.citation-score {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

.citation-score.score-high {
  background: rgba(52, 211, 153, 0.15);
  color: #34D399;
}

.citation-score.score-medium {
  background: rgba(251, 191, 36, 0.15);
  color: #FBBF24;
}

.citation-score.score-low {
  background: rgba(248, 113, 113, 0.15);
  color: #F87171;
}

.citation-open-icon {
  display: flex;
  align-items: center;
  color: var(--muted);
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.citation-clickable:hover .citation-open-icon {
  color: var(--accent);
}

/* Model Thinking Indicator */
.model-thinking {
  margin: 6px auto 6px 0;
  padding: 8px 12px;
  max-width: 720px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(232, 99, 43, 0.04);
  border-left: 2px solid rgba(232, 99, 43, 0.4);
  border-radius: 0 6px 6px 0;
  animation: fadeIn 0.2s ease-in;
}

.model-thinking-icon {
  display: flex;
  align-items: center;
  color: #E8632B;
  opacity: 0.7;
  animation: thinkPulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
  margin-top: 1px;
}

@keyframes thinkPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.model-thinking-text {
  font-size: 13px;
  font-style: italic;
  color: var(--fg);
  opacity: 0.8;
  line-height: 1.4;
}

.model-thinking-finalized {
  opacity: 0.5;
  border-left-color: rgba(232, 99, 43, 0.15);
  background: transparent;
}

.model-thinking-finalized .model-thinking-icon {
  animation: none;
  opacity: 0.4;
}

.model-thinking-finalized .model-thinking-text {
  opacity: 0.5;
}

/* Error bubble */
.error-bubble {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: 12px;
  padding: 16px 20px;
  color: #fca5a5;
  font-size: 14px;
}

.error-bubble strong {
  color: #f87171;
}

@media (max-width: 768px) {
  .suggestion-chips {
    gap: 8px;
  }
  .suggestion-chip {
    padding: 8px 14px;
    font-size: 13px;
  }
  .citations-container {
    max-width: 100%;
  }
}

/* ========== DOCUMENT VIEWER MODAL ========== */

.doc-viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.doc-viewer-modal {
  width: 90vw;
  height: 90vh;
  background: var(--bg-white);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px var(--shadow-lg);
}

.doc-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.doc-viewer-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 12px;
}

.doc-viewer-close {
  background: var(--bg-white);
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 22px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  line-height: 1;
}

.doc-viewer-close:hover {
  background: var(--bg-hover);
  border-color: rgba(232, 99, 43, 0.2);
}

.doc-viewer-body {
  flex: 1;
  overflow: hidden;
}

.doc-viewer-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: var(--bg-white);
}

@media (max-width: 768px) {
  .doc-viewer-modal {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
}
