/* Toast notifications – top-right stack */
.toast-root {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    max-width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 280px;
    max-width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
    background: var(--bg-card, #28353f);
    color: var(--text, #f4f4f4);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.toast.is-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast.is-leaving {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
}

.toast-icon svg {
    display: block;
}

.toast-body {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.toast-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
    opacity: 0.85;
}

.toast-message {
    font-size: 0.9rem;
    line-height: 1.45;
    font-weight: 500;
    word-break: break-word;
}

.toast-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    opacity: 0.55;
    cursor: pointer;
    display: grid;
    place-items: center;
    margin: -4px -6px 0 0;
    transition: opacity 0.2s, background 0.2s;
}

.toast-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
}

.toast--success .toast-icon {
    background: rgba(41, 193, 132, 0.15);
    color: #29c184;
}

.toast--error .toast-icon {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
}

.toast--warning .toast-icon {
    background: rgba(255, 184, 77, 0.15);
    color: #ffb84d;
}

.toast--info .toast-icon {
    background: rgba(24, 181, 178, 0.15);
    color: #18b5b2;
}

[data-theme="light"] .toast {
    background: #fff;
    border-color: rgba(51, 65, 85, 0.12);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
    color: #374151;
}

[data-theme="light"] .toast-close:hover {
    background: rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .toast--success .toast-icon {
    background: rgba(4, 120, 87, 0.1);
    color: #047857;
}

[data-theme="light"] .toast--error .toast-icon {
    background: rgba(190, 18, 60, 0.1);
    color: #be123c;
}

@media (max-width: 640px) {
    .toast-root {
        top: 12px;
        right: 12px;
        left: 12px;
        align-items: stretch;
    }

    .toast {
        min-width: 0;
    }
}
