/* ==================== BASE VARIABLES ==================== */
:root {
    --bg: #212121;
    --sidebar-bg: #171717;
    --panel: #212121;
    --panel-2: #2a2a2a;
    --panel-3: #303030;
    --border: #343434;
    --text: #ececec;
    --muted: #a1a1aa;
    --accent: #10a37f;
    --accent-hover: #0e8f70;
    --accent-rgb: 16, 163, 127;
    --user-bubble: #2f2f2f;
    --assistant-bubble: #262626;
    --danger: #ff6b6b;
    --warning: #f59e0b;
    --info: #3b82f6;
    --success: #10a37f;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

/* ==================== THEME: BIOLUMINESCENCE ==================== */
[data-theme="bioluminescence"] {
    --bg: #0a0f14;
    --sidebar-bg: #05080a;
    --panel: #0d1419;
    --panel-2: #152028;
    --panel-3: #1a2832;
    --border: #1e2d38;
    --text: #e0f7ff;
    --muted: #5a7a8a;
    --accent: #00f0ff;
    --accent-hover: #00c4cc;
    --accent-rgb: 0, 240, 255;
    --user-bubble: #152028;
    --assistant-bubble: #0d1419;
    --danger: #ff4d6d;
    --warning: #ffd166;
    --info: #00f0ff;
    --success: #06ffa5;
    --glow: 0 0 20px rgba(0, 240, 255, 0.3);
}

[data-theme="bioluminescence"] .message-card {
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.15);
    backdrop-filter: blur(10px);
}

[data-theme="bioluminescence"] .action-btn,
[data-theme="bioluminescence"] .message-action-btn {
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
    border: 1px solid rgba(0, 240, 255, 0.4);
    background: rgba(0, 240, 255, 0.08);
    color: #00f0ff;
}

[data-theme="bioluminescence"] .action-btn:hover {
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.3);
    text-shadow: 0 0 15px rgba(0, 240, 255, 0.8);
    background: rgba(0, 240, 255, 0.15);
}

[data-theme="bioluminescence"] .mode-dropdown-wrap,
[data-theme="bioluminescence"] .chat-image-upload-btn {
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

[data-theme="bioluminescence"] .send-btn {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

[data-theme="bioluminescence"] #flavor-input {
    background: #0d1419 !important;
    color: #e0f7ff !important;
    border: 1px solid rgba(0, 240, 255, 0.3) !important;
}
[data-theme="bioluminescence"] .attunement-drawer {
    background: #0a0f14;
    color: #e0f7ff;
}

/* Bioluminescence provider status */
[data-theme="bioluminescence"] .provider-status-bar {
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

[data-theme="bioluminescence"] .provider-status-bar:hover {
    background: rgba(0, 240, 255, 0.1);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.2);
    border-color: rgba(0, 240, 255, 0.5);
}

[data-theme="bioluminescence"] .typing-indicator {
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.1);
}

[data-theme="bioluminescence"] .typing-animation span {
    background: #00f0ff;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.8);
}

[data-theme="bioluminescence"] .typing-text {
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.5), #00f0ff, rgba(0, 240, 255, 0.5));
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="bioluminescence"] .upload-progress-container {
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.3);
}

[data-theme="bioluminescence"] .upload-progress-fill {
    background: linear-gradient(90deg, #00f0ff, #00c4cc);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

[data-theme="bioluminescence"] .provider-status-tooltip {
    background: #0a0f14;
    border: 1px solid rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.2);
}

/* ==================== THEME: VINTAGE MEDICAL ==================== */
[data-theme="vintage"] {
    --bg: #e8e4d9;
    --sidebar-bg: #dcd8cc;
    --panel: #f5f2eb;
    --panel-2: #ebe7de;
    --panel-3: #e0dcd0;
    --border: #c4b5a0;
    --text: #2c241b;
    --muted: #6b5b4f;
    --accent: #8b4513;
    --accent-hover: #a0522d;
    --accent-rgb: 139, 69, 19;
    --user-bubble: #f0ece3;
    --assistant-bubble: #ffffff;
    --danger: #8b0000;
    --warning: #b8860b;
    --info: #2f4f4f;
    --success: #556b2f;
    --font-main: Georgia, 'Times New Roman', serif;
}

/* Фон страницы без текстуры */
[data-theme="vintage"] body {
    font-family: var(--font-main);
    background-image: none;
    background: var(--bg);
}

/* Карточки сообщений — четкий контраст */
[data-theme="vintage"] .message-card {
    border: 1px solid #c4b5a0;
    box-shadow: 2px 3px 10px rgba(44, 36, 27, 0.12);
    border-radius: 4px 16px 16px 4px;
    font-family: Georgia, serif;
    color: var(--text);
}

[data-theme="vintage"] .message-card.user-card {
    background: var(--user-bubble);
    border-left: 3px solid var(--accent);
}

[data-theme="vintage"] .message-card.assistant-card {
    background: var(--assistant-bubble);
    border-left: 3px solid #6b5b4f;
}

/* Автор сообщения */
[data-theme="vintage"] .message-author {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Текст сообщения */
[data-theme="vintage"] .message-content {
    color: var(--text);
    line-height: 1.7;
    font-size: 1.05rem;
}

/* Кнопки Edit/Branch — видимые на светлом фоне */
[data-theme="vintage"] .action-btn,
[data-theme="vintage"] .message-action-btn {
    border: 1px solid var(--accent);
    background: rgba(139, 69, 19, 0.1);
    color: var(--accent);
    font-family: Georgia, serif;
    font-style: italic;
    border-radius: 4px;
    font-weight: 600;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

[data-theme="vintage"] .action-btn:hover {
    background: rgba(139, 69, 19, 0.2);
    transform: translateY(-1px);
    box-shadow: 2px 2px 5px rgba(0,0,0,0.15);
}

/* Кнопки feedback (лайк/дизлайк) */
[data-theme="vintage"] .feedback-btn {
    background: rgba(139, 69, 19, 0.05);
    border-color: #c4b5a0;
    color: #6b5b4f;
}

[data-theme="vintage"] .feedback-btn:hover {
    background: rgba(139, 69, 19, 0.15);
    color: var(--accent);
}

[data-theme="vintage"] .feedback-btn.active {
    background: rgba(139, 69, 19, 0.25);
    border-color: var(--accent);
    color: var(--accent);
}

/* Верхняя панель */
[data-theme="vintage"] .chat-header {
    background: var(--panel);
    border-bottom: 2px solid var(--border);
    box-shadow: 0 2px 10px rgba(44, 36, 27, 0.08);
}

[data-theme="vintage"] .chat-title {
    color: var(--text);
    font-weight: 700;
}

[data-theme="vintage"] .chat-subtitle {
    color: var(--muted);
}

/* Боковая панель */
[data-theme="vintage"] .sidebar {
    background: var(--sidebar-bg);
    border-right: 2px solid var(--border);
}

[data-theme="vintage"] .brand {
    color: var(--text);
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: 0.5px;
}

/* Элементы диалога в сайдбаре */
[data-theme="vintage"] .conversation-item {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid transparent;
    transition: all 0.2s;
}

[data-theme="vintage"] .conversation-item:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: var(--border);
}

[data-theme="vintage"] .conversation-item.active {
    background: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.15);
}

[data-theme="vintage"] .conversation-item-title {
    color: var(--text);
    font-weight: 600;
}

/* Поле ввода */
[data-theme="vintage"] .chat-form {
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: 0 4px 15px rgba(44, 36, 27, 0.1);
}

[data-theme="vintage"] .chat-input {
    color: var(--text);
}

[data-theme="vintage"] .chat-input::placeholder {
    color: #9a8a7a;
}

/* Кнопка отправки */
/* Фикс кнопки отправки (чтобы не была зеленой) */
[data-theme="vintage"] .send-btn {
    background: var(--accent) !important;
    color: #fff !important;
    box-shadow: 2px 3px 8px rgba(139, 69, 19, 0.3) !important;
}

[data-theme="vintage"] .send-btn:hover {
    background: var(--accent-hover) !important;
}

/* Выпадающий выбор модели */
[data-theme="vintage"] .mode-dropdown-wrap {
    background: rgba(139, 69, 19, 0.08);
    border: 1px solid var(--border);
}

[data-theme="vintage"] .mode-dropdown {
    color: var(--text);
    font-family: Georgia, serif;
    font-weight: 600;
}

/* Кнопки в хедере */
[data-theme="vintage"] .topbar-link {
    background: rgba(139, 69, 19, 0.08);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: Georgia, serif;
}

[data-theme="vintage"] .topbar-link:hover {
    background: rgba(139, 69, 19, 0.15);
}

[data-theme="vintage"] .topbar-link.logout {
    background: rgba(139, 0, 0, 0.08);
    border-color: rgba(139, 0, 0, 0.3);
    color: #8b0000;
}

[data-theme="vintage"] .topbar-link.logout:hover {
    background: rgba(139, 0, 0, 0.15);
}

/* Убираем темный градиент снизу ПОЛНОСТЬЮ */
[data-theme="vintage"] .chat-input-wrap {
    background: var(--panel) !important;
    background-image: none !important;
    border-top: 2px solid var(--border);
    box-shadow: 0 -4px 20px rgba(44, 36, 27, 0.05);
}

/* Подсказка должна быть видна на светлом фоне */
[data-theme="vintage"] .chat-hint {
    color: var(--muted) !important;
    opacity: 1;
}

/* Изображение в чате — рамка в тон темы */
[data-theme="vintage"] .message-image {
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 2px 3px 10px rgba(44, 36, 27, 0.1);
}

/* Фикс для auth карточек — светлый фон и темный текст */
[data-theme="vintage"] .auth-card,
[data-theme="vintage"] .landing-card,
[data-theme="vintage"] .profile-card {
    background: var(--panel) !important;
    border: 2px solid var(--border) !important;
    color: var(--text) !important;
}

[data-theme="vintage"] .auth-card h1,
[data-theme="vintage"] .landing-card h1,
[data-theme="vintage"] .profile-card h1 {
    color: var(--text) !important;
}

[data-theme="vintage"] .auth-card input,
[data-theme="vintage"] .profile-card input {
    background: #ffffff !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
}

[data-theme="vintage"] .auth-card input::placeholder,
[data-theme="vintage"] .profile-card input::placeholder {
    color: #9a8a7a !important;
}

[data-theme="vintage"] .auth-card label,
[data-theme="vintage"] .profile-card label {
    color: var(--text) !important;
}

[data-theme="vintage"] .auth-card .checkbox-label {
    color: var(--muted) !important;
}

/* Фикс черной кнопки прикрепления — делаем в тон темы */
[data-theme="vintage"] .chat-image-upload-btn {
    background: rgba(139, 69, 19, 0.1) !important;
    border: 1px solid var(--border) !important;
    color: var(--accent) !important;
    box-shadow: none !important;
}

[data-theme="vintage"] .chat-image-upload-btn:hover {
    background: rgba(139, 69, 19, 0.2) !important;
    border-color: var(--accent) !important;
}

/* Чип с изображением */
[data-theme="vintage"] .chat-image-chip {
    background: var(--panel-2);
    border-color: var(--border);
}

[data-theme="vintage"] .chat-image-chip-name {
    color: var(--text);
}

[data-theme="vintage"] #flavor-input {
    background: #ffffff !important;
    color: #2c241b !important;
    border: 1px solid #c4b5a0 !important;
}
[data-theme="vintage"] .attunement-drawer {
    background: #f5f2eb;
    color: #2c241b;
}
[data-theme="vintage"] .attunement-header h3 {
    color: #2c241b;
}
[data-theme="vintage"] .tab-btn {
    background: rgba(139, 69, 19, 0.1);
    color: #2c241b;
    border-color: #c4b5a0;
}
[data-theme="vintage"] .tab-btn.active {
    background: #8b4513;
    color: #fff;
}
[data-theme="vintage"] .axis-item {
    background: rgba(139, 69, 19, 0.05);
    border-color: #c4b5a0;
}
[data-theme="vintage"] .analyze-btn {
    background: #8b4513;
    color: #fff;
}
[data-theme="vintage"] .secondary-btn {
    background: transparent;
    border: 1px solid #c4b5a0;
    color: #5d3a1a;
}

/* Precision mode button for vintage theme */
[data-theme="vintage"] .precision-btn .precision-indicator {
    background: rgba(139, 69, 19, 0.15);
    color: #6b5b4f;
}

[data-theme="vintage"] .precision-btn.active .precision-indicator {
    background: #8b4513;
    color: #fff;
}

[data-theme="vintage"] .precision-btn.active {
    background: rgba(139, 69, 19, 0.2) !important;
    border-color: var(--accent) !important;
    color: var(--accent) !important;
}

/* Provider status for vintage theme */
[data-theme="vintage"] .provider-status-bar {
    background: linear-gradient(135deg, #ebe7de, #f0ece3);
    border: 2px solid #c4b5a0;
    color: #5d3a1a;
    font-family: Georgia, serif;
    box-shadow: 2px 3px 8px rgba(44, 36, 27, 0.1);
}

[data-theme="vintage"] .provider-status-bar:hover {
    background: linear-gradient(135deg, #f5f2eb, #ebe7de);
    border-color: #8b4513;
    box-shadow: 3px 4px 10px rgba(44, 36, 27, 0.15);
}

[data-theme="vintage"] .status-indicator.healthy {
    background: #556b2f;
    box-shadow: 0 0 8px rgba(85, 107, 47, 0.5);
}

[data-theme="vintage"] .status-indicator.degraded {
    background: #b8860b;
    box-shadow: 0 0 8px rgba(184, 134, 11, 0.5);
}

[data-theme="vintage"] .status-indicator.unhealthy {
    background: #8b0000;
    box-shadow: 0 0 8px rgba(139, 0, 0, 0.5);
}

/* Typing indicator for vintage theme */
[data-theme="vintage"] .typing-indicator {
    background: linear-gradient(135deg, #f5f2eb, #ffffff);
    border: 2px solid #c4b5a0;
    font-family: Georgia, serif;
    box-shadow: 3px 4px 12px rgba(44, 36, 27, 0.12);
}

[data-theme="vintage"] .typing-animation span {
    background: #8b4513;
}

[data-theme="vintage"] .typing-text {
    color: #5d3a1a;
    background: none;
    -webkit-text-fill-color: #5d3a1a;
}

/* Upload progress for vintage theme */
[data-theme="vintage"] .upload-progress-container {
    background: linear-gradient(135deg, #f5f2eb, #ffffff);
    border: 2px solid #c4b5a0;
    box-shadow: 2px 3px 8px rgba(44, 36, 27, 0.1);
}

[data-theme="vintage"] .upload-progress-bar {
    background: #e0dcd0;
}

[data-theme="vintage"] .upload-progress-fill {
    background: linear-gradient(90deg, #8b4513, #a0522d);
}

[data-theme="vintage"] .provider-status-tooltip {
    background: #f5f2eb;
    border: 2px solid #c4b5a0;
    font-family: Georgia, serif;
    box-shadow: 5px 8px 20px rgba(44, 36, 27, 0.15);
}

/* ==================== THEME: RADIOACTIVE ==================== */
[data-theme="radioactive"] {
    --bg: #0a0a0a;
    --sidebar-bg: #050505;
    --panel: #0c0c0c;
    --panel-2: #111111;
    --panel-3: #161616;
    --border: #1a1a1a;
    --text: #e0e0e0;
    --muted: #444;
    --accent: #39ff14;
    --accent-hover: #32e012;
    --accent-rgb: 57, 255, 20;
    --user-bubble: #0f1a0f;
    --assistant-bubble: #0a0f0a;
    --danger: #ff003c;
    --warning: #ffee00;
    --info: #39ff14;
    --success: #39ff14;
}

[data-theme="radioactive"] .chat-window {
    background-image: none;
    background: var(--panel);
}

[data-theme="radioactive"] .message-card {
    border: 1px solid rgba(57, 255, 20, 0.15);
    font-family: 'Courier New', monospace;
}

[data-theme="radioactive"] .action-btn,
[data-theme="radioactive"] .message-action-btn {
    border: 1px solid rgba(57, 255, 20, 0.4);
    background: rgba(57, 255, 20, 0.05);
    color: #39ff14;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.7rem;
    box-shadow: inset 0 0 10px rgba(57, 255, 20, 0.1);
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
}

[data-theme="radioactive"] .action-btn:hover {
    background: rgba(57, 255, 20, 0.15);
    box-shadow: inset 0 0 20px rgba(57, 255, 20, 0.2), 0 0 15px rgba(57, 255, 20, 0.3);
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.8);
}

[data-theme="radioactive"] .mode-dropdown-wrap,
[data-theme="radioactive"] .chat-image-upload-btn {
    background: rgba(57, 255, 20, 0.05);
    border: 1px solid rgba(57, 255, 20, 0.3);
    box-shadow: inset 0 0 10px rgba(57, 255, 20, 0.1);
}

[data-theme="radioactive"] .send-btn {
    background: #39ff14;
    color: #000;
    box-shadow: 0 0 30px rgba(57, 255, 20, 0.5);
    font-weight: 900;
}

[data-theme="radioactive"] #flavor-input {
    background: #0c0c0c !important;
    color: #39ff14 !important;
    border: 1px solid rgba(57, 255, 20, 0.3) !important;
}
[data-theme="radioactive"] .attunement-drawer {
    background: #0a0a0a;
    color: #39ff14;
}

/* Status indicators for radioactive */
[data-theme="radioactive"] .provider-status-bar {
    background: rgba(57, 255, 20, 0.05);
    border: 1px solid rgba(57, 255, 20, 0.3);
    font-family: 'Courier New', monospace;
}

[data-theme="radioactive"] .provider-status-bar:hover {
    background: rgba(57, 255, 20, 0.1);
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.2);
}

[data-theme="radioactive"] .status-indicator.healthy {
    background: #39ff14;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.8);
}

[data-theme="radioactive"] .status-indicator.degraded {
    background: #ffee00;
    box-shadow: 0 0 10px rgba(255, 238, 0, 0.8);
}

[data-theme="radioactive"] .status-indicator.unhealthy {
    background: #ff003c;
    box-shadow: 0 0 10px rgba(255, 0, 60, 0.8);
}

[data-theme="radioactive"] .typing-indicator {
    background: rgba(57, 255, 20, 0.05);
    border: 1px solid rgba(57, 255, 20, 0.3);
    font-family: 'Courier New', monospace;
    clip-path: polygon(10% 0, 100% 0, 100% 80%, 90% 100%, 0 100%, 0 20%);
    border-radius: 0;
}

[data-theme="radioactive"] .typing-animation span {
    background: #39ff14;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.8);
}

[data-theme="radioactive"] .typing-text {
    background: linear-gradient(90deg, rgba(57, 255, 20, 0.5), #39ff14, rgba(57, 255, 20, 0.5));
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="radioactive"] .upload-progress-container {
    background: rgba(57, 255, 20, 0.05);
    border: 1px solid rgba(57, 255, 20, 0.3);
    clip-path: polygon(10% 0, 100% 0, 100% 80%, 90% 100%, 0 100%, 0 20%);
    border-radius: 0;
}

[data-theme="radioactive"] .upload-progress-fill {
    background: #39ff14;
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.5);
}

[data-theme="radioactive"] .provider-status-tooltip {
    background: #0a0a0a;
    border: 1px solid rgba(57, 255, 20, 0.4);
    clip-path: polygon(5% 0, 100% 0, 100% 95%, 95% 100%, 0 100%, 0 5%);
    border-radius: 0;
}

/* ==================== THEME: SUNSET DIAGNOSIS ==================== */
[data-theme="sunset"] {
    --bg: #1a0f2e;
    --sidebar-bg: #120824;
    --panel: #231336;
    --panel-2: #2d1b42;
    --panel-3: #372251;
    --border: #3d2b5a;
    --text: #fff0f5;
    --muted: #b8a9c9;
    --accent: #ff6b6b;
    --accent-secondary: #c084fc;
    --accent-rgb: 255, 107, 107;
    --user-bubble: rgba(255, 107, 107, 0.12);
    --assistant-bubble: rgba(192, 132, 252, 0.08);
    --danger: #ff4d6d;
    --warning: #ffd166;
    --info: #c084fc;
    --success: #06ffa5;
    --gradient: linear-gradient(135deg, #ff6b6b, #c084fc);
}

[data-theme="sunset"] .message-card.user {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(192, 132, 252, 0.1));
    border: 1px solid transparent;
    border-image: linear-gradient(135deg, #ff6b6b, #c084fc) 1;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.1);
}

[data-theme="sunset"] .message-card.assistant {
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--accent);
    border-radius: 4px 18px 18px 18px;
}

[data-theme="sunset"] .action-btn,
[data-theme="sunset"] .message-action-btn {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(192, 132, 252, 0.15));
    border: 1px solid rgba(255, 107, 107, 0.4);
    color: #ffd4d4;
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.2);
}

[data-theme="sunset"] .action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.4);
    filter: brightness(1.1);
}

[data-theme="sunset"] .send-btn {
    background: linear-gradient(135deg, #ff6b6b, #c084fc);
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.4);
    border: none;
}

[data-theme="sunset"] #flavor-input {
    background: #231336 !important;
    color: #fff0f5 !important;
    border: 1px solid rgba(255, 107, 107, 0.3) !important;
}
[data-theme="sunset"] .attunement-drawer {
    background: #1a0f2e;
    color: #fff0f5;
}

/* Status indicators for sunset */
[data-theme="sunset"] .provider-status-bar {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(192, 132, 252, 0.1));
    border: 1px solid rgba(255, 107, 107, 0.3);
}

[data-theme="sunset"] .provider-status-bar:hover {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(192, 132, 252, 0.15));
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.2);
}

[data-theme="sunset"] .status-indicator.healthy {
    background: #06ffa5;
    box-shadow: 0 0 10px rgba(6, 255, 165, 0.5);
}

[data-theme="sunset"] .status-indicator.degraded {
    background: #ffd166;
    box-shadow: 0 0 10px rgba(255, 209, 102, 0.5);
}

[data-theme="sunset"] .status-indicator.unhealthy {
    background: #ff4d6d;
    box-shadow: 0 0 10px rgba(255, 77, 109, 0.5);
}

[data-theme="sunset"] .typing-indicator {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(192, 132, 252, 0.1));
    border: 1px solid rgba(255, 107, 107, 0.3);
}

[data-theme="sunset"] .typing-animation span {
    background: linear-gradient(135deg, #ff6b6b, #c084fc);
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.4);
}

[data-theme="sunset"] .typing-text {
    background: linear-gradient(90deg, #ff6b6b, #c084fc, #ff6b6b);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="sunset"] .upload-progress-container {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(192, 132, 252, 0.1));
    border: 1px solid rgba(255, 107, 107, 0.3);
}

[data-theme="sunset"] .upload-progress-fill {
    background: linear-gradient(90deg, #ff6b6b, #c084fc);
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.4);
}

/* ==================== THEME: MONOCHROME ECG ==================== */
[data-theme="monochrome"] {
    --bg: #0d0d0d;
    --sidebar-bg: #080808;
    --panel: #111111;
    --panel-2: #141414;
    --panel-3: #1a1a1a;
    --border: #222;
    --text: #f0f0f0;
    --muted: #444;
    --accent: #ff3333;
    --accent-hover: #ff0000;
    --accent-rgb: 255, 51, 51;
    --user-bubble: #1a1a1a;
    --assistant-bubble: #111;
    --danger: #ff0000;
    --warning: #ffaa00;
    --info: #ffffff;
    --success: #00ff00;
    --font-main: 'SF Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
}

[data-theme="monochrome"] * {
    font-family: var(--font-main) !important;
}

[data-theme="monochrome"] .message-card {
    border: 1px solid #333;
    border-radius: 0;
    position: relative;
}

[data-theme="monochrome"] .message-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #333;
}

[data-theme="monochrome"] .message-card.user::before {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

[data-theme="monochrome"] .action-btn,
[data-theme="monochrome"] .message-action-btn {
    background: transparent;
    border: 1px solid #444;
    color: #666;
    border-radius: 0;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1px;
    clip-path: none;
    border-radius: 4px;
    transition: all 0.1s;
}

[data-theme="monochrome"] .action-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(255, 51, 51, 0.1);
    box-shadow: 4px 4px 0 rgba(255, 51, 51, 0.3);
    transform: translate(-2px, -2px);
}

[data-theme="monochrome"] .mode-dropdown-wrap,
[data-theme="monochrome"] .chat-image-upload-btn {
    background: #0a0a0a;
    border: 1px solid #333;
    color: #666;
    border-radius: 0;
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
}

[data-theme="monochrome"] .mode-dropdown-wrap:hover,
[data-theme="monochrome"] .chat-image-upload-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 3px 3px 0 rgba(255, 51, 51, 0.3);
    transform: translate(-1px, -1px);
}

[data-theme="monochrome"] .send-btn {
    background: var(--accent);
    color: #000;
    font-weight: 900;
    clip-path: polygon(20% 0, 100% 0, 100% 80%, 80% 100%, 0 100%, 0 20%);
    border-radius: 0;
}

[data-theme="monochrome"] #flavor-input {
    background: #111 !important;
    color: #f0f0f0 !important;
    border: 1px solid #333 !important;
}
[data-theme="monochrome"] .attunement-drawer {
    background: #0d0d0d;
    color: #f0f0f0;
}

/* Status indicators for monochrome */
[data-theme="monochrome"] .provider-status-bar {
    background: #111;
    border: 1px solid #333;
    font-family: 'SF Mono', monospace;
    border-radius: 0;
}

[data-theme="monochrome"] .provider-status-bar:hover {
    border-color: #ff3333;
    box-shadow: 4px 4px 0 rgba(255, 51, 51, 0.3);
    transform: translate(-2px, -2px);
}

[data-theme="monochrome"] .status-indicator.healthy {
    background: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

[data-theme="monochrome"] .status-indicator.degraded {
    background: #ffaa00;
    box-shadow: 0 0 10px rgba(255, 170, 0, 0.8);
}

[data-theme="monochrome"] .status-indicator.unhealthy {
    background: #ff3333;
    box-shadow: 0 0 10px rgba(255, 51, 51, 0.8);
}

[data-theme="monochrome"] .typing-indicator {
    background: #111;
    border: 1px solid #333;
    border-radius: 0;
    font-family: 'SF Mono', monospace;
}

[data-theme="monochrome"] .typing-animation span {
    background: #ff3333;
    box-shadow: 0 0 10px rgba(255, 51, 51, 0.8);
}

[data-theme="monochrome"] .typing-text {
    background: none;
    -webkit-text-fill-color: #f0f0f0;
    color: #f0f0f0;
}

[data-theme="monochrome"] .upload-progress-container {
    background: #111;
    border: 1px solid #333;
    border-radius: 0;
}

[data-theme="monochrome"] .upload-progress-fill {
    background: #ff3333;
    box-shadow: 0 0 10px rgba(255, 51, 51, 0.5);
}

/* ==================== COMMON STYLES ==================== */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme Switcher */
.theme-switcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--panel);
    color: var(--accent);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.theme-menu {
    position: absolute;
    bottom: 65px;
    right: 0;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.theme-menu.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
    border: 1px solid transparent;
}

.theme-option:hover {
    background: rgba(var(--accent-rgb), 0.1);
}

.theme-option.active {
    background: rgba(var(--accent-rgb), 0.15);
    border-color: rgba(var(--accent-rgb), 0.4);
}

.theme-preview {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.theme-preview.bioluminescence { 
    background: linear-gradient(135deg, #0a0f14, #00f0ff); 
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}
.theme-preview.vintage { background: #f4f1ea; }
.theme-preview.radioactive { 
    background: #0a0a0a; 
    border-color: #39ff14;
    box-shadow: 0 0 8px rgba(57, 255, 20, 0.5);
}
.theme-preview.sunset { background: linear-gradient(135deg, #ff6b6b, #c084fc); }
.theme-preview.monochrome { 
    background: #0d0d0d; 
    border-color: #ff3333;
}

/* ==================== PANEL HIGHLIGHTING ==================== */

/* Bioluminescence — неоновая граница */
[data-theme="bioluminescence"] .sidebar {
    border-right: 2px solid rgba(0, 240, 255, 0.4);
    box-shadow: 5px 0 30px rgba(0, 240, 255, 0.1);
}
[data-theme="bioluminescence"] .chat-header {
    border-bottom: 2px solid rgba(0, 240, 255, 0.4);
    background: rgba(13, 20, 25, 0.95);
    backdrop-filter: none;
}

/* Vintage — классическая рамка */
[data-theme="vintage"] .sidebar {
    border-right: 2px solid #c4b5a0;
    box-shadow: 3px 0 15px rgba(139, 69, 19, 0.15);
}
[data-theme="vintage"] .chat-header {
    border-bottom: 2px solid #c4b5a0;
    background: #fdfcf7;
    backdrop-filter: none;
}

/* Radioactive — кислотная рамка */
[data-theme="radioactive"] .sidebar {
    border-right: 2px solid rgba(57, 255, 20, 0.5);
    box-shadow: 5px 0 30px rgba(57, 255, 20, 0.15);
}
[data-theme="radioactive"] .chat-header {
    border-bottom: 2px solid rgba(57, 255, 20, 0.5);
    background: #0c0c0c;
    backdrop-filter: none;
}

/* Sunset — градиентная рамка */
[data-theme="sunset"] .sidebar {
    border-right: 2px solid rgba(255, 107, 107, 0.6);
    box-shadow: 5px 0 30px rgba(255, 107, 107, 0.15);
}
[data-theme="sunset"] .chat-header {
    border-bottom: 2px solid rgba(255, 107, 107, 0.6);
    background: rgba(35, 19, 54, 0.98);
    backdrop-filter: none;
}

/* Monochrome — четкая контрастная рамка */
[data-theme="monochrome"] .sidebar {
    border-right: 2px solid #ff3333;
    box-shadow: 5px 0 20px rgba(255, 51, 51, 0.2);
}
[data-theme="monochrome"] .chat-header {
    border-bottom: 2px solid #ff3333;
    background: #111;
    backdrop-filter: none;
}

/* Общие улучшения для всех тем */
.sidebar {
    position: sticky;
    top: 0;
    z-index: 100;
}

.chat-header {
    position: sticky;
    top: 0;
    z-index: 50;
}
