.flow-body {
    overflow-x: hidden;
}

.step[data-direction="forward"] {
    animation: step-from-right var(--duration-base) var(--ease-out);
}

.step[data-direction="back"] {
    animation: step-from-left var(--duration-base) var(--ease-out);
}

.progress-fill {
    transition: width var(--duration-slow) var(--ease-out);
}

.button,
.icon-button,
.option,
.tick,
.recap-row {
    transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}

.button:active:not(:disabled),
.icon-button:active,
.option:active {
    transform: scale(.98);
}

.option[aria-pressed="true"] .tick {
    animation: tick-pop var(--duration-base) var(--ease-out);
}

.done-icon {
    position: relative;
    animation: done-pop var(--duration-slow) var(--ease-spring) both;
}

.done-icon::after {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0;
    border-radius: inherit;
    background: inherit;
    animation: done-ring calc(var(--duration-slow) * 2) .15s var(--ease-out) both;
}

.done-icon .icon[data-icon="check"] path {
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    animation: check-draw var(--duration-slow) .3s var(--ease-out) forwards;
}

.done-icon ~ * {
    animation: rise-in var(--duration-slow) var(--ease-out) both;
}

.done-icon ~ :nth-child(2) { animation-delay: .12s; }
.done-icon ~ :nth-child(3) { animation-delay: .2s; }
.done-icon ~ :nth-child(4) { animation-delay: .28s; }
.done-icon ~ :nth-child(n + 5) { animation-delay: .36s; }

.toast {
    animation: toast-in var(--duration-base) var(--ease-out) both;
}

.toast[data-leaving] {
    animation: toast-out var(--duration-base) var(--ease-in) forwards;
}

.toast .icon[data-icon="check"] path {
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    animation: check-draw var(--duration-slow) .25s var(--ease-out) forwards;
}

.undo-banner,
.save-failure {
    animation: rise-in var(--duration-base) var(--ease-out) both;
}

dialog[open] {
    animation: dialog-in var(--duration-base) var(--ease-out);
}

dialog[open]::backdrop {
    animation: backdrop-in var(--duration-base) var(--ease-out);
}

@keyframes step-from-right {
    from {
        opacity: 0;
        transform: translateX(32px);
    }
}

@keyframes step-from-left {
    from {
        opacity: 0;
        transform: translateX(-32px);
    }
}

@keyframes tick-pop {
    50% {
        transform: scale(1.25);
    }
}

@keyframes done-pop {
    from {
        opacity: 0;
        transform: scale(.4);
    }
}

@keyframes done-ring {
    from {
        opacity: .55;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(1.6);
    }
}

@keyframes check-draw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(24px) scale(.96);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(16px);
    }
}

@keyframes dialog-in {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
}

@keyframes backdrop-in {
    from {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-delay: 0s !important;
        transition-duration: .01ms !important;
    }
}
