/* ============================================
   AIKOLAB CHAT CORE CSS
   Clean, maintainable CSS architecture
   ============================================ */

/* ============================================
   FONT IMPORTS AND RESET
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================
   GLOBAL SCROLLBAR HIDING - UNIVERSAL RULES
   ============================================ */

/* Hide ALL scrollbars globally while keeping scroll functionality */
* {
  /* Hide scrollbars for WebKit browsers (Chrome, Safari, Edge) */
  -webkit-scrollbar: none !important;
  -webkit-scrollbar-width: none !important;
  
  /* Hide scrollbars for Firefox */
  scrollbar-width: none !important;
  
  /* Hide scrollbars for IE and old Edge */
  -ms-overflow-style: none !important;
}

/* Ensure all webkit scrollbar components are completely hidden */
*::-webkit-scrollbar,
*::-webkit-scrollbar-track,
*::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-corner,
*::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Apply to all pseudo-elements and interactive states */
*::before::-webkit-scrollbar,
*::after::-webkit-scrollbar,
*:hover::-webkit-scrollbar,
*:focus::-webkit-scrollbar,
*:active::-webkit-scrollbar,
*:visited::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Specific high-priority rules for common scrollable elements */
html, body, div, main, section, article, aside, nav, header, footer,
.chat-messages, .quick-actions, .quick-suggestions-popup, .suggestions-popup, 
.modal, .dropdown, .popup, .menu, .sidebar, .panel,
textarea, pre, code, .scrollable, .overflow-auto, .overflow-y-auto,
.chat-area, #chat-area, .message-container, .content, .list,
.quick-actions-popup, .meta-suggestions-popup, #meta-suggestions-popup,
#quick-suggestions-popup, .quick-suggestions, #quick-suggestions {
  /* WebKit browsers */
  -webkit-scrollbar: none !important;
  -webkit-scrollbar-width: none !important;
  
  /* Firefox */
  scrollbar-width: none !important;
  
  /* IE and old Edge */
  -ms-overflow-style: none !important;
}

/* Override any existing scrollbar styling with maximum specificity */
html *::-webkit-scrollbar,
body *::-webkit-scrollbar,
div *::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* ============================================
   ENSURE BASE HEADER IS ALWAYS VISIBLE
   ============================================ */
header.bg-theme {
  position: fixed !important; /* Changed from sticky to fixed to prevent overlap issues */
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 9999 !important;
  display: block !important;
  visibility: visible !important;
  width: 100% !important;
  height: var(--header-height) !important;
  background-color: var(--bg-primary) !important; /* Ensure background is opaque */
}

/* Prevent any hiding of the main header */
body header,
html header {
  display: block !important;
  visibility: visible !important;
}

/* Prevent overflow from hiding header */
body, html {
  overflow-x: hidden;
  overflow-y: auto; /* Allow page scroll if needed */
}

/* Ensure body content starts below fixed header */
body {
  padding-top: var(--header-height) !important; /* Push content below fixed header */
  margin: 0;
}

/* ============================================
   0. CONTAINMENT OVERRIDE FOR SIDEBAR
   ============================================ */
/* Override base.html containment that breaks fixed positioning */
.bg-white.min-h-screen,
.container.mx-auto.px-4,
.container {
  contain: none !important;
}

/* Ensure body doesn't interfere with fixed positioning */
body {
  contain: none !important;
  overflow-x: visible !important;
}

/* ============================================
   1. CSS CUSTOM PROPERTIES
   ============================================ */
:root {
  /* Colors */
  --color-primary: #E3175E;
  --color-primary-hover: #F3175C;
  --color-text-primary: #1a1a1a;
  --color-text-secondary: #666666;
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f3f4f6;
  --color-bg-tertiary: #e5e7eb;
  --color-border: #d1d5db;
  --color-shadow: rgba(0, 0, 0, 0.1);
  
  /* Spacing - More generous for easier interaction */
  --spacing-xs: 6px;     /* was 4px */
  --spacing-sm: 10px;    /* was 8px */
  --spacing-md: 16px;    /* was 12px */
  --spacing-lg: 20px;    /* was 16px */
  --spacing-xl: 28px;    /* was 24px */
  --spacing-2xl: 36px;   /* was 32px */
  --spacing-3xl: 52px;   /* was 48px */
  
  /* Sizing */
  --header-height: 64px;
  --chat-header-height: 48px;  /* Slightly increased for better icon fit */
  --input-container-height: 70px;  /* Keeping original compact height */
  --chat-max-width: 1200px;
  --message-max-width: 75%;  /* Slightly narrower for easier reading */
  --sidebar-width: 280px;
  
  /* Typography - Increased for 45+ readability */
  --font-size-xs: 14px;    /* was 12px */
  --font-size-sm: 16px;    /* was 14px */
  --font-size-base: 18px;  /* was 16px */
  --font-size-lg: 21px;    /* was 18px */
  --font-size-xl: 24px;    /* was 20px */
  --font-size-2xl: 28px;   /* new - for headers */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Line height for better readability */
  --line-height-tight: 1.4;
  --line-height-base: 1.6;   /* increased from 1.5 */
  --line-height-relaxed: 1.8;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 18px;
  --radius-full: 50%;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  
  /* Z-index */
  --z-base: 1;
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-fixed: 30;
  --z-modal: 40;
  --z-tooltip: 50;
  
  /* Import theme variables from base */
  --bg-primary: #ffffff;
  --bg-secondary: #f7f7f8;
  --text-primary: #000000;
  --border-color: #e5e7eb;
}

/* Dark mode variables - ChatGPT-inspired Professional System */
body.dark-mode {
  /* ChatGPT exact color palette */
  --color-bg-primary: #343541;      /* Main background - ChatGPT's exact color */
  --color-bg-secondary: #343541;     /* Same as primary for seamless look */
  --color-bg-tertiary: #444654;      /* Input fields, message bubbles - slightly lighter */
  --color-bg-elevated: #565869;      /* Hover states - subtle difference */
  
  /* Text colors matching ChatGPT */
  --color-text-primary: #D1D5DB;     /* Main content - softer than pure white */
  --color-text-secondary: #ACACBE;   /* Descriptions, metadata */
  --color-text-muted: #8E8EA0;       /* Placeholders */
  
  /* Borders - almost invisible like ChatGPT */
  --color-border: rgba(255, 255, 255, 0.05);  /* Very subtle borders */
  --color-shadow: rgba(0, 0, 0, 0.3);
  
  /* Accent colors */
  --color-primary: #E3175E;          /* Keep AIkolab's brand color */
  --color-primary-hover: #F3175C;    /* Brighter on hover */
  
  /* Legacy variables for compatibility */
  --bg-primary: #343541;
  --bg-secondary: #343541;
  --text-primary: #D1D5DB;
  --border-color: rgba(255, 255, 255, 0.05);
}

/* Additional dark mode specific styles */
body.dark-mode .chat-container {
  background-color: #343541;
}

body.dark-mode .chat-header {
  background-color: #343541;
  border-bottom: none;
}

body.dark-mode .chat-input,
body.dark-mode .message-input-container {
  background-color: var(--color-bg-secondary);
  border-top-color: var(--color-border);
}

body.dark-mode .chat-input__wrapper,
body.dark-mode #message-input-wrapper {
  background-color: #444654;
}

body.dark-mode .chat-input__wrapper:focus-within,
body.dark-mode #message-input-wrapper:focus-within {
  box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.2);
}

body.dark-mode .action-button:hover,
body.dark-mode .chat-header__action:hover {
  background-color: #444654;
}

/* ============================================
   2. BASE STYLES
   ============================================ */

/* Ensure proper stacking context and no overlap with base header */
.main-chat-layout {
  position: relative;
  z-index: 1;
  overflow: hidden;
  height: 100%; /* Fill parent container */
  margin: 0 !important; /* No margins */
  padding: 0 !important; /* No padding */
}

/* Ensure chat content area is properly contained */
.chat-content-area {
  position: relative;
  height: 100%;
  overflow: hidden;
  display: flex;
  z-index: 1;
  padding: 0 !important;
  margin: 0 !important;
}

/* Additional safety measures to prevent header overlap */
#main-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: var(--header-height) !important;
  z-index: 9999 !important;
  background-color: var(--bg-primary) !important;
}

/* Content positioning is handled by the bg-theme.min-h-screen rule below */

/* Specific fix for chat pages to ensure no overlap */
/* Using class-based approach instead of :has() for better performance */
body.chat-page {
  padding-top: 0 !important; /* Reset body padding */
}

/* Positioning for bg-theme is handled by the fixed position rule below */

/* Prevent layout shifts when popups/modals are open */
body.chat-page .main-container,
body.chat-page .chat-container,
body.chat-page .chat-header {
  /* Lock positioning to prevent shifts */
  position: relative !important;
  top: 0 !important;
  transform: none !important;
  margin-top: 0 !important; /* Reset any margin changes */
}

/* bg-theme positioning is handled by the fixed position rule below */

/* Prevent any body transformations or position changes */
body.chat-page {
  position: static !important;
  transform: none !important;
  top: 0 !important;
  margin: 0 !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important; /* Prevent body scrolling */
}

/* Ensure the main wrapper maintains its position */
body.chat-page > .bg-theme.min-h-screen {
  position: fixed !important; /* Fix it in place */
  top: var(--header-height) !important; /* Start right below header (64px) */
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  height: calc(100vh - var(--header-height)) !important; /* Full viewport minus header */
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Ensure main-container fills the space properly */
body.chat-page .main-container {
  position: absolute !important;
  top: 0 !important; /* No need for header offset - parent already handles it */
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  height: 100% !important; /* Full height of parent container */
  overflow: hidden !important;
}

/* Ensure fixed elements don't affect layout flow */
.quick-actions-popup,
.modal,
.lightbox-overlay,
[style*="position: fixed"] {
  /* Fixed elements should not affect document flow */
  pointer-events: auto;
  z-index: 9999;
}

/* Quick actions popup should not affect layout at all since it uses position: fixed */
/* Removed :has() selectors that were causing layout shifts when popup opens/closes */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);  /* Using new variable */
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Better text rendering for older eyes */
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
}

/* ============================================
   3. LAYOUT STRUCTURE
   ============================================ */
.main-container {
  height: 100% !important; /* Full height of parent container */
  max-height: 100% !important;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  margin-top: 0 !important;
  margin-bottom: 0;
  padding-top: 0 !important;
  padding-bottom: 0;
  transform: none !important;
  isolation: auto !important;
  contain: none !important;
  z-index: 1; /* Below header */
  top: 0 !important; /* Start at top of its container */
}

.chat-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  background-color: var(--color-bg-primary);
  overflow: hidden;
  height: 100% !important; /* Fill parent container */
  position: relative;
  min-height: 0;
  padding-bottom: 0;
  /* Ensure chat container stays within bounds */
  max-height: 100% !important;
  contain: layout;
  /* Prevent any content from escaping */
  clip-path: inset(0 0 0 0);
}

/* Mobile: no sidebar margin */
@media (max-width: 767px) {
  .chat-container {
    margin-left: 0 !important;
  }
}

/* ============================================
   4. CHAT HEADER
   ============================================ */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--chat-header-height);
  padding: 0 var(--spacing-md); /* Reduced padding */
  background-color: var(--color-bg-primary);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  box-shadow: none;
  gap: var(--spacing-sm); /* Reduced gap */
  /* Ensure chat header stays within its container */
  position: relative;
  z-index: 10; /* Above chat content but below base header */
  top: 0;
  width: 100%;
  /* Additional safety to prevent overlap */
  max-height: var(--chat-header-height);
  overflow: hidden;
}

.chat-header__left {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  min-width: 0;
  flex: 1;
}

.chat-header__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--color-bg-secondary);
  box-shadow: 0 2px 8px var(--color-shadow);
}

.chat-header__info {
  min-width: 0;
  flex: 1;
}

.chat-header__title {
  font-size: var(--font-size-base); /* Reduced font size */
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1; /* Tighter line height */
  display: -webkit-box;
  -webkit-line-clamp: 1; /* Single line only */
  line-clamp: 1; /* Standard property for future compatibility */
  -webkit-box-orient: vertical;
}

/* Ensure chat header title has proper colors in light and dark mode */
body:not(.dark-mode) .chat-header__title {
  color: #1a1a1a !important;
}

body.dark-mode .chat-header__title {
  color: #e4e4e7 !important;
}

/* Agent name styling for proper alignment and typography */
.agent-name {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  margin: 0;
  padding: 0;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Fix agent name color in chat header for light and dark mode */
body:not(.dark-mode) .agent-name {
  color: #1a1a1a !important;
}

body.dark-mode .agent-name {
  color: #e4e4e7 !important;
}

/* Agent info container for proper alignment */
.agent-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
}

/* Agent description styling for proper alignment */
.agent-description {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: 0;
  padding: 0;
  line-height: var(--line-height-tight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.8;
}

.chat-header__subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.8;
}

/* Ensure action buttons are visible */
.chat-header .flex-shrink-0 {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  flex-shrink: 0;
  align-items: center;
  gap: 0.25rem; /* Small gap between buttons */
}

/* Ensure action buttons have proper styling */
.chat-header .action-button {
  display: flex !important;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 1 !important;
  visibility: visible !important;
}

.chat-header .action-button:hover {
  background-color: var(--color-bg-secondary);
  color: var(--color-primary);
  border-color: var(--color-border);
}

.chat-header .action-button i {
  font-size: 16px;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Server Notification Container - Compact design */
#server-notification-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-width: 0;
  max-width: 200px;
  flex-shrink: 1;
  margin: 0 var(--spacing-xs);
}

#server-notification-container .notification {
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin: 2px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all var(--transition-fast);
}

/* Notification types */
#server-notification-container .notification.error {
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

#server-notification-container .notification.warning {
  background-color: #fffbeb;
  color: #d97706;
  border: 1px solid #fed7aa;
}

#server-notification-container .notification.success {
  background-color: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

#server-notification-container .notification.info {
  background-color: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

/* Dark mode notifications */
body.dark-mode #server-notification-container .notification.error {
  background-color: #450a0a;
  color: #fca5a5;
  border-color: #7f1d1d;
}

body.dark-mode #server-notification-container .notification.warning {
  background-color: #451a03;
  color: #fdba74;
  border-color: #92400e;
}

body.dark-mode #server-notification-container .notification.success {
  background-color: #052e16;
  color: #86efac;
  border-color: #166534;
}

body.dark-mode #server-notification-container .notification.info {
  background-color: #1e3a8a;
  color: #93c5fd;
  border-color: #1d4ed8;
}

.chat-header__actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-shrink: 0;
  margin-left: var(--spacing-md);
}

.chat-header__action {
  width: 32px;  /* Reduced to match smaller header */
  height: 32px;  /* Reduced to match smaller header */
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-secondary);  /* Visible background */
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  color: var(--color-text-primary);  /* Darker color for better contrast */
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.chat-header__action:hover {
  background-color: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  transform: translateY(-2px);  /* Lift effect instead of scale */
  box-shadow: 0 4px 12px rgba(227, 23, 94, 0.3);
}

.chat-header__action i {
  font-size: 18px;  /* Reduced to match smaller button */
}

/* Add tooltips for clarity */
.chat-header__action[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
  white-space: nowrap;
  z-index: 1000;
}

/* ============================================
   5. CHAT MESSAGES AREA
   ============================================ */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  scroll-behavior: smooth;
  /* Calculate height relative to parent container - increased space for input + bottom offset */
  height: calc(100% - var(--chat-header-height) - 225px) !important;
  max-height: calc(100% - var(--chat-header-height) - 225px) !important;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0; /* Prevent flex item from overflowing */
  
  /* Hide scrollbar for Chrome, Safari and Opera */
  -webkit-scrollbar-width: none;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

/* When chat is active, ensure messages don't go under fixed input */
.chat-container.chat-active .chat-messages {
  padding-bottom: 10px !important; /* Small padding for visual comfort */
}

/* Centered empty state */
.chat-empty-state {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  flex: 1;
  padding: 0;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* Welcome message bubble */
.welcome-message-bubble {
  padding: 40px 20px 20px 20px; /* Reduced top padding to save space */
  max-width: var(--chat-max-width);
  margin: 0 auto;
  width: 100%;
}

/* Use existing message styles for consistency */
.welcome-message-bubble .message-container {
  display: flex;
  gap: 12px;
  padding: 0;
  margin: 0;
  width: auto;
  justify-content: flex-start;
  align-items: flex-start;
}

.welcome-message-bubble .avatar-container {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
}

.welcome-message-bubble .message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  font-size: 18px;
  border: 2px solid var(--color-bg-primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.welcome-message-bubble .message-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  flex: 0 1 auto;
}

.welcome-message-bubble .message-bubble {
  background-color: var(--color-bg-secondary);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  padding: 10px 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  max-width: 520px;
}

.welcome-message-bubble .message-text {
  font-size: 16px;
  line-height: 1.4;
  color: var(--color-text-primary);
  margin: 0;
}

/* Agent avatar with initial */
.agent-avatar-initial {
  background-color: #e3175e;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
}

/* Dark mode for welcome bubble */
body.dark-mode .welcome-message-bubble .message-bubble {
  background-color: #444654; /* Exact ChatGPT bubble color */
  border: none;
  box-shadow: none;
}

body.dark-mode .welcome-message-bubble .message-text {
  color: var(--color-text-primary);
  opacity: 1;
}

/* Optimize spacing in welcome message when it contains audio */
.welcome-message-bubble .message-text:has(.audio-wrapper) {
  line-height: 1.2;
}

/* Remove extra line breaks around audio in welcome messages */
.welcome-message-bubble .audio-wrapper {
  margin: 0 !important;
  padding: 0 !important;
}

/* Centered input container for empty state */
.centered-input-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 900px; /* Wider like ChatGPT */
  z-index: 10; /* Ensure it's above the welcome message */
  background-color: transparent !important; /* Completely transparent */
  border-radius: 0 !important; /* No rounding on container */
  padding: 0 !important; /* No padding on container */
  box-shadow: none !important; /* No shadow */
  border: none !important; /* No border */
  outline: none !important; /* Remove any outline */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background wrapper for ChatGPT-like styling */
.centered-input-background {
  background-color: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  border: none !important;
}

/* Dark mode background wrapper */
body.dark-mode .centered-input-background {
  background-color: transparent;
  box-shadow: none;
  padding: 0;
  border: none !important;
}

/* Group container for input and buttons - DEPRECATED, using .centered-input-container instead */
.centered-input-group {
  /* Styles moved to .centered-input-container */
}

/* Input wrapper */
.centered-input-wrapper {
  background-color: rgba(255, 255, 255, 0.05) !important; /* Almost transparent white */
  border: none !important; /* No border */
  outline: none !important;
  box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.02) !important; /* Very subtle shadow */
  border-radius: 24px; /* Rounded like ChatGPT */
  overflow: hidden;
  transition: all 0.2s ease;
  -webkit-backface-visibility: hidden; /* Smoother rendering */
  backface-visibility: hidden;
  margin: 0; /* No margin on wrapper */
  margin-bottom: 0; /* No bottom margin */
  padding: 8px 0; /* Reduced padding for smaller height */
  display: flex;
  align-items: center;
  min-height: 40px; /* Smaller height like ChatGPT */
}

.centered-input-wrapper:focus-within {
  box-shadow: none !important; /* Remove focus ring for cleaner look */
  border: none !important; /* No border on focus */
  border-bottom: none !important; /* No bottom border */
}

/* Textarea styling - Single line that expands */
.centered-textarea {
  width: 100%;
  min-height: 20px; /* Smaller single line like ChatGPT */
  max-height: 200px; /* Reasonable max */
  padding: 0 16px; /* Slightly smaller horizontal padding */
  background: transparent !important;
  background-color: transparent !important;
  border: none !important; /* Force no border */
  border-bottom: none !important; /* Remove any bottom border */
  box-shadow: none !important; /* Remove any shadow */
  font-size: 14px; /* Smaller font like ChatGPT */
  line-height: 20px; /* Proportional line height */
  color: #212121 !important; /* Dark text */
  resize: none;
  outline: none !important; /* Remove focus outline */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-y: hidden; /* Hide scrollbar initially */
  transition: height 0.1s ease-out;
  font-weight: 400;
}

/* Extra specificity for textarea colors */
.centered-input-container .centered-textarea,
body:not(.dark-mode) .centered-input-container .centered-textarea {
  color: #212121 !important;
  background: transparent !important;
}

.centered-textarea::placeholder {
  color: #c5c5d2 !important; /* Lighter placeholder like ChatGPT */
  opacity: 0.8 !important;
  font-size: 14px; /* Match textarea font size */
  font-weight: 400;
  letter-spacing: 0;
}

/* Remove any focus states that might add borders */
.centered-textarea:focus {
  border: none !important;
  border-bottom: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Buttons row below input */
.centered-buttons-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 6px 0 0 0; /* Even smaller top margin */
  padding: 0 6px; /* Smaller horizontal padding */
  gap: 8px;
}

.centered-left-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.centered-right-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Icon buttons (Plus, Mic, Analytics) */
.centered-icon-button {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #8e8ea0;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.centered-icon-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #1a1a1a;
}

/* Specific icon adjustments */
.centered-icon-button .fa-plus {
  font-size: 16px;
  font-weight: 600;
}

.centered-icon-button .fa-microphone {
  font-size: 13px;
}

.centered-icon-button .fa-chart-line {
  font-size: 12px;
}

/* Tool button with text */
.centered-tool-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 10px; /* Even smaller padding */
  background: transparent;
  border: none; /* Remove border to match ChatGPT */
  border-radius: 6px; /* Consistent with icon buttons */
  color: #666666; /* Subtle gray */
  font-size: 13px; /* Even smaller font */
  font-weight: 500; /* Medium weight for better readability */
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); /* Smooth easing */
  white-space: nowrap;
  height: 28px; /* Match other buttons */
  -webkit-font-smoothing: antialiased;
}

.centered-tool-button i {
  font-size: 12px; /* Smaller icon size */
}

.centered-tool-button span {
  font-size: 13px;
  line-height: 1;
}

.centered-tool-button:hover {
  background-color: rgba(0, 0, 0, 0.05); /* Slightly more visible hover */
  border: none; /* No border */
  color: #2d2d2d; /* Softer black */
  transform: translateY(-1px); /* Subtle lift */
}

/* Icon size is already defined above in .centered-tool-button i */

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

/* Send button */
.centered-send-button {
  width: 28px; /* Even smaller to match compact height */
  height: 28px; /* Even smaller to match compact height */
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.05); /* Very light gray when disabled */
  border: none;
  border-radius: 50%; /* Circular like ChatGPT */
  color: rgba(0, 0, 0, 0.3); /* Light gray icon */
  cursor: not-allowed;
  transition: all 0.2s ease;
  flex-shrink: 0; /* Prevent shrinking */
  opacity: 1; /* Full opacity, control via background/color */
}

/* Active send button when there's text */
.centered-send-button.active {
  background-color: #000000;
  color: #ffffff;
  cursor: pointer;
}

.centered-send-button:hover {
  background-color: #333333; /* Subtle hover */
}

.centered-send-button:disabled {
  background-color: #e0e0e0;
  color: #999999;
  cursor: not-allowed;
}

.centered-send-button i {
  font-size: 14px; /* Even smaller icon to match button size */
  display: inline-block;
  transform: none !important; /* Ensure no rotation */
}

/* Remove any potential underlines from parent elements */
.centered-input-container * {
  border-bottom: none !important;
  text-decoration: none !important;
}

/* Remove ALL borders from centered input area */
.centered-input-background,
.centered-input-background *,
.centered-input-wrapper,
.centered-input-wrapper *,
.centered-buttons-row,
.centered-buttons-row * {
  border: none !important;
  outline: none !important;
}

/* Allow subtle borders on wrapper while removing them elsewhere */
body .centered-input-container,
body.dark-mode .centered-input-container {
  border: none !important;
  outline: none !important;
}

/* Override any Tailwind or external dark backgrounds */
.centered-input-container,
.centered-input-container .centered-input-wrapper,
.centered-input-container .centered-textarea {
  background-image: none !important;
}

/* Remove ALL borders and outlines from centered input elements */
.centered-input-container,
.centered-input-container *,
.centered-input-wrapper,
.centered-textarea,
.centered-buttons-row,
.centered-input-container:focus,
.centered-input-container:focus-within,
.centered-input-wrapper:focus,
.centered-input-wrapper:focus-within,
.centered-textarea:focus {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
}

/* Force proper backgrounds in light mode */
body:not(.dark-mode) .centered-input-container {
  background-color: transparent !important; /* Transparent container */
  border: none !important;
  outline: none !important;
}

body:not(.dark-mode) .centered-input-container .centered-input-wrapper {
  background-color: rgba(255, 255, 255, 0.05) !important; /* Almost transparent */
  border: none !important; /* No border */
  outline: none !important;
  box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.02) !important; /* Subtle shadow */
}

/* Force proper backgrounds in dark mode with extra specificity */
html body.dark-mode .centered-input-container,
.dark-mode .centered-input-container {
  background-color: transparent !important; /* Transparent container */
  border: none !important; /* No border */
  box-shadow: none !important;
}

html body.dark-mode .centered-input-container .centered-input-wrapper,
.dark-mode .centered-input-container .centered-input-wrapper {
  background-color: rgba(255, 255, 255, 0.05) !important; /* Subtle white overlay */
  border: none !important; /* No border */
}

/* Dark mode styles for centered layout */

body.dark-mode .centered-input-container {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

body.dark-mode .centered-input-group {
  /* Deprecated */
}

body.dark-mode .centered-input-wrapper {
  background-color: rgba(255, 255, 255, 0.05) !important;
  border: none !important;
  box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.05) !important;
}

body.dark-mode .centered-input-wrapper:focus-within {
  border: none !important;
  box-shadow: none !important;
}

body.dark-mode .centered-textarea {
  color: #D1D5DB !important; /* ChatGPT's text color */
  background: transparent !important;
}

body.dark-mode .centered-textarea::placeholder {
  color: #8E8EA0 !important; /* ChatGPT's placeholder color */
  opacity: 1;
}

/* Extra specificity for dark mode */
body.dark-mode .centered-input-container .centered-textarea {
  color: #ececf1 !important;
  background: transparent !important;
}

body.dark-mode .centered-tool-button {
  border: none !important; /* No border */
  color: var(--color-text-secondary) !important;
  background-color: transparent !important;
}

body.dark-mode .centered-tool-button:hover {
  background-color: var(--color-bg-elevated) !important;
  border: none !important; /* No border */
  color: var(--color-text-primary) !important;
}

body.dark-mode .centered-icon-button {
  color: var(--color-text-secondary) !important;
}

body.dark-mode .centered-icon-button:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: var(--color-text-primary) !important;
}

body.dark-mode .centered-send-button {
  background-color: rgba(255, 255, 255, 0.08) !important; /* Subtle button like ChatGPT */
  color: rgba(255, 255, 255, 0.3) !important;
  box-shadow: none !important;
  border: none !important; /* Remove border */
}

body.dark-mode .centered-send-button.active {
  background-color: rgba(255, 255, 255, 0.9) !important;
  color: #000000 !important;
}

body.dark-mode .centered-send-button.active:hover {
  background-color: rgba(255, 255, 255, 1) !important; /* Full white on hover */
  box-shadow: none !important;
}

/* Ensure light mode has correct background */
body:not(.dark-mode) .centered-input-container,
.chat-container:not(.dark-mode) .centered-input-container {
  background-color: #f7f7f8 !important;
}

/* Force light mode text colors */
body:not(.dark-mode) .centered-textarea {
  color: #212121 !important; /* Dark text for light mode */
  background: transparent !important;
}

body:not(.dark-mode) .centered-textarea::placeholder {
  color: #6e6e80 !important; /* Darker placeholder for better visibility */
  opacity: 1 !important;
}

/* Light mode button styles */
body:not(.dark-mode) .centered-tool-button {
  border: none !important; /* No border like ChatGPT */
  color: #424242 !important; /* Darker text */
  background-color: transparent !important;
}

body:not(.dark-mode) .centered-tool-button:hover {
  background-color: rgba(0, 0, 0, 0.05) !important;
  border: none !important; /* No border */
  color: #1a1a1a !important;
}

body:not(.dark-mode) .centered-icon-button {
  color: #6b6b6b !important; /* Subtle gray icon */
}

body:not(.dark-mode) .centered-icon-button:hover {
  background-color: rgba(0, 0, 0, 0.05) !important;
  color: #1a1a1a !important;
}

body:not(.dark-mode) .centered-send-button {
  background-color: rgba(0, 0, 0, 0.05) !important; /* Light gray when disabled */
  color: rgba(0, 0, 0, 0.3) !important; /* Light gray icon */
}

body:not(.dark-mode) .centered-send-button.active {
  background-color: #000000 !important; /* Black when active */
  color: #ffffff !important; /* White icon */
}

body:not(.dark-mode) .centered-send-button.active:hover {
  background-color: #2d2d2d !important; /* Slightly lighter on hover */
}

body:not(.dark-mode) .centered-input-wrapper,
.chat-container:not(.dark-mode) .centered-input-wrapper,
.centered-input-wrapper {
  background-color: #ffffff !important; /* White background in light mode */
}

/* Mobile responsive for centered layout */
@media (max-width: 768px) {
  .welcome-message-bubble {
    top: 10px;
    padding: 0 12px;
  }
  
  .welcome-message-bubble .message-bubble {
    font-size: 15px;
    padding: 8px 12px;
    max-width: 85vw;
  }
  
  .welcome-message-bubble .message-avatar {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  
  .welcome-message-bubble .avatar-container {
    width: 36px;
    height: 36px;
  }
  
  .centered-input-container {
    width: 95%;
  }
  
  .centered-textarea {
    min-height: 20px;
    font-size: 14px; /* Consistent with desktop */
    padding: 0 14px;
  }
  
  .centered-textarea::placeholder {
    font-size: 14px; /* Match input font size */
  }
  
  /* Dark mode mobile adjustments */
  body.dark-mode .centered-input-container {
    background-color: var(--color-bg-secondary) !important;
  }
  
  body.dark-mode .centered-input-wrapper {
    background-color: var(--color-bg-tertiary) !important;
  }
  
  .centered-tool-button {
    padding: 4px 8px;
    font-size: 12px;
    height: 26px; /* Even smaller for mobile */
  }
  
  .centered-tool-button i {
    font-size: 11px;
  }
  
  .centered-icon-button {
    width: 26px;
    height: 26px;
  }
  
  .centered-send-button {
    width: 26px;
    height: 26px;
  }
  
  /* Hide analytics on mobile for space */
  #centered-analytics-button {
    display: none;
  }
  
  .centered-send-button i {
    font-size: 12px;
  }
}

/* Active chat state */
.chat-active .chat-empty-state {
  display: none;
}

.chat-active #chat-area {
  flex: 1;
  padding: var(--spacing-xl) var(--spacing-md);
  overflow-y: auto;
  background-color: #ffffff; /* White in light mode */
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  max-width: var(--chat-max-width);
  margin: 0 auto;
  width: 100%;
}

/* Dark mode chat area */
body.dark-mode .chat-active #chat-area {
  background-color: var(--color-bg-primary) !important;
}

/* Ensure chat container has correct background in active state */
.chat-container.chat-active {
  background-color: #ffffff !important; /* White in light mode */
}

body.dark-mode .chat-container.chat-active {
  background-color: var(--color-bg-primary) !important;
}

/* When empty, hide chat area */
.chat-container:not(.chat-active) #chat-area {
  display: none;
}

/* Show centered input in empty state */
.chat-container:not(.chat-active) .centered-input-container {
  display: block !important;
}

/* Dark mode adjustments */
body.dark-mode .chat-empty-state h1 {
  color: var(--color-text-primary);
}

body.dark-mode .chat-empty-state .agent-description-large {
  color: var(--color-text-secondary);
}

/* Hide scrollbar for all browsers */
.chat-messages::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Hide scrollbar for Firefox */
.chat-messages {
  scrollbar-width: none; /* Firefox */
}

/* Hide scrollbar for IE/Edge */
.chat-messages {
  -ms-overflow-style: none; /* IE and Edge */
}

.chat-messages__container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  max-width: var(--chat-max-width);
  margin: 0 auto;
  width: 100%;
}

/* Ensure chat area and message containers work together */
#chat-area .message-container {
  width: 100%;
  max-width: 100%;
}

#chat-area .message-container.user-message {
  width: 100%;
  max-width: 100%;
  justify-content: flex-end;
}

#chat-area .message-container.agent-message {
  width: 100%;
  max-width: 100%;
  justify-content: flex-start;
}

/* Message container base styles */
.message,
.message-container {
  display: flex;
  gap: var(--spacing-md);
  align-items: flex-start;
  width: 100%;
  margin-bottom: var(--spacing-md);
}

/* USER MESSAGES - RIGHT SIDE */
.message--user,
.message-container.user-message {
  flex-direction: row-reverse;
  justify-content: flex-start;
  margin-left: auto;
}

/* USER MESSAGE BACKGROUND FIX - Same as agent messages */
.message-container.user-message .message-bubble {
  background: var(--color-bg-secondary) !important; /* Same as agent messages */
  color: var(--color-text-primary) !important;
  border: none !important;
  box-shadow: 0 2px 8px var(--color-shadow) !important;
  border-bottom-right-radius: 4px !important;
}

.message-container.user-message .message-text,
.message-container.user-message .text-content,
.message-container.user-message .message-bubble .message-text,
.message-container.user-message .message-bubble .text-content,
.message-container.user-message .message-bubble * {
  color: #1a1a1a !important;
}

/* Dark mode user messages - Same as agent messages */
body.dark-mode .message-container.user-message .message-bubble {
  background: #444654 !important; /* Same as agent messages */
  color: #D1D5DB !important;
  border: none !important;
  box-shadow: none !important;
}

/* Extra specificity for dark mode user bubbles */
html body.dark-mode .message-container.user-message .message-bubble,
body.dark-mode .message--user .message__bubble {
  background: #444654 !important; /* ChatGPT dark bubble color */
  background-color: #444654 !important;
  color: #D1D5DB !important;
  border: none !important;
  box-shadow: none !important;
}

/* Ultra-high specificity to override any other CSS that might set white backgrounds */
html body.dark-mode div.message-container.user-message div.message-content div.message-bubble,
html body.dark-mode .agent-of-agents-page .message-container.user-message .message-bubble,
html body.dark-mode .meta-agent-container .message-container.user-message .message-bubble,
html body.dark-mode .chat-container .message-container.user-message .message-bubble,
html body.dark-mode #chat-area .message-container.user-message .message-bubble {
  background: #444654 !important; /* ChatGPT dark bubble color */
  background-color: #444654 !important;
  color: #D1D5DB !important;
  border: none !important;
  box-shadow: none !important;
}

/* Target any potential inline styles or high-specificity overrides */
html body.dark-mode .message-container.user-message .message-bubble[style*="background"],
html body.dark-mode .message-container.user-message .message-bubble[style*="Background"] {
  background: #444654 !important;
  background-color: #444654 !important;
}

/* Ultra-specific dark mode text color overrides */
html body.dark-mode .message-container.user-message .message-text,
html body.dark-mode .message-container.user-message .text-content,
html body.dark-mode .message-container.user-message .message-bubble .message-text,
html body.dark-mode .message-container.user-message .message-bubble .text-content,
html body.dark-mode .message-container.user-message .message-bubble *,
html body.dark-mode .message-container.user-message .message-bubble p,
html body.dark-mode .message-container.user-message .message-bubble span,
html body.dark-mode .message-container.user-message .message-bubble div,
body.dark-mode .message-container.user-message .message-text,
body.dark-mode .message-container.user-message .text-content,
body.dark-mode .message-container.user-message .message-bubble .message-text,
body.dark-mode .message-container.user-message .message-bubble .text-content,
body.dark-mode .message-container.user-message .message-bubble *,
body.dark-mode .message-container.user-message .message-bubble p,
body.dark-mode .message-container.user-message .message-bubble span,
body.dark-mode .message-container.user-message .message-bubble div {
  color: #e4e4e7 !important;
  background: transparent !important;
}

/* Override any CSS variable usage */
body.dark-mode .message-container.user-message .message-bubble {
  --color-text-primary: #e4e4e7 !important;
  --color-text-secondary: #e4e4e7 !important;
}

/* AGENT MESSAGES - LEFT SIDE */
.message--agent,
.message-container.agent-message {
  flex-direction: row;
  justify-content: flex-start;
}

/* Avatar styles */
.message__avatar,
.message-container .avatar-container,
.message-container .avatar-container img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--color-bg-primary);
  box-shadow: 0 2px 4px var(--color-shadow);
}

/* Message content wrapper */
.message__content,
.message-container .message-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  flex: 1;
  min-width: 0;
  align-items: flex-start;
}

/* USER MESSAGE CONTENT - Right aligned */
.message--user .message__content,
.message-container.user-message .message-content {
  align-items: flex-end;
  text-align: right;
}

/* Message bubble */
.message__bubble,
.message-container .message-bubble {
  padding: var(--spacing-lg) var(--spacing-xl);  /* More padding */
  border-radius: 20px;
  background-color: var(--color-bg-secondary);
  box-shadow: 0 2px 8px var(--color-shadow);
  word-wrap: break-word;
  overflow-wrap: break-word;
  transition: all var(--transition-fast);
  width: fit-content;
  max-width: var(--message-max-width);  /* Use proper max width */
  line-height: var(--line-height-relaxed);  /* More line height */
  position: relative;
  font-size: var(--font-size-base);  /* Ensure proper size */
}

.message__bubble:hover,
.message-container .message-bubble:hover {
  box-shadow: 0 4px 12px var(--color-shadow);
  transform: translateY(-1px);
}

/* USER BUBBLES - Light gray with right-pointing tail */
.message--user .message__bubble,
.message-container.user-message .message-bubble {
  background: #f5f5f5;
  color: #1a1a1a;
  border-bottom-right-radius: 4px;
  text-align: left;
}

/* Ensure user bubbles work properly in light mode */
body:not(.dark-mode) .message--user .message__bubble,
body:not(.dark-mode) .message-container.user-message .message-bubble {
  background: #f5f5f5 !important;
  color: #1a1a1a !important;
}

/* AGENT BUBBLES - Gray with left-pointing tail */
.message--agent .message__bubble,
.message-container.agent-message .message-bubble {
  background-color: var(--color-bg-secondary);
  color: var(--color-text-primary);
  border-bottom-left-radius: 4px;
}

/* Message text */
.message__text,
.message-container .message-text,
.message-container .text-content,
.message-container .markdown-content {
  margin: 0;
  color: var(--color-text-primary);
  text-align: left;
  display: inline;
  width: fit-content;
  max-width: 100%;
}

/* Ensure markdown content displays properly */
.message__bubble .markdown-content,
.message-container .message-bubble .markdown-content {
  display: block;
}

/* Remove margins from paragraphs */
.message__bubble p,
.message-container .message-bubble p {
  margin: 0;
}

/* Add spacing between multiple paragraphs - COMPACT */
.message__bubble p + p,
.message-container .message-bubble p + p {
  margin-top: 4px; /* Reduced from 8px to 4px */
}

/* Remove spacing around audio players in messages */
.message-text .audio-wrapper,
.message-content .audio-wrapper,
.message-bubble .audio-wrapper {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
}

.message-text .audio-wrapper.minimal,
.message-content .audio-wrapper.minimal,
.message-bubble .audio-wrapper.minimal {
  display: inline-block;
  width: 100%;
}

/* Fix spacing when audio is in message text with pre-line */
.message-text:has(.audio-wrapper) {
  line-height: 1.3;
}

/* Ensure no extra spacing before/after audio player */
.audio-wrapper.minimal + br,
br + .audio-wrapper.minimal {
  display: none;
}

/* Message footer */
.message__footer,
.message-container .message-footer {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  flex-direction: row;
  margin-top: var(--spacing-xs);
  transform: translateY(-4px);
}

.message:hover .message__footer,
.message-container:hover .message-footer {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.message__timestamp,
.message-container .message-timestamp {
  white-space: nowrap;
}

.message__actions,
.message-container .message-actions {
  display: flex;
  gap: var(--spacing-xs);
  align-items: center;
  flex-direction: row;
}

.message__action,
.message-container .message-action {
  padding: var(--spacing-xs);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.message__action:hover,
.message-container .message-action:hover {
  background-color: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

/* Dark mode message styles */
body.dark-mode .message__bubble,
body.dark-mode .message-container .message-bubble {
  background-color: #444654;
  color: #D1D5DB;
  box-shadow: none;
  border: none;
}

body.dark-mode .message--user .message__bubble,
body.dark-mode .message-container.user-message .message-bubble {
  background: #444654 !important; /* ChatGPT dark bubble color */
  background-color: #444654 !important;
  color: #D1D5DB !important;
  border: none !important;
  box-shadow: none !important;
}

body.dark-mode .message--agent .message__bubble,
body.dark-mode .message-container.agent-message .message-bubble {
  background-color: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

body.dark-mode .message__text,
body.dark-mode .message-container .message-text,
body.dark-mode .message-container .text-content {
  color: inherit;
}

body.dark-mode .message__footer,
body.dark-mode .message-container .message-footer {
  color: #a1a1aa;
}

body.dark-mode .message__action:hover,
body.dark-mode .message-container .message-action:hover {
  background-color: #404040;
  color: #ffffff;
}

/* Code blocks and links - Enhanced for chat bubble containment */
.message__bubble code,
.message-container .message-bubble code,
.message-content code {
  background-color: rgba(0, 0, 0, 0.08);
  padding: 2px 4px;
  border-radius: 3px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
  border: 1px solid rgba(0, 0, 0, 0.08);
  /* Enhanced containment - more conservative */
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.message__bubble pre,
.message-container .message-bubble pre,
.message-content pre {
  background-color: rgba(0, 0, 0, 0.05);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  margin: var(--spacing-sm) 0;
  /* Enhanced containment for pre blocks */
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: pre;
  word-wrap: normal;
  /* Ensure scrollable content doesn't break bubble */
  box-sizing: border-box;
  /* Add subtle border for better definition */
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Code inside pre blocks should have distinct styling but not break layout */
.message__bubble pre code,
.message-container .message-bubble pre code,
.message-content pre code {
  background-color: rgba(50, 50, 50, 0.15) !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  font-size: inherit !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  white-space: pre-wrap !important;
  display: inline !important;
  max-width: 100% !important;
}

/* Dark mode enhancements */
body.dark-mode .message__bubble code,
body.dark-mode .message-container .message-bubble code,
body.dark-mode .message-content code {
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.dark-mode .message__bubble pre,
body.dark-mode .message-container .message-bubble pre,
body.dark-mode .message-content pre {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Dark mode for code inside pre blocks */
body.dark-mode .message__bubble pre code,
body.dark-mode .message-container .message-bubble pre code,
body.dark-mode .message-content pre code {
  background-color: rgba(200, 200, 200, 0.2) !important;
  border: none !important;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .message__bubble pre,
  .message-container .message-bubble pre,
  .message-content pre,
  .text-content.markdown-content pre,
  .message-content .markdown-content pre {
    padding: var(--spacing-sm);
    font-size: 0.85em;
    /* Ensure better mobile scrolling */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .message__bubble code,
  .message-container .message-bubble code,
  .message-content code,
  .text-content.markdown-content code,
  .message-content .markdown-content code {
    font-size: 0.85em;
    /* Allow breaking on mobile only when absolutely necessary */
    overflow-wrap: break-word;
  }
}

.message__bubble a,
.message-container .message-bubble a {
  color: var(--color-primary);
  text-decoration: underline;
}

.message__bubble a:hover,
.message-container .message-bubble a:hover {
  opacity: 0.8;
}

body.dark-mode .message__bubble a,
body.dark-mode .message-container .message-bubble a {
  color: #60a5fa;
}

.message__bubble img,
.message-container .message-bubble img {
  max-width: 400px;
  max-height: 400px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-md);
  margin: var(--spacing-sm) 0;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

/* Hover effect for images */
.message__bubble img:hover,
.message-container .message-bubble img:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px var(--color-shadow);
}

/* Small images should not be constrained */
.message__bubble img[width],
.message-container .message-bubble img[width] {
  max-width: min(400px, 100%);
}

/* Mobile image sizing */
@media (max-width: 768px) {
  .message__bubble img,
  .message-container .message-bubble img {
    max-width: 280px;
    max-height: 280px;
  }
}

/* Enhanced Markdown Content Styling for Message Bubbles */
.message__bubble .markdown-content,
.message-container .message-bubble .markdown-content {
  line-height: 1.5;
  font-family: inherit;
  color: inherit;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Better spacing for markdown content in message bubbles */
.message__bubble .markdown-content,
.message-container .message-bubble .markdown-content {
  /* Reset margins for better bubble appearance */
  margin: 0;
  padding: 0;
}

/* Fix consecutive paragraph spacing in message bubbles */
.message__bubble .markdown-content p + p,
.message-container .message-bubble .markdown-content p + p {
  margin-top: var(--spacing-sm);
}

/* Ensure proper spacing between different elements - COMPACT */
.message__bubble .markdown-content h1 + p,
.message__bubble .markdown-content h2 + p,
.message__bubble .markdown-content h3 + p,
.message__bubble .markdown-content h4 + p,
.message__bubble .markdown-content h5 + p,
.message__bubble .markdown-content h6 + p,
.message-container .message-bubble .markdown-content h1 + p,
.message-container .message-bubble .markdown-content h2 + p,
.message-container .message-bubble .markdown-content h3 + p,
.message-container .message-bubble .markdown-content h4 + p,
.message-container .message-bubble .markdown-content h5 + p,
.message-container .message-bubble .markdown-content h6 + p {
  margin-top: 2px; /* Reduced from 4px to 2px */
}

/* Markdown headers in messages - COMPACT SPACING */
.message__bubble .markdown-content h1,
.message-container .message-bubble .markdown-content h1 {
  font-size: 1.25em;
  font-weight: 600;
  margin: 6px 0 3px 0; /* Reduced from 12px/8px to 6px/3px */
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: var(--spacing-xs);
}

.message__bubble .markdown-content h2,
.message-container .message-bubble .markdown-content h2 {
  font-size: 1.15em;
  font-weight: 600;
  margin: 6px 0 3px 0; /* Reduced from 12px/8px to 6px/3px */
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: var(--spacing-xs);
}

.message__bubble .markdown-content h3,
.message-container .message-bubble .markdown-content h3 {
  font-size: 1.1em;
  font-weight: 600;
  margin: 4px 0 2px 0; /* Reduced from 8px/4px to 4px/2px */
}

.message__bubble .markdown-content h4,
.message__bubble .markdown-content h5,
.message__bubble .markdown-content h6,
.message-container .message-bubble .markdown-content h4,
.message-container .message-bubble .markdown-content h5,
.message-container .message-bubble .markdown-content h6 {
  font-size: 1em;
  font-weight: 600;
  margin: 4px 0 2px 0; /* Reduced from 8px/4px to 4px/2px */
}

/* Markdown paragraphs in messages - COMPACT SPACING */
.message__bubble .markdown-content p,
.message-container .message-bubble .markdown-content p {
  margin: 0 0 4px 0; /* Reduced from 8px to 4px */
  line-height: 1.5;
}

.message__bubble .markdown-content p:last-child,
.message-container .message-bubble .markdown-content p:last-child {
  margin-bottom: 0;
}

/* Markdown lists in messages - COMPACT SPACING */
.message__bubble .markdown-content ul,
.message__bubble .markdown-content ol,
.message-container .message-bubble .markdown-content ul,
.message-container .message-bubble .markdown-content ol {
  margin: 4px 0; /* Reduced from 8px to 4px */
  padding-left: 1.5em;
}

.message__bubble .markdown-content li,
.message-container .message-bubble .markdown-content li {
  margin: var(--spacing-xs) 0;
  line-height: 1.4;
}

.message__bubble .markdown-content ul,
.message-container .message-bubble .markdown-content ul {
  list-style-type: disc;
}

.message__bubble .markdown-content ol,
.message-container .message-bubble .markdown-content ol {
  list-style-type: decimal;
}

/* Nested lists */
.message__bubble .markdown-content ul ul,
.message-container .message-bubble .markdown-content ul ul {
  list-style-type: circle;
  margin-top: 0;
  margin-bottom: 0;
}

.message__bubble .markdown-content ol ol,
.message-container .message-bubble .markdown-content ol ol {
  list-style-type: lower-alpha;
  margin-top: 0;
  margin-bottom: 0;
}

/* Markdown blockquotes in messages - COMPACT SPACING */
.message__bubble .markdown-content blockquote,
.message-container .message-bubble .markdown-content blockquote {
  border-left: 3px solid rgba(255, 255, 255, 0.3);
  padding-left: var(--spacing-md);
  margin: 4px 0; /* Reduced from 8px to 4px */
  font-style: italic;
  opacity: 0.9;
}

/* Agent message blockquotes */
.message--agent .message__bubble .markdown-content blockquote,
.message-container.agent-message .message-bubble .markdown-content blockquote {
  border-left-color: var(--color-border);
}

/* Markdown code in messages */
.message__bubble .markdown-content code,
.message-container .message-bubble .markdown-content code,
.text-content.markdown-content code,
.message-content .markdown-content code {
  background-color: rgba(200, 220, 255, 0.3);
  padding: 2px 4px;
  border-radius: 3px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
  font-weight: normal;
  border: 1px solid rgba(200, 220, 255, 0.4);
  /* Enhanced containment - more conservative */
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.message__bubble .markdown-content pre,
.message-container .message-bubble .markdown-content pre,
.text-content.markdown-content pre,
.message-content .markdown-content pre {
  background-color: rgba(255, 255, 255, 0.1);
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 4px 0; /* Reduced from 8px to 4px */
  border: 1px solid rgba(255, 255, 255, 0.1);
  /* Enhanced containment for pre blocks */
  max-width: 100%;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
  /* Force containment within bubble */
  width: 100%;
  min-width: 0;
}

.message__bubble .markdown-content pre code,
.message-container .message-bubble .markdown-content pre code,
.text-content.markdown-content pre code,
.message-content .markdown-content pre code {
  background-color: rgba(50, 50, 50, 0.15) !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
}

/* Agent message code styling */
.message--agent .message__bubble .markdown-content code,
.message-container.agent-message .message-bubble .markdown-content code,
.message-container.agent-message .text-content.markdown-content code,
.message-container.agent-message .message-content .markdown-content code {
  background-color: rgba(0, 0, 0, 0.08);
}

.message--agent .message__bubble .markdown-content pre,
.message-container.agent-message .message-bubble .markdown-content pre,
.message-container.agent-message .text-content.markdown-content pre,
.message-container.agent-message .message-content .markdown-content pre {
  background-color: rgba(0, 0, 0, 0.05);
  border-color: var(--color-border);
}

/* Agent message header styling - Light mode */
.message--agent .message__bubble .markdown-content h1,
.message-container.agent-message .message-bubble .markdown-content h1 {
  border-bottom-color: rgba(0, 0, 0, 0.15);
}

.message--agent .message__bubble .markdown-content h2,
.message-container.agent-message .message-bubble .markdown-content h2 {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

/* Markdown horizontal rules in messages - COMPACT SPACING */
.message__bubble .markdown-content hr,
.message-container .message-bubble .markdown-content hr {
  border: none;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.2);
  margin: 6px 0; /* Reduced from 12px to 6px */
}

.message--agent .message__bubble .markdown-content hr,
.message-container.agent-message .message-bubble .markdown-content hr {
  background-color: var(--color-border);
}

/* Markdown tables in messages - COMPACT SPACING */
.message__bubble .markdown-content table,
.message-container .message-bubble .markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0; /* Reduced from 8px to 4px */
  font-size: 0.9em;
}

.message__bubble .markdown-content th,
.message__bubble .markdown-content td,
.message-container .message-bubble .markdown-content th,
.message-container .message-bubble .markdown-content td {
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-align: left;
}

.message__bubble .markdown-content th,
.message-container .message-bubble .markdown-content th {
  font-weight: 600;
  background-color: rgba(255, 255, 255, 0.1);
}

/* Agent message table styling */
.message--agent .message__bubble .markdown-content th,
.message--agent .message__bubble .markdown-content td,
.message-container.agent-message .message-bubble .markdown-content th,
.message-container.agent-message .message-bubble .markdown-content td {
  border-color: var(--color-border);
}

.message--agent .message__bubble .markdown-content th,
.message-container.agent-message .message-bubble .markdown-content th {
  background-color: var(--color-bg-tertiary);
}

/* Markdown strong and emphasis in messages */
.message__bubble .markdown-content strong,
.message-container .message-bubble .markdown-content strong {
  font-weight: 600;
}

.message__bubble .markdown-content em,
.message-container .message-bubble .markdown-content em {
  font-style: italic;
}

.message__bubble .markdown-content del,
.message-container .message-bubble .markdown-content del {
  text-decoration: line-through;
  opacity: 0.7;
}

/* Fix spacing issues */
.message__bubble .markdown-content > *:first-child,
.message-container .message-bubble .markdown-content > *:first-child {
  margin-top: 0;
}

.message__bubble .markdown-content > *:last-child,
.message-container .message-bubble .markdown-content > *:last-child {
  margin-bottom: 0;
}

/* ULTRA COMPACT SPACING FOR META AGENT PAGE - AGGRESSIVE LINE BREAK REMOVAL */
.agent-of-agents-page .message__bubble .markdown-content p,
.agent-of-agents-page .message-container .message-bubble .markdown-content p {
  margin: 0 0 2px 0 !important; /* Ultra compact paragraphs */
  line-height: 1.3 !important; /* Tighter line height */
  padding: 0 !important;
}

/* Remove extra spacing from empty or near-empty paragraphs */
.agent-of-agents-page .message__bubble .markdown-content p:empty,
.agent-of-agents-page .message-container .message-bubble .markdown-content p:empty,
.agent-of-agents-page .message__bubble .markdown-content p:contains("&nbsp;"),
.agent-of-agents-page .message-container .message-bubble .markdown-content p:contains("&nbsp;") {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
}

/* Ultra compact headers */
.agent-of-agents-page .message__bubble .markdown-content h1,
.agent-of-agents-page .message__bubble .markdown-content h2,
.agent-of-agents-page .message-container .message-bubble .markdown-content h1,
.agent-of-agents-page .message-container .message-bubble .markdown-content h2 {
  margin: 4px 0 1px 0 !important; /* Ultra compact headers */
  line-height: 1.2 !important;
  padding-bottom: 2px !important;
}

.agent-of-agents-page .message__bubble .markdown-content h3,
.agent-of-agents-page .message__bubble .markdown-content h4,
.agent-of-agents-page .message__bubble .markdown-content h5,
.agent-of-agents-page .message__bubble .markdown-content h6,
.agent-of-agents-page .message-container .message-bubble .markdown-content h3,
.agent-of-agents-page .message-container .message-bubble .markdown-content h4,
.agent-of-agents-page .message-container .message-bubble .markdown-content h5,
.agent-of-agents-page .message-container .message-bubble .markdown-content h6 {
  margin: 2px 0 1px 0 !important; /* Ultra compact smaller headers */
  line-height: 1.2 !important;
}

/* Ultra compact lists */
.agent-of-agents-page .message__bubble .markdown-content ul,
.agent-of-agents-page .message__bubble .markdown-content ol,
.agent-of-agents-page .message-container .message-bubble .markdown-content ul,
.agent-of-agents-page .message-container .message-bubble .markdown-content ol {
  margin: 2px 0 !important; /* Ultra compact lists */
  padding-left: 1.2em !important;
}

.agent-of-agents-page .message__bubble .markdown-content li,
.agent-of-agents-page .message-container .message-bubble .markdown-content li {
  margin: 1px 0 !important; /* Ultra tight list items */
  line-height: 1.25 !important;
  padding: 0 !important;
}

/* Remove spacing from br tags and empty elements */
.agent-of-agents-page .message__bubble .markdown-content br,
.agent-of-agents-page .message-container .message-bubble .markdown-content br {
  line-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: none !important; /* Hide all br tags in meta agent */
}

/* Ultra compact blockquotes and code */
.agent-of-agents-page .message__bubble .markdown-content blockquote,
.agent-of-agents-page .message-container .message-bubble .markdown-content blockquote {
  margin: 2px 0 !important;
  padding: 2px 0 2px var(--spacing-md) !important;
}

.agent-of-agents-page .message__bubble .markdown-content pre,
.agent-of-agents-page .message-container .message-bubble .markdown-content pre {
  margin: 2px 0 !important;
  padding: 4px !important;
}

/* Remove spacing between consecutive elements */
.agent-of-agents-page .message__bubble .markdown-content h1 + p,
.agent-of-agents-page .message__bubble .markdown-content h2 + p,
.agent-of-agents-page .message__bubble .markdown-content h3 + p,
.agent-of-agents-page .message__bubble .markdown-content h4 + p,
.agent-of-agents-page .message__bubble .markdown-content h5 + p,
.agent-of-agents-page .message__bubble .markdown-content h6 + p,
.agent-of-agents-page .message-container .message-bubble .markdown-content h1 + p,
.agent-of-agents-page .message-container .message-bubble .markdown-content h2 + p,
.agent-of-agents-page .message-container .message-bubble .markdown-content h3 + p,
.agent-of-agents-page .message-container .message-bubble .markdown-content h4 + p,
.agent-of-agents-page .message-container .message-bubble .markdown-content h5 + p,
.agent-of-agents-page .message-container .message-bubble .markdown-content h6 + p {
  margin-top: 0 !important;
}

/* Ultra compact paragraph spacing */
.agent-of-agents-page .message__bubble .markdown-content p + p,
.agent-of-agents-page .message-container .message-bubble .markdown-content p + p {
  margin-top: 1px !important;
}

/* Dark mode adjustments for markdown in messages */
body.dark-mode .message__bubble .markdown-content h1,
body.dark-mode .message__bubble .markdown-content h2,
body.dark-mode .message-container .message-bubble .markdown-content h1,
body.dark-mode .message-container .message-bubble .markdown-content h2 {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .message--agent .message__bubble .markdown-content code,
body.dark-mode .message-container.agent-message .message-bubble .markdown-content code,
body.dark-mode .message-container.agent-message .text-content.markdown-content code,
body.dark-mode .message-container.agent-message .message-content .markdown-content code {
  background-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .message--agent .message__bubble .markdown-content pre,
body.dark-mode .message-container.agent-message .message-bubble .markdown-content pre,
body.dark-mode .message-container.agent-message .text-content.markdown-content pre,
body.dark-mode .message-container.agent-message .message-content .markdown-content pre {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Dark mode for markdown content */
body.dark-mode .text-content.markdown-content code,
body.dark-mode .message-content .markdown-content code {
  background-color: rgba(100, 150, 255, 0.25);
  border: 1px solid rgba(100, 150, 255, 0.3);
}

body.dark-mode .text-content.markdown-content pre,
body.dark-mode .message-content .markdown-content pre {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Dark mode for markdown pre code */
body.dark-mode .message__bubble .markdown-content pre code,
body.dark-mode .message-container .message-bubble .markdown-content pre code,
body.dark-mode .text-content.markdown-content pre code,
body.dark-mode .message-content .markdown-content pre code {
  background-color: rgba(200, 200, 200, 0.2) !important;
  border: none !important;
}

/* CRITICAL: Enhanced bubble containment rules for the exact HTML structure */
.message-container.agent-message .message-bubble,
.message-container.user-message .message-bubble {
  /* Ensure the bubble itself is properly constrained */
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.message-container .message-bubble .message-content {
  /* Ensure content wrapper is contained */
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.message-container .message-bubble .message-content .text-content.markdown-content {
  /* Ensure markdown content is contained */
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

/* Specific containment for pre elements in the exact structure */
.message-container .message-bubble .message-content .text-content.markdown-content pre {
  max-width: 100% !important;
  width: 100% !important;
  min-width: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  box-sizing: border-box !important;
  /* Force table-cell like behavior for better containment */
  display: block !important;
}

/* Specific containment for code elements in the exact structure */
.message-container .message-bubble .message-content .text-content.markdown-content code {
  max-width: 100% !important;
  min-width: 0 !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  box-sizing: border-box !important;
}

/* Ultra-specific for pre code combination */
.message-container .message-bubble .message-content .text-content.markdown-content pre code {
  max-width: 100% !important; /* Force containment */
  white-space: pre-wrap !important; /* Allow line wrapping */
  word-wrap: break-word !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
}

/* System messages */
.system-message {
  margin: var(--spacing-sm) auto;
  padding: var(--spacing-sm) var(--spacing-lg);
  background-color: rgba(255, 247, 237, 0.8);
  border-left: 3px solid #f97316;
  color: #9a3412;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  max-width: 80%;
  text-align: center;
  box-shadow: 0 1px 2px var(--color-shadow);
  animation: fadeIn var(--transition-slow) ease;
}

body.dark-mode .system-message {
  background-color: rgba(49, 46, 43, 0.8);
  border-left-color: #c2410c;
  color: #fdba74;
}

/* Typing indicator */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  background-color: var(--color-bg-secondary);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: 0; /* Remove any auto margin that might center it */
}

.typing-indicator__dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-text-secondary);
  border-radius: var(--radius-full);
  animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-indicator__dot:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-indicator__dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing-bounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

body.dark-mode .typing-indicator {
  background-color: #2d2d2d;
}

/* Status messages */
.status-message {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: var(--spacing-sm);
  margin: var(--spacing-sm) 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-style: italic;
  white-space: nowrap;
  width: fit-content;
  max-width: 100%;
}

/* Thinking status specific styles */
.thinking-status,
.status-message.thinking {
  display: inline-flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  background-color: var(--color-bg-secondary);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-full);
  font-style: normal;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  width: fit-content;
  max-width: 100%;
  margin: var(--spacing-sm) 0;
  box-shadow: 0 2px 4px var(--color-shadow);
  animation: fadeIn 0.3s ease-in-out;
}

.message-container .thinking-status,
.message-container .status-message.thinking {
  margin: var(--spacing-sm) 0;
  align-self: flex-start;
}

.thinking-status span,
.status-message.thinking span,
.typing-indicator span {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0;
}

/* Message status indicators */
.message__status,
.message-container .message-status {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: var(--spacing-xs);
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  opacity: 0.7;
}

.message__status-icon,
.message-container .message-status-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.message__status--sending .message__status-icon,
.message-container .message-status--sending .message-status-icon {
  animation: pulse 1s infinite;
}

.message__status--sent .message__status-icon,
.message-container .message-status--sent .message-status-icon {
  color: var(--color-text-secondary);
}

.message__status--delivered .message__status-icon,
.message-container .message-status--delivered .message-status-icon {
  color: var(--color-primary);
}

.message__status--read .message__status-icon,
.message-container .message-status--read .message-status-icon {
  color: var(--color-primary);
}

.message__status--delivered .message__status-icon::after,
.message-container .message-status--delivered .message-status-icon::after,
.message__status--read .message__status-icon::after,
.message-container .message-status--read .message-status-icon::after {
  content: '✓✓';
  font-size: 10px;
  letter-spacing: -2px;
}

.message__status--sent .message__status-icon::after,
.message-container .message-status--sent .message-status-icon::after {
  content: '✓';
  font-size: 10px;
}

.message__status--sending .message__status-icon::after,
.message-container .message-status--sending .message-status-icon::after {
  content: '⋯';
  font-size: 14px;
}

/* ============================================
   6. MEDIA CONTENT IN MESSAGES
   Images, videos, audio, and file attachments
   ============================================ */

/* Image wrapper and styling */
.image-wrapper {
  margin: var(--spacing-sm) 0;
  max-width: 400px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 2px 4px var(--color-shadow);
}

.message-image {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.message-image:hover {
  transform: scale(1.02);
}

/* Video wrapper and styling */
.video-wrapper {
  margin: var(--spacing-sm) 0;
  max-width: 600px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 2px 4px var(--color-shadow);
  background-color: #000;
}

.message-video {
  width: 100%;
  height: auto;
  max-height: 400px;
  display: block;
  background-color: #000;
  border-radius: 8px;
  outline: none;
}

/* Tool Result Media Containers */
.tool-result-media-container {
  margin: var(--spacing-md) 0;
  background-color: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  box-shadow: 0 2px 8px var(--color-shadow);
  max-width: 600px;
}

.tool-result-media-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  background-color: var(--color-bg-primary);
  border-bottom: 1px solid var(--color-border);
}

.tool-result-icon {
  font-size: 1.2rem;
  color: var(--color-primary);
}

.tool-result-media-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-primary);
}

.tool-result-media-container video {
  width: 100%;
  height: auto;
  max-height: 400px;
  display: block;
  background-color: #000;
}

.tool-result-media-container img {
  width: 100%;
  height: auto;
  max-height: 400px;
  display: block;
}

.tool-result-download-link {
  display: inline-block;
  margin: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: var(--color-primary);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.tool-result-download-link:hover {
  background-color: var(--color-primary-dark);
}

/* Dark mode adjustments for tool result media */
body.dark-mode .tool-result-media-container {
  background-color: var(--color-bg-secondary);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .tool-result-media-header {
  background-color: var(--color-bg-primary);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .tool-result-media-title {
  color: var(--color-text-primary);
}

body.dark-mode .tool-result-download-link {
  background-color: var(--color-primary);
}

body.dark-mode .tool-result-download-link:hover {
  background-color: var(--color-primary-dark);
}

/* Dark mode audio wrapper in tool results */
body.dark-mode .tool-result-media-container .audio-wrapper {
  background-color: var(--color-bg-secondary);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Tool result message styling */
.tool-result-message .message-bubble {
  max-width: 700px;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: none;
}

.tool-result-message .message-content {
  padding: 0;
}

.tool-result-message .tool-result-media-container {
  width: 100%;
}

/* Add visibility for tool result audio messages */
.tool-result-message:has(.audio-wrapper) .message-bubble {
  background: var(--color-bg-secondary, #f5f5f5) !important;
  padding: 12px !important;
  border-radius: var(--radius-lg, 16px) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

body.dark-mode .tool-result-message:has(.audio-wrapper) .message-bubble {
  background: var(--color-bg-secondary, #2a2a2a) !important;
}

/* Ensure audio wrapper in tool results is visible */
.tool-result-message .audio-wrapper {
  margin: 0 !important;
  padding: 0 !important;
}

.tool-result-message .audio-wrapper.minimal {
  background: transparent !important;
}

/* Audio wrapper and styling */
.audio-wrapper {
  margin: var(--spacing-sm) 0;
  max-width: 400px;
}

.message-audio {
  width: 100%;
  height: 40px;
}

/* File attachment styling */
.file-attachment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-sm) var(--spacing-md);
  margin: var(--spacing-sm) 0;
  background-color: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  max-width: 400px;
}

.file-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex: 1;
  min-width: 0;
}

.file-icon {
  font-size: 1.5rem;
  color: var(--color-primary);
  flex-shrink: 0;
}

.file-name {
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-actions {
  display: flex;
  gap: var(--spacing-xs);
  flex-shrink: 0;
}

.file-action-btn {
  padding: var(--spacing-xs);
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.file-action-btn:hover {
  color: var(--color-primary);
  background-color: var(--color-bg-tertiary);
}

/* Dark mode adjustments for media */
body.dark-mode .image-wrapper,
body.dark-mode .video-wrapper {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-mode .file-attachment {
  background-color: var(--color-bg-secondary);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .file-action-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Mobile responsiveness for media */
@media (max-width: 768px) {
  .image-wrapper,
  .video-wrapper,
  .audio-wrapper,
  .file-attachment {
    max-width: 100%;
  }
  
  .message-video {
    max-height: 300px;
  }
}

/* ============================================
   7. UNIFIED STATUS INDICATOR
   Status bubbles as regular chat messages
   ============================================ */
.status-message-bubble {
  /* Inherits from message-container agent-message */
  margin-bottom: var(--spacing-md);
}

.status-message-bubble .message-bubble {
  /* Inherits agent message bubble styling */
  background: var(--color-bg-secondary, #f5f5f5) !important;
  color: var(--color-text-secondary, #666) !important;
}

body.dark-mode .status-message-bubble .message-bubble {
  background: var(--color-bg-secondary, #2a2a2a) !important;
  color: var(--color-text-primary, #e4e4e7) !important;
}

/* Tool status container in chat */
#tool-status-container {
  /* Behaves like a regular message */
  margin-bottom: var(--spacing-md);
  width: 100% !important;
  display: flex !important;
  justify-content: flex-start !important;
}

#tool-status-container .flex {
  width: 100% !important;
  justify-content: flex-start !important;
}

#tool-status-container .status-bubble {
  /* Remove any absolute positioning */
  position: static !important;
  transform: none !important;
  margin-left: 0 !important;
  margin-right: auto !important;
}

/* Spinner animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Fade in animation */
@keyframes fadeIn {
  from { 
    opacity: 0;
    transform: translateY(10px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

/* Remove old overlay status indicators */
.typing-indicator-container:not(.message-container),
.thinking-status:not(.message-container),
#status-inline:not(.message-container),
.tool-status-bubble:not(.message-container) {
  display: none !important;
}

/* Status bubbles for regular chat interface - Minimalist design */
.status-bubble {
  background-color: transparent !important;
  padding: 4px 0;
  border-radius: 0;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  box-shadow: none !important;
  border: none !important;
  max-width: 80% !important;
  width: fit-content;
  margin-left: 50px;
  flex-direction: column;
}

.dark-mode .status-bubble {
  background-color: transparent !important;
  border: none !important;
  color: rgba(255, 255, 255, 0.8);
}

/* Status bubble text styling - Minimalist */
.status-bubble .message-text {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px !important;
  font-size: 14px;
  color: #666666;
  flex-direction: row !important;
  overflow: visible;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.4;
  width: fit-content;
  flex: none;
  opacity: 0.8;
}

.dark-mode .status-bubble .message-text {
  color: rgba(255, 255, 255, 0.7);
}

/* CSS spinner with magenta color */
.status-bubble .css-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top: 2px solid #d946ef;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

.dark-mode .status-bubble .css-spinner {
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top: 2px solid #d946ef;
}

/* Override any conflicting styles from other CSS */
.status-bubble .msg {
  display: flex;
  align-items: flex-start;
  flex: none;
  overflow: visible;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.5;
  width: fit-content;
  position: relative;
  cursor: default;
}

/* Hide legacy typing indicators when status manager is active */
.typing-indicator-container {
  display: none !important;
}

.typing-indicator {
  display: none !important;
}

.message-bubble.typing-indicator {
  display: none !important;
}

/* Only show status bubbles */
.status-bubble {
  display: flex !important;
}

/* ============================================
   7. CHAT INPUT
   ============================================ */
.chat-input,
.message-input-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: 16px; /* Reduced padding for cleaner look */
  background-color: #f7f7f8; /* Light gray background like centered input */
  border-top: none !important; /* Remove border */
  min-height: 80px; /* Slightly smaller */
  width: 100%;
  box-shadow: none;
  flex-shrink: 0;
  transition: all 0.3s ease;
  border: none !important; /* Ensure no borders */
  outline: none !important;
}

/* Dark mode for message input container */
body.dark-mode .chat-input,
body.dark-mode .message-input-container {
  background-color: #343541 !important;
  border: none !important;
}

/* ... existing code ... */

.chat-input__wrapper,
#message-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background-color: #ffffff; /* White background */
  border-radius: 20px; /* Rounded like centered input */
  border: none !important; /* Remove all borders */
  outline: none !important;
  box-shadow: none !important;
  transition: all var(--transition-base);
  padding: 8px 8px 8px 24px; /* Asymmetric padding for clean look */
  width: 100%;
  max-width: 768px;
  margin: 0 auto;
  min-height: 56px; /* Taller minimum height */
}

/* Dark mode input wrapper */
.dark-mode #message-input-wrapper {
  background-color: #444654 !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* ... existing code ... */

.chat-input__wrapper:focus-within,
#message-input-wrapper:focus-within {
  border: none !important; /* Remove focus border */
  box-shadow: none !important; /* Remove focus shadow */
  outline: none !important;
}

/* ... existing code ... */

/* Agent avatar in input area - hidden for clean design */
.input-agent-avatar {
  display: none; /* Hide avatar for clean, modern design */
}

.chat-input__attach,
.action-button {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: #666666; /* Lighter gray for subtle buttons */
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  font-size: 20px; /* Larger icons */
}

.chat-input__attach:hover,
.action-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--color-text-primary);
}

.dark-mode .chat-input__attach:hover,
.dark-mode .action-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.chat-input__field {
  flex: 1;
  min-height: 52px;
  max-height: 200px;
  padding: 16px 20px !important;
  background-color: transparent;
  border: none !important;
  font-size: 20px !important;
  line-height: 1.5;
  color: var(--color-text-primary);
  outline: none !important;
  resize: none;
  width: 100%;
  min-width: 0;
  transition: all var(--transition-fast);
  font-weight: 400;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  border-radius: 12px !important;
}

/* Override old #message-input styles - commented out to prevent conflicts */
/*
#message-input {
  // Old styles removed to prevent conflicts with new chat-input-textarea
}
*/

/* Light mode text color */
body:not(.dark-mode) #message-input {
  color: #212121 !important;
}

/* Dark mode text color */
body.dark-mode #message-input {
  color: #ececf1 !important;
}

/* ... existing code ... */

.chat-input__field::placeholder {
  color: #6e6e80 !important;
  opacity: 1;
  font-size: 20px;
  font-weight: 400;
}

/* Override old placeholder styles - now handled by chat-input-textarea */
/*
#message-input::placeholder {
  // Old styles removed
}

body.dark-mode #message-input::placeholder {
  // Old styles removed
}
*/

/* ... existing code ... */



/* High contrast focus indicator for better visibility */
.chat-input__field:focus,
#message-input:focus {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Send button with more prominence */
.chat-input__send,
#send-button {
  width: 44px; /* Match centered button size */
  height: 44px; /* Match centered button size */
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000000; /* Black background for prominence */
  border: none;
  border-radius: 10px; /* Rounded square like centered button */
  color: #ffffff; /* White icon */
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  padding: 0;
  margin-right: 8px;
}

/* Light mode send button hover */
body:not(.dark-mode) .chat-input__send:hover:not(:disabled),
body:not(.dark-mode) #send-button:hover:not(:disabled) {
  background-color: #2d2d2d !important; /* Slightly lighter on hover */
}

/* Light mode send button disabled */
body:not(.dark-mode) .chat-input__send:disabled,
body:not(.dark-mode) #send-button:disabled {
  background-color: #f0f0f0 !important;
  color: #a0a0a0 !important;
  cursor: not-allowed;
}

.chat-input__send:active:not(:disabled),
#send-button:active:not(:disabled) {
  transform: scale(0.95);
}

.chat-input__send:disabled,
#send-button:disabled {
  background-color: var(--color-text-secondary);
  opacity: 0.3;
  cursor: not-allowed;
  box-shadow: none;
}

/* Send button icon styles */
.chat-input__send i,
#send-button i {
  font-size: 16px;
  display: inline-block;
  transform: none !important; /* Ensure no rotation */
}

/* File preview area improvements */
#file-preview {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-bg-secondary);
  border-radius: 12px;
  margin: 0 var(--spacing-md) var(--spacing-sm);
  border: 1px solid var(--color-border);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

#file-preview:not(.hidden) {
  display: flex !important;
  animation: slideDown 0.2s ease-out;
}

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

/* Quick actions button styling */
#quick-actions-toggle {
  position: relative;
  background: var(--color-bg-tertiary);
  transition: all var(--transition-fast);
}

#quick-actions-toggle:hover {
  background: var(--color-primary);
  color: white;
  transform: rotate(45deg) scale(1.1);
}

/* Quick actions popup improvements */
.quick-actions-popup {
  position: fixed; /* Use fixed positioning */
  /* Position will be set by JavaScript */
  background: #40414F; /* ChatGPT-like dark background */
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  padding: 8px;
  min-width: 280px;
  max-width: 320px;
  z-index: 9999; /* Very high z-index to ensure visibility */
  animation: popupAppear 0.2s ease-out;
  display: none; /* Hidden by default */
}

/* Show popup when not hidden class */
.quick-actions-popup:not(.hidden) {
  display: block;
}

/* Light mode quick actions popup */
body:not(.dark-mode) .quick-actions-popup {
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Quick actions header */
.quick-actions-header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 8px;
}

.quick-actions-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
}

body:not(.dark-mode) .quick-actions-header h3 {
  color: #111827;
}

/* Quick actions content */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 8px 8px 8px;
}

.quick-actions .skill-item,
.quick-actions .action-item {
  padding: 10px 12px;
  background-color: transparent;
  border: none;
  border-radius: 8px;
  color: #e0e0e0;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.quick-actions .skill-item:hover,
.quick-actions .action-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.quick-actions .skill-item i,
.quick-actions .action-item i {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

/* Light mode quick actions items */
body:not(.dark-mode) .quick-actions .skill-item,
body:not(.dark-mode) .quick-actions .action-item {
  color: #374151;
}

body:not(.dark-mode) .quick-actions .skill-item:hover,
body:not(.dark-mode) .quick-actions .action-item:hover {
  background-color: #F3F4F6;
  color: #111827;
}

/* Position for centered state - handled by JavaScript */
.chat-container:not(.chat-active) .quick-actions-popup {
  /* Position will be set dynamically by JavaScript */
  max-height: 300px;
  overflow-y: auto;
}

/* Position for active chat state - handled by JavaScript */
.chat-container.chat-active .quick-actions-popup {
  /* Position will be set dynamically by JavaScript */
}

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

/* Drag and drop area improvements */
#drag-drop-area {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  border: 3px dashed var(--color-primary);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.2s ease, visibility 0.2s ease, background-color 0.2s ease;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#drag-drop-area:not(.hidden) {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#drag-drop-area.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  background: rgba(227, 23, 94, 0.05);
  border-color: var(--color-primary);
}

#drag-drop-area i {
  font-size: 48px;
  color: var(--color-primary);
  margin-bottom: var(--spacing-md);
}

#drag-drop-area p {
  margin: 5px 0;
  font-size: 16px;
  font-weight: 500;
}

#drag-drop-area p:first-of-type {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-primary);
}

#drag-drop-area p:last-of-type {
  color: var(--color-text-secondary);
  font-size: 14px;
}

/* Dark mode adjustments for new input design */
body.dark-mode .chat-input,
body.dark-mode .message-input-container {
  background-color: #343541;
  border-top: none;
}

body.dark-mode #message-input-wrapper {
  background-color: #444654;
  border: none;
}

body.dark-mode .agent-avatar-small {
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode #drag-drop-area {
  background: rgba(64, 65, 79, 0.95);
  border-color: var(--color-primary);
}

body.dark-mode #drag-drop-area.active {
  background: rgba(227, 23, 94, 0.1);
}

/* ============================================
   8. LIGHTBOX STYLES
   ============================================ */
.lightbox-overlay {
  display: none;
  visibility: hidden;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: var(--z-modal);
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.lightbox-overlay.active {
  display: flex;
  visibility: visible;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  color: white;
  font-size: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition-fast);
}

.lightbox-close:hover {
  opacity: 0.8;
}

/* ============================================
   9. UTILITIES
   ============================================ */
.action-button {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.action-button:hover {
  background-color: var(--color-bg-secondary);
  color: var(--color-primary);
  transform: scale(1.1);
}

.action-button:active {
  transform: scale(0.95);
}

.action-button i {
  font-size: 18px;
}

/* ============================================
   10. RESPONSIVE DESIGN
   ============================================ */
  @media (max-width: 768px) {
    :root {
      --chat-header-height: 48px; /* Match desktop for consistency */
      --input-container-height: 70px; /* Match desktop for consistency */
    }
  
  .main-container {
    margin-top: 0;
    height: 100vh;
  }
  
  .chat-container {
    margin-left: 0;
    height: 100vh;
  }
  
  .chat-header {
    padding: 0 var(--spacing-md);
    gap: var(--spacing-xs);
  }
  
  .chat-messages {
    padding: 0;
    height: calc(100% - var(--chat-header-height));
  }
  
  /* Ensure proper height calculation on mobile */
  .chat-messages {
    height: calc(100vh - var(--header-height) - var(--chat-header-height) - 100px - env(safe-area-inset-bottom, 0)) !important;
    max-height: calc(100vh - var(--header-height) - var(--chat-header-height) - 100px - env(safe-area-inset-bottom, 0)) !important;
  }
  
  /* Ensure proper padding on mobile when chat is active */
  .chat-container.chat-active .chat-messages {
    padding-bottom: 20px !important; /* Small padding for visual comfort */
  }
  
  /* Ensure input container is properly positioned on mobile */
  .chat-container.chat-active .message-input-container {
    position: fixed !important;
    bottom: 60px !important; /* Add more space above browser UI elements */
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0)) !important;
    background-color: var(--color-bg-primary) !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05) !important;
    z-index: 1000 !important;
    height: auto !important;
    min-height: 100px !important;
  }
  
  /* Mobile empty state adjustments */
  .chat-empty-state h1 {
    font-size: 24px;
  }
  
  .chat-empty-state .agent-description-large {
    font-size: var(--font-size-base);
  }
  
  .chat-header__avatar {
    width: 36px;
    height: 36px;
  }
  
  .chat-header__title {
    font-size: var(--font-size-base);
    -webkit-line-clamp: 1;
    line-clamp: 1; /* Standard property for future compatibility */
  }
  
  .chat-header__action {
    width: 32px;
    height: 32px;
  }
  
  .chat-header__action i {
    font-size: 16px;
  }
  
  #server-notification-container {
    max-width: 120px;
    margin: 0 2px;
  }
  
  #server-notification-container .notification {
    padding: 2px var(--spacing-xs);
    font-size: 10px;
    border-radius: 4px;
    margin: 1px 0;
  }
  
  .message__avatar,
  .message-container .avatar-container {
    width: 32px;
    height: 32px;
  }
  
  .message__bubble,
  .message-container .message-bubble {
    padding: var(--spacing-sm) var(--spacing-md);
  }
  
  .message__content,
  .message-container .message-content {
    width: fit-content;
  }
  
  .message-container.user-message .message-content {
    align-items: flex-end;
    text-align: right;
  }
  
  .thinking-status,
  .status-message.thinking,
  .status-message {
    white-space: nowrap;
    width: fit-content;
    max-width: none;
    font-size: var(--font-size-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    gap: 0;
  }
  
  .desktop-only {
    display: none !important;
  }
  
  .mobile-only {
    display: flex !important;
  }
  
  /* Mobile input area adjustments */
  .chat-input,
  .message-input-container {
    padding: var(--spacing-md);
    min-height: var(--input-container-height);
  }
  
  #message-input-wrapper,
  .chat-input__wrapper {
    padding: 6px 6px 6px 12px;
  }
  
  #message-input,
  .chat-input__field {
    min-height: 44px; /* Slightly increased for larger font */
    padding: 10px var(--spacing-md);
    font-size: 16px; /* Keep 16px on mobile to prevent iOS zoom */
    line-height: 1.5;
  }
  
  #message-input::placeholder,
  .chat-input__field::placeholder {
    font-size: 15px;
  }
  
  .action-button,
  .chat-input__attach {
    width: 36px;
    height: 36px;
  }
  
  #send-button,
  .chat-input__send {
    width: 40px;
    height: 40px;
  }
  
  .quick-actions-popup {
    /* Position will be set dynamically by JavaScript */
    /* On mobile, JS will handle full-width positioning */
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .message__bubble,
  .message-container .message-bubble {
    width: fit-content;
  }
  
  .message__content,
  .message-container .message-content {
    width: fit-content;
  }
}

/* Large screens */
@media (min-width: 1440px) {
  :root {
    --chat-max-width: 1400px;
  }
  
  .message__bubble,
  .message-container .message-bubble {
    width: fit-content;
  }
  
  .message__content,
  .message-container .message-content {
    width: fit-content;
  }
}

/* iOS Safe Area Support */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .chat-input,
  .message-input-container {
    padding-bottom: calc(var(--spacing-md) + env(safe-area-inset-bottom));
  }
  
  @media (max-width: 768px) {
    .chat-messages {
      height: calc(100vh - var(--chat-header-height) - var(--input-container-height) - env(safe-area-inset-bottom) - 10px);
      max-height: calc(100vh - var(--chat-header-height) - var(--input-container-height) - env(safe-area-inset-bottom) - 10px);
    }
  }
}

/* ============================================
   11. ANIMATIONS & TRANSITIONS
   ============================================ */
.fade-in {
  animation: fadeIn var(--transition-slow) ease-out;
}

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

.message,
.message-container {
  animation: messageAppear var(--transition-slow) ease-out;
}

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

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(227, 23, 94, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(227, 23, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(227, 23, 94, 0);
  }
}

.chat-input__send:not(:disabled) {
  animation: pulse 2s infinite;
}

button:active {
  transform: scale(0.95);
}

/* ============================================
   12. VOICE RECORDER STYLES
   ============================================ */

/* Microphone button states */
.mic-btn {
  transition: all 0.3s ease;
  position: relative;
}

.mic-btn.recording {
  background-color: #dc3545 !important;
  color: white !important;
  animation: pulse-red 1.5s infinite;
}

.mic-btn.processing {
  background-color: #ffc107 !important;
  color: #212529 !important;
  animation: spin 1s linear infinite;
}

/* Recording animations */
@keyframes pulse-red {
  0% { 
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); 
  }
  70% { 
    box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); 
  }
  100% { 
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); 
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Recording indicator */
.recording-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #dc3545;
  font-size: 12px;
  font-weight: 500;
  margin-right: 8px;
}

.recording-dot {
  width: 8px;
  height: 8px;
  background-color: #dc3545;
  border-radius: 50%;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.3; }
}

/* Recording timer */
.recording-timer {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #666;
  min-width: 30px;
  margin-right: 8px;
  font-weight: bold;
}

/* Dark mode adjustments for recording elements */
.dark-mode .recording-indicator {
  color: #ff6b6b;
}

.dark-mode .recording-dot {
  background-color: #ff6b6b;
}

.dark-mode .recording-timer {
  color: #ccc;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
  .recording-indicator {
    font-size: 11px;
    gap: 4px;
    margin-right: 6px;
  }
  
  .recording-timer {
    font-size: 11px;
    min-width: 25px;
    margin-right: 6px;
  }
  
  .recording-dot {
    width: 6px;
    height: 6px;
  }
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Remove focus outline from input elements */
.centered-textarea:focus-visible,
.centered-input-wrapper:focus-visible,
.centered-input-container:focus-visible,
.centered-textarea:focus,
.centered-input-wrapper:focus,
.centered-input-container:focus {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* Ensure no black borders in dark mode */
body.dark-mode .centered-input-container,
body.dark-mode .centered-input-wrapper,
body.dark-mode .centered-textarea,
body.dark-mode .centered-input-container *,
body.dark-mode .centered-input-wrapper * {
  border: 0 solid transparent !important;
  border-width: 0 !important;
  border-color: transparent !important;
  outline: 0 solid transparent !important;
  outline-width: 0 !important;
  outline-color: transparent !important;
  -webkit-box-shadow: none !important;
  -moz-box-shadow: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}

/* Additional specificity to override any browser defaults */
body.dark-mode textarea.centered-textarea,
body.dark-mode input.centered-textarea,
body.dark-mode .centered-input-container textarea,
body.dark-mode .centered-input-wrapper textarea {
  border: 0 !important;
  outline: 0 !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}

body,
.chat-container,
.chat-header,
.message__bubble,
.chat-input,
.chat-input__field {
  transition: 
    background-color var(--transition-slow),
    color var(--transition-slow),
    border-color var(--transition-slow);
}

/* Dark mode thinking bubble */
body.dark-mode .thinking-status,
body.dark-mode .status-message.thinking,
body.dark-mode .typing-indicator {
  background-color: #374151;
  color: #d1d5db;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* ============================================
   OVERRIDE STYLES - Higher specificity for user bubble positioning
   ============================================ */
body .agent-of-agents-page .message-container.user-message,
body .agent-of-agents-page .user-message,
.message-container.user-message,
.user-message {
  flex-direction: row-reverse !important;
  justify-content: flex-start !important;
  margin-left: auto !important;
  display: flex !important;
}

body .agent-of-agents-page .message-container.user-message .message-content,
body .agent-of-agents-page .user-message .message-content,
.message-container.user-message .message-content {
  align-items: flex-end !important;
  text-align: right !important;
}

body .agent-of-agents-page .message-container.user-message .message-bubble,
body .agent-of-agents-page .user-message .message-content,
.message-container.user-message .message-bubble {
  background: #f5f5f5 !important;
  color: #1a1a1a !important;
  border: none !important;
  border-bottom-right-radius: 4px !important;
}

/* ============================================
   META AGENT SPECIFIC STYLES
   ============================================ */

/* Meta agent container layout */
.main-container.meta-agent-container {
  /* No special padding needed - let it flow naturally like regular chat */
  padding-top: 0;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Chat header positioning and alignment - NORMAL FLOW LIKE REGULAR CHAT */
.meta-agent-container .chat-header {
  /* Remove fixed positioning to match regular chat.html behavior */
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  width: 100%;
  max-width: none;
  z-index: auto;
  /* Keep the background and border styling */
  background: var(--color-bg-primary, #ffffff) !important;
  border-bottom: 1px solid var(--color-border, #e5e7eb) !important;
  margin: 0;
  box-shadow: none; /* Remove shadow to match regular chat header */
}

/* Dark mode header fix */
body.dark-mode .meta-agent-container .chat-header {
  background: var(--color-bg-primary, #1a1a1a) !important;
  border-bottom: 1px solid var(--color-border, #374151) !important;
}

/* Normal chat messages layout - no padding needed for non-fixed header */
.meta-agent-container .chat-messages {
  /* Remove padding since header is no longer fixed */
  padding-top: 0;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  /* Use same height calculation as regular chat */
  height: auto;
  max-height: none;
}

/* Normal agent-of-agents page content (same as regular chat) */
.agent-of-agents-page {
  /* Use normal width like regular chat containers */
  width: 100%;
  max-width: none;
  margin: 0 auto;
  overflow-x: hidden !important; /* Prevent horizontal scroll */
}

/* Sidebar normal positioning for meta agent (same as regular chat) */
.meta-agent-container .sidebar {
  /* Use normal sidebar positioning like regular chat */
  top: 64px; /* Only account for base header */
  height: calc(100vh - 64px);
}

/* Dark mode sidebar adjustments */
body.dark-mode .meta-agent-container .sidebar {
  border-right: 1px solid var(--color-border, #374151) !important;
}

/* User message colors - Dark mode with maximum specificity */
html body.dark-mode .agent-of-agents-page .message-container.user-message .message-bubble,
html body.dark-mode .meta-agent-container .message-container.user-message .message-bubble,
body.dark-mode .agent-of-agents-page .message-container.user-message .message-bubble {
  background: #374151 !important; /* Darker gray background */
  color: #f3f4f6 !important;       /* Light text */
  border: 1px solid #4b5563 !important; /* Darker border */
}

/* Ultra-specific dark mode text color overrides - HIGHEST PRIORITY */
html body.dark-mode .agent-of-agents-page .message-container.user-message .message-text,
html body.dark-mode .agent-of-agents-page .message-container.user-message .text-content,
html body.dark-mode .agent-of-agents-page .message-container.user-message .message-bubble .message-text,
html body.dark-mode .agent-of-agents-page .message-container.user-message .message-bubble .text-content,
html body.dark-mode .agent-of-agents-page .message-container.user-message .message-bubble *,
html body.dark-mode .agent-of-agents-page .message-container.user-message .message-bubble p,
html body.dark-mode .agent-of-agents-page .message-container.user-message .message-bubble span,
html body.dark-mode .agent-of-agents-page .message-container.user-message .message-bubble div,
html body.dark-mode .meta-agent-container .message-container.user-message .message-text,
html body.dark-mode .meta-agent-container .message-container.user-message .text-content,
html body.dark-mode .meta-agent-container .message-container.user-message .message-bubble .message-text,
html body.dark-mode .meta-agent-container .message-container.user-message .message-bubble .text-content,
html body.dark-mode .meta-agent-container .message-container.user-message .message-bubble *,
html body.dark-mode .meta-agent-container .message-container.user-message .message-bubble p,
html body.dark-mode .meta-agent-container .message-container.user-message .message-bubble span,
html body.dark-mode .meta-agent-container .message-container.user-message .message-bubble div {
  color: #f3f4f6 !important;    /* Light text for dark mode */
  background: transparent !important;
}

/* Override any CSS variable usage for dark mode */
html body.dark-mode .agent-of-agents-page .message-container.user-message .message-bubble,
html body.dark-mode .meta-agent-container .message-container.user-message .message-bubble {
  --color-text-primary: #f3f4f6 !important;
  --color-text-secondary: #f3f4f6 !important;
  --color-bg-user: #374151 !important;
}

/* Mobile responsive adjustments for meta agent */
@media (max-width: 768px) {
  /* Mobile adjustments - normal flow like regular chat */
  .main-container.meta-agent-container {
    /* No special padding needed - use normal flow */
    padding-top: 0;
  }
  
  .meta-agent-container .chat-header {
    /* Keep normal flow positioning on mobile too */
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 100%;
    max-width: none;
  }
  
  .meta-agent-container .chat-messages {
    /* Normal flow - no special padding or height needed */
    padding-top: 0;
    height: auto;
    max-height: none;
  }
  
  /* Mobile agent-of-agents page content - normal width */
  .agent-of-agents-page {
    width: 100%;
    max-width: none;
  }
  
  /* Mobile sidebar - normal positioning relative to viewport */
  .meta-agent-container .sidebar {
    top: 64px; /* Only account for base header */
    height: calc(100vh - 64px);
  }
}

/* ============================================
   15. EXECUTIVE MODE - Enhanced accessibility for 45+ users
   ============================================ */

/* Apply executive mode with body.executive-mode class */
body.executive-mode {
  /* Even larger typography */
  --font-size-xs: 16px;
  --font-size-sm: 18px;
  --font-size-base: 20px;
  --font-size-lg: 24px;
  --font-size-xl: 28px;
  --font-size-2xl: 32px;
  
  /* More spacing */
  --spacing-xs: 8px;
  --spacing-sm: 12px;
  --spacing-md: 20px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 40px;
  --spacing-3xl: 56px;
  
  /* Enhanced line height */
  --line-height-base: 1.8;
  --line-height-relaxed: 2.0;
}

/* Larger touch targets in executive mode */
body.executive-mode .chat-header__action {
  width: 56px;
  height: 56px;
}

body.executive-mode .chat-header__action i {
  font-size: 28px;
}

body.executive-mode .action-button {
  width: 48px;
  height: 48px;
}

body.executive-mode .action-button i {
  font-size: 24px;
}

/* Clearer message bubbles */
body.executive-mode .message__bubble,
body.executive-mode .message-container .message-bubble {
  font-size: 20px;
  padding: 24px 32px;
  line-height: 1.8;
}

/* Larger input field */
body.executive-mode .chat-input__field,
body.executive-mode #message-input {
  font-size: 22px;
  min-height: 64px;
  padding: 20px 32px;
}

body.executive-mode .chat-input__send,
body.executive-mode #send-button {
  min-width: 120px;
  height: 60px;
  font-size: 20px;
  padding: 0 28px;
}

/* Higher contrast mode */
body.executive-mode:not(.dark-mode) {
  --color-text-primary: #000000;
  --color-text-secondary: #333333;
  --color-bg-secondary: #f8f8f8;
  --color-border: #cccccc;
}

body.executive-mode.dark-mode {
  --color-text-primary: #ffffff;
  --color-text-secondary: #e0e0e0;
  --color-bg-primary: #000000;
  --color-bg-secondary: #1a1a1a;
  --color-border: #444444;
}

/* Clearer focus states */
body.executive-mode :focus {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* ============================================
   16. RESERVED FOR FUTURE USE
   ============================================ */

/* Typing indicator container - ensure left alignment */
.typing-indicator-container {
  /* Inherits from message-container agent-message */
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  margin-bottom: var(--spacing-md);
  width: 100%;
}

.typing-indicator-container .message-bubble {
  margin-left: 0;
  margin-right: auto;
}

/* Override typing_indicators.css margin-left */
.chat-messages .typing-indicator,
.typing-indicator-container .typing-indicator,
.message-container .typing-indicator,
#chat-area .typing-indicator {
  margin-left: 0 !important;
  margin-right: auto;
  display: inline-flex;
  max-width: fit-content;
}

/* Ensure thinking status bubbles are left-aligned */
.chat-messages .thinking-status,
.chat-messages .status-message.thinking,
#chat-area .thinking-status,
#chat-area .status-message.thinking {
  margin-left: 0 !important;
  margin-right: auto !important;
  align-self: flex-start !important;
}

.typing-indicator__dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-text-secondary);
  border-radius: var(--radius-full);
  animation: typing-bounce 1.4s ease-in-out infinite;
}

/* Chat Core CSS - Main chat interface styles */

/* Allow subtle styling on input elements */
.centered-input-container {
    border: none !important;
    outline: none !important;
}

.centered-textarea,
.centered-buttons-row,
.centered-buttons-row * {
    border: none !important;
    outline: none !important;
}

/* Override only container pseudo elements */
.centered-input-container::before,
.centered-input-container::after {
    border: none !important;
    box-shadow: none !important;
}

/* Main container with transparent background */
.centered-input-container {
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    width: 100% !important;
    max-width: 900px !important;
    margin: 0 auto !important;
    border: 0px solid transparent !important;
    outline: 0px solid transparent !important;
    box-shadow: none !important;
}

/* Inner wrapper with subtle styling */
.centered-input-wrapper {
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 24px !important;
    padding: 8px 0 !important;
    border: none !important;
    outline: 0px solid transparent !important;
    box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.02) !important;
    min-height: 40px !important;
}

/* Remove borders from parent containers */
.chat-container .centered-input-container,
.main-container .centered-input-container,
body .centered-input-container {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

/* Ensure no borders on any state */
.centered-input-container:hover,
.centered-input-container:focus,
.centered-input-container:active,
.centered-input-wrapper:hover,
.centered-input-wrapper:focus,
.centered-input-wrapper:active {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

/* Fix chat container background when showing centered input */
.chat-container:not(.chat-active) {
    background-color: #f7f7f8 !important; /* Same gray as centered container */
}

/* Dark mode chat container background */
body.dark-mode .chat-container:not(.chat-active) {
    background-color: #343541 !important;
}

/* Chat empty state should match ChatGPT background */
.chat-empty-state {
    background-color: #fafafa !important;
}

body.dark-mode .chat-empty-state {
    background-color: #343541 !important;
}

/* Ensure chat-messages area also has correct background */
.chat-messages {
    background-color: transparent !important;
}

.chat-container:not(.chat-active) .chat-messages {
    background-color: #fafafa !important;
}

body.dark-mode .chat-container:not(.chat-active) .chat-messages {
    background-color: #343541 !important;
}

/* Remove any possible padding that could show white edges */
.chat-container:not(.chat-active) .chat-messages {
    padding: 0 !important;
}

/* Fix body background to match container colors */
body:not(.dark-mode) {
    background-color: #ffffff !important;
}

body.dark-mode {
    background-color: #343541 !important;
}

/* Ensure main container also has correct background */
body.dark-mode .main-container {
    background-color: #343541 !important;
}

/* Ensure html and all parent elements have correct background */
html.dark-mode,
html body.dark-mode {
    background-color: #343541 !important;
}

/* Ensure the entire viewport has dark background in dark mode */
body.dark-mode .bg-white,
body.dark-mode .min-h-screen {
    background-color: #343541 !important;
}

/* Override Tailwind bg-white class in dark mode */
body.dark-mode.bg-white,
body.dark-mode .bg-white,
.dark-mode .bg-white,
.dark-mode.bg-white {
    background-color: #343541 !important;
}

/* Specific overrides for containers that might have white background */
body.dark-mode header.bg-white,
body.dark-mode div.bg-white.min-h-screen {
    background-color: #343541 !important;
}

/* Hide old input container in empty state */
.chat-container:not(.chat-active) .message-input-container {
  display: none;
}

/* Show centered input only in empty state */
.chat-container:not(.chat-active) .centered-input-container {
  display: block !important;
}

.chat-container.chat-active .centered-input-container {
  display: none !important;
}

/* Active state - bottom input */
.chat-active .message-input-container {
  position: sticky;
  bottom: 0;
  transform: none;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Dark mode input wrapper */
.dark-mode #message-input-wrapper {
  background-color: #444654 !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Dark mode send button */
.dark-mode .chat-input__send,
.dark-mode #send-button {
  background-color: #ffffff !important;
  color: #000000 !important;
}

.dark-mode .chat-input__send:hover:not(:disabled),
.dark-mode #send-button:hover:not(:disabled) {
  background-color: #d9d9e3 !important;
}

/* CRITICAL: Centered input styles with maximum specificity to prevent overrides */
/* Using multiple selectors to ensure PurgeCSS doesn't remove these */
html body .centered-input-container,
html body div.centered-input-container,
body .centered-input-container,
.centered-input-container {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 100% !important;
  max-width: 900px !important;
  z-index: 10 !important;
  background-color: transparent !important;
  background: transparent !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  border: 0 solid transparent !important;
  border-width: 0 !important;
  outline: 0 solid transparent !important;
  outline-width: 0 !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* Dark mode container with maximum specificity */
html body.dark-mode .centered-input-container,
html body.dark-mode div.centered-input-container,
body.dark-mode .centered-input-container,
.dark-mode .centered-input-container {
  background-color: transparent !important;
  background: transparent !important;
  border: 0 !important;
  outline: 0 !important;
}

/* Input wrapper with maximum specificity */
html body .centered-input-wrapper,
html body div.centered-input-wrapper,
body .centered-input-wrapper,
.centered-input-wrapper {
  background-color: rgba(255, 255, 255, 0.05) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: none !important;
  border-width: 0 !important;
  outline: 0 solid transparent !important;
  outline-width: 0 !important;
  box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.02) !important;
  border-radius: 24px !important;
  overflow: hidden !important;
  transition: all 0.2s ease !important;
  -webkit-backface-visibility: hidden !important;
  backface-visibility: hidden !important;
  margin: 0 !important;
  margin-bottom: 0 !important;
  padding: 8px 0 !important;
  display: flex !important;
  align-items: center !important;
  min-height: 40px !important;
}

/* Dark mode input wrapper */
html body.dark-mode .centered-input-wrapper,
html body.dark-mode div.centered-input-wrapper,
body.dark-mode .centered-input-wrapper,
.dark-mode .centered-input-wrapper {
  background-color: rgba(255, 255, 255, 0.05) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: none !important;
  outline: 0 !important;
  box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.05) !important;
}

/* OVERRIDE ANY POSSIBLE CONFLICTING STYLES */
/* Target any parent that might have white background */
html body.dark-mode,
body.dark-mode {
  background-color: #343541 !important;
  background: #343541 !important;
}

/* Ensure no white borders from any source */
.centered-input-container *,
.centered-input-wrapper * {
  border-color: transparent !important;
  outline-color: transparent !important;
}

/* Remove any box model properties that could show white */
.centered-input-container,
.centered-input-container::before,
.centered-input-container::after,
.centered-input-wrapper,
.centered-input-wrapper::before,
.centered-input-wrapper::after {
  box-sizing: border-box !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

/* ... existing code ... */

/* ============================================
   FIX ROOT CAUSE: Parent Container Backgrounds
   ============================================ */

/* When chat is not active (showing centered input), make ALL parents match ChatGPT */
.chat-container:not(.chat-active) {
    background-color: #fafafa !important;
}

/* Target the main-chat-layout when showing centered input */
body.chat-page .main-chat-layout,
body.chat-page .chat-content-area,
body.chat-page .container {
    background-color: #fafafa !important;
}

/* Override the bg-white classes from base.html when showing centered input */
body.chat-page,
body.chat-page > div.bg-white {
    background-color: #fafafa !important;
}

/* Dark mode versions */
body.dark-mode.chat-page,
body.dark-mode.chat-page > div.bg-white,
body.dark-mode.chat-page .main-chat-layout,
body.dark-mode.chat-page .chat-content-area,
body.dark-mode.chat-page .container {
    background-color: #343541 !important;
}

/* Fallback for browsers that don't support :has() */
/* Apply ChatGPT-like background to body when chat is empty */
body.chat-empty {
    background-color: #fafafa !important; /* Very light gray like ChatGPT */
}

body.chat-empty > div.bg-white {
    background-color: #fafafa !important;
}

body.dark-mode.chat-empty,
body.dark-mode.chat-empty > div.bg-white {
    background-color: #343541 !important;
}

/* ... existing code ... */

/* Additional specificity to override any browser defaults */
body.dark-mode textarea.centered-textarea,
body.dark-mode input.centered-textarea,
body.dark-mode .centered-input-container textarea,
body.dark-mode .centered-input-wrapper textarea {
  border: 0 !important;
  outline: 0 !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}

/* Allow subtle borders on wrapper while ensuring container has none */
html body.dark-mode .centered-input-container,
html body.dark-mode .centered-input-container::before,
html body.dark-mode .centered-input-container::after {
  border: 0 !important;
  outline: 0 !important;
}

/* Keep textarea and buttons without borders */
html body.dark-mode .centered-textarea,
html body.dark-mode .centered-buttons-row,
html body.dark-mode .centered-buttons-row * {
  border: 0 !important;
  outline: 0 !important;
}

/* Override generic .input class from styles.css with maximum specificity */
.chat-interface .input#message-input,
.chat-interface textarea#message-input,
.chat-interface #message-input.input,
#message-input-wrapper .input,
#message-input-wrapper input,
#message-input-wrapper textarea,
#message-input,
textarea#message-input,
.input#message-input {
  padding: 16px 20px !important;
  font-size: 20px !important;
  border: none !important;
  border-radius: 12px !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-color: transparent !important;
  outline: none !important;
}

/* Force removal of all borders in any state */
#message-input,
#message-input:hover,
#message-input:focus,
#message-input:active,
.input#message-input,
.input#message-input:hover,
.input#message-input:focus,
.input#message-input:active,
textarea#message-input,
textarea#message-input:hover,
textarea#message-input:focus,
textarea#message-input:active {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Override styles.css input focus state */
.input:focus,
#message-input.input:focus,
textarea.input:focus {
  border-color: transparent !important;
  box-shadow: none !important;
}

/* Ensure proper styling in wrapper */
#message-input-wrapper textarea,
#message-input-wrapper input,
#message-input-wrapper .input {
  padding: 16px 20px !important;
  font-size: 20px !important;
  line-height: 1.5 !important;
  border: none !important;
  background-color: transparent !important;
}

/* ... existing code ... */

/* ============================================
   CHAT INPUT CARD - ChatGPT Style
   ============================================ */

/* Main card container - base styles without background */
.chat-input-card {
  background-image: none !important;
  border-radius: 28px !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 10px 12px 8px !important; /* Reduced horizontal padding from 16px to 12px */
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important; /* Further reduced gap */
  box-shadow: none !important;
  transition: all 0.2s ease !important;
  min-height: 65px !important; /* Ultra compact height */
}

/* Dark mode chat input card */
body.dark-mode .chat-input-card {
  background: #40414F !important; /* ChatGPT dark mode color */
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Focus/hover state */
.chat-input-card:focus-within {
  box-shadow: none !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

/* Textarea styling */
.chat-input-textarea {
  background: transparent !important;
  border: none !important;
  resize: none !important;
  color: #ECECF1 !important; /* ChatGPT text color */
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 16px !important; /* ChatGPT uses 16px not 22px */
  font-weight: 400 !important;
  line-height: 1.2 !important; /* Further reduced line height */
  outline: none !important;
  width: 100% !important;
  min-height: 24px !important; /* Minimal height for single line */
  max-height: 120px !important; /* Reduced max height */
  padding: 0 !important;
  margin: 0 !important;
  overflow-y: auto !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}

/* Placeholder styling */
.chat-input-textarea::placeholder {
  color: #8E8EA0 !important; /* ChatGPT placeholder color */
  font-weight: 400 !important;
  opacity: 1 !important;
}

/* Toolbar container */
.chat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px; /* Further reduced gap */
  min-height: 28px; /* Minimal toolbar height */
}

/* Left tools group */
.tools-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Right actions group */
.actions-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

/* Generic icon button */
.icon-btn {
  background: none !important;
  border: none !important;
  color: #FFFFFF !important;
  font-size: 18px !important; /* Smaller icons */
  cursor: pointer !important;
  padding: 6px !important; /* Reduced padding */
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 30px !important; /* Smaller buttons */
  height: 30px !important;
  opacity: 0.9;
}

.icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  opacity: 1;
}

/* Tools label */
.tools-label {
  color: #FFFFFF !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  font-family: Inter, sans-serif !important;
  margin-left: 4px;
  white-space: nowrap;
}

/* Send button - circular with white background */
.send-btn {
  width: 32px !important; /* Smaller send button */
  height: 32px !important;
  border-radius: 50% !important;
  background: #FFFFFF !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.25) !important;
  transition: all 0.2s ease !important;
  padding: 0 !important;
}

.send-btn i {
  color: #000000 !important;
  font-size: 16px !important; /* Smaller icon */
}

/* Disabled state for send button */
.send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed !important;
  background: #666666 !important;
}

.send-btn:disabled i {
  color: #333333 !important;
}

/* Active/hover state */
.send-btn:not(:disabled):hover {
  transform: scale(1.05);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3) !important;
}

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

/* Light mode adjustments */
body:not(.dark-mode) .chat-input-card {
  background: #FFFFFF !important; /* Pure white background */
  background-image: none !important;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1) !important; /* Subtle shadow for depth */
  border: 1px solid rgba(0, 0, 0, 0.15) !important; /* Slightly darker border */
}

body:not(.dark-mode) .chat-input-card:focus-within {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2) !important;
  border-color: rgba(0, 0, 0, 0.3) !important;
}

body:not(.dark-mode) .chat-input-textarea {
  color: #000000 !important; /* Pure black text */
}

body:not(.dark-mode) .chat-input-textarea::placeholder {
  color: #666666 !important; /* Darker gray for better contrast on white */
  opacity: 1;
}

body:not(.dark-mode) .icon-btn {
  color: #000000 !important; /* Pure black for high contrast */
  opacity: 0.7;
}

body:not(.dark-mode) .icon-btn:hover {
  background-color: rgba(0, 0, 0, 0.08) !important; /* Light black hover */
  opacity: 1;
}

body:not(.dark-mode) .tools-label {
  color: #000000 !important; /* Pure black */
  font-weight: 500 !important;
}

body:not(.dark-mode) .send-btn {
  background: #000000 !important; /* Black send button */
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.2) !important;
}

body:not(.dark-mode) .send-btn i {
  color: #FFFFFF !important; /* White icon on black button */
}

body:not(.dark-mode) .send-btn:not(:disabled):hover {
  background: #1a1a1a !important; /* Slightly lighter black on hover */
  transform: scale(1.05);
}

body:not(.dark-mode) .send-btn:disabled {
  background: #E5E7EB !important;
  opacity: 0.5;
}

body:not(.dark-mode) .send-btn:disabled i {
  color: #9CA3AF !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .chat-input-card {
    padding: 16px 16px 14px; /* Reduced horizontal padding from 20px to 16px for mobile */
    border-radius: 20px;
  }
  
  .chat-input-textarea {
    font-size: 18px !important;
  }
  
  .chat-toolbar {
    gap: 8px;
  }
  
  .icon-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 18px !important;
  }
  
  .send-btn {
    width: 36px !important;
    height: 36px !important;
  }
  
  .tools-label {
    font-size: 14px !important;
  }
}

/* Override old message-input-wrapper styles */
#message-input-wrapper,
.chat-input__wrapper {
  display: none !important;
}

/* Hide old chat input elements */
.chat-input__field,
.chat-input__send,
.chat-input__attach {
  display: none !important;
}

/* Update message-input-container to have proper padding */
.message-input-container {
  background-color: var(--color-bg-primary) !important;
  padding: 12px 8px 20px !important; /* Reduced left/right padding from 16px to 8px */
  border-top: 1px solid var(--color-border) !important;
  position: fixed !important; /* Acts as containing block for absolutely positioned children */
  bottom: 60px !important; /* Add more space above browser UI elements */
  left: 0 !important;
  right: 0 !important;
  z-index: 1000 !important; /* Higher z-index to ensure it's always on top */
  transition: none !important; /* Remove transition for stable positioning */
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 100px !important; /* Ensure minimum height */
  display: block !important; /* Force display */
}

/* When chat is empty, center the input container */
.chat-container:not(.chat-active) .message-input-container {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  bottom: auto !important;
  width: 90% !important;
  max-width: 1100px !important;
  padding: 0 !important;
  background: transparent !important;
  border-top: none !important; /* No border when centered */
  box-shadow: none !important; /* No shadow when centered */
  z-index: 1000 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  min-height: auto !important; /* No min-height when centered */
}

/* Style the chat-input-card when centered - DARK MODE */
body.dark-mode .chat-container:not(.chat-active) .chat-input-card {
  background: rgb(64, 65, 79) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 20px !important;
  margin: 12px 12px 8px !important;
  min-height: auto !important;
  padding: 12px 12px !important; /* Reduced horizontal padding from 16px to 12px */
}

/* Style the chat-input-card when centered - LIGHT MODE */
body:not(.dark-mode) .chat-container:not(.chat-active) .chat-input-card {
  background: #FFFFFF !important; /* Pure white */
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1) !important;
  border-radius: 20px !important;
  margin: 12px 12px 8px !important;
  min-height: auto !important;
  padding: 12px 12px !important; /* Reduced horizontal padding from 16px to 12px */
}

/* Style the textarea when centered */
.chat-container:not(.chat-active) .chat-input-textarea {
  font-size: 16px !important;
  line-height: 1.5 !important;
  min-height: 20px !important;
}

/* Adjust toolbar spacing when centered */
.chat-container:not(.chat-active) .chat-toolbar {
  margin-top: 8px !important;
}

/* When chat has messages, ensure input stays at bottom */
.chat-container.chat-active .message-input-container {
  position: fixed !important;
  bottom: 60px !important; /* Add more space above browser UI elements */
  top: auto !important;
  transform: none !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 12px 8px 20px !important;
  background-color: var(--color-bg-primary) !important;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05) !important;
  z-index: 1000 !important; /* Ensure it stays on top */
  height: auto !important;
  min-height: 100px !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Add padding to chat container when input is at bottom to prevent content overlap */
.chat-container.chat-active {
  padding-bottom: 0 !important; /* No padding needed with proper height calculations */
}

/* Ensure chat container doesn't overflow its parent */
.chat-container {
  max-height: 100% !important;
}

/* Ensure proper scroll behavior for chat pages */
html.chat-page, 
body.chat-page {
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden !important; /* No horizontal scroll */
  height: 100vh !important;
  max-height: 100vh !important;
  position: relative !important;
}

/* Prevent body scroll - everything should fit in viewport */
body.chat-page {
  overflow-y: hidden !important; /* No vertical scroll - everything fits */
}

/* Chat container handles its own scrolling */
.chat-container {
  overflow: hidden !important;
}

/* Dark mode specific for message-input-container */
body.dark-mode .message-input-container {
  background-color: #343541 !important; /* ChatGPT main background */
}

/* Light mode specific */
body:not(.dark-mode) .message-input-container {
  background-color: #ffffff !important;
}

/* Ensure proper background when chat is active */
body.dark-mode .chat-container.chat-active .message-input-container {
  background-color: #343541 !important; /* ChatGPT main background */
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2) !important; /* Darker shadow for dark mode */
}

body:not(.dark-mode) .chat-container.chat-active .message-input-container {
  background-color: #ffffff !important;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05) !important;
}

/* Force override with higher specificity - DARK MODE ONLY */
body.dark-mode .chat-container .message-input-container .chat-input-card,
body.dark-mode .message-input-container .chat-input-card,
body.dark-mode .chat-input-card {
  background: #40414F !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  min-height: 80px !important; /* Reduced for better balance */
}

/* Force override with higher specificity - LIGHT MODE */
body:not(.dark-mode) .chat-container .message-input-container .chat-input-card,
body:not(.dark-mode) .message-input-container .chat-input-card,
body:not(.dark-mode) .chat-input-card {
  background: #FFFFFF !important; /* Pure white background */
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1) !important;
  min-height: 80px !important; /* Reduced for better balance */
}

body.dark-mode .chat-container .message-input-container .chat-input-textarea,
body.dark-mode .message-input-container .chat-input-textarea,
.dark-mode .chat-input-textarea,
.chat-input-textarea,
#message-input.chat-input-textarea {
  font-size: 16px !important;
  line-height: 1.5 !important;
  color: #ECECF1 !important;
  min-height: 52px !important;
}

#message-input {
  font-size: 16px !important;
  line-height: 1.5 !important;
  padding: 0 !important;
  min-height: 52px !important;
}

/* Audio player in tool results */
.tool-result-media-container .audio-wrapper {
  padding: 12px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  margin: 10px 0;
}

.tool-result-media-container audio {
  width: 100% !important;
  max-width: 500px;
  height: 60px !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: white;
  border-radius: 30px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin: 10px 0;
}

/* Audio Player Styles */
.audio-wrapper {
    margin: 5px 0;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

/* Minimal audio wrapper - no background */
.audio-wrapper.minimal {
    margin: 2px 0;
    padding: 0;
    background-color: transparent;
    border: none;
}

.audio-wrapper audio {
    width: 100%;
    max-width: 500px;
    height: 54px;
    display: block;
    background: white;
    border-radius: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    outline: none;
}

.tool-result-audio {
    margin: 8px 0;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.tool-result-audio .audio-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 0.95em;
}

.tool-result-audio .audio-icon {
    font-size: 1.2em;
}

/* Dark mode support */
[data-theme="dark"] .audio-wrapper,
[data-theme="dark"] .tool-result-audio {
    background-color: #1f2937;
    border-color: #374151;
}

[data-theme="dark"] .audio-wrapper audio,
[data-theme="dark"] .tool-result-audio audio {
    background: #374151;
}

[data-theme="dark"] .tool-result-audio .audio-header {
          color: #e5e7eb;
  }


