@font-face {
    font-family: 'Roboto-Medium';
    src: url('../font/Roboto-Medium.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Material Icons';
    font-style: normal;
    font-weight: 400;
    src: url('../font/MaterialIcons-Regular.woff2') format('woff2');
}

.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto-Medium', sans-serif;
    background: #0a0f1a;
    min-height: 100vh;
    margin: 0;
}

.chat-wrapper {
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
    height: 100dvh;
    min-height: 100dvh;
    background: 
                url('../image/abstract-white-and-grey.svg') repeat,
                radial-gradient(circle,#42274d 0%, rgba(10, 15, 26, 1) 100%);
    background-size:  20%, cover;
}

.logo {
    display: block;
    max-width: 100%;
    max-height: 200px;
    width: auto;
    height: auto;
    margin: 0 auto 20px;
    object-fit: contain;
}

.logo-text {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: rgba(96, 165, 250, 0.3);
    letter-spacing: 2px;
    padding-top: 80px;
}

.header-logo {
    max-height: 55px;
    transition: max-height 0.2s ease;
    overflow: visible;
}

.top-header.header-transparent .header-logo {
    max-height: 150px;
}

.file-preview-container.active {
    display: flex;
}

/* Прикреплённые файлы */
.attached-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.15);
    border-radius: 12px;
    font-size: 12px;
    color: #94a3b8;
    margin: 2px 4px;
    transition: all 0.15s;
}

.attached-file .material-icons {
    font-size: 16px;
    color: #60a5fa;
}

.attached-file-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attached-file-remove {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: none;
    background: rgba(248, 113, 113, 0.12);
    border-radius: 50%;
    color: #f87171;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 0;
    line-height: 1;
}

.attached-file-remove:hover {
    background: rgba(248, 113, 113, 0.25);
    transform: scale(1.1);
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 50vh 0 120px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    overflow-y: visible;
}

/* Скроллбар для chat-wrapper */
.chat-wrapper::-webkit-scrollbar {
    width: 4px;
}

.chat-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.chat-wrapper::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.3);
    border-radius: 2px;
}

.message {
    max-width: min(600px, calc(100% - 40px));
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 15px;
    line-height: 1.6;

    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: break-word;
    background: rgba(10, 15, 26, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    align-self: flex-end;
    background: rgba(96, 165, 250, 0.3);
    border-color: rgba(96, 165, 250, 0.15);
    color: #e2e8f0;
}

.message.agent {
    align-self: flex-start;
    background: rgba(192, 132, 252, 0.25);
    border-color: rgba(192, 132, 252, 0.12);
    color: #e2e8f0;
}

.input-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    width: calc(100% - 40px);
    max-width: 600px;
    background: rgba(10, 15, 26, 0.5);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 26px;
    padding: 6px 6px 6px 20px;
    transition: all 0.2s ease;
    z-index: 900;
}

.input-container:focus-within {
    background: rgba(10, 15, 26, 0.7);
    backdrop-filter: blur(50px);
    border-color: rgba(96, 165, 250, 0.3);
}

/* Прикреплённые файлы — над input-контейнером */
.file-preview-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 550px;
    width: 100%;
    margin: 0 auto;
    padding: 0 10px 8px;
    display: none;
    box-sizing: border-box;
    z-index: 901;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
}

.message-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e2e8f0;
    font-size: 15px;
    padding: 10px 0;
}

.message-input::placeholder {
    color: #64748b;
}

.send-button {
    width: 42px;
    height: 42px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: 4px;
}

.send-button:hover {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

.send-button:active {
    transform: scale(0.95);
}

.send-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Адаптивность */
@media (max-width: 1024px) {
    body {
        padding: 0;
    }

    .chat-wrapper {
        background-size: 150% auto;
    }

    .chat-area {
        padding: 10vh 0 110px;
        gap: 10px;
    }

    .input-container {
        bottom: 10px;
        width: calc(100% - 24px);
        padding: 5px 5px 5px 16px;
    }

    .file-preview-container {
        bottom: 75px;
        width: calc(100% - 20px);
        padding: 0 8px;
    }

    .file-preview-container.active {
        display: flex;
    }

    .message {
        max-width: 90%;
        padding: 12px 14px;
        font-size: 14px;
        line-height: 1.5;
    }

    .message-input {
        font-size: 16px;
    }
    
    .send-button {
        width: 38px;
        height: 38px;
    }

    /* Хедер в мобильной версии: фиксированная высота 60px и без прозрачности */
    .top-header {
        height: 60px !important;
    }
    .top-header.header-transparent {
        height: 60px !important;
        background: rgba(10, 15, 26, 0.7) !important;
        backdrop-filter: blur(15px) !important;
        border-bottom: none !important;
    }
    /* Лого в мобильной версии: фиксированный размер */
    .header-logo {
        max-height: 55px !important;
    }
    .top-header.header-transparent .header-logo {
        max-height: 55px !important;
    }
}

/* Кнопка прикрепления файла */
.attach-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 4px;
}

.attach-btn:hover {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

.attach-btn:active {
    transform: scale(0.95);
}

/* Кнопка облака */
.cloud-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 4px;
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
}

.cloud-btn:hover {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

.cloud-btn:active {
    transform: scale(0.95);
}

.file-input {
    display: none;
}

.file-preview-container.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.file-preview-card {
    background: rgba(10, 15, 26, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    box-sizing: border-box;
}

.file-preview-icon {
    flex-shrink: 0;
    font-size: 20px;
    line-height: 1;
    color: #64748b;
}

.file-preview-info {
    flex: 1;
    min-width: 0; /* ✅ Ключевое для обрезки текста */
    overflow: hidden;
}

.file-preview-name {
    font-size: 13px;
    color: #e2e8f0;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    max-width: 100%;
}

.file-preview-size {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

.file-preview-remove {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: rgba(248, 113, 113, 0.15);
    border: none;
    border-radius: 50%;
    color: #f87171;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-family: 'Material Icons', sans-serif;
}

.file-preview-remove:hover {
    background: rgba(248, 113, 113, 0.3);
    transform: scale(1.05);
}

/* Для нескольких файлов */
.file-preview-multiple {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.file-preview-count {
    font-size: 12px;
    color: #94a3b8;
    padding: 4px 0;
}

/* Адаптивность */
@media (max-width: 480px) {
    .file-preview-name {
        font-size: 12px;
    }
}

/* === Блок регистрации === */
.hidden { display: none !important; }

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #0a0f1a;
}

.auth-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 32px 28px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.auth-logo {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 24px;
    letter-spacing: 1px;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.auth-tab.active {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.auth-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: #e2e8f0;
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
}

.auth-input:focus {
    border-color: rgba(96, 165, 250, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.auth-input::placeholder { color: #64748b; }

.auth-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 6px;
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.4);
}

.auth-btn:active { transform: scale(0.98); }

.auth-toggle-text {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #94a3b8;
}

.auth-toggle-text a {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 500;
    margin-left: 4px;
}

.auth-toggle-text a:hover { text-decoration: underline; }

@media (max-width: 768px) {
    .auth-card { padding: 24px 20px; }
}

/* === TOP HEADER === */
.top-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 60px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 24px 0;
    background: rgba(10, 15, 26, 0.7);
    backdrop-filter: blur(15px);
    border-bottom: none;
    z-index: 2000;
    overflow: visible;
    transition: height 0.2s ease, background 0.1s ease, backdrop-filter 0.1s ease, padding 0.3s ease;
}

.top-header.header-transparent {
    background: rgba(10, 15, 26, 0);
    backdrop-filter: blur(0);
    border-bottom: none;
    overflow: visible;
    height: 250px;
}

.header-btn {
    width: 40px; height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-btn:hover { background: rgba(96,165,250,0.15); color: #60a5fa; }

/* === SIDEBAR === */
/* Подложка под сайдбар */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    max-width: 90vw;
    height: 100%;
    background: rgba(10, 15, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1999; /* ниже header (2000) */
    pointer-events: none; /* чтобы клики проходили сквозь */
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 300px;
    max-width: 90vw;
    background: transparent;
    backdrop-filter: none;
    border-right: none;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2500;
    overflow-y: auto;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar.open + .sidebar-backdrop {
    transform: translateX(0);
}

/* Стили для содержимого сайдбара */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 500;
    color: #e2e8f0;
    margin: 0;
}

.sidebar-add-btn {
    background: transparent;
    border: none;
    color: #60a5fa;
    cursor: pointer;
    font-size: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.sidebar-add-btn:hover {
    background-color: rgba(96, 165, 250, 0.1);
}

.chats-list {
    padding: 12px 0;
    overflow-y: auto;
    flex-grow: 1;
}

.chat-item {
    display: flex;
    flex-direction: column;
    padding: 12px 24px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-left: 3px solid transparent;
    position: relative;
}

.chat-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.chat-item.active {
    background-color: rgba(96, 165, 250, 0.15);
    border-left-color: #60a5fa;
}

.chat-title {
    font-size: 15px;
    color: #e2e8f0;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-date {
    font-size: 12px;
    color: #94a3b8;
}

.chat-delete-btn {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(248, 113, 113, 0.1);
    border-radius: 50%;
    color: #f87171;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0;
    z-index: 1;
    transform: translateY(-50%);
}

.chat-item:hover .chat-delete-btn {
    opacity: 1;
}

.chat-delete-btn:hover {
    background: rgba(248, 113, 113, 0.25);
    transform: translateY(-50%) scale(1.1);
}

/* === PANEL (account + storage) === */
.account-panel,
.storage-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 100vw;
    background: rgba(10, 15, 26, 0.85);
    backdrop-filter: blur(20px);
    transform: translateX(100%);
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255,255,255,0.06);
    overflow-y: auto;
}
.account-panel.active,
.storage-panel.active { transform: translateX(0); pointer-events: auto; }

.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    margin-bottom: 24px;
}
.panel-header h3 {
    font-size: 20px;
    color: #e2e8f0;
    margin: 0;
    font-weight: 600;
}
.close-panel {
    background: none;
    border: none;
    color: #60a5fa;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}
.close-panel:hover { color: #3b82f6; }

/* Контейнер контента панели */
.panel-content {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 24px 40px;
}

/* Карточка пользователя */
.user-info {
    background: rgba(96, 165, 250, 0.08);
    border: 1px solid rgba(96, 165, 250, 0.15);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.user-info-text { flex: 1; min-width: 0; }
.user-info-name { font-size: 15px; color: #e2e8f0; font-weight: 500; font-family: 'keyfont', sans-serif; }
.user-info-email { font-size: 13px; color: #64748b; margin-top: 2px; font-family: 'keyfont', sans-serif; }

/* Кнопка выхода — круглая, как send-button */
.panel-logout-btn {
    width: 40px; height: 40px; min-width: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: #f87171;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.panel-logout-btn:hover { background: rgba(248,113,113,0.15); }

/* Форма */
.account-form { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.form-group label { display: block; font-size: 12px; color: #94a3b8; margin-bottom: 6px; }
.panel-input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 10px 14px;
    color: #e2e8f0;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}
.panel-input:focus { border-color: rgba(96,165,250,0.4); background: rgba(255,255,255,0.08); }
.panel-input::placeholder { color: #475569; }

.panel-save-btn {
    width: 100%;
    padding: 12px;
    background: rgba(96, 165, 250, 0.15);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 10px;
    color: #60a5fa;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.panel-save-btn:hover { background: rgba(96,165,250,0.25); }

/* Разделитель */
.panel-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 24px 0;
}

/* Кнопка хранилища */
.panel-secondary-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 12px;
}
.panel-secondary-btn span { font-family: 'Roboto-Medium', sans-serif; }
.panel-secondary-btn:hover { background: rgba(96,165,250,0.15); border-color: rgba(96,165,250,0.3); color: #60a5fa; }

@media (max-width: 820px) {
    .account-panel,
    .storage-panel {
        width: 100vw;
        max-width: 100vw;
    }
}

/* Индикатор "печатает..." */
.typing-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 4px 0;
    vertical-align: middle;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing-bounce 1.2s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Status bubble — visually muted compared to the final answer.
   The answer uses purple-tinted .message.agent; this one drops to neutral gray
   so the user immediately reads it as "in progress, not the actual reply". */
.message.agent.typing {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
}

.typing-status-label {
    display: inline-block;
    margin-right: 10px;
    color: #94a3b8;
    font-style: italic;
    font-size: 0.92em;
    letter-spacing: 0.01em;
    vertical-align: middle;
}

.email-verify-section {
    background: rgba(96,165,250,0.05);
    border: 1px solid rgba(96,165,250,0.15);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

/* File Storage */
.file-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.file-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    transition: background 0.2s;
    cursor: pointer;
}

.file-list-item:hover { background: rgba(255,255,255,0.06); }

.file-list-icon {
    font-size: 20px;
    flex-shrink: 0;
    color: #64748b;
    cursor: pointer;
    transition: color 0.15s;
}
.file-list-icon:hover { color: #60a5fa; }

.file-list-info { flex: 1; min-width: 0; overflow: hidden; }
.file-list-name {
    font-size: 13px;
    color: #e2e8f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    cursor: pointer;
    transition: color 0.15s;
}
.file-list-name:hover { color: #60a5fa; }
.file-list-meta { font-size: 11px; color: #64748b; margin-top: 2px; }

.file-list-delete {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 18px;
    flex-shrink: 0;
}
.file-list-delete:hover { color: #f87171; background: rgba(248,113,113,0.1); }

.file-list-download {
    width: 32px; height: 32px;
    border: none;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 50%;
    color: #22c55e;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-decoration: none;
    pointer-events: auto;
}
.file-list-download:hover { background: rgba(34, 197, 94, 0.25); transform: scale(1.1); }

.upload-file-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    background: rgba(96,165,250,0.1);
    border: 1px dashed rgba(96,165,250,0.3);
    border-radius: 10px;
    color: #60a5fa;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.upload-file-btn:hover { background: rgba(96,165,250,0.2); border-color: rgba(96,165,250,0.5); }
.upload-file-btn span { font-family: 'Roboto-Medium', sans-serif; }

.file-list-empty {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
    font-size: 14px;
}

.file-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background 0.15s;
    cursor: pointer;
}
.file-list-item:hover { background: rgba(255,255,255,0.04); }

.file-list-icon {
    color: #64748b;
    font-size: 20px;
    flex-shrink: 0;
}

.file-list-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.file-list-name {
    color: #e2e8f0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-list-meta {
    color: #475569;
    font-size: 12px;
}

.file-list-attach {
    width: 32px; height: 32px;
    border: none;
    background: rgba(96,165,250,0.1);
    border-radius: 50%;
    color: #60a5fa;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.file-list-attach:hover { background: rgba(96,165,250,0.25); transform: scale(1.1); }

.file-list-delete {
    width: 32px; height: 32px;
    border: none;
    background: rgba(248,113,113,0.1);
    border-radius: 50%;
    color: #f87171;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.file-list-delete:hover { background: rgba(248,113,113,0.25); transform: scale(1.1); }

/* === UNDO TOAST === */
.undo-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(10, 15, 26, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    max-width: 90vw;
    overflow: hidden;
    pointer-events: auto;
}
.undo-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.undo-toast-message {
    color: #e2e8f0;
    font-size: 14px;
    white-space: nowrap;
}

.undo-toast-timer {
    color: #64748b;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.undo-toast-btn {
    background: none;
    border: none;
    color: #60a5fa;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 6px;
    transition: background 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.undo-toast-btn:hover { background: rgba(96,165,250,0.15); }

.undo-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(96,165,250,0.4);
    border-radius: 0 0 12px 12px;
    transition: width 0.2s linear;
}

.storage-panel .panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.storage-panel .file-list {
    margin-bottom: 16px;
}

/* Модальное окно для создания чата */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    backdrop-filter: blur(4px);
    pointer-events: auto;
}

.modal-content {
    background: #1e293b;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid #334155;
    color: #e2e8f0;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 20px;
    font-weight: 500;
    color: #f1f5f9;
}

.modal-content input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #475569;
    background: #0f172a;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 16px;
    margin-bottom: 20px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.modal-content input:focus {
    outline: none;
    border-color: #60a5fa;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.modal-btn.cancel {
    background: #475569;
    color: #cbd5e1;
}

.modal-btn.cancel:hover {
    background: #64748b;
}

.modal-btn.create {
    background: #3b82f6;
    color: white;
}

.modal-btn.create:hover {
    background: #2563eb;
}