.theme-spinner {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}

.theme-spinner--dual::before,
.theme-spinner--dual::after,
.loading-spinner::before,
.loading-spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    box-sizing: border-box;
}

.theme-spinner--dual::before,
.loading-spinner::before {
    inset: 0;
    border: 4px solid rgba(34, 211, 238, 0.2);
    border-top-color: var(--theme-accent);
    border-right-color: rgba(168, 85, 247, 0.8);
    animation: theme-spin-outer 0.9s linear infinite;
}

.theme-spinner--dual::after,
.loading-spinner::after {
    inset: 8px;
    border: 3px solid rgba(244, 114, 182, 0.2);
    border-top-color: var(--theme-accent-hot);
    border-left-color: var(--theme-accent-2);
    animation: theme-spin-inner 0.7s linear infinite;
}

.theme-spinner--sm {
    width: 32px;
    height: 32px;
}

.theme-spinner--sm::after {
    inset: 6px;
}

.theme-skel {
    background: linear-gradient(
        90deg,
        rgba(30, 41, 59, 0.9) 0%,
        rgba(51, 65, 85, 0.95) 45%,
        rgba(30, 41, 59, 0.9) 90%
    );
    background-size: 200% 100%;
    animation: theme-skeleton-wave 1.4s ease-in-out infinite;
    border-radius: var(--theme-radius-xs);
}

.theme-skel--text {
    height: 14px;
    width: 72%;
}

.theme-skel--media {
    min-height: 180px;
    width: 100%;
}

.theme-skel--card {
    min-height: 120px;
    border-radius: var(--theme-radius-md);
}

.theme-toast,
.toast.theme-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 28px;
    background: var(--theme-panel-strong);
    border: 1px solid var(--theme-line);
    border-radius: var(--theme-radius-sm);
    color: var(--theme-text);
    font-weight: 700;
    font-size: 15px;
    z-index: var(--theme-z-toast);
    box-shadow: var(--theme-shadow-card);
    max-width: min(92vw, 420px);
    text-align: center;
}

.theme-toast--in {
    animation: theme-slide-toast var(--theme-dur-2) var(--theme-ease-out);
}

.theme-toast--out {
    opacity: 0;
    transform: translate(-50%, 12px);
    transition: opacity var(--theme-dur-1), transform var(--theme-dur-1);
}

.theme-modal__backdrop,
.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    background: rgba(0, 0, 0, 0.86);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10060;
    opacity: 0;
    transition: opacity 0.25s var(--theme-ease-out);
}

.modal-overlay.active {
    display: flex !important;
    opacity: 1;
}

.modal-content {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
    border: 2px solid rgba(99, 102, 241, 0.35);
    border-radius: 24px;
    padding: 36px 32px;
    max-width: 480px;
    width: min(480px, 100%);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    position: relative;
    color: #f8fafc;
}

.modal-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: rgba(239, 68, 68, 0.18);
    border: 3px solid rgba(239, 68, 68, 0.45);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon svg {
    width: 36px;
    height: 36px;
    color: #fca5a5;
}

.modal-title {
    font-size: 24px;
    font-weight: 800;
    color: #f8fafc;
    margin: 0 0 10px;
    text-align: center;
}

.modal-text {
    font-size: 15px;
    color: #94a3b8;
    margin: 0 0 24px;
    text-align: center;
    line-height: 1.55;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-btn {
    flex: 1;
    padding: 14px 18px;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.modal-btn-cancel {
    background: rgba(51, 65, 85, 0.9);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.28);
}

.modal-btn-confirm {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
}

.theme-modal .modal-content,
.modal-content.theme-modal__panel {
    animation: theme-scale-in var(--theme-dur-3) var(--theme-ease-out) both;
}

.theme-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--theme-radius-xs);
    border: 1px solid var(--theme-line);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    color: var(--theme-text);
    background: var(--theme-panel-soft);
    transition: transform var(--theme-dur-1) var(--theme-ease-out), box-shadow var(--theme-dur-1), border-color var(--theme-dur-1), background var(--theme-dur-1);
}

.theme-btn--primary {
    border-color: transparent;
    background: var(--theme-gradient-cta);
    box-shadow: 0 8px 28px rgba(34, 211, 238, 0.22);
}

.theme-btn--ghost {
    background: transparent;
}

.theme-btn--danger {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.45);
}

@media (hover: hover) and (pointer: fine) {
    .theme-btn--primary:hover {
        transform: translateY(-2px);
        box-shadow: var(--theme-shadow-hover);
    }
}

.theme-btn:active {
    transform: scale(0.98);
}

.theme-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--theme-muted);
}

.theme-empty__title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--theme-text);
    margin-bottom: 8px;
}

.theme-stagger > * {
    animation: theme-fade-up var(--theme-dur-3) var(--theme-ease-out) both;
    animation-delay: calc(var(--theme-i, 0) * 40ms);
}

.theme-card {
    border: 1px solid var(--theme-line);
    border-radius: var(--theme-radius-md);
    background: var(--theme-panel);
    box-shadow: var(--theme-shadow-card);
}

.lenta-page .item.theme-accent-bar,
.file-card.theme-accent-bar {
    border-left: 4px solid var(--theme-accent);
}
