/* ============================================================
   НЕумный дом — основной стиль (СКОМПИЛИРОВАН)
   Сгенерировано: 2026-09-04 10:41:34 (админка → 🎨 Assets)
   НЕ редактировать вручную! Правьте исходники в assets/css/
   ============================================================ */

/* ============================================================
   1. ПЕРЕМЕННЫЕ ТЕМ
   
   Светлая тема — в :root
   Тёмная тема — в [data-theme="dark"]
   
   Чат: светлый в светлой теме, терминальный в тёмной
   Кнопка пушей: --push-* адаптируются к теме
   ============================================================ */
:root {
    /* Основные цвета */
    --primary: #2f6fed;
    --primary-hover: #1e5ad6;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #0ea5e9;
    
    /* Структурные цвета (светлая тема) */
    --bg: #f0f2f5;
    --card-bg: #ffffff;
    --card-bg-hover: #f6f8fa;
    --border: #d0d7de;
    --text: #1e2a3a;
    --muted: #656d76;
    --header-bg: #ffffff;
    --input-bg: #ffffff;
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-lg: rgba(0, 0, 0, 0.15);
    
    /* Цвета чата (СВЕТЛАЯ тема) */
    --chat-bg: #ffffff;
    --chat-header-bg: #f6f8fa;
    --chat-border: #d0d7de;
    --chat-text: #1e2a3a;
    --chat-muted: #656d76;
    --chat-mine-bg: #e7f6ec;
    --chat-mine-border: #22c55e;
    --chat-mine-text: #15803d;
    --chat-other-bg: #eef4ff;
    --chat-other-border: #2f6fed;
    --chat-other-text: #1d4ed8;
    --chat-accent: #b45309;
    --chat-overlay: rgba(30, 42, 58, 0.05);
    --chat-overlay-hover: rgba(30, 42, 58, 0.1);
    
    /* Кнопка пуш-уведомлений (СВЕТЛАЯ тема) */
    --push-on-color: #1e5ad6;
    --push-on-bg: rgba(47, 111, 237, 0.12);
    --push-on-bg-hover: rgba(47, 111, 237, 0.2);
    --push-off-color: #656d76;
    
    /* Шрифты */
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --geek-mono: "JetBrains Mono", "Fira Code", "Courier New", monospace;
    
    /* Радиусы */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-full: 999px;
}

/* Тёмная тема */
[data-theme="dark"] {
    /* Структурные цвета */
    --bg: #0d1117;
    --card-bg: #1a1f2e;
    --card-bg-hover: #222839;
    --border: #2d3548;
    --text: #e6edf3;
    --muted: #8b949e;
    --header-bg: #161b22;
    --input-bg: #161b22;
    --shadow: rgba(0, 0, 0, 0.4);
    --shadow-lg: rgba(0, 0, 0, 0.6);
    
    /* Терминальные цвета чата (ТЁМНАЯ тема) */
    --chat-bg: #0a0e1a;
    --chat-header-bg: #141a2e;
    --chat-border: #1e2a4a;
    --chat-text: #e6edf3;
    --chat-muted: #8b949e;
    --chat-mine-bg: #1a3a2e;
    --chat-mine-border: #2ea95f;
    --chat-mine-text: #7ee2a8;
    --chat-other-bg: #141a2e;
    --chat-other-border: #2f6fed;
    --chat-other-text: #b8d4ff;
    --chat-accent: #ffd700;
    --chat-overlay: rgba(255, 255, 255, 0.05);
    --chat-overlay-hover: rgba(255, 255, 255, 0.1);
    
    /* Кнопка пуш-уведомлений (ТЁМНАЯ тема) */
    --push-on-color: #7ab0ff;
    --push-on-bg: rgba(47, 111, 237, 0.3);
    --push-on-bg-hover: rgba(47, 111, 237, 0.42);
    --push-off-color: #8b949e;
}

/* ============================================================
   2. СБРОС И БАЗОВЫЕ СТИЛИ
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.3s ease, color 0.3s ease;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text);
    margin-bottom: 0.6em;
    line-height: 1.3;
}

h1 { font-size: 1.8rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; }

p {
    margin-bottom: 1em;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

code, pre {
    font-family: var(--geek-mono);
    background: var(--card-bg-hover);
    border-radius: var(--radius-sm);
}

code {
    padding: 2px 6px;
    font-size: 0.9em;
}

pre {
    padding: 12px;
    overflow-x: auto;
    border: 1px solid var(--border);
}

/* ============================================================
   3. КОНТЕЙНЕР И РАСКЛАДКА + 6. ФУТЕР
   ============================================================ */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

.site-main {
    flex: 1;
    padding: 24px 0;
}

/* ФУТЕР */
.site-footer {
    background: var(--header-bg);
    border-top: 1px solid var(--border);
    color: var(--muted);
    padding: 16px 0;
    font-size: 13px;
    margin-top: auto;
}

/* ============================================================
   4. ШАПКА САЙТА + 5. НАВИГАЦИЯ + КНОПКА ПУШ-УВЕДОМЛЕНИЙ
   ============================================================ */
.site-header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 60px;
}

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

.site-logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.site-logo:hover {
    color: var(--primary);
    text-decoration: none;
}

/* НАВИГАЦИЯ */
.site-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-text-link {
    color: var(--text);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    font-size: 14px;
}

.nav-text-link:hover {
    background: var(--card-bg-hover);
    color: var(--primary);
    text-decoration: none;
}

.nav-text-link.active {
    color: var(--primary);
    background: rgba(47, 111, 237, 0.08);
}

.nav-icon {
    color: var(--text);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    position: relative;
}

.nav-icon:hover {
    background: var(--card-bg-hover);
    color: var(--primary);
    text-decoration: none;
}

.nav-icon.active {
    color: var(--primary);
    background: rgba(47, 111, 237, 0.08);
}

/* 🆕 Любая <button> с классом nav-icon — без нативного фона/рамки */
button.nav-icon {
    background: transparent;
    border: none;
    appearance: none;
    -webkit-appearance: none;
}

.nav-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--header-bg);
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 4px;
}

.nav-form {
    display: inline;
}

.nav-form button {
    background: transparent;
    border: none;
    color: var(--text);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s ease;
}

.nav-form button:hover {
    background: var(--card-bg-hover);
    color: var(--danger);
}

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.theme-toggle:hover {
    background: var(--card-bg-hover);
}

/* Мобильное меню */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
}

.menu-toggle:hover {
    background: var(--card-bg-hover);
}

/* ============================================================
   КНОПКА ПУШ-УВЕДОМЛЕНИЙ (🔔 / )
   Цвета состояний — через темозависимые переменные --push-*
   ============================================================ */
.push-toggle {
    position: relative;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
    
    /* СБРОС нативных стилей <button> — убирает белый фон и рамку */
    background: transparent;
    border: none;
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    color: var(--text);
    padding: 6px 10px;
}

/* Состояние "проверка" (при загрузке) */
.push-toggle.is-loading {
    opacity: 0.4;
    pointer-events: none;
    animation: push-loading 1.2s ease-in-out infinite;
}

@keyframes push-loading {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* Состояние "включено" (🔔) */
.push-toggle.is-subscribed {
    color: var(--push-on-color);
    background: var(--push-on-bg);
}

.push-toggle.is-subscribed:hover {
    color: var(--push-on-color);
    background: var(--push-on-bg-hover);
}

/* Состояние "выключено" (🔕) */
.push-toggle.is-unsubscribed {
    color: var(--push-off-color);
}

.push-toggle.is-unsubscribed:hover {
    color: var(--primary);
    background: var(--card-bg-hover);
}

/* Зелёная точка-индикатор (адаптируется к фону шапки) */
.push-toggle.is-subscribed::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    border: 2px solid var(--header-bg);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    animation: push-active-pulse 2s infinite;
}

@keyframes push-active-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
    70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Эмодзи */
.push-toggle .push-icon {
    display: inline-block;
    transition: transform 0.2s ease;
}

.push-toggle:hover .push-icon {
    transform: scale(1.15) rotate(-8deg);
}

/* Тёмная тема: зелёная точка со свечением */
[data-theme="dark"] .push-toggle.is-subscribed::after {
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

/* ============================================================
   АДАПТИВНОСТЬ ШАПКИ/НАВИГАЦИИ
   ============================================================ */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .site-nav {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--header-bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
        gap: 4px;
        transform: translateY(-120%);
        transition: transform 0.25s ease;
        box-shadow: 0 4px 12px var(--shadow);
    }
    
    .site-nav.open {
        transform: translateY(0);
    }
    
    .nav-divider {
        width: 100%;
        height: 1px;
        margin: 8px 0;
    }
    
    .nav-text-link,
    .nav-icon,
    .push-toggle {
        width: 100%;
        text-align: left;
    }
}

/* ============================================================
   23. СКРОЛЛБАР
   ============================================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bg);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--border);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* ============================================================
   МОБИЛЬНЫЕ УСТРОЙСТВА И PWA
   safe-area (чёлка/home-индикатор), dvh, iOS-зум, tap-зоны
   ============================================================ */

/* Корректная высота с учётом панелей мобильного браузера */
body {
    min-height: 100vh;
    min-height: 100dvh;
}

/* Safe-зоны: шапка не уходит под чёлку */
.site-header {
    padding-top: env(safe-area-inset-top);
}

/* Футер не перекрывается home-индикатором */
.site-footer {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

/* Тосты ниже статус-бара */
.toast-container {
    top: calc(12px + env(safe-area-inset-top));
    right: calc(12px + env(safe-area-inset-right));
}

/* Чат: корректная высота + запрет pull-to-refresh внутри */
.messages-list {
    height: 60vh;
    height: 60dvh;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Кнопка установки PWA (класс вместо inline-стилей) */
.pwa-install-btn {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: calc(20px + env(safe-area-inset-right));
    z-index: 1000;
}

/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   ============================================================ */
@media (max-width: 768px) {
    /* Мобильное меню ниже шапки с учётом safe-area */
    .site-nav {
        top: calc(60px + env(safe-area-inset-top));
    }
    
    /* 🆕 iOS: не зумить при фокусе на поле (мин. 16px) */
    input[type="text"], input[type="email"], input[type="password"],
    input[type="number"], input[type="search"], input[type="tel"],
    input[type="url"], textarea, select,
    .form-input, .form-textarea,
    .reply-form textarea {
        font-size: 16px;
    }
    
    /* 🆕 Комфортные tap-зоны (44px — рекомендация Apple) */
    .nav-icon, .push-toggle, .theme-toggle, .menu-toggle {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-text-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
    
    .messages-list {
        height: 55vh;
        height: 55dvh;
    }
    
    /* Кнопки форм — во всю ширину пальцем */
    .reply-form-actions .btn,
    .form-actions .btn {
        min-height: 44px;
    }
}

/* ============================================================
   УСТАНОВЛЕННОЕ PWA (standalone)
   ============================================================ */
@media (display-mode: standalone) {
    .site-header {
        padding-top: env(safe-area-inset-top);
    }
    
    /* В установленном приложении кнопка установки не нужна */
    .pwa-install-btn {
        display: none !important;
    }
}

/* ============================================================
   8. КНОПКИ
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn:hover {
    background: var(--primary-hover);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn.ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

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

.btn.success {
    background: var(--success);
}

.btn.success:hover {
    background: #16a34a;
}

.btn.danger {
    background: var(--danger);
}

.btn.danger:hover {
    background: #dc2626;
}

.btn.small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn.large {
    padding: 14px 24px;
    font-size: 16px;
}

/* ============================================================
   7. КАРТОЧКИ + 20. ПУСТЫЕ СОСТОЯНИЯ
   ============================================================ */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px var(--shadow);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px var(--shadow);
}

.card-title {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--text);
}

/* ПУСТЫЕ СОСТОЯНИЯ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--text);
}

/* Адаптивность карточек */
@media (max-width: 768px) {
    .card {
        padding: 16px;
    }
    
    h1 { font-size: 1.5rem; }
}

/* ============================================================
   9. ФОРМЫ
   ============================================================ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea,
select,
.form-input,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--input-bg);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

input.is-invalid,
textarea.is-invalid {
    border-color: var(--danger);
}

input.is-valid,
textarea.is-valid {
    border-color: var(--success);
}

.form-hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

/* ============================================================
   10. БЕЙДЖИ И СТАТУСЫ
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    background: var(--card-bg-hover);
    color: var(--text);
}

.badge.primary { background: var(--primary); color: #fff; }
.badge.success { background: var(--success); color: #fff; }
.badge.danger { background: var(--danger); color: #fff; }
.badge.warning { background: var(--warning); color: #fff; }

.muted {
    color: var(--muted) !important;
}

/* Онлайн-статус */
.online-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #9ca3af;
}

.online-dot.online {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
    animation: pulse-online 2s infinite;
}

@keyframes pulse-online {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); }
}

.conversation-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--muted);
}

/* ============================================================
   19. ТАБЛИЦЫ
   ============================================================ */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

th, td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

th {
    background: var(--card-bg-hover);
    font-weight: 600;
    font-size: 13px;
}

tr:hover td {
    background: var(--card-bg-hover);
}

/* ============================================================
   18. МОДАЛЬНОЕ ОКНО И ТОСТЫ
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    max-width: 420px;
    width: 100%;
    box-shadow: 0 10px 40px var(--shadow-lg);
    animation: modalIn 0.2s ease;
}

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

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

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    color: var(--danger);
    background: var(--card-bg-hover);
}

.modal-body {
    padding: 20px;
    color: var(--text);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

/* Тосты */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    padding: 12px 16px;
    color: var(--text);
    box-shadow: 0 4px 12px var(--shadow-lg);
    min-width: 280px;
    max-width: 400px;
    animation: toastIn 0.3s ease;
}

.toast.success { border-left-color: var(--success); }
.toast.danger { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

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

/* ============================================================
   21. АВАТАРЫ
   ============================================================ */
.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-sm {
    width: 32px;
    height: 32px;
}

.avatar-lg {
    width: 80px;
    height: 80px;
}

/* ============================================================
   22. УТИЛИТЫ
   ============================================================ */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* ============================================================
   МОДУЛЬ: МЕССЕНДЖЕР
   Секции 11 (входящие), 13 (диалог), 14 (вниз), 15 (печатает),
   16 (превью), 17 (форма ответа)
   
   ИСПРАВЛЕНО: все подложки используют var(--chat-overlay) —
   корректно в светлой и тёмной темах
   ============================================================ */

/* --- ВХОДЯЩИЕ СООБЩЕНИЯ (inbox) --- */
.inbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: all 0.15s ease;
}

.inbox-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(47, 111, 237, 0.1);
    transform: translateY(-1px);
    text-decoration: none;
    background: var(--card-bg-hover);
}

.inbox-item.unread {
    background: var(--card-bg);
    border-left: 3px solid var(--primary);
    border-color: var(--primary);
}

[data-theme="dark"] .inbox-item.unread {
    background: rgba(47, 111, 237, 0.08);
}

.inbox-avatar-wrap {
    flex-shrink: 0;
}

.inbox-avatar-wrap .avatar {
    width: 48px;
    height: 48px;
}

.inbox-content {
    flex: 1;
    min-width: 0;
}

.inbox-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
    gap: 8px;
}

.inbox-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inbox-item.unread .inbox-name {
    font-weight: 700;
}

.inbox-time {
    font-size: 12px;
    color: var(--muted);
    flex-shrink: 0;
}

.inbox-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.inbox-message {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.inbox-item.unread .inbox-message {
    color: var(--text);
    font-weight: 500;
}

.inbox-badge {
    flex-shrink: 0;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.inbox-handle {
    font-size: 12px;
    font-family: var(--geek-mono);
}

/* --- ДИАЛОГ (терминальный стиль в тёмной, светлый в светлой) --- */
.conversation-container {
    position: relative;
    background: var(--chat-bg);
    border: 1px solid var(--chat-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px var(--shadow-lg);
    overflow: hidden;
    font-family: var(--geek-mono);
    margin-bottom: 16px;
}

.messages-list {
    height: 60vh;
    max-height: 600px;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--chat-bg);
}

/* Сообщение */
.message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 90%;
    font-size: 13px;
    line-height: 1.5;
}

.message-mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}

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

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--chat-border);
}

.message-bubble {
    padding: 8px 12px;
    border-radius: 4px;
    max-width: 100%;
    word-wrap: break-word;
    position: relative;
    border: 1px solid;
}

.message-other .message-bubble {
    background: var(--chat-other-bg);
    border-color: var(--chat-other-border);
    color: var(--chat-other-text);
}

.message-mine .message-bubble {
    background: var(--chat-mine-bg);
    border-color: var(--chat-mine-border);
    color: var(--chat-mine-text);
}

.message-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 4px;
    font-size: 11px;
}

.message-sender {
    font-weight: 600;
    color: var(--chat-accent);
}

.message-other .message-sender::before {
    content: '> ';
    color: var(--chat-other-border);
}

.message-mine .message-sender::before {
    content: '$ ';
    color: var(--chat-mine-border);
}

.message-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: var(--geek-mono);
}

.message-deleted-text {
    font-style: italic;
    color: var(--chat-muted);
    font-size: 12px;
}

.message-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
    font-size: 10px;
    color: var(--chat-muted);
}

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

/* Индикаторы прочтения */
.message-status {
    font-family: var(--geek-mono);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0;
}

.message-status.sent {
    color: var(--chat-muted);
}

.message-status.read {
    color: var(--chat-accent);
    animation: readPulse 0.4s ease;
}

@keyframes readPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Кнопки действий на сообщении */
.message-actions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

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

.msg-action-btn {
    background: var(--chat-overlay);
    border: 1px solid var(--chat-border);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: var(--chat-muted);
    transition: all 0.15s ease;
}

.msg-action-btn:hover {
    background: var(--chat-overlay-hover);
    color: var(--chat-text);
    border-color: var(--chat-accent);
}

/* Цитата в сообщении */
.message-quote {
    background: var(--chat-overlay);
    border-left: 3px solid var(--chat-accent);
    padding: 6px 10px;
    border-radius: 2px;
    margin-bottom: 6px;
    font-size: 11px;
}

.quote-author {
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--chat-accent);
}

.quote-body {
    opacity: 0.8;
}

/* Вложения */
.message-attachments {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.attachment-image-link img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 3px;
    object-fit: cover;
    border: 1px solid var(--chat-border);
}

.attachment-file-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--chat-overlay);
    border: 1px solid var(--chat-border);
    border-radius: 3px;
    font-size: 12px;
    color: var(--chat-text);
}

.attachment-file-link:hover {
    border-color: var(--chat-accent);
    color: var(--chat-accent);
    text-decoration: none;
}

/* Подсветка непрочитанного */
.message-unread-highlight .message-bubble {
    animation: unreadPulse 1.5s ease 2;
}

@keyframes unreadPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.6); }
    50% { box-shadow: 0 0 0 8px rgba(255, 215, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

/* --- КНОПКА "ВНИЗ" --- */
.scroll-down-btn {
    position: absolute;
    bottom: 110px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: var(--chat-header-bg);
    color: var(--chat-accent);
    border: 1px solid var(--chat-border);
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    font-family: var(--geek-mono);
}

.scroll-down-btn:hover {
    transform: translateY(-2px);
    border-color: var(--chat-accent);
}

.scroll-down-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 2px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--chat-bg);
    font-family: var(--geek-mono);
}

/* --- ИНДИКАТОР "ПЕЧАТАЕТ" --- */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 12px;
    color: var(--chat-muted);
    background: var(--chat-bg);
    font-family: var(--geek-mono);
}

.typing-indicator::before {
    content: '>';
    color: var(--chat-accent);
    animation: blink-cursor 1s infinite;
}

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

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 1px;
    background: var(--chat-muted);
    animation: typingBounce 1.2s infinite;
}

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

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.typing-text {
    font-style: italic;
    margin-left: 6px;
}

/* --- БЛОКИ ПРЕВЬЮ (цитата и редактирование) --- */
.quote-preview,
.edit-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--chat-header-bg);
    border-left: 3px solid var(--chat-accent);
    margin: 8px 16px;
    border-radius: 3px;
    font-family: var(--geek-mono);
    font-size: 12px;
}

.quote-preview-content,
.edit-preview-content {
    flex: 1;
    min-width: 0;
}

.quote-preview-author,
.edit-preview-label {
    font-weight: 600;
    font-size: 12px;
    color: var(--chat-accent);
    margin-bottom: 2px;
}

.quote-preview-body,
.edit-preview-body {
    font-size: 12px;
    color: var(--chat-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quote-cancel,
.edit-cancel {
    background: transparent;
    border: 1px solid var(--chat-border);
    color: var(--chat-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 3px;
    transition: all 0.15s ease;
}

.quote-cancel:hover,
.edit-cancel:hover {
    color: var(--danger);
    border-color: var(--danger);
}

/* --- ФОРМА ОТВЕТА И ПАНЕЛЬ ЭМОДЗИ --- */
.reply-form {
    padding: 12px 16px;
    border-top: 1px solid var(--chat-border);
    background: var(--chat-header-bg);
}

.reply-form textarea {
    background: var(--chat-bg);
    color: var(--chat-text);
    border: 1px solid var(--chat-border);
    border-radius: 3px;
    font-family: var(--geek-mono);
    font-size: 13px;
    margin-bottom: 10px;
    min-height: 70px;
}

.reply-form textarea:focus {
    border-color: var(--chat-accent);
    box-shadow: 0 0 0 3px var(--chat-overlay-hover);
}

.reply-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.reply-form-actions .btn {
    margin-left: auto;
    font-family: var(--geek-mono);
}

.emoji-toggle {
    background: transparent;
    border: 1px solid var(--chat-border);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.15s ease;
}

.emoji-toggle:hover {
    background: var(--chat-overlay-hover);
    border-color: var(--chat-accent);
}

.emoji-picker {
    position: absolute;
    bottom: 110px;
    left: 16px;
    background: var(--chat-header-bg);
    border: 1px solid var(--chat-border);
    border-radius: 4px;
    padding: 12px;
    box-shadow: 0 8px 24px var(--shadow-lg);
    max-width: 320px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 20;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
}

.emoji-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    line-height: 1;
    transition: all 0.15s ease;
}

.emoji-btn:hover {
    background: var(--chat-overlay-hover);
    border-color: var(--chat-accent);
    transform: scale(1.15);
}

/* Вложения в форме */
.attachment-input {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.attachment-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--chat-border);
    border-radius: 3px;
    color: var(--chat-text);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--geek-mono);
}

.attachment-label:hover {
    border-color: var(--chat-accent);
    color: var(--chat-accent);
}

.attachment-preview {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* --- АДАПТИВНОСТЬ МЕССЕНДЖЕРА --- */
@media (max-width: 768px) {
    .message {
        max-width: 95%;
    }
    
    .messages-list {
        height: 55vh;
    }
}

@media (max-width: 600px) {
    .inbox-item {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .inbox-avatar-wrap .avatar {
        width: 40px;
        height: 40px;
    }
    
    .inbox-name {
        font-size: 14px;
    }
    
    .inbox-message {
        font-size: 12px;
    }
    
    .reply-form {
        padding: 10px 12px;
    }
    
    .emoji-picker {
        max-width: calc(100vw - 40px);
        left: 12px;
    }
    
    .scroll-down-btn {
        bottom: 100px;
        right: 12px;
    }
    
    .message-bubble {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* ============================================================
   МОДУЛЬ: КОНТАКТЫ
   Секция 12
   ============================================================ */
.contact-item {
    margin-bottom: 12px;
    transition: opacity 0.2s ease;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px var(--shadow);
    transition: all 0.15s ease;
}

.contact-card:hover {
    box-shadow: 0 4px 12px var(--shadow);
    border-color: var(--primary);
}

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

.contact-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
    color: var(--text);
}

.contact-handle,
.contact-code {
    font-size: 13px;
    color: var(--muted);
    font-family: var(--geek-mono);
}

.contact-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Адаптивность контактов */
@media (max-width: 600px) {
    .contact-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .contact-actions {
        width: 100%;
    }
    
    .contact-actions .btn {
        flex: 1;
    }
}

/* ============================================================
   🆕 v4.2.0 — РЕАКЦИИ НА СООБЩЕНИЯ
   Модуль: Messages
   Исходник: 03-modules/22-reactions.css
   Использует переменные из 01-core/01-variables.css
   ============================================================ */

/* Контейнер реакций — под текстом, над footer */
.message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    align-items: center;
    position: relative;
    max-width: 100%;
    min-height: 28px;
}

/* Пилюля реакции (👍 3) */
.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border: 1px solid var(--chat-border);
    background: var(--chat-overlay);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 12px;
    line-height: 1.4;
    transition: all 0.15s ease;
    color: var(--chat-text);
    font-family: var(--geek-mono);
}

.reaction-btn:hover {
    background: var(--chat-overlay-hover);
    border-color: var(--chat-accent);
    transform: translateY(-1px);
}

.reaction-btn:active {
    transform: translateY(0);
}

/* Своя реакция — акцентная */
.reaction-btn.mine {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.reaction-btn.mine:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    opacity: 0.95;
}

.reaction-emoji {
    font-size: 14px;
    line-height: 1;
}

.reaction-count {
    font-size: 11px;
    font-weight: 600;
    min-width: 10px;
    text-align: center;
    font-family: var(--geek-mono);
}

/* Кнопка "+" (появляется при hover на сообщение) */
.reaction-add-btn {
    width: 24px;
    height: 24px;
    border: 1px dashed var(--chat-border);
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    color: var(--chat-muted);
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    padding: 0;
    line-height: 1;
}

.message:hover .reaction-add-btn {
    opacity: 0.7;
}

.reaction-add-btn:hover {
    opacity: 1 !important;
    background: var(--chat-overlay-hover);
    color: var(--chat-accent);
    border-style: solid;
    border-color: var(--chat-accent);
    transform: scale(1.1);
}

/* Пикер эмодзи — всплывает НАД реакциями */
.reaction-picker {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    background: var(--chat-header-bg);
    border: 1px solid var(--chat-border);
    border-radius: var(--radius);
    padding: 6px 8px;
    display: flex;
    gap: 2px;
    box-shadow: 0 4px 16px var(--shadow-lg);
    z-index: 20;
    animation: reactionPickerIn 0.15s ease;
    backdrop-filter: blur(4px);
}

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

/* Кнопка эмодзи в пикере */
.reaction-pick {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: transform 0.1s ease, background 0.1s ease;
    padding: 0;
    line-height: 1;
}

.reaction-pick:hover {
    background: var(--chat-overlay-hover);
    transform: scale(1.25);
}

.reaction-pick:active {
    transform: scale(1.1);
}

/* ============================================================
   ВЫРАВНИВАНИЕ ДЛЯ СВОИХ/ЧУЖИХ СООБЩЕНИЙ
   ============================================================ */

/* Свои сообщения: реакции вправо, пикер справа, "+" слева */
.message-mine .message-reactions {
    justify-content: flex-end;
}

.message-mine .reaction-picker {
    left: auto;
    right: 0;
}

.message-mine .reaction-add-btn {
    order: -1;
    margin-right: 2px;
}

/* Чужие сообщения: реакции влево (по умолчанию), пикер слева */
.message-other .reaction-add-btn {
    margin-left: 2px;
}

/* ============================================================
   АДАПТИВНОСТЬ
   ============================================================ */

@media (max-width: 600px) {
    .reaction-picker {
        flex-wrap: wrap;
        max-width: 220px;
        padding: 4px 6px;
    }

    .reaction-pick {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    /* На мобилках кнопка "+" видна всегда (нет hover-эффекта) */
    .reaction-add-btn {
        opacity: 0.7;
    }

    .reaction-btn {
        padding: 2px 6px;
        font-size: 11px;
    }

    .reaction-emoji {
        font-size: 13px;
    }

    .reaction-count {
        font-size: 10px;
    }
}

/* ============================================================
   АНИМАЦИЯ ПОЯВЛЕНИЯ НОВОЙ РЕАКЦИИ
   ============================================================ */

@keyframes reactionPop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.reaction-btn {
    animation: reactionPop 0.2s ease;
}

/* ============================================================
   🆕 v4.2.0 — ВЛОЖЕНИЯ В СООБЩЕНИЯХ (v4.2.1)
   ============================================================ */

.message-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    max-width: 100%;
}

.attachment-image {
    display: inline-block;
    max-width: 240px;
    max-height: 240px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--chat-border);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    line-height: 0;
}

.attachment-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px var(--shadow-lg);
}

.attachment-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 240px;
}

.attachment-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--chat-overlay);
    border: 1px solid var(--chat-border);
    border-radius: var(--radius);
    color: var(--chat-text);
    text-decoration: none;
    max-width: 280px;
    transition: all 0.15s ease;
    font-family: var(--geek-mono);
    font-size: 12px;
}

.attachment-file:hover {
    background: var(--chat-overlay-hover);
    border-color: var(--chat-accent);
    color: var(--chat-accent);
    text-decoration: none;
    transform: translateY(-1px);
}

.attachment-file .att-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.attachment-file .att-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.attachment-file .att-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
}

.attachment-file .att-size {
    font-size: 10px;
    color: var(--chat-muted);
    opacity: 0.8;
}

/* ============================================================
   ПРЕВЬЮ ВЛОЖЕНИЙ (перед отправкой)
   ============================================================ */
.attachment-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    width: 100%;
}

.att-preview-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 28px 6px 6px;
    background: var(--chat-header-bg);
    border: 1px solid var(--chat-border);
    border-radius: var(--radius-sm);
    max-width: 220px;
    font-size: 11px;
    animation: attachmentIn 0.2s ease;
}

@keyframes attachmentIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

.att-preview-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.att-preview-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--chat-overlay);
    border-radius: 4px;
    font-size: 20px;
    flex-shrink: 0;
}

.att-preview-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
    font-family: var(--geek-mono);
}

.att-preview-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
    color: var(--chat-text);
}

.att-preview-size {
    font-size: 10px;
    color: var(--chat-muted);
}

.att-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border: none;
    background: var(--danger);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.att-preview-remove:hover {
    transform: scale(1.15);
}

.att-preview-warning {
    padding: 4px 8px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    border-radius: var(--radius-sm);
    color: var(--warning);
    font-size: 11px;
    font-family: var(--geek-mono);
}

@media (max-width: 600px) {
    .attachment-image { max-width: 180px; max-height: 180px; }
    .attachment-file  { max-width: 220px; padding: 6px 10px; }
    .att-preview-card { max-width: 180px; }
}

