/* Контекстное меню - ГАРАНТИРОВАННО показывается */
.ctx-menu {
    display: block !important;
    position: fixed !important;
    z-index: 9999 !important;
    background: var(--surface) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3) !important;
    min-width: 200px !important;
    overflow: hidden !important;
    animation: ctxIn 0.1s ease !important;
    border: 1px solid var(--border) !important;
}
@keyframes ctxIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.ctx-menu-item {
    padding: 12px 18px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    color: var(--text) !important;
    transition: background 0.1s !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}
.ctx-menu-item:hover { background: var(--bg) !important; }
.ctx-menu-item.danger { color: var(--danger) !important; }

/* Модальные окна */
.modal-overlay {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 500;
    align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex !important; animation: fadeIn 0.2s ease; }
.modal {
    background: var(--surface); border-radius: 20px;
    max-width: 480px; width: 90%; max-height: 85vh;
    overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px 12px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 18px; font-weight: 700; }
.modal-close {
    width: 36px; height: 36px; border-radius: 50%;
    border: none; background: var(--bg); cursor: pointer;
    font-size: 18px; display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
}
.modal-close:hover { background: var(--border); }
.modal-body { padding: 20px 24px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Выпадающее меню */
.dropdown-menu {
    position: absolute;
    top: 60px;
    right: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 100;
    min-width: 220px;
    overflow: hidden;
    animation: dropdownIn 0.2s ease;
}
.dropdown-menu.show {
    display: block !important;
}
.dropdown-item {
    padding: 14px 18px;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.dropdown-item:hover {
    background: var(--bg);
}
@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Переключатель */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #666;
    border-radius: 26px;
    transition: 0.3s;
}
.toggle-slider:before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}
input:checked + .toggle-slider {
    background: #4CAF50;
}
input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* Табы настроек */
.settings-tab.active {
    color: #4F8CFF !important;
    border-bottom-color: #4F8CFF !important;
}

#modal-content {
    min-width: 300px;
    min-height: 200px;
}

.emoji-icon {
    display: inline-block;
    vertical-align: middle;
    margin: 0 1px;
}
