/* Full CSS Styles for Russian version - Mushebi.ge
   Complete design system with utilities, components, animations, and responsive design
   Dark theme for better eye comfort */

/* ============================================
   DARK THEME CSS VARIABLES
   ============================================ */

:root {
  /* ============================================
     DESIGN SYSTEM - PROFESSIONAL SCALE
     ============================================ */
  
  /* Spacing System (4px base) */
  --spacing-xs: 0.25rem;   /* 4px */
  --spacing-sm: 0.5rem;    /* 8px */
  --spacing-md: 0.75rem;   /* 12px */
  --spacing-base: 1rem;    /* 16px */
  --spacing-lg: 1.5rem;    /* 24px */
  --spacing-xl: 2rem;      /* 32px */
  --spacing-2xl: 3rem;     /* 48px */
  --spacing-3xl: 4rem;     /* 64px */
  
  /* Typography Scale */
  --font-xs: 0.75rem;      /* 12px */
  --font-sm: 0.875rem;     /* 14px */
  --font-base: 1rem;       /* 16px */
  --font-lg: 1.125rem;     /* 18px */
  --font-xl: 1.25rem;      /* 20px */
  --font-2xl: 1.5rem;      /* 24px */
  --font-3xl: 1.875rem;    /* 30px */
  --font-4xl: 2.25rem;     /* 36px */
  
  /* Line Heights */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;
  
  /* Font Weights */
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  
  /* Border Radius System */
  --radius-sm: 0.375rem;   /* 6px */
  --radius-md: 0.5rem;     /* 8px */
  --radius-lg: 0.75rem;    /* 12px */
  --radius-xl: 1rem;       /* 16px */
  --radius-2xl: 1.5rem;    /* 24px */
  --radius-full: 9999px;
  
  /* Transition System */
  --transition-fast: 150ms;
  --transition-base: 200ms;
  --transition-slow: 300ms;
  --transition-slower: 500ms;
  
  /* Easing Functions */
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  
  /* ============================================
     COLOR SYSTEM
     ============================================ */
  
  /* Ultra Dark theme colors - почти черная тема для комфорта глаз */
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-tertiary: #1a1a1a;
  --bg-card: #0f0f0f;
  --bg-sidebar: #050505;
  --bg-input: #1a1a1a;
  --bg-hover: #252525;
  --bg-order-card: #1a1a1a;
  
  /* Text colors */
  --text-primary: #ffffff;
  --text-secondary: #e5e5e5;
  --text-tertiary: #b3b3b3;
  --text-muted: #808080;
  
  /* Border colors */
  --border-primary: #2a2a2a;
  --border-secondary: #3a3a3a;
  --border-hover: #4a4a4a;
  
  /* Accent colors - яркие для контраста */
  --accent-primary: #6366f1;
  --accent-secondary: #06b6d4;
  --accent-hover: #818cf8;
  --accent-light: #a5b4fc;
  
  /* Status colors - Semantic */
  --success: #10b981;
  --success-light: #34d399;
  --success-dark: #059669;
  --warning: #f59e0b;
  --warning-light: #fbbf24;
  --warning-dark: #d97706;
  --error: #ef4444;
  --error-light: #f87171;
  --error-dark: #dc2626;
  --info: #3b82f6;
  --info-light: #60a5fa;
  --info-dark: #2563eb;
  
  /* Shadows - более выраженные для темной темы */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.7);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.8);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
  
  /* Focus rings for accessibility */
  --focus-ring: 0 0 0 3px rgba(99, 102, 241, 0.3);
  --focus-ring-offset: 0 0 0 2px var(--bg-primary), 0 0 0 5px rgba(99, 102, 241, 0.3);
  
  /* Z-index system - для управления слоями */
  --z-base: 0;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* Apply dark theme to body and html - адаптивный */
html {
  height: 100%;
  overflow-y: auto; /* Разрешаем вертикальную прокрутку */
  overflow-x: hidden; /* Скрываем горизонтальную прокрутку */
  /* Плавная прокрутка для лучшего UX */
  scroll-behavior: smooth;
}

/* Плавная прокрутка для всех элементов */
@media (prefers-reduced-motion: no-preference) {
  * {
    scroll-behavior: smooth;
  }
}

/* Отключаем плавную прокрутку для пользователей с настройкой reduced motion */
@media (prefers-reduced-motion: reduce) {
  html,
  * {
    scroll-behavior: auto;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  min-height: 100vh; /* Fallback для старых браузеров */
  min-height: 100dvh; /* Динамическая высота viewport для мобильных */
  overflow-y: auto; /* Разрешаем вертикальную прокрутку */
  overflow-x: hidden; /* Скрываем горизонтальную прокрутку */
  display: flex;
  flex-direction: column;
}

/* Fallback для браузеров без поддержки dvh */
@supports not (min-height: 100dvh) {
  body {
    min-height: 100vh;
  }
}

/* Allow scrolling within main content area */
.main-content-area {
  overflow: visible; /* Allow content to scroll */
}

/* Allow scrolling within orders section - прокрутка внутри .tenders-grid-compact */

/* Main Layout with Sidebar - адаптивный */
.main-layout {
  display: flex;
  min-height: calc(100vh - 48px); /* Обновлено с учетом нового header (48px) */
  min-height: calc(100dvh - 48px); /* Динамическая высота viewport для мобильных */
  /* Убираем max-height, чтобы контент мог расширяться */
  overflow: visible; /* Allow scrolling within sections */
}

/* Fallback для браузеров без поддержки dvh */
@supports not (min-height: 100dvh) {
  .main-layout {
    min-height: calc(100vh - 48px);
  }
}

/* Sidebar - скрыт на всех размерах экрана */
.sidebar {
  width: 240px;
  min-width: 240px;
  position: fixed;
  left: 0;
  top: 48px; /* Обновлено с учетом нового header (48px) */
  height: calc(100vh - 48px); /* Fallback для старых браузеров */
  height: calc(100dvh - 48px); /* Динамическая высота viewport для мобильных */
  overflow-y: auto;
  z-index: 30;
  padding: 1.25rem;
  display: none; /* Скрываем sidebar - используем мобильный стиль */
}

/* Fallback для браузеров без поддержки dvh */
@supports not (height: 100dvh) {
  .sidebar {
    height: calc(100vh - 48px);
  }
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-nav {
  flex: 1;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  transition: all 0.2s;
  font-size: 0.875rem;
}

.sidebar-nav-link:hover {
  background: var(--bg-hover);
  transform: translateX(4px);
}

.sidebar-nav-link:active {
  transform: translateX(2px);
}

/* Main Content Area - адаптивный */
.main-content-area {
  flex: 1;
  margin-left: 0; /* Убрали отступ - sidebar скрыт */
  min-height: calc(100vh - 48px); /* Обновлено с учетом нового header (48px) */
  min-height: calc(100dvh - 48px); /* Динамическая высота viewport для мобильных */
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
}

/* Fallback для браузеров без поддержки dvh */
@supports not (min-height: 100dvh) {
  .main-content-area {
    min-height: calc(100vh - 48px); /* Обновлено с учетом нового header */
  }
}

/* AI Chat Section - ChatGPT style: основной экран (адаптивный) */
.ai-chat-section-main {
  flex: 0 0 auto; /* Не растягивается, фиксированный размер */
  min-height: 400px;
  max-height: 85vh; /* Увеличено с 70vh до 85vh для большего пространства */
  display: flex;
  flex-direction: column;
  padding: var(--spacing-xs) 0 0; /* Утонченные отступы сверху для максимального пространства */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--bg-secondary);
  overflow: hidden; /* Предотвращаем растягивание */
  position: relative; /* Для правильного позиционирования */
}

.ai-chat-section-main .ai-chat-inline {
  width: 100%;
  max-width: 1200px; /* Широкий чат для удобства на десктопе */
  margin: 0 auto; /* Центрируем контент */
  box-sizing: border-box;
  min-height: 400px;
  max-height: 100%; /* Не превышает родителя */
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0 var(--spacing-base);
  overflow: hidden; /* Предотвращаем растягивание */
  position: relative; /* Для правильного позиционирования */
  /* Стиль Dark Chat - переопределяем базовые стили (ВАЖНО: эти стили должны применяться) */
  border-radius: 0 !important; /* Стиль Dark Chat: без скругления */
  box-shadow: none !important; /* Стиль Dark Chat: без тени */
  border: none !important; /* Стиль Dark Chat: без границы */
  background: var(--bg-card) !important; /* Стиль Dark Chat: темный фон */
}

/* На десктопе чат по центру сверху */
@media (min-width: 1025px) {
  .main-content-area {
    align-items: center; /* Центрируем содержимое */
    justify-content: flex-start; /* Сверху */
    padding-top: var(--spacing-sm); /* Утонченные отступы сверху для большего пространства */
  }
  
  .ai-chat-section-main {
    max-width: 1200px; /* Ограничиваем ширину чата */
    width: 100%;
    margin: 0 auto; /* Центрируем */
    max-height: 85vh; /* Увеличено с 70vh до 85vh для большего пространства */
    flex-shrink: 0; /* Не сжимается */
  }
  
  /* Убеждаемся, что сообщения прокручиваются внутри ограниченной высоты */
  .ai-chat-inline-messages {
    flex: 1 1 auto;
    min-height: 0; /* Важно для работы overflow */
    overflow-y: auto !important;
    overflow-x: hidden;
  }
}

/* Orders Section - Compact panel at bottom, ChatGPT style (адаптивный) */
.orders-section-main {
  flex: 0 0 auto; /* Don't grow, but can shrink */
  /* Убрали фиксированную высоту - секция расширяется по содержимому */
  min-height: 200px; /* Minimum height */
  padding: var(--spacing-md) var(--spacing-base);
  background: var(--bg-primary);
  border-top: 2px solid var(--border-primary);
  width: 100%;
  clear: both;
  display: flex;
  flex-direction: column;
  /* Убрали overflow: hidden - прокрутка теперь естественная, как на обычной странице */
}

.orders-header-compact {
  padding: 0 var(--spacing-base);
  margin-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--border-primary);
  flex-shrink: 0;
}

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

.orders-header-text {
  flex: 1;
}

.orders-header-title {
  font-size: var(--font-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
}

.orders-header-hint {
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin: 0;
}

.orders-count {
  font-size: var(--font-xs);
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: 1rem;
}

.mobile-empty-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Sidebar overlay and toggle button - УДАЛЕНЫ (не используются на мобильном) */

/* Responsive: Sidebar скрыт на мобильном */
@media (max-width: 1024px) {
  .sidebar {
    display: none !important;
  }
  
  .main-content-area {
    margin-left: 0;
  }
}

/* Pulse animation for voice indicator */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scaleY(1);
  }
  50% {
    opacity: 0.5;
    transform: scaleY(0.5);
  }
}

/* Import critical styles (they define CSS variables) */
/* Note: Critical CSS should be loaded first in HTML */

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Display utilities */
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }

/* Flexbox utilities */
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-12 { gap: 3rem; }

/* Grid utilities */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Spacing utilities - using design system */
.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-base); }
.p-5 { padding: var(--spacing-lg); }
.p-6 { padding: var(--spacing-xl); }
.p-8 { padding: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.pt-6 { padding-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-16 { margin-top: 4rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Width & Height utilities */
.w-3 { width: 0.75rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.h-3 { height: 0.75rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.w-full { width: 100%; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-6xl { max-width: 72rem; }

/* Typography utilities */
.font-sans { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-center { text-align: center; }
.text-white { color: #ffffff; }
.text-slate-300 { color: var(--text-tertiary); }
.text-slate-400 { color: var(--text-tertiary); }
.text-slate-500 { color: var(--text-muted); }
.text-slate-600 { color: var(--text-secondary); }
.text-slate-700 { color: var(--text-secondary); }
.text-slate-800 { color: var(--text-primary); }
.text-slate-900 { color: var(--text-primary); }
.text-indigo-100 { color: var(--text-secondary); }
.text-indigo-600 { color: var(--accent-primary); }
.text-indigo-700 { color: var(--accent-hover); }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }

/* Background utilities - Dark theme */
.bg-white { background-color: var(--bg-card); }
.bg-white\/10 { background-color: rgba(31, 41, 55, 0.1); }
.bg-white\/20 { background-color: rgba(31, 41, 55, 0.2); }
.bg-white\/90 { background-color: rgba(31, 41, 55, 0.9); }
.bg-white\/95 { background-color: rgba(31, 41, 55, 0.95); }
.bg-indigo-700 { background-color: var(--accent-primary); }
.bg-cyan-600 { background-color: var(--accent-secondary); }
.bg-emerald-400 { background-color: var(--success); }
.bg-slate-50 { background-color: var(--bg-secondary); }
.bg-slate-100 { background-color: var(--bg-tertiary); }
.bg-slate-200 { background-color: var(--border-primary); }
.bg-slate-700 { background-color: var(--text-secondary); }
.bg-slate-800 { background-color: var(--bg-tertiary); }
.bg-slate-900 { background-color: var(--bg-secondary); }
.bg-indigo-50 { background-color: rgba(99, 102, 241, 0.1); }
.bg-indigo-100 { background-color: rgba(99, 102, 241, 0.2); }
.bg-indigo-500 { background-color: var(--accent-primary); }
.bg-indigo-600 { background-color: var(--accent-primary); }
.bg-emerald-50 { background-color: #ecfdf5; }
.bg-emerald-100 { background-color: #d1fae5; }
.bg-emerald-500 { background-color: #10b981; }
.bg-purple-50 { background-color: #faf5ff; }
.bg-purple-100 { background-color: #f3e8ff; }
.bg-purple-500 { background-color: #a855f7; }
.bg-orange-50 { background-color: #fff7ed; }
.bg-orange-100 { background-color: #ffedd5; }
.bg-orange-500 { background-color: #f97316; }
.bg-green-500 { background-color: #22c55e; }
.bg-cyan-50 { background-color: #ecfeff; }
.bg-cyan-400 { background-color: #22d3ee; }
.bg-teal-50 { background-color: #f0fdfa; }
.bg-teal-500 { background-color: #14b8a6; }
.bg-pink-50 { background-color: #fdf2f8; }
.bg-pink-500 { background-color: #ec4899; }
.bg-red-50 { background-color: #fef2f2; }
.bg-red-500 { background-color: #ef4444; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-yellow-500 { background-color: #eab308; }

/* Gradient utilities */
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-stops)); }
.bg-gradient-to-br { background-image: linear-gradient(to bottom right, var(--tw-gradient-stops)); }
.from-indigo-500 { --tw-gradient-from: #6366f1; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(99, 102, 241, 0)); }
.from-indigo-600 { --tw-gradient-from: #4f46e5; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(79, 70, 229, 0)); }
.from-indigo-700 { --tw-gradient-from: #4338ca; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(67, 56, 202, 0)); }
.from-slate-50 { --tw-gradient-from: #f8fafc; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(248, 250, 252, 0)); }
.via-indigo-700 {
  --tw-gradient-stops: var(--tw-gradient-from), #4338ca 50%, var(--tw-gradient-to, #0891b2);
}
.to-cyan-400 { --tw-gradient-to: #22d3ee; }
.to-cyan-500 { --tw-gradient-to: #06b6d4; }
.to-cyan-600 { --tw-gradient-to: #0891b2; }
.to-indigo-50 { --tw-gradient-to: #eef2ff; }
.to-cyan-50 { --tw-gradient-to: #ecfeff; }
.to-teal-50 { --tw-gradient-to: #f0fdfa; }
.to-pink-50 { --tw-gradient-to: #fdf2f8; }
.to-red-50 { --tw-gradient-to: #fef2f2; }

/* Border utilities */
.border { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-slate-100 { border-color: var(--border-primary); }
.border-slate-200 { border-color: var(--border-primary); }
.border-slate-300 { border-color: var(--border-secondary); }
.border-indigo-100 { border-color: rgba(99, 102, 241, 0.3); }
.border-indigo-600 { border-color: var(--accent-primary); }
.border-emerald-100 { border-color: rgba(16, 185, 129, 0.3); }
.border-purple-100 { border-color: rgba(168, 85, 247, 0.3); }
.border-orange-100 { border-color: rgba(249, 115, 22, 0.3); }
.border-white { border-color: var(--border-primary); }
.border-t { border-top-width: 1px; }
.border-white\/10 { border-color: rgba(255, 255, 255, 0.1); }
.border-white\/20 { border-color: rgba(255, 255, 255, 0.2); }

/* Border radius utilities */
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }

/* Shadow utilities */
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); }
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }

/* Backdrop blur */
.backdrop-blur {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.backdrop-blur-sm {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Position utilities */
.relative { position: relative; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.absolute { position: absolute; }
.top-0 { top: 0; }
.top-4 { top: 1rem; }
.bottom-6 { bottom: 1.5rem; }
.left-0 { left: 0; }
.left-4 { left: 1rem; }
.left-6 { left: 1.5rem; }
.right-6 { right: 1.5rem; }
.inset-y-0 { top: 0; bottom: 0; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* Transform utilities */
.transform { transform: translateZ(0); }
.scale-110 { transform: scale(1.1); }
.-translate-y-0\.5 { transform: translateY(-0.125rem); }
.-translate-y-2 { transform: translateY(-0.5rem); }

/* Transition utilities */
.transition { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }

/* Space utilities */
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* ============================================
   COMPONENTS
   ============================================ */

/* Hero Header Gradient */
.hero-header-gradient {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 50%, #0891b2 100%);
  width: 100%;
}

/* AI Chat Section - full width, starts immediately after header */
.ai-chat-section {
  padding-top: 2rem;
  padding-bottom: 2rem;
  background: var(--bg-primary);
}

@media (max-width: 640px) {
  .ai-chat-section {
    padding-top: 1rem;
    padding-bottom: 1.5rem;
  }
}

/* Container */
.container { width: 100%; margin-left: auto; margin-right: auto; padding-left: 1rem; padding-right: 1rem; }
@media (min-width: 640px) {
  .container { max-width: 640px; }
}
@media (min-width: 768px) {
  .container { max-width: 768px; }
}
@media (min-width: 1024px) {
  .container { max-width: 1024px; }
}
@media (min-width: 1280px) {
  .container { max-width: 1280px; }
}

/* Card modern */
.card-modern {
  background-color: var(--bg-card);
  border-radius: 1rem;
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-sm);
  transition: all 200ms ease-in-out;
  color: var(--text-primary);
  /* Оптимизация производительности */
  will-change: transform, box-shadow;
  contain: layout style paint;
}

.card-modern:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px) scale(1.01);
  border-color: var(--border-hover);
}

.card-modern:active {
  transform: translateY(0) scale(0.99);
  transition: transform 100ms ease-in-out;
}

/* Button modern */
.btn-modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  border-radius: 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 200ms ease-in-out;
}

/* Group hover */
.group:hover .group-hover\:scale-110 {
  transform: scale(1.1);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

.animate-fade-in-up {
  animation: fade-in-up 0.6s ease-out forwards;
  opacity: 0;
}

.animate-slide-in-right {
  animation: slide-in-right 0.6s ease-out forwards;
  opacity: 0;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Delay utilities */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }

/* ============================================
   HOVER STATES
   ============================================ */

.hover\:bg-slate-50:hover { background-color: var(--bg-secondary); }
.hover\:bg-slate-100:hover { background-color: var(--bg-tertiary); }
.hover\:bg-white:hover { background-color: var(--bg-card); }
.hover\:bg-slate-700:hover { background-color: var(--bg-tertiary); }
.hover\:text-white:hover { color: #ffffff; }
.hover\:text-indigo-600:hover { color: var(--accent-primary); }
.hover\:text-indigo-700:hover { color: var(--accent-hover); }
.hover\:border-indigo-400:hover { border-color: var(--accent-hover); }
.hover\:shadow-lg:hover { box-shadow: var(--shadow-lg); }
.hover\:shadow-xl:hover { box-shadow: var(--shadow-xl); }
.hover\:scale-110:hover { transform: scale(1.1); }
.hover\:-translate-y-0\.5:hover { transform: translateY(-0.125rem); }
.hover\:-translate-y-1:hover { transform: translateY(-0.25rem); }

/* Ring utilities */
.ring-2 {
  outline: 2px solid transparent;
  outline-offset: 2px;
}
.ring-indigo-600 {
  outline-color: #4f46e5;
}

/* ============================================
   FOCUS STATES
   ============================================ */

.focus\:not-sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

.focus\:absolute:focus {
  position: absolute;
}

.focus\:top-4:focus {
  top: 1rem;
}

.focus\:left-4:focus {
  left: 1rem;
}

.focus-visible\:not-sr-only:focus-visible {
  position: static;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

.focus-visible\:absolute:focus-visible {
  position: absolute;
}

.focus-visible\:top-4:focus-visible {
  top: 1rem;
}

.focus-visible\:left-4:focus-visible {
  left: 1rem;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Mobile menu */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 16rem;
  height: 100vh;
  background-color: var(--bg-card);
  box-shadow: var(--shadow-xl);
  z-index: 50;
  transform: translateX(-100%);
  transition: transform 300ms ease-in-out;
  overflow-y: auto;
  color: var(--text-primary);
}

.mobile-menu.open,
.mobile-menu.active {
  transform: translateX(0);
}

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease-in-out;
}

.mobile-menu-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  padding: 0.75rem;
  border-radius: 9999px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transition: all 200ms ease-in-out;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top:hover {
  background: var(--bg-tertiary);
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: all;
}

/* Form inputs */
input[type="tel"],
input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-primary);
  border-radius: 0.75rem;
  font-size: 1rem;
  transition: border-color 200ms ease-in-out;
  background: var(--bg-input);
  color: var(--text-primary);
}

input[type="tel"]:focus,
input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

input[type="tel"]::placeholder,
input[type="text"]::placeholder,
input[type="email"]::placeholder,
textarea::placeholder {
  color: var(--text-tertiary);
}

/* ============================================
   TENDER PLATFORM COMPONENTS (Yandex.Uslugi style)
   ============================================ */

/* Tender Card (карточка заказа) */
.tender-card {
  background: var(--bg-order-card);
  border: 1px solid var(--border-primary);
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-primary);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  /* Оптимизация производительности */
  will-change: transform, box-shadow;
  contain: layout style paint;
}

.tender-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  transform: scaleX(0);
  transform-origin: left;
}

.tender-card:hover {
  box-shadow: var(--shadow-xl);
  border-color: var(--border-hover);
  transform: translateY(-4px) scale(1.02);
}

.tender-card:hover::before {
  opacity: 1;
  transform: scaleX(1);
}

.tender-card:active {
  transform: translateY(-2px) scale(1);
  transition: transform 100ms ease-in-out;
}

/* Tender Card Content */
.tender-card h3 {
  color: var(--text-primary);
}

.tender-card p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.tender-card .text-slate-900 {
  color: var(--text-primary);
}

.tender-card .text-slate-600 {
  color: var(--text-secondary);
}

.tender-card .text-slate-500 {
  color: var(--text-tertiary);
}

.tender-card .text-indigo-600 {
  color: var(--accent-primary);
}

.tender-card a.text-indigo-600 {
  color: var(--accent-primary);
  transition: color 0.2s ease-in-out;
}

.tender-card a.text-indigo-600:hover {
  color: var(--accent-hover);
}

/* Category Badge */
.category-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-open {
  background: #ecfdf5;
  color: #059669;
}

.status-reviewing {
  background: #fef3c7;
  color: #d97706;
}

.status-accepted {
  background: #dbeafe;
  color: #2563eb;
}

.status-closed {
  background: #f3f4f6;
  color: #6b7280;
}

.status-cancelled {
  background: #fee2e2;
  color: #dc2626;
}

/* ============================================
   BUTTON COMPONENTS - UNIFIED SYSTEM
   ============================================ */

/* Button Base */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-lg);
  font-size: var(--font-base);
  font-weight: var(--weight-medium);
  line-height: var(--leading-normal);
  transition: all var(--transition-base) var(--ease-in-out);
  border: none;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

/* Button Sizes */
.btn-sm {
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-sm);
  border-radius: var(--radius-md);
}

.btn-lg {
  padding: var(--spacing-base) var(--spacing-xl);
  font-size: var(--font-lg);
  border-radius: var(--radius-xl);
}

/* Button Primary */
.btn-primary {
  background: var(--accent-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

.btn-primary:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn-primary:disabled {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

/* Button Secondary */
.btn-secondary {
  background: var(--bg-card);
  color: var(--accent-primary);
  border: 2px solid var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--accent-hover);
  color: var(--accent-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn-secondary:disabled {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border-color: var(--border-primary);
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

/* Button Ghost (transparent) */
.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.btn-ghost:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Form Input (Yandex.Uslugi style) */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-primary);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 200ms ease-in-out, box-shadow 200ms ease-in-out;
  background: var(--bg-input);
  color: var(--text-primary);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

/* Form Select */
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-primary);
  border-radius: 0.5rem;
  font-size: 1rem;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: border-color 200ms ease-in-out, box-shadow 200ms ease-in-out;
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Form Textarea */
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-primary);
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 200ms ease-in-out, box-shadow 200ms ease-in-out;
  background: var(--bg-input);
  color: var(--text-primary);
}

.form-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-textarea::placeholder {
  color: var(--text-tertiary);
}

/* Form Label */
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

/* Form Group */
.form-group {
  margin-bottom: 1.5rem;
}

/* Filter Card */
.filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

/* Statistics Card */
.stats-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 0.5rem;
  padding: 1.5rem;
  text-align: center;
  color: var(--text-primary);
}

.stats-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
}

.stats-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* How it works card */
.how-it-works-card {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-primary);
}

.how-it-works-number {
  width: 3rem;
  height: 3rem;
  background: rgba(99, 102, 241, 0.2);
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Container max-width - уже определен выше, удаляем дубликат */

/* Responsive grid for tenders */
.tenders-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 640px) {
  .tenders-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .tenders-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.empty-state-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Responsive utilities */
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:flex-row { flex-direction: row; }
}

@media (min-width: 768px) {
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\:text-4xl { font-size: 2.25rem; }
}

@media (min-width: 1024px) {
  .lg\:hidden { display: none; }
  .lg\:flex { display: flex; }
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:text-4xl { font-size: 2.25rem; }
  .lg\:text-5xl { font-size: 3rem; }
  .lg\:text-6xl { font-size: 3.75rem; }
  .lg\:py-20 { padding-top: 5rem; padding-bottom: 5rem; }
  .lg\:py-24 { padding-top: 6rem; padding-bottom: 6rem; }
}

@media (min-width: 1280px) {
  .xl\:text-2xl { font-size: 1.5rem; }
  .xl\:text-6xl { font-size: 3.75rem; }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Focus visible - улучшенная доступность */
*:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Focus states для всех интерактивных элементов */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Улучшенные focus states для кнопок */
button:not(:disabled):focus-visible {
  box-shadow: var(--focus-ring);
}

/* Улучшенные focus states для ссылок */
a:focus-visible {
  text-decoration: underline;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #4f46e5;
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* ============================================
   AI CHAT DIALOG COMPONENT
   ============================================ */

/* AI Chat Overlay */
.ai-chat-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease-in-out;
  backdrop-filter: blur(4px);
}

.ai-chat-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* AI Chat Window */
.ai-chat-window {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 100%;
  max-width: 28rem;
  height: 90vh;
  max-height: 40rem;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  z-index: 51;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 300ms ease-in-out;
  overflow: hidden;
}

.ai-chat-window.active {
  transform: translateY(0);
}

@media (max-width: 640px) {
  .ai-chat-window {
    bottom: 0;
    right: 0;
    border-radius: 1rem 1rem 0 0;
    height: 100vh;
    max-height: 100vh;
  }
}

/* AI Chat Header */
.ai-chat-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  color: white;
}

.ai-chat-header-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ai-chat-header-title h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.ai-chat-header-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.ai-chat-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  color: white;
  transition: background 200ms ease-in-out;
}

.ai-chat-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* AI Chat Messages */
.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #f8fafc;
}

.ai-chat-message {
  display: flex;
  gap: 0.75rem;
  animation: fadeIn 200ms ease-in-out;
}

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

.ai-chat-message.ai-message {
  flex-direction: row;
}

.ai-chat-message.user-message {
  flex-direction: row-reverse;
}

.ai-chat-message-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.ai-chat-message.ai-message .ai-chat-message-avatar {
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  color: white;
}

.ai-chat-message.user-message .ai-chat-message-avatar {
  background: #e2e8f0;
  color: #475569;
}

.ai-chat-message-content {
  flex: 1;
  max-width: 75%;
}

.ai-chat-message.ai-message .ai-chat-message-content {
  background: white;
  padding: 0.75rem 1rem;
  border-radius: 1rem 1rem 1rem 0.25rem;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 0.875rem;
  line-height: 1.5;
}

.ai-chat-message.user-message .ai-chat-message-content {
  background: #4f46e5;
  padding: 0.75rem 1rem;
  border-radius: 1rem 1rem 0.25rem 1rem;
  color: white;
  font-size: 0.875rem;
  line-height: 1.5;
}

.ai-chat-typing {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem;
}

.ai-chat-typing-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #94a3b8;
  animation: typing 1.4s infinite;
}

.ai-chat-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-chat-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: scale(0.8);
    opacity: 0.3;
  }
  30% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Typing dots for AI responses */
.typing-dots {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0;
}

.typing-dots span {
  width: 0.5rem;
  height: 0.5rem;
  background: var(--text-tertiary);
  border-radius: 50%;
  animation: typing 1.4s infinite;
  display: inline-block;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

/* AI Chat Input */
.ai-chat-input-container {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e2e8f0;
  background: white;
}

.ai-chat-input-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.ai-chat-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  resize: none;
  max-height: 6rem;
  transition: border-color 200ms ease-in-out;
}

.ai-chat-input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.ai-chat-input:disabled {
  background: #f1f5f9;
  cursor: not-allowed;
}

.ai-chat-send {
  padding: 0.75rem 1rem;
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background 200ms ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-chat-send:hover {
  background: #4338ca;
}

.ai-chat-send:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

/* AI Chat Quick Actions */
.ai-chat-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.ai-chat-quick-action {
  padding: 0.5rem 0.75rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 200ms ease-in-out, border-color 200ms ease-in-out;
  color: #475569;
}

.ai-chat-quick-action:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

/* AI Chat Progress */
.ai-chat-progress {
  padding: 0.75rem 1.5rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #64748b;
}

.ai-chat-progress-bar {
  flex: 1;
  height: 0.25rem;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.ai-chat-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5 0%, #06b6d4 100%);
  transition: width 300ms ease-in-out;
  border-radius: 9999px;
}

/* AI Chat Toggle Button */
.ai-chat-toggle {
  position: fixed;
  bottom: 6rem;
  right: 1.5rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  color: white;
  border: none;
  box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
  cursor: pointer;
  z-index: 49;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 200ms ease-in-out, box-shadow 200ms ease-in-out;
  font-size: 1.5rem;
}

.ai-chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 15px 35px -5px rgba(79, 70, 229, 0.5);
}

.ai-chat-toggle.active {
  transform: scale(0.9);
}

@media (max-width: 640px) {
  .ai-chat-toggle {
    bottom: 5rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
  }
}

/* Form/AI Toggle Switcher */
.form-ai-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: var(--bg-tertiary);
  padding: 0.25rem;
  border-radius: 0.75rem;
}

.form-ai-toggle button {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 200ms ease-in-out;
}

.form-ai-toggle button.active {
  background: var(--bg-card);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.form-ai-toggle button:hover:not(.active) {
  color: var(--text-primary);
}

/* AI Form Preview */
.ai-form-preview {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 0.5rem;
  display: none;
  color: var(--text-primary);
}

.ai-form-preview.active {
  display: block;
}

.ai-form-preview-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.ai-form-preview-item {
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}

.ai-form-preview-item-label {
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.ai-form-preview-item-value {
  color: var(--text-primary);
}

/* Space utilities for form/ai toggle */
.space-y-6 > * + * {
  margin-top: 1.5rem;
}

/* ============================================
   INLINE AI CHAT COMPONENT (встроенный чат)
   ============================================ */

/* Inline AI Chat Container */
.ai-chat-inline {
  background: var(--bg-card) !important;
  border-radius: 0 !important; /* Стиль Dark Chat: без скругления для полноэкранного режима */
  box-shadow: none !important; /* Стиль Dark Chat: без тени */
  border: none !important; /* Стиль Dark Chat: без границы */
  overflow: hidden; /* Скрываем переполнение контейнера, прокрутка внутри messages */
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  z-index: 10;
  min-height: 0; /* Позволяем сжиматься */
  max-height: 100%; /* Ограничиваем высоту */
  flex: 1; /* Стиль Dark Chat: занимает доступное пространство */
}

/* Убираем декоративный градиент для Dark Chat стиля */
.ai-chat-inline::before {
  display: none; /* Стиль Dark Chat: убираем декоративный элемент */
}

/* Compact orders grid - vertical scroll (заказы идут вниз) */
.tenders-grid-compact {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-md);
  padding: var(--spacing-sm) 0;
  overflow-x: hidden;
  /* Убрали overflow-y: auto - прокрутка теперь естественная, как на обычной странице */
  scroll-behavior: smooth;
  min-width: 0;
  /* Контент расширяется естественно, без ограничений по высоте */
}

.tenders-grid-compact::-webkit-scrollbar {
  width: 8px;
}

.tenders-grid-compact::-webkit-scrollbar-track {
  background: transparent;
}

.tenders-grid-compact::-webkit-scrollbar-thumb {
  background: var(--border-primary);
  border-radius: 4px;
}

.tenders-grid-compact::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

.tenders-grid-compact .tender-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: var(--spacing-md);
  font-size: var(--font-sm);
  height: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* Обеспечиваем видимость текста */
  color: var(--text-primary) !important;
  background: var(--bg-order-card) !important;
}

.tenders-grid-compact .tender-card h3 {
  font-size: var(--font-base);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--spacing-xs);
  line-height: var(--leading-tight);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* Обеспечиваем видимость заголовка */
  color: var(--text-primary) !important;
}

.tenders-grid-compact .tender-card p {
  font-size: var(--font-xs);
  margin-bottom: var(--spacing-sm);
  line-height: var(--leading-normal);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  /* Обеспечиваем видимость описания */
  color: var(--text-secondary) !important;
}

/* Tablet and smaller desktop (768px - 1024px) */
@media (max-width: 1024px) {
  .main-layout {
    min-height: calc(100vh - 48px); /* Обновлено с учетом нового header */
    /* Убираем max-height для возможности прокрутки */
  }
  
  .main-content-area {
    margin-left: 0; /* Sidebar hidden on mobile */
    min-height: calc(100vh - 48px); /* Обновлено с учетом нового header */
    padding-top: var(--spacing-xs); /* Утонченные отступы */
    /* Убираем max-height для возможности прокрутки */
  }
  
  .ai-chat-section-main {
    min-height: 350px; /* Minimum for usability */
    max-height: calc(100dvh - 128px); /* Обновлено с учетом нового header (48px) и bottom navigation (80px) */
    padding-top: var(--spacing-xs); /* Утонченные отступы */
    /* Увеличено пространство для диалога на планшетах */
  }
  
  .orders-section-main {
    height: 250px; /* Фиксированная высота для планшетов */
    min-height: 200px;
    max-height: 350px;
  }
  
  .tenders-grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
  
  .tenders-grid-compact .tender-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
}

/* Mobile devices (до 640px) */
@media (max-width: 640px) {
  /* Уменьшаем header */
  header {
    min-height: 50px;
  }
  
  header nav {
    min-height: 50px;
    padding: var(--spacing-sm) 0;
  }
  
  .main-layout {
    min-height: calc(100vh - 50px);
    /* Убираем max-height для возможности прокрутки */
  }
  
  .main-content-area {
    margin-left: 0;
    min-height: calc(100vh - 50px);
    /* Убираем max-height для возможности прокрутки */
  }
  
  .sidebar {
    top: 50px;
    height: calc(100vh - 50px);
  }
  
  /* МОБИЛЬНАЯ ВЕРСИЯ: Принудительное применение Dark Chat стиля */
  .ai-chat-inline,
  .ai-chat-section-main .ai-chat-inline {
    border-radius: 0 !important; /* Стиль Dark Chat: без скругления для полноэкранного режима */
    box-shadow: none !important; /* Стиль Dark Chat: без тени */
    border: none !important; /* Стиль Dark Chat: без границы */
    background: var(--bg-card) !important; /* Темный фон */
  }
  
  /* Убираем декоративный элемент на мобильных */
  .ai-chat-inline::before {
    display: none !important;
  }
  
  .ai-chat-section-main {
    position: fixed; /* Полноэкранный режим на мобильных */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh; /* Динамическая высота для мобильных */
    min-height: 100vh;
    min-height: 100dvh;
    max-height: none; /* Убираем ограничение высоты */
    padding: 0; /* Убираем отступы для полноэкранного режима */
    margin: 0;
    z-index: 1000; /* Поверх всего контента */
    background: var(--bg-primary); /* Фон на весь экран */
    overflow: hidden; /* Предотвращаем прокрутку страницы */
  }
  
  .orders-section-main {
    /* Убрали фиксированную высоту - естественная прокрутка на мобильных тоже */
    min-height: 180px;
    padding: var(--spacing-sm) var(--spacing-base);
  }
  
  .tenders-grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--spacing-sm);
  }
  
  .tenders-grid-compact .tender-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: var(--spacing-sm);
  }
  
  .tenders-grid-compact .tender-card h3 {
    font-size: var(--font-sm);
  }
  
  .tenders-grid-compact .tender-card p {
    font-size: var(--font-xs);
  }
}

/* Small mobile devices (до 480px) */
@media (max-width: 480px) {
  header {
    min-height: 45px;
  }
  
  header nav {
    min-height: 45px;
    padding: var(--spacing-xs) 0;
  }
  
  .main-layout {
    min-height: calc(100vh - 45px);
    /* Убираем max-height для возможности прокрутки */
  }
  
  .main-content-area {
    min-height: calc(100vh - 45px);
    /* Убираем max-height для возможности прокрутки */
  }
  
  .sidebar {
    top: 45px;
    height: calc(100vh - 45px);
  }
  
  .ai-chat-section-main {
    min-height: 250px;
    /* Убираем фиксированную height для гибкости */
  }
  
  .orders-section-main {
    /* Убрали фиксированную высоту - естественная прокрутка на всех экранах */
    min-height: 150px;
  }
  
  .tenders-grid-compact {
    grid-template-columns: 1fr; /* Одна колонка на маленьких экранах */
  }
  
  .tenders-grid-compact .tender-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
}

/* Chat is full width - no max-width restriction */

/* Header improvements */
/* Компактный header для большего пространства диалога */
header {
  min-height: 48px; /* Уменьшено с 60px до 48px */
  max-height: 48px; /* Фиксированная высота */
}

header nav {
  min-height: 48px; /* Уменьшено с 60px до 48px */
  padding: var(--spacing-xs) 0; /* Утонченные отступы */
}

/* Logo improvements */
header a[aria-label*="Mushebi"] {
  transition: transform var(--transition-base) var(--ease-in-out);
}

header a[aria-label*="Mushebi"]:hover {
  transform: scale(1.02);
}

/* Header quick examples responsive */
@media (max-width: 768px) {
  /* УДАЛЕНО: #header-quick-examples - элементы удалены из HTML */
  
  /* Уменьшаем header на планшетах */
  header {
    min-height: 50px;
  }
  
  header nav {
    min-height: 50px;
    padding: var(--spacing-sm) 0;
  }
  
  /* Обновляем высоты с учетом меньшего header */
  .main-layout {
    min-height: calc(100vh - 50px);
    /* Убираем max-height для возможности прокрутки */
  }
  
  .main-content-area {
    min-height: calc(100vh - 50px);
    /* Убираем max-height для возможности прокрутки */
  }
  
  .sidebar {
    top: 50px;
    height: calc(100vh - 50px);
  }
  
  .ai-chat-section-main {
    min-height: 350px; /* Minimum for usability */
  }
  
  .orders-section-main {
    height: 250px; /* Фиксированная высота для планшетов */
    min-height: 200px;
    max-height: 350px;
  }
}

/* Inline AI Chat Header */
.ai-chat-inline-header {
  padding: var(--spacing-sm) var(--spacing-lg); /* Утонченные отступы для большего пространства */
  background: var(--bg-card);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-primary);
  flex-shrink: 0; /* Don't shrink */
  /* Ensure it stays at top */
  order: -1;
}

@media (max-width: 640px) {
  .ai-chat-inline-header {
    padding: var(--spacing-xs) var(--spacing-base); /* Еще более компактные отступы на мобильных */
  }
}

.ai-chat-inline-header-title {
  display: flex;
  align-items: center; /* Изменено с flex-start на center для более компактного вида */
  gap: 0.75rem; /* Уменьшен gap для компактности */
}

.ai-chat-inline-header-content {
  flex: 1;
  min-width: 0;
}

.ai-chat-inline-header-avatar {
  width: 2rem; /* Уменьшено с 2.5rem для компактности */
  height: 2rem; /* Уменьшено с 2.5rem для компактности */
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  color: white;
  position: relative;
  overflow: hidden;
  border: 2px solid var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Фото оператора */
.operator-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9999px;
}

/* Контейнер для live видео оператора */
.operator-live-video-container {
  position: relative;
  overflow: visible;
}

.operator-live-video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  overflow: hidden;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.5), 0 0 20px rgba(239, 68, 68, 0.3);
  animation: live-glow 2s ease-in-out infinite;
}

@keyframes live-glow {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.5), 0 0 20px rgba(239, 68, 68, 0.3);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.7), 0 0 30px rgba(239, 68, 68, 0.5);
  }
}

/* Видео оператора в header */
.operator-live-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9999px;
  display: block;
}

/* Overlay для LIVE бейджа */
.operator-live-overlay {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 20;
}

/* LIVE бейдж */
.operator-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Пульсирующая точка в LIVE бейдже */
.live-pulse {
  display: inline-block;
  width: 0.375rem;
  height: 0.375rem;
  background: white;
  border-radius: 50%;
  animation: live-pulse-dot 1.5s ease-in-out infinite;
}

@keyframes live-pulse-dot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

/* Маленькое видео в сообщениях */
.operator-live-avatar {
  position: relative;
}

.operator-live-video-wrapper-small {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.3);
}

.operator-live-video-small {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9999px;
  display: block;
}

/* Индикатор печатания с текстом */
.typing-indicator-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.typing-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Индикатор онлайн статуса (пульсирующий зеленый кружок) */
.operator-status-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0.75rem;
  height: 0.75rem;
  background: #10b981;
  border: 2px solid var(--bg-primary);
  border-radius: 9999px;
  animation: pulse-online 2s infinite;
  z-index: 10;
}

@keyframes pulse-online {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
  }
}

/* Бейдж "В прямом эфире" */
.online-badge {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.2) 100%) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  animation: pulse-badge 2s infinite;
  font-weight: 600;
}

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

.ai-chat-inline-header-name {
  font-size: 1rem; /* Уменьшено с 1.125rem для компактности */
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
  line-height: 1.3; /* Уменьшен line-height для компактности */
}

.ai-chat-inline-header-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: white;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.ai-chat-inline-header-subtitle {
  font-size: 0.75rem; /* Уменьшено с 0.8125rem для компактности */
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4; /* Уменьшен line-height для компактности */
}

.ai-chat-example-mini {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 0.375rem;
  color: var(--accent-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.ai-chat-example-mini:hover {
  background: rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
  border-color: var(--accent-primary);
}

@media (max-width: 640px) {
  .ai-chat-inline-header {
    padding: 1rem 1.25rem;
  }
  
  .ai-chat-inline-header-name {
    font-size: 1rem;
  }
  
  .ai-chat-inline-header-subtitle {
    font-size: 0.75rem;
  }
  
  .ai-chat-inline-header-badge {
    font-size: 0.6875rem;
    padding: 0.2rem 0.4rem;
  }
}

/* Inline AI Chat Messages */
.ai-chat-inline-messages {
  flex: 1 1 auto; /* Take available space */
  overflow-y: auto !important; /* Принудительная вертикальная прокрутка */
  overflow-x: hidden;
  padding: 1rem; /* Стиль Dark Chat: 16px padding */
  padding-bottom: calc(1rem + env(safe-area-inset-bottom)); /* Safe area для iPhone */
  display: flex;
  flex-direction: column;
  gap: 0.75rem; /* Стиль Dark Chat: 12px gap между сообщениями */
  background: #141414; /* Тёмный фон как в примере */
  min-height: 0; /* Allow shrinking */
  max-height: 100%; /* Ограничиваем высоту для прокрутки */
  /* Smooth scrolling */
  scroll-behavior: smooth;
  /* Better scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  /* Ensure scrolling works */
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
  /* МОБИЛЬНАЯ ВЕРСИЯ: Область сообщений с Dark Chat стилем */
  .ai-chat-inline-messages {
    padding: 1rem !important; /* Стиль Dark Chat: 16px padding */
    padding-bottom: calc(1rem + env(safe-area-inset-bottom)) !important;
    background: #141414 !important; /* Тёмный фон как в Dark Chat */
    background-image: none !important; /* Убираем градиентный паттерн */
    gap: 0.75rem !important; /* Стиль Dark Chat: 12px gap между сообщениями */
  }
}

.ai-chat-inline-messages::-webkit-scrollbar {
  width: 6px; /* Тонкая полоса прокрутки */
}

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

.ai-chat-inline-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2); /* Светлая полоса для тёмной темы */
  border-radius: 3px;
}

.ai-chat-inline-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3); /* Чуть светлее при hover */
}

/* Quick Examples / Suggestions - теперь в header, скрыты в чате */
.ai-chat-quick-examples {
  display: none !important; /* Скрываем в чате, показываем только в header */
}

/* УДАЛЕНО: #header-quick-examples - элементы удалены из HTML */

.ai-chat-examples-header {
  margin-bottom: var(--spacing-md);
}

.ai-chat-examples-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ai-chat-example-btn {
  padding: var(--spacing-sm) var(--spacing-base);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--font-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: all var(--transition-base) var(--ease-in-out);
  white-space: nowrap;
}

.ai-chat-example-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.ai-chat-example-btn:active {
  transform: translateY(0);
}

.ai-chat-example-btn:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

.ai-chat-inline-message {
  display: flex;
  gap: 0; /* Gap убран - используем gap в контейнере сообщений */
  animation: fadeIn 200ms ease-in-out;
  margin-bottom: 0; /* Margin убран - используем gap в контейнере */
  width: 100%;
}

.ai-chat-inline-message.ai-message {
  justify-content: flex-start; /* Как в iMessage */
}

.ai-chat-inline-message.user-message {
  justify-content: flex-end; /* Как в iMessage */
}

@media (max-width: 640px) {
  .ai-chat-inline-message {
    gap: 0; /* Стиль Dark Chat: gap убран, используем gap в контейнере */
    margin-bottom: 0; /* Стиль Dark Chat: margin убран */
  }
}

.ai-chat-inline-message.ai-message {
  flex-direction: row;
}

.ai-chat-inline-message.user-message {
  flex-direction: row-reverse;
}

.ai-chat-inline-message-avatar {
  width: 1.5rem; /* Стиль Dark Chat: 24px */
  height: 1.5rem;
  min-width: 1.5rem;
  min-height: 1.5rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.75rem; /* Стиль Dark Chat */
}

/* Скрываем аватар пользователя (как в iMessage) */
.ai-chat-inline-message.user-message .ai-chat-inline-message-avatar {
  display: none; /* В iMessage аватары пользователя не показываются */
}

@media (max-width: 640px) {
  .ai-chat-inline-message-avatar {
    width: 1.5rem; /* Еще более компактно на мобильных (24px) */
    height: 1.5rem;
    min-width: 1.5rem;
    min-height: 1.5rem;
    font-size: 0.75rem;
  }
  
  /* На мобильных тоже скрываем аватар пользователя */
  .ai-chat-inline-message.user-message .ai-chat-inline-message-avatar {
    display: none;
  }
}

.ai-chat-inline-message.ai-message .ai-chat-inline-message-avatar {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: white;
  position: relative;
  overflow: hidden;
  border: 2px solid var(--accent-primary);
}

/* Фото оператора в сообщениях */
.ai-chat-inline-message-avatar .operator-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9999px;
}

.ai-chat-inline-message.user-message .ai-chat-inline-message-avatar {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.ai-chat-inline-message-content {
  max-width: 75%; /* Стиль Dark Chat: максимум 75% ширины */
  flex-shrink: 0;
}

.ai-chat-inline-message.ai-message .ai-chat-inline-message-content {
  background: #1f1f1f; /* Тёмно-серый фон как в Dark Chat */
  padding: 0.625rem 0.875rem; /* Стиль Dark Chat: 10px 14px */
  border-radius: 0.75rem; /* Стиль Dark Chat: 12px */
  border: 1px solid #2a2a2a; /* Граница как в примере */
  color: #ddd; /* Светло-серый текст */
  font-size: 0.9375rem; /* Размер 15px */
  line-height: 1.45; /* Стиль Dark Chat */
  word-wrap: break-word;
  box-shadow: none; /* Без тени */
  max-width: 75%; /* Стиль Dark Chat: максимум 75% ширины */
}

.ai-chat-inline-message.user-message .ai-chat-inline-message-content {
  background: #3a3a3a; /* Серый фон как в Dark Chat */
  padding: 0.625rem 0.875rem; /* Стиль Dark Chat: 10px 14px */
  border-radius: 0.75rem; /* Стиль Dark Chat: 12px */
  border: 1px solid #444; /* Граница как в примере */
  color: #fff; /* Белый текст */
  font-size: 0.9375rem; /* Размер 15px */
  line-height: 1.45; /* Стиль Dark Chat */
  box-shadow: none; /* Без тени */
  max-width: 75%; /* Стиль Dark Chat: максимум 75% ширины */
}

@media (max-width: 640px) {
  /* МОБИЛЬНАЯ ВЕРСИЯ: Принудительное применение Dark Chat стиля для сообщений */
  .ai-chat-inline-message-content {
    max-width: 75% !important; /* Стиль Dark Chat: 75% на всех устройствах */
  }
  
  .ai-chat-inline-message.ai-message .ai-chat-inline-message-content {
    background: #1f1f1f !important; /* Тёмно-серый фон как в Dark Chat */
    border: 1px solid #2a2a2a !important; /* Граница как в примере */
    padding: 0.625rem 0.875rem !important; /* Стиль Dark Chat: 10px 14px */
    font-size: 0.9375rem !important; /* Размер 15px */
    line-height: 1.45 !important; /* Стиль Dark Chat */
    border-radius: 0.75rem !important; /* Стиль Dark Chat: 12px */
    color: #ddd !important; /* Светло-серый текст */
  }
  
  .ai-chat-inline-message.user-message .ai-chat-inline-message-content {
    background: #3a3a3a !important; /* Серый фон как в Dark Chat */
    border: 1px solid #444 !important; /* Граница как в примере */
    padding: 0.625rem 0.875rem !important; /* Стиль Dark Chat: 10px 14px */
    font-size: 0.9375rem !important; /* Размер 15px */
    line-height: 1.45 !important; /* Стиль Dark Chat */
    border-radius: 0.75rem !important; /* Стиль Dark Chat: 12px */
    color: #fff !important; /* Белый текст */
  }
  
  .ai-chat-inline-message.user-message .ai-chat-inline-message-content {
    background: #3a3a3a; /* Серый фон */
    border: 1px solid #444;
    color: #fff;
  }
  
  .ai-chat-inline-message.ai-message .ai-chat-inline-message-content {
    background: #1f1f1f; /* Тёмно-серый фон */
    border: 1px solid #2a2a2a;
    color: #ddd;
  }
}

/* Inline AI Chat Progress */
.ai-chat-inline-progress {
  padding: 0.75rem 1.5rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .ai-chat-inline-progress {
    padding: 0.625rem 1rem;
    gap: 0.625rem;
  }
  
  .ai-chat-cancel-btn {
    min-width: 40px;
    min-height: 40px;
    padding: 0.375rem 0.5rem;
    touch-action: manipulation;
  }
  
  .ai-chat-progress-stats {
    font-size: 0.75rem;
    margin-top: 0.375rem;
  }
  
  #ai-chat-inline-progress-text {
    font-size: 0.8125rem;
  }
}

.ai-chat-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.ai-chat-cancel-btn {
  background: transparent;
  border: 1px solid var(--border-primary);
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-chat-cancel-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.ai-chat-progress-stats {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.ai-chat-progress-stats span {
  font-weight: 600;
  color: var(--accent-primary);
}

.ai-chat-inline-progress-bar {
  flex: 1;
  height: 0.25rem;
  background: var(--bg-tertiary);
  border-radius: 9999px;
  overflow: hidden;
}

.ai-chat-inline-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  transition: width 300ms ease-in-out;
  border-radius: 9999px;
}

/* Inline AI Chat Input */
.ai-chat-inline-input-container {
  padding: 0.75rem; /* Стиль Dark Chat: 12px padding */
  border-top: 1px solid #222; /* Стиль Dark Chat: тёмная граница */
  background: #1a1a1a; /* Тёмный фон как в Dark Chat */
  box-shadow: none; /* Без тени для тёмной темы */
  position: fixed; /* Фиксированная позиция */
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20; /* Выше контента, но ниже модальных окон */
  flex-shrink: 0; /* Don't shrink */
  /* Ensure it stays at bottom */
  margin-top: auto;
}

/* На десктопе input-container не должен перекрывать контент */
@media (min-width: 1025px) {
  .ai-chat-inline-input-container {
    position: relative; /* Не sticky на десктопе, так как чат ограничен по высоте */
    bottom: auto;
  }
}

/* Wrapper для формы и подсказок */
.ai-chat-inline-input-form {
  position: relative;
}

@media (max-width: 640px) {
  .ai-chat-inline-input-container {
    padding: 0.75rem; /* Стиль Dark Chat: 12px padding */
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #222; /* Стиль Dark Chat: тёмная граница */
    background: #1a1a1a; /* Тёмный фон */
    position: sticky; /* Стиль Dark Chat: sticky для мобильных */
    bottom: 0;
    z-index: 20;
    box-shadow: none; /* Без тени для тёмной темы */
    flex-shrink: 0; /* Не сжимается */
    margin-top: auto; /* Прижимается к низу */
  }
  
  .ai-chat-inline-input {
    font-size: 16px; /* Предотвращает zoom на iOS */
    padding: var(--spacing-sm) var(--spacing-sm); /* Компактные отступы: 0.75rem */
    height: 44px !important; /* Фиксированная высота как в мессенджерах */
    min-height: 44px !important; /* Фиксированная высота */
    max-height: 44px !important; /* Фиксированная высота - не растягивается */
    resize: none !important; /* Отключаем изменение размера */
    overflow-y: hidden; /* Скрываем вертикальную прокрутку */
    overflow-x: hidden; /* Скрываем горизонтальную прокрутку */
    white-space: normal; /* Перенос текста внутри */
    word-wrap: break-word; /* Перенос длинных слов */
    line-height: 1.5; /* Комфортная высота строки */
    font-size: 0.875rem; /* Компактный шрифт */
    /* Отключаем авторастягивание на мобильных */
  }
  
  .ai-chat-inline-send {
    min-width: 40px; /* Уменьшено с 44px */
    min-height: 40px; /* Уменьшено с 44px */
    width: 40px; /* Уменьшено с 44px */
    height: 44px;
  }
  
  .ai-chat-hint-example {
    min-height: 36px;
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    touch-action: manipulation;
  }
  
  /* Исправление проблемы с мобильной клавиатурой */
  .ai-chat-inline {
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
  }
  
  .ai-chat-inline-messages {
    padding-bottom: calc(var(--spacing-lg) + env(safe-area-inset-bottom, 0px)); /* Уменьшено для компактности */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100vh - 160px); /* Уменьшено для большего пространства */
    max-height: calc(100dvh - 160px); /* Уменьшено для большего пространства */
  }
  
  /* Когда input в фокусе - скрываем bottom navigation */
  .ai-chat-inline-input:focus ~ .mobile-chat-tabbar,
  .ai-chat-inline:has(.ai-chat-inline-input:focus) ~ .mobile-chat-tabbar {
    transform: translateY(100%);
    transition: transform 0.3s ease;
  }
  
  /* Кнопка "Повторить вопрос" удалена */
  .ai-chat-repeat-question-btn {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
}

.ai-chat-inline-input-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch; /* Растягиваем элементы по ширине */
}

/* Input wrapper - стиль iMessage */
.ai-chat-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.375rem; /* Стиль iMessage: 6px gap */
}

@media (max-width: 640px) {
  .ai-chat-input-wrapper {
    gap: 0.375rem; /* Одинаковый gap на всех устройствах */
  }
}

/* Кнопка "Повторить вопрос" удалена */

.ai-chat-input-wrapper {
  display: flex;
  gap: var(--spacing-sm); /* Компактный gap: 0.75rem на десктопе */
  align-items: flex-end;
}

@media (max-width: 640px) {
  .ai-chat-input-wrapper {
    gap: var(--spacing-xs); /* Еще более компактный gap на мобильных: 0.5rem */
  }
}

/* Кнопка "Повторить вопрос" полностью удалена - пользователь может написать "повтори" или "не понял" в чат */
#ai-chat-repeat-question-btn,
.ai-chat-repeat-question-btn {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  position: absolute !important;
  left: -9999px !important;
}

/* Кнопка "Повторить вопрос" удалена - все стили удалены */

/* Input hints - ПОЛНОСТЬЮ УДАЛЕНЫ */
.ai-chat-input-hints {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

.ai-chat-hint-text {
  display: none !important;
}

.ai-chat-hint-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.ai-chat-hint-example {
  padding: 0.25rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 0.375rem;
  color: var(--accent-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.8rem;
}

.ai-chat-hint-example:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.ai-chat-validation-error {
  color: #ef4444;
  font-size: 0.8rem;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 0.375rem;
  border-left: 3px solid #ef4444;
}

.ai-chat-inline-input.ai-chat-input-error {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

/* Edit message button */
.ai-chat-inline-message-wrapper {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.ai-chat-edit-message-btn {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  min-width: 36px;
  min-height: 36px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
  opacity: 0;
  touch-action: manipulation;
}

.user-message:hover .ai-chat-edit-message-btn,
.user-message:active .ai-chat-edit-message-btn {
  display: flex;
  opacity: 1;
}

/* На мобильном всегда показываем кнопку редактирования */
@media (max-width: 1024px) {
  .ai-chat-edit-message-btn {
    display: flex;
    opacity: 0.6;
  }
  
  .user-message:active .ai-chat-edit-message-btn,
  .ai-chat-edit-message-btn:active {
    opacity: 1;
    background: var(--bg-tertiary);
  }
}

.ai-chat-edit-message-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.ai-chat-inline-input {
  flex: 1;
  height: 44px; /* Фиксированная высота */
  padding: 0.75rem; /* Стиль Dark Chat: 12px padding */
  background: #111; /* Тёмный фон как в Dark Chat */
  border: 1px solid #333; /* Граница как в примере */
  border-radius: 0.5rem; /* Стиль Dark Chat: 8px */
  font-size: 0.9375rem; /* Размер 15px */
  line-height: 1.5;
  resize: none;
  transition: all 200ms ease-in-out;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; /* Системный шрифт */
  color: #fff; /* Белый текст для тёмной темы */
  box-shadow: none;
  overflow-y: hidden;
  outline: none;
}

.ai-chat-inline-input:focus {
  background: #111; /* Остаётся тёмным при фокусе */
  border: 1px solid #3b82f6; /* Синяя граница при фокусе как в примере */
  outline: none;
}

.ai-chat-inline-input::placeholder {
  color: #666; /* Серый placeholder для тёмной темы */
}

@media (max-width: 640px) {
  .ai-chat-inline-input {
    height: 44px; /* Фиксированная высота на мобильных */
    padding: 0 0.875rem;
    font-size: 1rem;
    border-radius: 1.375rem;
  }
}

/* Плавная анимация при изменении размера */
.ai-chat-inline-input {
  transition: height 0.2s ease-in-out, border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
  /* Оптимизация производительности */
  will-change: transform, box-shadow, height;
}

.ai-chat-inline-input::placeholder {
  color: var(--text-tertiary);
  font-size: 0.9375rem;
  transition: opacity 0.2s ease-in-out;
}

.ai-chat-inline-input:focus::placeholder {
  opacity: 0.5;
}

/* Удаляем дубликат - стиль уже определен выше */

.ai-chat-inline-input:disabled {
  background: var(--bg-tertiary);
  cursor: not-allowed;
  opacity: 0.6;
}

.ai-chat-inline-send {
  min-width: 44px; /* Стиль Dark Chat: 44px минимум */
  height: 44px;
  padding: 0 1.125rem; /* Стиль Dark Chat: 0 18px */
  background: #3b82f6; /* Синий цвет как в Dark Chat примере */
  color: #fff; /* Белый текст */
  border: none;
  border-radius: 0.5rem; /* Стиль Dark Chat: 8px */
  cursor: pointer;
  transition: all 200ms ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem; /* Размер иконки 16px как в примере */
  box-shadow: none;
  /* Оптимизация производительности */
  will-change: transform, background;
  contain: layout style paint;
}

.ai-chat-inline-send:hover {
  background: #2563eb; /* Темнее при hover */
  transform: scale(1.02);
}

.ai-chat-inline-send:active {
  transform: scale(0.95);
  transition: transform 100ms ease-in-out;
}

@media (max-width: 640px) {
  .ai-chat-inline-send {
    min-width: 44px; /* Одинаковый размер на всех устройствах */
    height: 44px;
    border-radius: 0.5rem; /* 8px как в примере */
    font-size: 1rem; /* 16px */
    padding: 0 1.125rem; /* 0 18px */
  }
}

.ai-chat-inline-send:disabled {
  background: var(--bg-tertiary);
  cursor: not-allowed;
  opacity: 0.6;
}

/* AI Chat Search Suggestions - Google-style autocomplete */
.ai-chat-suggestions {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 8px 32px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
}

.ai-chat-suggestions-list {
  padding: 0.5rem 0;
}

.ai-chat-suggestion-item {
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: background 150ms ease-in-out;
  color: var(--text-primary);
  font-size: 0.9375rem;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.ai-chat-suggestion-item:hover,
.ai-chat-suggestion-item.selected {
  background: var(--bg-hover);
}

.ai-chat-suggestion-item:active {
  background: var(--bg-tertiary);
}

.ai-chat-suggestion-icon {
  font-size: 1.125rem;
  flex-shrink: 0;
  opacity: 0.7;
}

.ai-chat-suggestion-text {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-chat-suggestion-highlight {
  font-weight: 600;
  color: var(--accent-primary);
}

.ai-chat-suggestion-query {
  color: var(--text-secondary);
}

/* Scrollbar для подсказок */
.ai-chat-suggestions::-webkit-scrollbar {
  width: 8px;
}

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

.ai-chat-suggestions::-webkit-scrollbar-thumb {
  background: var(--border-primary);
  border-radius: 4px;
}

.ai-chat-suggestions::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* Inline AI Chat Quick Actions */
.ai-chat-inline-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.ai-chat-inline-quick-action {
  padding: 0.5rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 200ms ease-in-out, border-color 200ms ease-in-out;
  color: var(--text-primary);
}

.ai-chat-inline-quick-action:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

/* WhatsApp-inspired mobile layout */
.mobile-chat-ui,
.mobile-orders-list,
.mobile-chat-tabbar {
  display: none;
}

/* Кнопка создания заказа скрыта на desktop */
.mobile-create-order-btn {
  display: none;
}

.mobile-chat-ui {
  background: var(--bg-sidebar);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.mobile-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.mobile-chat-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mobile-chat-icon-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  cursor: pointer;
  transition: background 200ms ease;
  touch-action: manipulation; /* Улучшает отклик на touch */
}

.mobile-chat-icon-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.mobile-create-order-btn {
  display: flex; /* Кнопка видна в мобильном header */
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px; /* Touch-friendly */
  min-width: 44px;
  touch-action: manipulation;
}

.mobile-create-order-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.mobile-create-order-btn:active {
  transform: translateY(0);
}

.mobile-create-order-icon {
  font-size: 1.125rem;
  line-height: 1;
}

.mobile-create-order-text {
  font-size: 0.875rem;
  font-weight: 600;
}

@media (max-width: 360px) {
  .mobile-create-order-text {
    display: none; /* На очень маленьких экранах только иконка */
  }
}

.mobile-chat-header-title {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.mobile-chat-header-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.mobile-chat-header-status {
  display: none; /* Убрали статус - упростили header */
}

/* Скрываем ненужные элементы на мобильном */
.mobile-chat-meta,
.mobile-chat-searchbar,
.mobile-chat-quick-tabs {
  display: none !important;
}

.mobile-orders-list {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(3, 12, 19, 0.95);
}

.mobile-order-chat-item {
  display: flex;
  gap: 0.8rem;
  padding: 0.875rem 1rem;
  min-height: 72px;
  border: none;
  width: 100%;
  background: transparent;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
  transition: background 0.2s ease;
}

.mobile-order-chat-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.mobile-order-avatar {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #5eead4 0%, #2563eb 100%);
  color: white;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  text-transform: uppercase;
  flex-shrink: 0;
}

.mobile-order-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-order-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.mobile-order-title {
  font-weight: 600;
  color: var(--text-primary);
}

.mobile-order-time {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.mobile-order-snippet {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

.mobile-order-meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.mobile-order-meta-dot {
  opacity: 0.4;
}

.mobile-orders-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
}

.mobile-empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.mobile-empty-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

.mobile-empty-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 1.5rem 0;
  max-width: 280px;
  line-height: 1.5;
}

.mobile-empty-action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  min-height: 48px;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 9999px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 200ms ease, transform 100ms ease;
  touch-action: manipulation;
  justify-content: center;
}

.mobile-empty-action-btn:active {
  transform: scale(0.98);
  background: var(--accent-hover);
}

.mobile-empty-action-btn:hover {
  background: var(--accent-hover);
}

/* Bottom navigation - WhatsApp стиль */
.mobile-chat-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(12, 20, 28, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 0.5rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
  z-index: 60; /* Выше back-to-top (50) */
  display: none; /* По умолчанию скрыто */
  gap: 0.5rem;
  justify-content: center;
  max-width: 1200px; /* Ограничиваем ширину на десктопе */
  margin: 0 auto; /* Центрируем */
}

/* На десктопе bottom navigation не должен перекрывать контент */
@media (min-width: 1025px) {
  .mobile-chat-tabbar {
    max-width: 1200px; /* Та же ширина что и чат */
    left: 50%;
    transform: translateX(-50%); /* Центрируем */
    right: auto;
  }
  
  /* Добавляем отступ снизу для body, чтобы контент не перекрывался */
  body {
    padding-bottom: 5rem; /* Место для bottom navigation */
  }
}

.mobile-chat-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.625rem 0.75rem;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  position: relative;
  font-size: 0.75rem;
  font-weight: 600;
  min-height: 44px;
  touch-action: manipulation;
  flex: 1;
  justify-content: center;
  max-width: 120px;
}

/* Новая главная кнопка "Оператор" - одна большая кнопка на всю ширину */
.mobile-chat-tab-operator {
  width: 100%;
  max-width: 100%;
  flex: 1;
  padding: var(--spacing-base) var(--spacing-lg);
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: white;
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  min-height: 60px;
  font-size: 1rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

.mobile-chat-tab-operator:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent-secondary) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.mobile-chat-tab-operator:active {
  transform: translateY(0);
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.4);
}

.mobile-chat-tab-operator .mobile-chat-tab-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.mobile-chat-tab-operator .mobile-chat-tab-label {
  font-size: 1rem;
  font-weight: 700;
  color: white;
}

.mobile-chat-tab-operator .mobile-chat-tab-subtitle {
  display: none; /* Скрыт по умолчанию, показываем только на больших экранах если нужно */
}

.mobile-chat-tab-primary {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.mobile-chat-tab-support {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-chat-tab-support:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.mobile-chat-tab-support:active {
  transform: translateY(0);
}

.mobile-chat-tab-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.mobile-chat-tab-primary:active {
  transform: translateY(0);
}

.mobile-chat-tab-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-chat-tab-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.mobile-chat-tab-secondary:active {
  transform: translateY(0);
}

/* Стили для hover и active определены выше для primary и secondary */

.mobile-chat-tab-icon {
  font-size: 1.125rem;
  line-height: 1;
}

.mobile-chat-tab-label {
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
}

.mobile-chat-tab-subtitle {
  font-size: 0.625rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  text-align: center;
  margin-top: -0.125rem;
  line-height: 1.2;
}

/* На мобильных показываем subtitle в кнопке оператора */
@media (max-width: 640px) {
  .mobile-chat-tab-operator {
    flex-direction: column;
    gap: 0.125rem;
    padding: var(--spacing-sm) var(--spacing-base);
    min-height: 64px;
  }
  
  .mobile-chat-tab-operator .mobile-chat-tab-label {
    font-size: 0.875rem;
    font-weight: 700;
  }
  
  .mobile-chat-tab-operator .mobile-chat-tab-subtitle {
    display: block;
    font-size: 0.625rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
  }
}

/* Десктопная версия - показываем bottom navigation */
@media (min-width: 1025px) {
  .mobile-chat-tabbar {
    display: flex; /* Показываем bottom navigation на десктопе */
  }
  
  /* Увеличиваем размер кнопок в header для десктопа */
  /* УДАЛЕНО: #header-quick-examples - элементы удалены из HTML */
  
  /* Увеличиваем размер bottom navigation кнопок на десктопе */
  .mobile-chat-tab {
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    max-width: 140px;
  }
  
  .mobile-chat-tab-icon {
    font-size: 1.25rem;
  }
  
  .mobile-chat-tab-label {
    font-size: 0.75rem;
  }
  
  /* Back to top кнопка не должна перекрывать bottom navigation */
  .back-to-top {
    bottom: 6rem; /* Выше bottom navigation */
  }
}

@media (max-width: 1024px) {
  body {
    background: #0a131b;
    /* Убрали padding-bottom - нет bottom navigation */
  }

  header {
    display: none !important;
  }

  /* Скрываем футер на мобильных - он мешает с заказами и bottom navigation */
  #footer {
    display: none !important;
  }

  .mobile-chat-ui {
    display: block;
  }

  /* Кнопка создания заказа скрыта - теперь в bottom navigation */
  .mobile-create-order-btn {
    display: none !important;
  }

  .mobile-chat-tabbar {
    display: flex;
  }

  body {
    padding-bottom: 5rem; /* Место для bottom navigation */
  }

  .main-layout,
  .main-content-area {
    margin-left: 0;
    min-height: calc(100vh - 4rem);
  }

  .main-layout {
    padding: 0;
  }

  .orders-section-main {
    order: 1; /* Список заказов первый - показываем по умолчанию */
    border-top: none;
    padding: 0;
    background: rgba(4, 9, 14, 0.95);
    padding-bottom: 5rem; /* Место для bottom navigation */
  }

  #orders-container,
  .orders-header-compact {
    display: none;
  }

  .mobile-orders-list {
    display: flex;
    flex-direction: column;
  }

  .ai-chat-section-main {
    order: 2; /* Чат второй - открывается при нажатии */
    background: rgba(8, 15, 22, 0.95);
    display: none; /* Скрыт по умолчанию - показываем список заказов */
    flex-direction: column;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
  }
  
  .ai-chat-section-main.mobile-chat-open {
    display: flex; /* Показываем когда открыт чат */
    flex-direction: column;
    opacity: 1;
    transform: translateX(0);
  }
  
  .mobile-orders-list {
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  
  .mobile-orders-list.hidden {
    opacity: 0;
    transform: translateX(-100%);
    pointer-events: none;
  }
  
  .mobile-chat-view-header {
    display: flex !important;
    align-items: center;
    gap: var(--spacing-xs); /* Компактный gap: 0.5rem */
    padding: var(--spacing-xs) var(--spacing-sm); /* Компактные отступы: 0.5rem 0.875rem */
    background: var(--bg-primary); /* Фон на весь экран */
    border-bottom: 1px solid rgba(255, 255, 255, 0.06); /* Более тонкая граница */
    position: sticky;
    top: 0;
    z-index: 50;
    flex-shrink: 0; /* Не сжимается */
  }
  
  .mobile-chat-back-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs); /* Компактный gap */
    padding: var(--spacing-xs); /* Компактные отступы: 0.5rem */
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    min-width: 36px; /* Компактный размер */
    min-height: 36px; /* Компактный размер */
    cursor: pointer;
    transition: background 200ms ease;
    font-size: 0.9rem;
    font-weight: 500;
  }
  
  .mobile-chat-back-btn:hover {
    background: rgba(255, 255, 255, 0.12);
  }
  
  .mobile-chat-back-text {
    display: none;
  }
  
@media (min-width: 360px) {
  .mobile-chat-back-text {
    display: inline;
  }
}

/* ============================================
   LOADING INDICATORS & SKELETONS
   ============================================ */

/* Skeleton animations - улучшенные с плавным shimmer эффектом */
@keyframes skeleton-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

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

.skeleton-item,
.skeleton-card {
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  /* Оптимизация производительности */
  will-change: opacity;
  contain: layout style paint;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0.05) 0%, 
    rgba(255, 255, 255, 0.15) 50%, 
    rgba(255, 255, 255, 0.05) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-text {
  height: 1rem;
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0.05) 0%, 
    rgba(255, 255, 255, 0.15) 50%, 
    rgba(255, 255, 255, 0.05) 100%);
  background-size: 200% 100%;
  border-radius: 0.25rem;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-title {
  width: 60%;
  height: 1.25rem;
}

.skeleton-time {
  width: 20%;
  height: 0.875rem;
}

.skeleton-description {
  width: 100%;
  height: 0.875rem;
  margin: 0.5rem 0;
}

.skeleton-description:nth-child(2) {
  width: 80%;
}

.skeleton-meta {
  width: 30%;
  height: 0.75rem;
}

.skeleton-badge {
  width: 80px;
  height: 24px;
  border-radius: 0.25rem;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.1) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-price {
  width: 100px;
  height: 1.25rem;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.1) 75%);
  background-size: 200% 100%;
  border-radius: 0.25rem;
  animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.skeleton-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

/* Chat spinner */
.chat-spinner {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem;
}

.spinner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  animation: spinner-bounce 1.4s infinite ease-in-out both;
}

.spinner-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.spinner-dot:nth-child(2) {
  animation-delay: -0.16s;
}

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

.ai-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 1rem;
  margin-bottom: 1rem;
}

.loading-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Saving indicator */
.saving-indicator {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

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

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

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 400px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  color: var(--text-primary);
  font-size: 0.875rem;
  opacity: 0;
  transform: translateX(400px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
  backdrop-filter: blur(10px);
}

.toast-show {
  opacity: 1;
  transform: translateX(0);
}

.toast-hide {
  opacity: 0;
  transform: translateX(400px);
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  line-height: 1.5;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  transition: background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.toast-success {
  border-left: 3px solid #10b981;
}

.toast-error {
  border-left: 3px solid #ef4444;
}

.toast-warning {
  border-left: 3px solid #f59e0b;
}

.toast-info {
  border-left: 3px solid #3b82f6;
}

@media (max-width: 640px) {
  .toast-container {
    top: 0.5rem;
    right: 0.5rem;
    left: 0.5rem;
    max-width: none;
  }
  
  .toast {
    transform: translateY(-100px);
  }
  
  .toast-show {
    transform: translateY(0);
  }
  
  .toast-hide {
    transform: translateY(-100px);
  }
}

/* ============================================
   PAGINATION CONTROLS
   ============================================ */

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  margin-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pagination-btn {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-primary);
}

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

.pagination-info {
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding: 0 1rem;
}

@media (max-width: 640px) {
  .pagination-controls {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .pagination-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }
  
  .pagination-info {
    width: 100%;
    text-align: center;
    padding: 0.5rem 0;
  }
}

/* ============================================
   PULL-TO-REFRESH
   ============================================ */

.pull-to-refresh-indicator {
  position: relative;
  width: 100%;
  padding: 1rem;
  text-align: center;
  transition: transform 0.2s ease;
  z-index: 10;
}

.pull-indicator-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.pull-indicator-icon {
  font-size: 1.5rem;
  transition: transform 0.3s ease;
}

.pull-indicator-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.pull-to-refresh-indicator.pull-ready {
  color: var(--accent-primary);
}

.pull-to-refresh-indicator.pull-ready .pull-indicator-text {
  color: var(--accent-primary);
}

.pull-to-refresh-indicator.pull-refreshing .pull-indicator-icon {
  animation: spinner-rotate 1s linear infinite;
}

/* ============================================
   SEARCH AUTOCOMPLETE
   ============================================ */

.search-autocomplete {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.autocomplete-title {
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.autocomplete-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.autocomplete-text {
  flex: 1;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.autocomplete-delete {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.autocomplete-delete:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* ============================================
   SWIPE ACTIONS
   ============================================ */

.mobile-order-chat-item {
  position: relative;
  overflow: hidden;
}

.mobile-order-body {
  position: relative;
  transition: transform 0.3s ease;
  background: inherit;
  z-index: 1;
}

.swipe-actions {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.5rem;
  z-index: 0;
}

.swipe-action-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.swipe-action-btn:active {
  transform: scale(0.9);
}

.swipe-edit {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.swipe-edit:hover {
  background: rgba(59, 130, 246, 0.3);
}

.swipe-delete {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.swipe-delete:hover {
  background: rgba(239, 68, 68, 0.3);
}

.mobile-chat-view-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.mobile-chat-view-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
  }
  
  .mobile-chat-view-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
  }
  
  /* Скрываем все лишнее на мобильной версии для чистого общения */
  .ai-chat-inline-header {
    display: none !important; /* Скрываем обычный header на мобильном */
  }
  
  /* Скрываем верхний mobile header когда открыт чат (fullscreen) */
  .ai-chat-section-main.mobile-chat-open ~ .mobile-chat-ui .mobile-chat-header,
  .mobile-chat-open ~ .mobile-chat-ui .mobile-chat-header,
  .mobile-chat-ui .mobile-chat-header {
    display: none !important;
  }
  
  /* Показываем bottom navigation на мобильных, но скрываем когда открыт чат (fullscreen) */
  .mobile-chat-tabbar {
    display: flex !important; /* Показываем на мобильных */
  }
  
  /* Скрываем bottom navigation когда чат открыт в полноэкранном режиме */
  body:has(.ai-chat-section-main.mobile-chat-open) .mobile-chat-tabbar,
  .ai-chat-section-main.mobile-chat-open ~ nav.mobile-chat-tabbar {
    display: none !important;
  }
  
  /* Скрываем footer на мобильных */
  footer#footer {
    display: none !important;
  }
  
  /* Скрываем back to top button на мобильных */
  #back-to-top {
    display: none !important;
  }
  
  /* Скрываем quick actions на мобильных */
  .ai-chat-inline-quick-actions {
    display: none !important;
  }
  
  /* Упрощаем header чата - убираем подзаголовок, оставляем только имя */
  .mobile-chat-view-subtitle {
    display: none !important;
  }
  
  /* Упрощаем кнопку "Назад" - убираем текст, только иконка */
  .mobile-chat-back-text {
    display: none !important;
  }
  
  /* Минимизируем header чата */
  .mobile-chat-view-header {
    padding: var(--spacing-xs) var(--spacing-sm) !important; /* Компактные отступы */
    min-height: 44px !important; /* Минимальная высота */
  }
  
  /* МОБИЛЬНАЯ ВЕРСИЯ: Область сообщений с Dark Chat стилем */
  .ai-chat-inline-messages {
    background: #141414 !important; /* Тёмный фон как в Dark Chat */
    background-image: none !important; /* Убираем градиентный паттерн */
    padding: 1rem !important; /* Стиль Dark Chat: 16px padding */
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
    gap: 0.75rem !important; /* Стиль Dark Chat: 12px gap между сообщениями */
  }
  
  /* МОБИЛЬНАЯ ВЕРСИЯ (max-width: 1024px): Принудительное применение Dark Chat стиля */
  .ai-chat-inline,
  .ai-chat-section-main .ai-chat-inline {
    height: 100vh; /* Полная высота экрана */
    height: 100dvh; /* Динамическая высота для мобильных */
    min-height: 100vh;
    min-height: 100dvh;
    max-height: none;
    border-radius: 0 !important; /* Стиль Dark Chat: без скругления углов для полноэкранного режима */
    margin: 0 !important; /* Убираем отступы */
    padding: 0 !important; /* Убираем padding */
    box-shadow: none !important; /* Стиль Dark Chat: без тени для чистого вида */
    border: none !important; /* Стиль Dark Chat: без границы */
    background: var(--bg-primary) !important; /* Фон на весь экран */
    display: flex;
    flex-direction: column;
  }
  
  /* Убираем декоративный элемент на мобильных */
  .ai-chat-inline::before {
    display: none !important;
  }

  /* МОБИЛЬНАЯ ВЕРСИЯ: Область сообщений с Dark Chat стилем */
  .ai-chat-inline-messages {
    background: #141414 !important; /* Тёмный фон как в Dark Chat */
    background-image: none !important; /* Убираем градиентный паттерн */
    padding: 1rem !important; /* Стиль Dark Chat: 16px padding */
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
    gap: 0.75rem !important; /* Стиль Dark Chat: 12px gap между сообщениями */
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
  }
  
  /* Компактные отступы для мобильного чата */
  .ai-chat-inline-message {
    margin-bottom: var(--spacing-xs); /* Уменьшено с 0.75rem */
  }
  
  .ai-chat-inline-message-content {
    padding: var(--spacing-xs) var(--spacing-sm); /* Компактные отступы: 0.5rem 0.875rem */
    font-size: 0.875rem; /* Уменьшен шрифт для компактности */
    line-height: 1.4; /* Уменьшен line-height */
  }
  
  /* Улучшенная видимость кнопок на мобильном */
  .ai-chat-inline-send {
    flex-shrink: 0;
  }
  
  /* Улучшенные размеры для мобильного чата */
  .ai-chat-inline-message-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    font-size: 1.125rem;
  }
  
  /* Улучшенные подсказки на мобильном */
  .ai-chat-input-hints {
    margin-top: 0.625rem;
    padding: 0.625rem 0.875rem;
  }
  
  .ai-chat-validation-error {
    margin-top: 0.625rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
  }

  .ai-chat-inline-header {
    padding: var(--spacing-xs) 0; /* Компактные отступы: 0.5rem */
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  
  /* Компактный mobile header */
  .mobile-chat-view-name {
    font-size: 1rem; /* Уменьшено с 1.05rem */
    font-weight: 700;
    color: var(--text-primary);
  }
  
  .mobile-chat-view-subtitle {
    font-size: 0.7rem; /* Уменьшено с 0.75rem */
    color: var(--text-secondary);
    margin-top: 0.125rem; /* Минимальный отступ */
  }
  
  /* Компактные размеры аватаров в сообщениях */
  .ai-chat-inline-message-avatar {
    width: 32px; /* Уменьшено с 36px */
    height: 32px; /* Уменьшено с 36px */
    min-width: 32px;
    min-height: 32px;
    font-size: 1rem; /* Уменьшено с 1.125rem */
  }

  #back-to-top {
    bottom: 1.5rem !important; /* Bottom navigation убрана */
  }
}

/* ============================================
   LANGUAGE SELECTION MODAL
   ============================================ */

.language-selection-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.language-selection-modal.visible {
  opacity: 1;
  pointer-events: all;
}

.language-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.language-modal-content {
  position: relative;
  background: var(--bg-card);
  border-radius: 1.5rem;
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
  z-index: 10000;
}

.language-selection-modal.visible .language-modal-content {
  transform: scale(1);
}

.language-modal-header {
  text-align: center;
  margin-bottom: 2rem;
}

.language-modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.language-modal-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

.language-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.language-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border-primary);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 60px;
  touch-action: manipulation;
  position: relative;
}

.language-option:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.language-option:active {
  transform: translateY(0);
}

.language-option.selected {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.language-flag {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.language-name {
  flex: 1;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
}

.language-check {
  font-size: 1.25rem;
  color: var(--accent-primary);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.language-option.selected .language-check {
  opacity: 1;
}

.language-modal-footer {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-primary);
}

.language-skip-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  touch-action: manipulation;
  min-height: 44px;
}

.language-skip-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* Language Selector Button in Header - УЛУЧШЕНА ВИДИМОСТЬ */
.language-selector-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(255, 255, 255, 0.15) !important; /* Более видимый фон */
  backdrop-filter: blur(10px) !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important; /* Более толстая и видимая граница */
  border-radius: 0.5rem !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  min-width: 40px !important;
  min-height: 40px !important;
  touch-action: manipulation !important;
  font-size: 1.5rem !important; /* Увеличен размер флага */
  line-height: 1 !important;
  padding: 0.5rem 0.875rem !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important; /* Двойная тень для лучшей видимости */
  position: relative !important;
  z-index: 10 !important;
}

#current-language-flag {
  display: inline-block !important;
  font-size: 1.5rem !important; /* Увеличен размер */
  line-height: 1 !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 2px rgba(255, 255, 255, 0.5)) !important; /* Двойная тень для лучшей видимости */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

.language-selector-btn:hover {
  background: rgba(255, 255, 255, 0.2) !important; /* Более видимый при hover */
  border-color: rgba(255, 255, 255, 0.4) !important;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

.language-selector-btn-mobile {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(255, 255, 255, 0.15) !important; /* Более видимый фон */
  backdrop-filter: blur(10px) !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important; /* Более толстая и видимая граница */
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  min-width: 48px !important;
  min-height: 48px !important;
  touch-action: manipulation !important;
  border-radius: 0.5rem !important;
  font-size: 1.5rem !important; /* Увеличен размер флага */
  line-height: 1 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important; /* Двойная тень */
  position: relative !important;
  z-index: 10 !important;
}

#mobile-language-flag {
  display: inline-block !important;
  font-size: 1.5rem !important; /* Увеличен размер */
  line-height: 1 !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 2px rgba(255, 255, 255, 0.5)) !important; /* Двойная тень */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

.language-selector-btn-mobile:hover {
  background: rgba(255, 255, 255, 0.2) !important; /* Более видимый при hover */
  border-color: rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.language-selector-btn-mobile:active {
  transform: scale(0.9);
}

/* Message Translation Styles */
.message-translation {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.message-translation-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
}

.translation-icon {
  font-size: 0.875rem;
}

.message-translation-content {
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.message-translation-toggle {
  background: transparent;
  border: none;
  color: var(--accent-primary);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.message-translation-toggle:hover {
  background: rgba(99, 102, 241, 0.1);
}

@media (max-width: 640px) {
  .language-modal-content {
    padding: 1.5rem;
    border-radius: 1rem;
  }

  .language-modal-title {
    font-size: 1.25rem;
  }

  .language-option {
    padding: 0.875rem 1rem;
    min-height: 56px;
  }

  .language-flag {
    font-size: 1.75rem;
  }

  .language-name {
    font-size: 1rem;
  }
}

/* ============================================
   USER ONBOARDING & GUIDANCE
   ============================================ */

/* Hero Guidance Section - УДАЛЕН (дублировал Quick Start Panel) */

/* AI Chat Tooltip */
.ai-chat-tooltip {
  position: absolute;
  bottom: calc(100% + 1rem);
  left: 0;
  right: 0;
  z-index: 50;
  opacity: 1;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.ai-chat-tooltip-content {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  position: relative;
}

.ai-chat-tooltip-arrow {
  position: absolute;
  bottom: -8px;
  left: 2rem;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--bg-card);
}

.ai-chat-tooltip-content p {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Pulse Animation */
.pulse-animation {
  animation: pulseButton 2s infinite;
}

@keyframes pulseButton {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
  }
}

/* Mobile adjustments */
@media (max-width: 1024px) {
  .ai-chat-tooltip {
    left: 1rem;
    right: 1rem;
  }
}

/* ============================================
   QUICK START PANEL - всегда видна
   ============================================ */

.quick-start-panel {
  position: sticky;
  top: 60px;
  z-index: 50;
  background: var(--bg-card);
  border-bottom: 2px solid var(--border-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: none;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.quick-start-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.quick-start-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.quick-start-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quick-start-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.quick-start-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.quick-start-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.quick-start-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border: 2px solid var(--border-primary);
  border-radius: 1rem;
  background: var(--bg-tertiary);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.quick-start-action-btn.primary {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
  border-color: var(--accent-primary);
}

.quick-start-action-btn.secondary {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(6, 182, 212, 0.05) 100%);
  border-color: #06b6d4;
}

.quick-start-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border-color: var(--accent-primary);
}

.quick-start-action-btn.primary:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.1) 100%);
}

.quick-start-action-btn.secondary:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(6, 182, 212, 0.1) 100%);
  border-color: #06b6d4;
}

.quick-start-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.quick-start-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.quick-start-text strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.quick-start-text span {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.quick-start-arrow {
  font-size: 1.5rem;
  color: var(--accent-primary);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateX(-5px);
}

.quick-start-action-btn:hover .quick-start-arrow {
  opacity: 1;
  transform: translateX(0);
}

.quick-start-hint {
  text-align: center;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Mobile adjustments */
@media (max-width: 1024px) {
  /* Quick Start Panel скрыт на мобильном - упростили интерфейс */
  .quick-start-panel {
    display: none !important;
  }

  /* Контекстные подсказки на мобильном */
  .context-hint-content {
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
  }

  /* Мобильный header - адаптация под роль */
  /* Стили для кнопки создания заказа определены выше */

  .mobile-chat-quick-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .mobile-chat-quick-tabs::-webkit-scrollbar {
    display: none;
  }

  .mobile-chat-quick-tabs button {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    white-space: nowrap;
  }
}

/* ============================================
   CONTEXT-AWARE HINTS
   ============================================ */

.context-hint {
  display: none !important; /* Отключены контекстные подсказки */
  margin-bottom: 1rem;
  animation: slideDown 0.3s ease;
}

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

.context-hint-content {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  position: relative;
}

.context-hint-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.context-hint-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
}

/* ============================================
   UTILITY CLASSES FOR INLINE STYLES REPLACEMENT
   ============================================ */

/* HTML full height */
.html-full-height {
  height: 100%;
}

/* Body theme - заменяет inline стили body */
.body-theme {
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* Header theme - заменяет inline стили header */
.header-theme {
  background: var(--bg-sidebar);
  border-color: var(--border-primary);
}

/* Logo link - убирает подчеркивание */
.logo-link {
  text-decoration: none;
}

/* Logo text - стили для текста логотипа */
.logo-text {
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  letter-spacing: -0.02em;
}

/* УДАЛЕНО: .header-quick-btn - элементы удалены из HTML */

/* Progress bar fill - для динамической ширины прогресс-бара */
.progress-bar-fill {
  width: 0%;
  transition: width 0.3s ease;
}

/* Data Collection Progress Styles */
.data-collection-progress-container {
  background: var(--bg-card, #0f0f0f);
  border: 1px solid var(--border-primary, #2a2a2a);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease;
  max-height: 0;
  overflow: hidden;
}

.data-collection-progress-container.data-progress-visible {
  opacity: 1;
  transform: translateY(0);
  max-height: 500px;
}

.data-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.data-progress-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #ffffff);
}

.data-progress-percent {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent-primary, #6366f1);
}

.data-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary, #1a1a1a);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.data-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary, #6366f1), var(--accent-secondary, #06b6d4));
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.data-progress-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.data-progress-collected,
.data-progress-missing {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.data-progress-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, #e5e5e5);
  margin-bottom: 0.25rem;
}

.data-progress-field {
  font-size: 0.75rem;
  color: var(--text-tertiary, #b3b3b3);
  padding-left: 0.5rem;
}

@media (max-width: 640px) {
  .data-collection-progress-container {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .data-progress-title,
  .data-progress-percent {
    font-size: 0.75rem;
  }

  .data-progress-field {
    font-size: 0.7rem;
  }
}

/* Improved Quick Actions Styles */
.ai-chat-inline-quick-action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card, #0f0f0f);
  border: 1px solid var(--border-primary, #2a2a2a);
  border-radius: 0.75rem;
  color: var(--text-primary, #ffffff);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.ai-chat-inline-quick-action:hover {
  background: var(--bg-hover, #252525);
  border-color: var(--accent-primary, #6366f1);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.6));
}

.ai-chat-inline-quick-action:active {
  transform: translateY(0);
}

.ai-chat-inline-quick-action .quick-action-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.ai-chat-inline-quick-action .quick-action-text {
  flex: 1;
}

/* ============================================
   ФИНАЛЬНЫЕ ПЕРЕОПРЕДЕЛЕНИЯ ДЛЯ DARK CHAT СТИЛЯ
   (должны быть в конце файла для максимального приоритета)
   ============================================ */

/* Принудительное применение Dark Chat стиля - переопределяет все предыдущие стили */
.ai-chat-inline,
.ai-chat-section-main .ai-chat-inline {
  border-radius: 0 !important;
  box-shadow: none !important;
  border: none !important;
  background: var(--bg-card) !important;
}

/* Убираем декоративный элемент */
.ai-chat-inline::before {
  display: none !important;
}

/* ============================================
   МОБИЛЬНАЯ ВЕРСИЯ: ФИНАЛЬНЫЕ ПЕРЕОПРЕДЕЛЕНИЯ
   (максимальный приоритет для мобильных устройств)
   ============================================ */

@media (max-width: 1024px) {
  /* МОБИЛЬНАЯ ВЕРСИЯ: Контейнер чата */
  .ai-chat-inline,
  .ai-chat-section-main .ai-chat-inline {
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
    background: var(--bg-card) !important;
  }
  
  /* МОБИЛЬНАЯ ВЕРСИЯ: Скрываем десктопный заголовок чата */
  .ai-chat-inline-header {
    display: none !important;
  }
  
  /* МОБИЛЬНАЯ ВЕРСИЯ: Показываем мобильный заголовок */
  .mobile-chat-view-header {
    display: flex !important;
    background: var(--bg-primary) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  }
  
  /* МОБИЛЬНАЯ ВЕРСИЯ: Область сообщений */
  .ai-chat-inline-messages {
    background: #141414 !important;
    background-image: none !important;
    padding: 1rem !important;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
    gap: 0.75rem !important;
  }
  
  /* МОБИЛЬНАЯ ВЕРСИЯ: Сообщения AI */
  .ai-chat-inline-message.ai-message .ai-chat-inline-message-content {
    background: #1f1f1f !important;
    border: 1px solid #2a2a2a !important;
    color: #ddd !important;
    max-width: 75% !important;
  }
  
  /* МОБИЛЬНАЯ ВЕРСИЯ: Сообщения пользователя */
  .ai-chat-inline-message.user-message .ai-chat-inline-message-content {
    background: #3a3a3a !important;
    border: 1px solid #444 !important;
    color: #fff !important;
    max-width: 75% !important;
  }
  
  /* МОБИЛЬНАЯ ВЕРСИЯ: Аватар */
  .ai-chat-inline-message-avatar {
    width: 1.5rem !important;
    height: 1.5rem !important;
  }
  
  /* МОБИЛЬНАЯ ВЕРСИЯ: Убираем декоративный элемент */
  .ai-chat-inline::before {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .ai-chat-inline-quick-action {
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
  }

  .ai-chat-inline-quick-action .quick-action-icon {
    font-size: 1.125rem;
  }
}


