/**
 * Redpoint Chat Analyst Styles
 * Professional chat interface matching the Company Screener design
 */

/* ============================================
   CSS Variables (matching screen.css)
   ============================================ */
:root {
  --color-primary: #C41230;
  --color-primary-hover: #a30f28;
  --color-primary-light: #fde8eb;
  --color-success: #10b981;
  --color-success-light: #d1fae5;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-error-light: #fee2e2;

  --color-text-primary: #111827;
  --color-text-secondary: #6b7280;
  --color-text-muted: #9ca3af;

  --color-bg: #ffffff;
  --color-bg-secondary: #f9fafb;
  --color-bg-tertiary: #f3f4f6;

  --color-border: #e5e7eb;
  --color-border-light: #f3f4f6;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', Monaco, Consolas, monospace;

  --sidebar-width: 280px;
  --header-height: 56px;
  --drawer-width: 50%;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Chat-specific */
  --color-user-bg: var(--color-primary);
  --color-user-text: white;
  --color-assistant-bg: var(--color-bg);
  --color-assistant-border: var(--color-border);
  --color-tool-running: #dbeafe;
  --color-tool-running-border: #93c5fd;
  --color-tool-running-text: #1d4ed8;
  --color-tool-completed: var(--color-success-light);
  --color-tool-completed-border: #86efac;
  --color-tool-completed-text: #166534;
}

/* ============================================
   Reset & Base
   ============================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-primary);
  background: var(--color-bg-secondary);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ============================================
   App Layout
   ============================================ */
.chat-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ============================================
   Header
   ============================================ */
.chat-header {
  height: var(--header-height);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
}

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

.header-left h1 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.header-center {
  display: flex;
  align-items: center;
}

.mode-toggle {
  display: flex;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  padding: 3px;
}

.mode-btn {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.mode-btn.active {
  background: var(--color-bg);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.mode-btn:hover:not(.active) {
  color: var(--color-text-primary);
}

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

.connection-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-muted);
}

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

.connection-status.connected .status-dot {
  background: var(--color-success);
}

.connection-status.connected {
  color: var(--color-success);
}

/* Gmail Status Wrapper & Dropdown */
.gmail-status-wrapper {
  position: relative;
}

.gmail-status-wrapper .connection-status {
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.gmail-status-wrapper .connection-status:hover {
  background: var(--color-bg-tertiary);
}

.gmail-status-wrapper .connection-status.connected {
  cursor: pointer;
}

.gmail-status-wrapper .dropdown-arrow {
  margin-left: 4px;
  opacity: 0.6;
  transition: transform var(--transition-fast);
}

.gmail-status-wrapper.open .dropdown-arrow {
  transform: rotate(180deg);
}

.gmail-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 160px;
  z-index: 100;
  animation: dropdown-appear 0.15s ease;
}

.gmail-dropdown.hidden {
  display: none;
}

.gmail-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--color-text-primary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.gmail-dropdown-item:hover {
  background: var(--color-bg-secondary);
  color: var(--color-error);
}

.gmail-dropdown-item svg {
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.gmail-dropdown-item:hover svg {
  color: var(--color-error);
}

.gmail-dropdown-item.gmail-connect:hover {
  color: var(--color-success);
}

.gmail-dropdown-item.gmail-connect:hover svg {
  color: var(--color-success);
}

/* Show/hide based on connection state */
.gmail-status-wrapper.connected .gmail-connect {
  display: none;
}

.gmail-status-wrapper:not(.connected) .gmail-disconnect {
  display: none;
}

/* ============================================
   Buttons
   ============================================ */
.btn-primary {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 4px rgba(196, 18, 48, 0.2);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(196, 18, 48, 0.3);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 1px 2px rgba(196, 18, 48, 0.2);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Send button specific enhancements */
.btn-send {
  position: relative;
}

.btn-send::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.2);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn-send:hover:not(:disabled)::after {
  opacity: 1;
}

/* Send button loading state */
.btn-send.loading {
  pointer-events: none;
}

.btn-send.loading::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Send button success flash */
.btn-send.success {
  background: var(--color-success);
  animation: success-flash 0.3s ease;
}

@keyframes success-flash {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.btn-secondary {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  background: var(--color-bg);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-text-muted);
}

.btn-secondary.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}

.btn-icon:hover:not(:disabled) {
  background: var(--color-bg-secondary);
  color: var(--color-primary);
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.btn-icon:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-icon.btn-sm {
  width: 24px;
  height: 24px;
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  font-family: var(--font-mono);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  margin-left: 6px;
  color: var(--color-text-muted);
}

/* ============================================
   Body Layout
   ============================================ */
.chat-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ============================================
   Conversation Sidebar
   ============================================ */
.conversation-sidebar {
  width: var(--sidebar-width);
  background: var(--color-bg);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-light);
}

.sidebar-section .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.sidebar-section h3 {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

/* New Chat Button */
.new-chat-section {
  background: var(--color-bg-secondary);
}

.btn-new-chat {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 6px rgba(196, 18, 48, 0.25);
  position: relative;
}

.btn-new-chat:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(196, 18, 48, 0.35);
}

.btn-new-chat:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 1px 3px rgba(196, 18, 48, 0.2);
}

.btn-new-chat kbd {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
  margin-left: auto;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn-new-chat:hover kbd {
  opacity: 1;
}

/* Suggested Prompts */
.suggested-prompts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-section h3 {
  font-weight: 600;
  letter-spacing: 0.75px;
}

.prompt-chip {
  padding: 10px 14px;
  font-size: 12px;
  text-align: left;
  background: var(--color-bg);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.prompt-chip:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(196, 18, 48, 0.1);
}

/* Transcript Filters */
.transcript-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.filter-select {
  padding: 8px 10px;
  font-size: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.filter-select:hover {
  border-color: var(--color-text-muted);
}

.filter-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-light);
}

/* Conversation List */
.conversations-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.conversation-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.empty-conversations {
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
  padding: 16px 8px;
}

.conversation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--color-bg);
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.conversation-item:hover {
  border-color: rgba(196, 18, 48, 0.2);
  border-left-color: var(--color-primary);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.conversation-item.active {
  background: var(--color-primary-light);
  border-color: rgba(196, 18, 48, 0.3);
  border-left-color: var(--color-primary);
  border-left-width: 4px;
  box-shadow: 0 2px 4px rgba(196, 18, 48, 0.08);
}

.conversation-info {
  flex: 1;
  min-width: 0;
}

.conversation-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-meta {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.conversation-actions {
  display: flex;
  gap: 4px;
}

.conversation-actions button {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  opacity: 0;
  transform: translateX(4px);
}

/* Stagger animation for action buttons */
.conversation-item:hover .conversation-actions button {
  opacity: 1;
  transform: translateX(0);
}

.conversation-item:hover .conversation-actions button:nth-child(1) {
  transition-delay: 0ms;
}

.conversation-item:hover .conversation-actions button:nth-child(2) {
  transition-delay: 30ms;
}

.conversation-item:hover .conversation-actions button:nth-child(3) {
  transition-delay: 60ms;
}

.conversation-actions button:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  transform: scale(1.1);
}

.conversation-actions button.delete-btn:hover {
  color: var(--color-error);
  background: var(--color-error-light);
}

/* ============================================
   Main Chat Area
   ============================================ */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-secondary);
  min-width: 0;
  position: relative;
  border: none;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 2;
  background: var(--color-bg);
}

/* Empty State */
.chat-empty-state {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 140px; /* Leave room for input area */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-text-muted);
  pointer-events: none;
  z-index: 3; /* Above messages-container (z-index: 2) */
  background: var(--color-bg); /* Cover messages container when visible */
}

.chat-empty-state.hidden {
  display: none;
}

.chat-empty-state .empty-icon {
  margin-bottom: 20px;
  color: var(--color-border);
  opacity: 0.6;
  transform: scale(1.2);
}

.chat-empty-state h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 10px;
}

.chat-empty-state p {
  font-size: 14px;
  max-width: 400px;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

/* Messages */
.message {
  max-width: 80%;
  animation: message-appear 0.2s ease;
}

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

.message-user {
  align-self: flex-end;
}

.message-user .message-content {
  background: var(--color-user-bg);
  color: var(--color-user-text);
  padding: 12px 16px;
  border-radius: 16px 16px 4px 16px;
  box-shadow: var(--shadow-sm);
}

.message-assistant {
  align-self: flex-start;
}

.message-assistant .message-content {
  background: var(--color-assistant-bg);
  border: 1px solid var(--color-assistant-border);
  padding: 16px 20px;
  border-radius: 16px 16px 16px 4px;
  box-shadow: var(--shadow-sm);
}

/* Hide empty message content bubble */
.message-assistant .message-content:has(.message-content-text:empty) {
  display: none;
}

.message-content {
  font-size: 14px;
  line-height: 1.6;
}

.message-content p {
  margin: 0 0 12px 0;
}

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

.message-content code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--color-bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
}

.message-user .message-content code {
  background: rgba(255, 255, 255, 0.2);
}

.message-content pre {
  margin: 12px 0;
  padding: 12px;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.message-content pre code {
  background: none;
  padding: 0;
}

.message-timestamp {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.message-user .message-timestamp {
  text-align: right;
}

/* Message Actions (Copy, Regenerate) */
.message-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.message-assistant:hover .message-actions {
  opacity: 1;
}

.message-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.message-action-btn:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.message-action-btn.copied {
  color: var(--color-success);
  border-color: var(--color-success);
  background: var(--color-success-light);
}

.message-action-btn svg {
  flex-shrink: 0;
}

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

/* Process Section - collapsible container for thinking + tools */
.message-process {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
}

.message-process.hidden {
  display: none;
}

.message-process-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  user-select: none;
  transition: background var(--transition-fast);
}

.message-process-header:hover {
  background: var(--color-bg-secondary);
}

.process-toggle {
  font-size: 10px;
  transition: transform 0.2s ease;
  display: inline-block;
}

.message-process.collapsed .process-toggle {
  transform: rotate(-90deg);
}

.process-label {
  flex: 1;
}

.process-count {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 400;
}

.message-process.collapsed .message-process-content {
  display: none;
}

.message-process-content {
  padding: 0 14px 14px;
}

/* Thinking text inside process section */
.message-thinking {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-style: italic;
  line-height: 1.5;
  padding: 8px 0 8px 12px;
  border-left: 2px solid var(--color-border);
  margin-bottom: 8px;
}

.message-thinking:empty {
  display: none;
}

.message-thinking p {
  margin: 0 0 8px 0;
}

.message-thinking p:last-child {
  margin-bottom: 0;
}

/* Streaming indicator on process section */
.message-process.streaming {
  border-color: var(--color-primary);
}

.message-process.streaming .message-process-header::after {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--color-primary);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
  margin-left: auto;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Tool Indicators */
.message-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Remove margin when tools are inside process section */
.message-process .message-tools {
  margin-bottom: 0;
}

.tool-indicator {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 12px;
}

.tool-indicator.running {
  background: var(--color-tool-running);
  border-color: var(--color-tool-running-border);
  color: var(--color-tool-running-text);
}

.tool-indicator.completed {
  background: var(--color-tool-completed);
  border-color: var(--color-tool-completed-border);
  color: var(--color-tool-completed-text);
}

.tool-indicator.error {
  background: var(--color-error-light);
  border-color: #fca5a5;
  color: #dc2626;
}

.tool-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(29, 78, 216, 0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

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

/* Elegant Apple-style spinner */
.spinner-elegant {
  width: 20px;
  height: 20px;
  position: relative;
}

.spinner-elegant::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.tool-name {
  font-weight: 500;
}

.tool-detail {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.8;
}

.show-sql-btn {
  padding: 2px 8px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid currentColor;
  border-radius: var(--radius-sm);
  color: inherit;
  cursor: pointer;
  opacity: 0.8;
  transition: all var(--transition-fast);
}

.show-sql-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.5);
}

.tool-sql {
  width: 100%;
  margin-top: 8px;
}

.tool-sql pre {
  margin: 0;
  padding: 12px;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  max-height: 200px;
}

.tool-sql code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Results Preview */
.message-results {
  margin-top: 12px;
}

.results-preview {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg);
}

.results-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--color-bg-tertiary);
  border-bottom: 1px solid var(--color-border);
}

.results-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
}

.results-toggle:hover {
  color: var(--color-text-primary);
}

.results-toggle .toggle-icon {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transition: transform var(--transition-fast);
}

.results-preview.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.results-preview.collapsed .results-preview-body {
  display: none;
}

.results-preview.collapsed .results-preview-header {
  border-bottom: none;
}

.results-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.expand-results-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--color-primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.expand-results-btn:hover {
  background: var(--color-primary-light);
}

.results-preview-actions {
  display: flex;
  gap: 6px;
}

.preview-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preview-action-btn:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.results-preview-body {
  max-height: 200px;
  overflow: auto;
}

/* Simple HTML table for preview */
.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.preview-table th,
.preview-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.preview-table th {
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  position: sticky;
  top: 0;
  z-index: 1;
}

.preview-table tbody tr:hover {
  background: var(--color-bg-secondary);
}

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

/* Keep AG Grid styles for full drawer */
.results-preview-body .ag-theme-alpine {
  --ag-row-height: 32px;
  --ag-header-height: 32px;
  --ag-font-size: 12px;
}

/* Chart Preview */
.chart-preview {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg);
  margin-top: 8px;
}

.chart-header {
  padding: 12px 16px;
  background: var(--color-bg-tertiary);
  border-bottom: 1px solid var(--color-border);
}

.chart-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.chart-container {
  padding: 16px;
  height: 300px;
  position: relative;
}

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

/* Web Search Preview */
.web-search-preview {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg);
  margin-top: 8px;
}

.web-search-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--color-bg-tertiary);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}

.web-search-header:hover {
  background: var(--color-bg-secondary);
}

.web-search-toggle {
  font-size: 10px;
  transition: transform 0.2s ease;
  display: inline-block;
}

.web-search-preview.collapsed .web-search-toggle {
  transform: rotate(-90deg);
}

.web-search-icon {
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
}

.web-search-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.web-search-count {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 400;
}

.web-search-body {
  padding: 12px 14px;
  border-top: 1px solid var(--color-border-light);
}

.web-search-preview.collapsed .web-search-body {
  display: none;
}

.web-search-sources {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.web-source-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  line-height: 1.4;
}

.source-index {
  font-weight: 600;
  color: var(--color-primary);
  flex-shrink: 0;
}

.source-link {
  color: var(--color-text-primary);
  text-decoration: none;
  word-break: break-word;
  transition: color var(--transition-fast);
}

.source-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 5px;
  padding: 14px 18px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 16px 16px 16px 4px;
  align-self: flex-start;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: var(--color-text-muted);
  border-radius: 50%;
  animation: typing-bounce 1.2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* Streaming Indicator - shows during message generation */
.message-assistant.streaming::after {
  content: '';
  display: block;
  width: 100%;
  height: 2px;
  margin-top: 12px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--color-primary) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: streaming-progress 1.5s infinite ease-in-out;
  border-radius: 1px;
}

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

/* Skeleton Loaders */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-bg-tertiary) 0%,
    var(--color-border) 50%,
    var(--color-bg-tertiary) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite ease-in-out;
  border-radius: var(--radius-sm);
}

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

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

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

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

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

.skeleton-chart {
  height: 200px;
  margin-bottom: 12px;
}

.skeleton-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-row {
  display: flex;
  gap: 12px;
}

.skeleton-cell {
  height: 24px;
  flex: 1;
}

/* ============================================
   Input Area
   ============================================ */
.input-container {
  padding: 16px 24px;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  border-bottom: none;
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  transition: all var(--transition-normal);
  min-height: 48px;
}

.input-wrapper:focus-within {
  border-color: rgba(196, 18, 48, 0.5);
  box-shadow: 0 0 0 3px rgba(196, 18, 48, 0.1), 0 0 12px rgba(196, 18, 48, 0.15);
  background: #ffffff;
}

.input-wrapper textarea {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  height: 24px;
  min-height: 24px;
  max-height: 200px;
  line-height: 1.5;
  color: var(--color-text-primary);
  overflow-y: auto;
}

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

.input-wrapper textarea::placeholder {
  color: var(--color-text-muted);
}

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

.char-count {
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
  transition: color var(--transition-normal);
  font-variant-numeric: tabular-nums;
}

/* Character counter color states */
.char-count.warning {
  color: #F59E0B;
}

.char-count.danger {
  color: #EF4444;
  font-weight: 500;
}

.btn-send {
  padding: 8px 12px;
}

.btn-stop {
  padding: 8px 12px;
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s;
}

.btn-stop:hover {
  background: #b91c1c;
}

.input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  gap: 12px;
}

.input-footer-left,
.input-footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.input-footer .mode-toggle {
  padding: 2px;
}

.input-footer .mode-btn {
  padding: 4px 12px;
  font-size: 12px;
}

.model-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

/* Segmented Control */
.model-segmented {
  display: flex;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}

.model-segment {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.model-segment:hover:not(.active) {
  color: var(--color-text-primary);
  background: rgba(0, 0, 0, 0.04);
}

.model-segment.active {
  color: white;
  background: var(--color-primary);
  box-shadow: 0 1px 3px rgba(196, 18, 48, 0.3);
}

/* More Models Button */
.model-more-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.model-more-btn:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  border-color: var(--color-text-muted);
}

/* Model Dropdown */
.model-dropdown {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 8px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  min-width: 180px;
  z-index: 100;
  animation: dropdown-appear 0.15s ease;
}

@keyframes dropdown-appear {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.model-dropdown.hidden {
  display: none;
}

.model-dropdown-section {
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.model-dropdown-section:last-child {
  border-bottom: none;
}

.model-dropdown-header {
  padding: 4px 12px 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
}

.model-dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  text-align: left;
  color: var(--color-text-primary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.model-dropdown-item:hover {
  background: var(--color-bg-secondary);
}

.model-dropdown-item.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.model-dropdown-item.active::before {
  content: '✓ ';
  font-weight: 600;
}

/* Legacy select (hidden but kept for compatibility) */
.model-select {
  padding: 4px 8px;
  font-size: 12px;
  font-family: var(--font-sans);
  color: var(--color-text-secondary);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.model-select:hover {
  border-color: var(--color-text-muted);
}

.model-select:focus {
  outline: none;
  border-color: var(--color-primary);
}

.input-hints {
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: right;
}

.input-hints kbd {
  margin: 0 2px;
}

/* ============================================
   Results Drawer
   ============================================ */
.results-drawer {
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  width: var(--drawer-width);
  background: var(--color-bg);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.results-drawer.visible {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.drawer-header h2 {
  font-size: 16px;
  font-weight: 600;
}

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

.drawer-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.results-stats {
  padding: 12px 20px;
  font-size: 13px;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border-light);
}

.results-stats .stat {
  display: inline;
}

.results-stats strong {
  color: var(--color-primary);
}

.stat-sep {
  margin: 0 8px;
  color: var(--color-border);
}

#results-grid {
  flex: 1;
}

#results-grid.ag-theme-alpine {
  --ag-row-height: 36px;
  --ag-header-height: 40px;
  --ag-font-size: 13px;
}

/* ============================================
   Modals
   ============================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  position: relative;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: modal-appear 0.2s ease;
}

@keyframes modal-appear {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-content h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.modal-description {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

.filter-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text-primary);
  transition: all var(--transition-fast);
}

.filter-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* Export Options */
.export-options {
  display: flex;
  gap: 12px;
}

.export-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}

.export-option:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.export-option span {
  font-size: 13px;
  font-weight: 500;
}

/* Shortcuts Modal */
.shortcuts-content {
  max-width: 480px;
}

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

.shortcut {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.shortcut kbd {
  min-width: 50px;
  text-align: center;
  margin-left: 0;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 300;
  max-width: 350px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  animation: toast-in 0.3s ease;
}

.toast.removing {
  animation: toast-out 0.3s ease forwards;
}

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

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

.toast-success {
  border-left: 3px solid var(--color-success);
}

.toast-error {
  border-left: 3px solid var(--color-error);
}

.toast-info {
  border-left: 3px solid var(--color-primary);
}

.toast-icon {
  font-size: 16px;
}

.toast-success .toast-icon { color: var(--color-success); }
.toast-error .toast-icon { color: var(--color-error); }
.toast-info .toast-icon { color: var(--color-primary); }

.toast-message {
  flex: 1;
  font-size: 13px;
  color: var(--color-text-primary);
}

/* ============================================
   Loading Overlay
   ============================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 400;
  animation: fade-in var(--transition-normal);
}

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

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

#loading-text {
  font-size: 14px;
  color: var(--color-text-secondary);
  animation: pulse-text 2s ease-in-out infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* ============================================
   Markdown Content Styling
   ============================================ */
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4 {
  margin: 20px 0 10px 0;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
}

.message-content h1 { font-size: 18px; }
.message-content h2 {
  font-size: 16px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-border-light);
}
.message-content h3 { font-size: 14px; }
.message-content h4 { font-size: 13px; }

.message-content ul,
.message-content ol {
  margin: 10px 0;
  padding-left: 20px;
}

.message-content li {
  margin: 6px 0;
  line-height: 1.6;
}

.message-content blockquote {
  margin: 12px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--color-primary);
  background: var(--color-bg-secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--color-text-primary);
}

.message-content blockquote em {
  font-style: normal;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.message-content a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: rgba(196, 18, 48, 0.3);
  text-underline-offset: 2px;
  transition: all var(--transition-fast);
}

.message-content a:hover {
  text-decoration-color: var(--color-primary);
  color: var(--color-primary-hover);
}

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

.message-content th,
.message-content td {
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  text-align: left;
}

.message-content th {
  background: var(--color-bg-tertiary);
  font-weight: 600;
}

.message-content hr {
  margin: 16px 0;
  border: none;
  border-top: 1px solid var(--color-border);
}

/* Collapsible Markdown Tables */
.table-wrapper {
  margin: 12px 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table-wrapper.collapsible .table-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: var(--color-bg-tertiary);
  border: none;
  border-bottom: 1px solid var(--color-border);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.table-wrapper.collapsible .table-toggle:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

.table-toggle .toggle-icon {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transition: transform var(--transition-fast);
}

.table-wrapper.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.table-wrapper.collapsed .table-content {
  display: none;
}

.table-content {
  max-height: 300px;
  overflow: auto;
}

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

.md-table th,
.md-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border-light);
  white-space: nowrap;
}

.md-table th {
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  position: sticky;
  top: 0;
  z-index: 1;
}

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

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

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 1200px) {
  .conversation-sidebar {
    width: 240px;
  }

  .results-drawer {
    width: 60%;
  }
}

@media (max-width: 900px) {
  .conversation-sidebar {
    width: 220px;
  }

  .results-drawer {
    width: 80%;
  }

  .header-center {
    display: none;
  }
}

/* ============================================
   Utility Classes
   ============================================ */
.hidden {
  display: none !important;
}

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