.toast {
    --toast-tint: var(--tone-success-bg);
    --toast-tone: var(--tone-success-dot);
    animation: toast-in 180ms ease-out;
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(27, 21, 35, 0.14), 0 2px 6px rgba(27, 21, 35, 0.06);
    box-sizing: border-box;
    overflow: hidden;
    pointer-events: auto;
    text-align: left;
    transition: opacity 0.15s ease, translate 0.15s ease;
}

.toast.is-bumped {
    animation: toast-bump 0.3s var(--ease-standard);
}

.toast.is-leaving {
    opacity: 0;
    pointer-events: none;
    translate: 0 -8px;
}

.toast--error {
    --toast-tint: var(--tone-danger-bg);
    --toast-tone: var(--tone-danger-ink);
}

.toast--info {
    --toast-tint: rgba(122, 62, 157, 0.1);
    --toast-tone: var(--color-accent);
}

.toast--warning {
    --toast-tint: var(--tone-warning-bg);
    --toast-tone: var(--tone-warning-strong);
}

.toast__action {
    align-items: center;
    align-self: flex-start;
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: 8px;
    color: var(--color-heading);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    margin-top: 6px;
    min-height: 32px;
    padding: 0 12px;
    text-decoration: none;
}

.toast__action[hidden] {
    display: none;
}

.toast__action:hover {
    background: var(--color-sidebar-submenu);
}

.toast__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding-top: 6px;
}

.toast__close {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--color-sidebar-muted);
    cursor: pointer;
    display: flex;
    flex: none;
    height: 36px;
    justify-content: center;
    padding: 0;
    width: 36px;
}

.toast__close .icon {
    height: 16px;
    width: 16px;
}

.toast__close:hover {
    background: var(--color-sidebar-hover);
    color: var(--color-heading);
}

.toast__description {
    color: var(--color-sidebar-muted);
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.toast__description[hidden] {
    display: none;
}

.toast__heading {
    color: var(--color-heading);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.toast__icon {
    align-items: center;
    background: var(--toast-tint);
    border-radius: 50%;
    color: var(--toast-tone);
    display: flex;
    flex: none;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.toast__icon .icon {
    height: 16px;
    width: 16px;
}

.toast__progress {
    animation: none;
    background: var(--toast-tone);
    display: block;
    height: 100%;
    opacity: 0.55;
    transform-origin: left;
}

.toast__row {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    padding: 14px 8px 14px 14px;
}

.toast__timer {
    background: var(--color-segment);
    height: 3px;
}

.toast.is-timing .toast__progress {
    animation: toast-progress var(--toast-duration, 5000ms) linear forwards;
}

.toast.is-paused .toast__progress {
    animation-play-state: paused;
}

.toast-region {
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    pointer-events: none;
    position: fixed;
    left: 50%;
    top: 16px;
    translate: -50% 0;
    width: min(380px, calc(100vw - 32px));
    z-index: var(--z-toast);
}

@media (prefers-reduced-motion: reduce) {
    .toast {
        animation: none;
        transition-duration: 0.01ms;
    }
}

@keyframes toast-bump {
    40% {
        scale: 1.025;
    }
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
}

@keyframes toast-progress {
    to {
        transform: scaleX(0);
    }
}
