* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#iframe-container {
    width: 100%;
    height: 100%;
    display: none;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

#fallback {
    width: 100%;
    height: 100%;
    background-image: url('default-wallpaper.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
}

#fallback.active {
    display: flex;
}

.search-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 60px;
    position: relative;
}

.search-box {
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#search-input {
    flex: 1;
    padding: 18px 25px;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
}

.search-suggestions {
    position: absolute;
    z-index: 10;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 360px;
    overflow-y: auto;
    padding: 8px;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.search-suggestion {
    display: block;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 11px;
}

.search-suggestion-query {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #222;
    font: inherit;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.search-suggestion-query:hover,
.search-suggestion-query:focus-visible {
    background: rgba(102, 126, 234, 0.14);
    outline: none;
}

.search-suggestion-remove {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    margin-right: 6px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #777;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.search-suggestion-remove:hover,
.search-suggestion-remove:focus-visible {
    background: rgba(220, 53, 69, 0.12);
    color: #c62828;
    outline: none;
}

#search-button {
    padding: 18px 35px;
    border: none;
    background: #667eea;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

#search-button:hover {
    background: #5568d3;
}

.time-container {
    text-align: center;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

#time {
    font-size: 120px;
    font-weight: 300;
    margin-bottom: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#date {
    font-size: 32px;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: rgba(0, 0, 0, 0.7);
    padding: 20px 40px;
    border-radius: 10px;
}

#search-yandex {
    background: #ffd600;
    border: 0;
    cursor: pointer;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#search-yandex:hover {
    background: #e6c200;
}

#search-google {
    color: #fff;
    background: #ffffff;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 4px solid #667eea;
    margin: -4px -24px;
    cursor: pointer;
    box-shadow: 0px 4px 14px rgba(102, 126, 234, 0.4);
    transition: all 0.2s ease;
}

#search-google:hover {
    transform: scale(1.06);
    box-shadow: 0px 6px 18px rgba(102, 126, 234, 0.6);
}

#search-google:active {
    transform: scale(0.96);
}

.ai {
    display: none;
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
}

#prompt {
    width: calc(100% + 30px);
    max-width: 600px;
    margin: 0 auto;
    display: block;
    min-height: 140px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    padding-right: 10px;
    height: auto;
    resize: none;
    overflow-y: auto;
    line-height: 1.3;
    box-sizing: border-box;
    background: #33333300;
    border: 0;
    max-height: calc(80vh - 80px);
    margin-bottom: 20px;
    padding-right: 23px;
}

textarea {
    outline: none;
}

#ai-tools {
    display: flex;
    justify-content: space-between;
    padding: 14px 0 0 0;
    border-top: 1px solid #9e9e9eb3;
    align-items: center;
}

.sent_ai {
    border: 0;
    width: 40px;
    line-height: 40px;
    cursor: pointer;
    border-radius: 4px;
    background: #0188ae;
    color: #fff;
}

#wr-prompt {
    padding: 20px 15px 10px 15px;
    border: 2px solid #fff;
    border-radius: 10px;
    background: #ffffffba;
    backdrop-filter: blur(5px);
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    overflow: hidden;
}

.select-wrapper {
    position: relative;
    display: inline-block;
}

.custom-select {
    border: 0;
    padding: 10px 14px;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
    min-width: 150px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.custom-select i {
    margin-left: 8px;
    font-size: 12px;
}

.select-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    max-height: 80vh;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    margin-bottom: 5px;
}

.select-dropdown.active {
    display: block;
}

.select-group-title {
    padding: 10px 14px;
    font-weight: bold;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.select-option {
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.select-option:hover {
    background: #f0f0f0;
}

.select-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.select-option.disabled:hover {
    background: transparent;
}

.select-option.selected {
    background: #e3f2fd;
}

/* Стилизованная полоса прокрутки */
.select-dropdown::-webkit-scrollbar {
    width: 8px;
}

.select-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.select-dropdown::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.select-dropdown::-webkit-scrollbar-thumb:hover {
    background: #555;
}

#chat-bord {
    max-height: calc(80vh - 230px);
    max-width: 600px;
    margin: 0 auto -20px;
    height: 30vh;
    border-radius: 10px;
    background: #ffffffba;
    backdrop-filter: blur(5px);
    flex-grow: 1;
    padding: 10px;
    display: none;
    height: auto;
    width: 100%;
    overflow-y: scroll;
}

.show-ai-bord {
    display: flex;
    max-height: 80vh;
    flex-direction: column;
    justify-content: flex-end;
}

.user_message, .bot_message, .typing {
    margin: 0 0 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.show-chatbord {
    display: block !important;
}

.bot_message p {
    line-height: 1.2;
    margin-bottom: 20px;
}

.login {
    position: fixed;
    z-index: 100;
    color: #fff;
    text-align: center;
    width: 39px;
    line-height: 40px;
    right: 15px;
    border: 1px solid;
    font-size: 21px;
    border-radius: 10px;
    opacity: .3;
    top: 13px;
    cursor: pointer;
    transition: all .4s;
}

.login:hover {
    opacity: .9;
}

.change-bg {
    position: fixed;
    z-index: 100;
    color: #fff;
    text-align: center;
    width: 39px;
    line-height: 40px;
    right: 15px;
    border: 1px solid;
    font-size: 21px;
    border-radius: 10px;
    opacity: .3;
    top: 63px;
    cursor: pointer;
    transition: all .4s;
}

.change-bg:hover {
    opacity: .9;
}


/* ══════════════════════════════════════════════════════════════════════════════
   💎 LIQUID GLASS — МОДАЛЬНЫЕ ОКНА И КНОПКИ (Glassmorphism)
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Overlay backdrop ── */
.bg-modal, .bookmark-modal, .auth-modal, .profile-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 30, 0.45);
    backdrop-filter: blur(12px) saturate(1.4);
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.bg-modal.active, .bookmark-modal.active, .auth-modal.active, .profile-modal.active {
    display: flex;
}

/* ── Glass Card ── */
.modal-card, .bookmark-content, .auth-content, .bg-content, .profile-content {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(40px) saturate(1.8);
    -webkit-backdrop-filter: blur(40px) saturate(1.8);
    padding: 32px 28px;
    border-radius: 24px;
    max-width: 420px;
    width: 92%;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(255, 255, 255, 0.15);
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    animation: glassPopIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

/* Subtle refraction highlight at the top */
.modal-card::before, .bookmark-content::before, .auth-content::before, .bg-content::before, .profile-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, transparent 100%);
    border-radius: 24px 24px 0 0;
    pointer-events: none;
    z-index: 0;
}

/* Content sits above the refraction highlight */
.modal-card > *, .bookmark-content > *, .auth-content > *, .bg-content > *, .profile-content > * {
    position: relative;
    z-index: 1;
}

@keyframes glassPopIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(16px);
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
        backdrop-filter: blur(40px);
    }
}

/* ── Close Button (Glass Pill) ── */
.modal-close, .bookmark-close, .auth-close, .bg-close, .profile-close {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    color: rgba(30, 41, 59, 0.6);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    line-height: 1;
    z-index: 2;
}

.modal-close:hover, .bookmark-close:hover, .auth-close:hover, .bg-close:hover, .profile-close:hover {
    background: rgba(255, 255, 255, 0.75);
    color: #0f172a;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

/* ── Стили модального окна профиля ── */
.profile-info-box {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.7);
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.profile-avatar-circle {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, #4a7c59 0%, #2e593d 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(74, 124, 89, 0.35);
    flex-shrink: 0;
}

.profile-user-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.profile-user-email {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
}

.profile-status-dot {
    width: 7px;
    height: 7px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
}

.profile-confirm-text {
    font-size: 13.5px;
    color: #475569;
    margin: 0 0 20px;
    line-height: 1.5;
    text-align: center;
}

/* ── Header Block ── */
.modal-header-block {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

/* ── Badge Icon (Frosted Circle) ── */
.modal-badge-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(139, 92, 246, 0.12) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #6366f1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-title {
    font-size: 19px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.modal-subtitle {
    font-size: 13px;
    color: rgba(51, 65, 85, 0.75);
    margin: 4px 0 0 0;
}

/* ── Body Block ── */
.modal-body-block {
    display: flex;
    flex-direction: column;
}

/* ── Input Group ── */
.modal-input-group {
    width: 100%;
    margin-bottom: 12px;
}

/* ── Glass Inputs ── */
.modal-input, .bg-input, .auth-input {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid rgba(148, 163, 184, 0.3);
    border-radius: 14px;
    font-size: 14px;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    outline: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    box-sizing: border-box;
}

.modal-input::placeholder, .bg-input::placeholder, .auth-input::placeholder {
    color: rgba(100, 116, 139, 0.65);
}

.modal-input:focus, .bg-input:focus, .auth-input:focus {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(255, 255, 255, 0.7);
    box-shadow:
        0 0 0 4px rgba(99, 102, 241, 0.1),
        0 2px 8px rgba(99, 102, 241, 0.08);
}

/* ── Button Stack ── */
.modal-btn-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

/* ── Glass Buttons ── */
.modal-btn, .bg-button, .auth-button {
    width: 100%;
    padding: 13px 20px;
    border-radius: 14px;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    letter-spacing: -0.01em;
}

.modal-btn:active, .bg-button:active, .auth-button:active {
    transform: scale(0.975);
}

/* Primary Button (Refined Gradient Glow) */
.modal-btn-primary, .auth-login-btn, .auth-register-btn {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #7c3aed 100%);
    background-size: 200% 200%;
    color: #ffffff;
    box-shadow:
        0 4px 16px rgba(79, 70, 229, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-btn-primary:hover, .auth-login-btn:hover, .auth-register-btn:hover {
    background-position: 100% 100%;
    box-shadow:
        0 8px 24px rgba(79, 70, 229, 0.45),
        0 0 0 1px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: translateY(-1.5px);
}

/* Secondary Button (Frosted Glass) */
.modal-btn-secondary {
    background: rgba(255, 255, 255, 0.6);
    color: #1e293b;
    border: 1px solid rgba(203, 213, 225, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(148, 163, 184, 0.7);
    color: #0f172a;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
    transform: translateY(-1px);
}

/* Danger Button (Frosted Red) */
.modal-btn-danger, .bg-reset {
    background: rgba(254, 242, 242, 0.75);
    color: #dc2626;
    border: 1px solid rgba(252, 165, 165, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.06);
}

.modal-btn-danger:hover, .bg-reset:hover {
    background: rgba(254, 226, 226, 0.9);
    color: #b91c1c;
    border-color: rgba(248, 113, 113, 0.8);
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.18);
    transform: translateY(-1px);
}

/* ── Hint Text ── */
.modal-hint, .bg-hint {
    font-size: 12px;
    color: rgba(100, 116, 139, 0.7);
    margin-top: 16px;
    margin-bottom: 0;
    text-align: center;
    font-weight: 500;
    line-height: 1.4;
}

.tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

#ai-sent {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Мобильная кнопка Tab */
.mobile-tab {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 99;
    transition: all 0.3s;
}

.mobile-tab:active {
    transform: translateX(-50%) scale(0.95);
}

.mobile-tab i {
    font-size: 24px;
    color: #667eea;
}

/* ═════════════════════════════════════════════════════════════════════════
/* ═════════════════════════════════════════════════════════════════════════
   ПЛАВАЮЩАЯ КНОПКА ПЕРЕХОДА В ПОЛНЫЙ ЧАТ (/chat.html) — LIQUID GLASS
   ═════════════════════════════════════════════════════════════════════════ */
.floating-chat-btn {
    position: fixed;
    right: 28px;
    bottom: 28px;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 100%);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.8);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 95;
    text-decoration: none;
}

.floating-chat-btn:hover {
    transform: translateY(-3px) scale(1.05);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.18) 100%);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

.floating-chat-btn:active {
    transform: scale(0.95);
}

.floating-chat-tooltip {
    position: absolute;
    right: calc(100% + 12px);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #f8fafc;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateX(10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.floating-chat-btn:hover .floating-chat-tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* ═════════════════════════════════════════════════════════════════════════
   ВИДЖЕТ МИНИ-ЧАТА (GLASSMORPHISM WINDOW ПО МАКЕТУ)
   ═════════════════════════════════════════════════ */
.mini-chat-widget {
    position: fixed;
    right: 28px;
    bottom: 28px;
    width: 420px;
    max-width: calc(100vw - 32px);
    height: 600px;
    max-height: calc(100vh - 56px);
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(36px);
    -webkit-backdrop-filter: blur(36px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px) scale(0.96);
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.35s;
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.mini-chat-widget.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Шапка мини-чата */
.mini-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.mini-chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mini-chat-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.mini-chat-title-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mini-chat-title {
    font-size: 14px;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.2;
}

.mini-chat-model-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
}

.mini-chat-model-badge:hover {
    background: rgba(79, 70, 229, 0.25);
    border-color: rgba(99, 102, 241, 0.5);
    color: #e0e7ff;
}

.mini-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mini-header-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.mini-header-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    transform: translateY(-1px);
}

.mini-close-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

/* Область сообщений мини-чата */
.mini-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.mini-chat-messages::-webkit-scrollbar {
    width: 5px;
}

.mini-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.mini-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Приветственный экран */
.mini-chat-welcome {
    margin: auto;
    text-align: center;
    padding: 24px 16px;
    color: #94a3b8;
}

.mini-welcome-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #818cf8;
    margin: 0 auto 12px;
}

.mini-chat-welcome h3 {
    margin: 0 0 6px 0;
    font-size: 17px;
    font-weight: 700;
    color: #f1f5f9;
}

.mini-chat-welcome p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
}

/* Пузыри сообщений */
.mini-msg {
    display: flex;
    flex-direction: column;
    max-width: 88%;
    animation: miniMsgIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.mini-msg.user {
    align-self: flex-end;
}

.mini-msg.assistant {
    align-self: flex-start;
}

.mini-msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
}

.mini-msg.user .mini-msg-bubble {
    background: #4f46e5;
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.35);
}

.mini-msg.assistant .mini-msg-bubble {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
    border-bottom-left-radius: 4px;
}

.mini-msg-bubble p {
    margin: 0 0 8px 0;
}
.mini-msg-bubble p:last-child {
    margin-bottom: 0;
}

.mini-msg-bubble pre {
    background: rgba(0, 0, 0, 0.4);
    padding: 10px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 12px;
    margin: 6px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mini-msg-bubble code {
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 4px;
    border-radius: 4px;
}

/* Стриминг курсор */
.mini-stream-cursor::after {
    content: '▋';
    display: inline-block;
    color: #818cf8;
    animation: miniCursorBlink 0.8s infinite;
    margin-left: 2px;
}

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

/* Превью прикрепленных файлов */
.mini-attachments-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    max-height: 90px;
    overflow-y: auto;
}

.mini-attachments-preview.hidden {
    display: none;
}

.mini-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 11.5px;
    color: #e2e8f0;
    max-width: 170px;
}

.mini-chip-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-chip-img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
}

.mini-chip-remove {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    margin-left: 2px;
}

.mini-chip-remove:hover {
    color: #f87171;
}

/* ═════════════════════════════════════════════════════════════════════════
   НИЖНЯЯ ПАНЕЛЬ ВВОДА МИНИ-ЧАТА (ПО МАКЕТУ)
   ═════════════════════════════════════════════════ */
.mini-chat-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.85);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    flex-shrink: 0;
}

.mini-action-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.mini-action-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

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

/* Красивые всплывающие подсказки (тултипы) */
.mini-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f8fafc;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 10px;
    white-space: normal;
    width: max-content;
    max-width: 260px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 200;
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.mini-tooltip.right-aligned {
    left: auto;
    right: 0;
    transform: translateY(6px);
}

.mini-tooltip.left-aligned {
    left: 0;
    transform: translateY(6px);
}

.mini-action-wrap:hover .mini-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.mini-action-wrap:hover .mini-tooltip.right-aligned {
    transform: translateY(0);
}

.mini-action-wrap:hover .mini-tooltip.left-aligned {
    transform: translateY(0);
}

.mini-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: rgba(15, 23, 42, 0.95) transparent transparent transparent;
}

.mini-tooltip.right-aligned::after {
    left: auto;
    right: 12px;
    transform: none;
}

.mini-tooltip.left-aligned::after {
    left: 12px;
    transform: none;
}

/* Поле ввода текста */
.mini-input-field-wrap {
    flex: 1;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.mini-input-field-wrap:focus-within {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(99, 102, 241, 0.7);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

#mini-chat-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #f8fafc;
    font-size: 13.5px;
    font-family: inherit;
    resize: none;
    line-height: 1.4;
    max-height: 120px;
    min-height: 22px;
}

#mini-chat-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Кнопка отправки */
.mini-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #4f46e5;
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
    flex-shrink: 0;
}

.mini-send-btn:hover {
    background: #4338ca;
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.55);
}

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

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

/* ═════════════════════════════════════════════════════════════════════════
   МОДАЛЬНОЕ ОКНО АДМИНКИ (ВЫБОР МОДЕЛИ МИНИ-ЧАТА)
   ═════════════════════════════════════════════════ */
.admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.admin-modal.active {
    opacity: 1;
    visibility: visible;
}

.admin-modal-content {
    background: #ffffff;
    border-radius: 20px;
    width: 90%;
    max-width: 480px;
    padding: 24px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    animation: adminModalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@keyframes adminModalIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.admin-modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
}

.admin-modal-close:hover {
    color: #0f172a;
}

.admin-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.admin-badge-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #eef2ff;
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-models-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 4px;
}

.admin-model-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-model-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.admin-model-item.selected {
    background: #eef2ff;
    border-color: #6366f1;
}

.admin-model-info {
    display: flex;
    flex-direction: column;
}

.admin-model-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.admin-model-id {
    font-size: 12px;
    color: #64748b;
}

.admin-model-price {
    font-size: 12px;
    font-weight: 600;
    color: #4f46e5;
}

.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: rgba(241, 245, 249, 0.85);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    position: relative;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.admin-tab {
    flex: 1;
    text-align: center;
    padding: 9px 16px;
    font-size: 13.5px;
    font-weight: 600;
    color: #64748b;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
}

.admin-tab:hover {
    color: #1e293b;
    background: rgba(255, 255, 255, 0.6);
}

.admin-tab.active {
    color: #4f46e5;
    background: #ffffff;
    font-weight: 700;
    border-color: rgba(226, 232, 240, 0.6);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.admin-tab:active {
    transform: scale(0.975);
}

.admin-wallpaper-preview-wrap {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    text-align: center;
    margin-bottom: 16px;
}

.admin-wallpaper-preview-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 8px;
}

.admin-wallpaper-desc {
    font-size: 12.5px;
    color: #64748b;
    font-weight: 600;
}

.admin-wallpaper-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-action-btn, .admin-save-btn {
    width: 100%;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    font-family: inherit;
    letter-spacing: -0.01em;
}

.admin-action-btn:active, .admin-save-btn:active {
    transform: scale(0.975);
}

.admin-action-btn.primary, .admin-save-btn {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #7c3aed 100%);
    background-size: 200% 200%;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.admin-action-btn.primary:hover, .admin-save-btn:hover {
    background-position: 100% 100%;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
    transform: translateY(-1.5px);
}

.admin-action-btn.danger {
    background: rgba(254, 242, 242, 0.85);
    color: #dc2626;
    border: 1px solid rgba(252, 165, 165, 0.6);
}

.admin-action-btn.danger:hover {
    background: rgba(254, 226, 226, 0.95);
    color: #b91c1c;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    .mini-chat-widget {
        right: 12px;
        bottom: 12px;
        width: calc(100vw - 24px);
        height: calc(100vh - 24px);
        max-height: calc(100vh - 24px);
        border-radius: 18px;
    }
    
    .floating-chat-btn {
        right: 16px;
        bottom: 16px;
    }
}

/* ── Закладки (Speed Dial) ── */
/* ── Закладки (Speed Dial) — Liquid Glass (Жидкое стекло) ── */
.bookmarks-wrapper {
    width: 100%;
    max-width: 860px;
    margin: 0 auto 36px;
    position: relative;
    overflow: visible;
    padding: 12px 0;
}

.bookmarks-carousel {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 18px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 14px 20px;
    /* Скрываем скроллбар */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.bookmarks-carousel::-webkit-scrollbar {
    display: none;
}

.bookmark-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
    flex: 0 0 calc((100% - (18px * 8)) / 9);
    min-width: 64px;
    scroll-snap-align: start;
    position: relative;
    cursor: pointer;
    outline: none;
}

/* ── Иконка в стиле Жидкое стекло (Liquid Glass) ── */
.bookmark-icon-wrapper {
    position: relative;
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.08) 100%);
    backdrop-filter: blur(18px) saturate(190%);
    -webkit-backdrop-filter: blur(18px) saturate(190%);
    border-radius: 17px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.16),
        0 2px 6px rgba(0, 0, 0, 0.08),
        inset 0 1px 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 2px 0 rgba(0, 0, 0, 0.06);
    margin-bottom: 8px;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Глянцевый световой блик на верхней части стекла */
.bookmark-icon-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 52%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.0) 100%);
    border-radius: 16px 16px 26px 26px;
    pointer-events: none;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

/* Ховер-эффект: парение, объемное свечение и усиление прозрачности */
.bookmark-item:hover .bookmark-icon-wrapper {
    transform: translateY(-6px) scale(1.08);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.14) 100%);
    border-color: rgba(255, 255, 255, 0.75);
    box-shadow: 
        0 16px 32px rgba(0, 0, 0, 0.25),
        0 0 20px rgba(255, 255, 255, 0.3),
        inset 0 1px 2px 0 rgba(255, 255, 255, 0.95),
        inset 0 -1px 2px 0 rgba(0, 0, 0, 0.08);
}

.bookmark-item:hover .bookmark-icon-wrapper::before {
    opacity: 1;
}

/* Нажатие */
.bookmark-item:active .bookmark-icon-wrapper {
    transform: translateY(-1px) scale(0.96);
    box-shadow: 
        0 4px 14px rgba(0, 0, 0, 0.18),
        inset 0 1px 1px 0 rgba(255, 255, 255, 0.6);
}

.bookmark-icon-wrapper img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.25));
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
}

.bookmark-item:hover .bookmark-icon-wrapper img {
    transform: scale(1.12);
}

.bookmark-title {
    font-size: 11.5px;
    font-weight: 500;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8), 0 2px 8px rgba(0, 0, 0, 0.4);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    letter-spacing: 0.15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Nunito Sans', 'Segoe UI', Roboto, sans-serif;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.bookmark-item:hover .bookmark-title {
    color: #ffffff;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9), 0 0 12px rgba(255, 255, 255, 0.4);
}

/* Состояние перетаскивания закладки */
.bookmark-item.is-dragging {
    opacity: 0.35;
    transform: scale(0.92);
    filter: grayscale(0.4);
}

/* Кнопка добавления закладки (FAB) — Liquid Glass */
.add-bookmark-btn {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.06) 100%);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.2),
        inset 0 1px 1px 0 rgba(255, 255, 255, 0.7);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 90;
    opacity: 0.35;
}

.add-bookmark-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.15) 100%);
    border-color: rgba(255, 255, 255, 0.75);
    transform: translateX(-50%) scale(1.12);
    box-shadow: 
        0 14px 28px rgba(0, 0, 0, 0.28),
        0 0 20px rgba(255, 255, 255, 0.3),
        inset 0 1px 2px 0 rgba(255, 255, 255, 0.9);
    opacity: 1;
}

.add-bookmark-btn:active {
    transform: translateX(-50%) scale(0.94);
}

/* ── Режим корзины при перетаскивании закладки над/к кнопке ── */
.add-bookmark-btn.trash-mode {
    opacity: 1 !important;
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.4) 0%, rgba(244, 63, 94, 0.16) 100%) !important;
    border-color: rgba(251, 113, 133, 0.8) !important;
    transform: translateX(-50%) scale(1.12) !important;
    box-shadow: 
        0 14px 32px rgba(244, 63, 94, 0.35),
        0 0 25px rgba(244, 63, 94, 0.5),
        inset 0 1px 2px 0 rgba(255, 255, 255, 0.9) !important;
    color: #ffe4e6 !important;
    animation: trashPulse 1.8s infinite ease-in-out;
}

.add-bookmark-btn.trash-hover {
    transform: translateX(-50%) scale(1.24) !important;
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.6) 0%, rgba(225, 29, 72, 0.3) 100%) !important;
    border-color: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 
        0 18px 40px rgba(225, 29, 72, 0.5),
        0 0 35px rgba(244, 63, 94, 0.8),
        inset 0 1px 3px 0 rgba(255, 255, 255, 1) !important;
    color: #ffffff !important;
}

@keyframes trashPulse {
    0%, 100% {
        box-shadow: 0 14px 32px rgba(244, 63, 94, 0.35), 0 0 20px rgba(244, 63, 94, 0.4), inset 0 1px 2px 0 rgba(255, 255, 255, 0.9);
    }
    50% {
        box-shadow: 0 16px 36px rgba(244, 63, 94, 0.45), 0 0 30px rgba(244, 63, 94, 0.65), inset 0 1px 2px 0 rgba(255, 255, 255, 0.9);
    }
}

/* ── Иконки в правом верхнем углу (Авторизация и Смена фона) ── */
.login {
    position: fixed;
    z-index: 100;
    color: #fff;
    text-align: center;
    width: 42px;
    height: 42px;
    line-height: 40px;
    right: 15px;
    top: 15px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    font-size: 22px;
    border-radius: 12px;
    cursor: pointer;
    transition: all .3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.change-bg {
    position: fixed;
    z-index: 100;
    color: #fff;
    text-align: center;
    width: 42px;
    height: 42px;
    line-height: 40px;
    right: 15px;
    top: 68px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    font-size: 22px;
    border-radius: 12px;
    cursor: pointer;
    transition: all .3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.change-bg:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ══════════════════════════════════════════════════════════════════════════════
   🧩 КНОПКА И МОДАЛЬНОЕ ОКНО СКАЧИВАНИЯ РАСШИРЕНИЯ (СЛЕВА ВНИЗУ)
   ══════════════════════════════════════════════════════════════════════════════ */

.floating-extension-btn {
    position: fixed;
    bottom: 30px;
    left: 28px;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 100%);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.8);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 85;
}

.floating-extension-btn:hover {
    transform: translateY(-3px) scale(1.05);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.18) 100%);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 255, 255, 0.35);
}

.floating-extension-btn:active {
    transform: scale(0.95);
}

.floating-extension-btn .extension-btn-tooltip {
    position: absolute;
    left: calc(100% + 12px);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #f8fafc;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateX(-10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.floating-extension-btn:hover .extension-btn-tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* ── Модальное окно расширения (Liquid Glass) ── */
.extension-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 30, 0.45);
    backdrop-filter: blur(12px) saturate(1.4);
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

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

.ext-feature-list {
    margin: 0 0 18px;
    padding-left: 20px;
    font-size: 13.5px;
    color: #334155;
    line-height: 1.7;
}

.ext-download-btn {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    margin-bottom: 16px;
}

.ext-install-details summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: #2563eb;
    user-select: none;
}

.ext-install-details ol {
    margin: 10px 0 0;
    padding-left: 20px;
    font-size: 13px;
    color: #334155;
    line-height: 1.7;
}

.ext-install-details code {
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 12px;
}

@media (max-width: 768px) {
    .floating-extension-btn {
        bottom: 20px;
        left: 16px;
        width: 44px;
        height: 44px;
    }
}

/* === API Keys (Profile Modal) === */
.apikeys-box {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
.apikeys-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 10px;
}
.apikeys-header svg { color: #4a7c59; flex-shrink: 0; }
.apikeys-body { font-size: 13px; color: #334155; }
.apikeys-loading, .apikeys-empty { color: #64748b; font-size: 12.5px; padding: 4px 0; }
.apikey-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(203, 213, 225, 0.6);
    border-radius: 10px;
    padding: 8px 10px;
}
.apikey-item + .apikey-item { margin-top: 8px; }
.apikey-item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.apikey-item-hint { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; color: #1e293b; }
.apikey-item-meta { font-size: 11px; color: #64748b; }
.apikey-item-meta.revoked { color: #b91c1c; }
.apikey-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.apikey-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(203, 213, 225, 0.8);
    border-radius: 8px;
    color: #1e293b;
    font-size: 12px;
    padding: 5px 10px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.apikey-btn:hover { background: #fff; border-color: #94a3b8; }
.apikey-btn.danger { color: #b91c1c; border-color: rgba(185, 28, 28, 0.35); }
.apikey-btn.danger:hover { background: rgba(185, 28, 28, 0.06); }
.apikey-btn:disabled { opacity: 0.55; cursor: default; }
.apikey-reveal {
    margin-top: 8px;
    background: rgba(74, 124, 89, 0.08);
    border: 1px solid rgba(74, 124, 89, 0.35);
    border-radius: 10px;
    padding: 8px 10px;
}
.apikey-reveal-label { font-size: 11.5px; color: #4a7c59; font-weight: 600; margin-bottom: 6px; }
.apikey-reveal-row { display: flex; align-items: center; gap: 8px; }
.apikey-reveal code {
    flex: 1;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11.5px;
    color: #0f172a;
    word-break: break-all;
    user-select: all;
}
.apikeys-footer { margin-top: 10px; }
.apikeys-hint { font-size: 11.5px; color: #64748b; }
.apikeys-hint code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    padding: 1px 6px;
}
