.premium-toast-region {
    position: fixed;
    inset-block-start: max(18px, env(safe-area-inset-top));
    inset-inline-end: max(18px, env(safe-area-inset-right));
    z-index: 10950;
    display: flex;
    width: min(390px, calc(100vw - 28px));
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.premium-toast {
    --notice-color: var(--web-primary, #1494a9);
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 30px;
    gap: 12px;
    align-items: center;
    min-height: 76px;
    padding: 14px 13px;
    overflow: hidden;
    color: #172033;
    background: rgba(255, 255, 255, .97);
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 17px;
    box-shadow: 0 20px 55px rgba(15, 23, 42, .18), 0 3px 12px rgba(15, 23, 42, .06);
    backdrop-filter: blur(16px);
    pointer-events: auto;
    animation: premium-toast-in .34s cubic-bezier(.2, .8, .2, 1) both;
}

.premium-toast--success { --notice-color: #159b67; }
.premium-toast--error { --notice-color: #dc3f52; }
.premium-toast--warning { --notice-color: #e58a12; }
.premium-toast--info { --notice-color: var(--web-primary, #1494a9); }

.premium-toast__icon,
.premium-dialog__icon {
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--notice-color);
    border-radius: 13px;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--notice-color) 28%, transparent);
}

.premium-toast__icon {
    width: 42px;
    height: 42px;
}

.premium-toast__icon svg,
.premium-dialog__icon svg {
    width: 21px;
    height: 21px;
}

.premium-toast__content {
    min-width: 0;
}

.premium-toast__title {
    margin: 0 0 2px;
    color: #172033;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
}

.premium-toast__message {
    margin: 0;
    color: #637083;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.premium-toast__close {
    display: grid;
    width: 30px;
    height: 30px;
    padding: 0;
    place-items: center;
    color: #8290a4;
    background: transparent;
    border: 0;
    border-radius: 50%;
    transition: .2s ease;
}

.premium-toast__close:hover {
    color: #172033;
    background: #f1f4f8;
}

.premium-toast__progress {
    position: absolute;
    inset-inline: 0;
    inset-block-end: 0;
    height: 3px;
    background: color-mix(in srgb, var(--notice-color) 14%, transparent);
}

.premium-toast__progress::after {
    position: absolute;
    inset: 0;
    content: "";
    background: var(--notice-color);
    transform-origin: left;
    animation: premium-progress var(--notice-duration, 3200ms) linear forwards;
}

[dir="rtl"] .premium-toast__progress::after {
    transform-origin: right;
}

.premium-toast.is-leaving {
    animation: premium-toast-out .22s ease both;
}

.premium-dialog-layer {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: grid;
    padding: 20px;
    place-items: center;
    background: rgba(15, 23, 42, .48);
    backdrop-filter: blur(7px);
    animation: premium-fade-in .2s ease both;
}

.premium-dialog {
    --notice-color: var(--web-primary, #1494a9);
    width: min(440px, 100%);
    padding: 27px;
    color: #172033;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 24px;
    box-shadow: 0 30px 90px rgba(15, 23, 42, .27);
    animation: premium-dialog-in .3s cubic-bezier(.2, .85, .2, 1) both;
}

.premium-dialog--success { --notice-color: #159b67; }
.premium-dialog--error { --notice-color: #dc3f52; }
.premium-dialog--warning { --notice-color: #e58a12; }

.premium-dialog__icon {
    width: 54px;
    height: 54px;
    margin-block-end: 20px;
    border-radius: 17px;
}

.premium-dialog__title {
    margin: 0 0 9px;
    color: #172033;
    font-size: 21px;
    font-weight: 800;
    line-height: 1.35;
}

.premium-dialog__message {
    margin: 0;
    color: #637083;
    font-size: 14px;
    line-height: 1.7;
}

.premium-dialog__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-block-start: 25px;
}

.premium-dialog__button {
    min-width: 105px;
    min-height: 45px;
    padding: 10px 18px;
    border: 0;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 800;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.premium-dialog__button:hover {
    transform: translateY(-1px);
}

.premium-dialog__button--cancel {
    color: #536075;
    background: #f0f3f7;
}

.premium-dialog__button--confirm {
    color: #fff;
    background: var(--web-primary, #1494a9);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--web-primary, #1494a9) 28%, transparent);
}

.premium-submit-busy {
    position: relative;
    pointer-events: none;
    opacity: .82;
}

.premium-submit-busy::before {
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-inline-end: 8px;
    vertical-align: -2px;
    content: "";
    border: 2px solid currentColor;
    border-inline-end-color: transparent;
    border-radius: 50%;
    animation: premium-spin .65s linear infinite;
}

@keyframes premium-toast-in {
    from { opacity: 0; transform: translate3d(25px, -8px, 0) scale(.97); }
}
@keyframes premium-toast-out {
    to { opacity: 0; transform: translate3d(20px, 0, 0) scale(.97); }
}
@keyframes premium-progress {
    to { transform: scaleX(0); }
}
@keyframes premium-fade-in {
    from { opacity: 0; }
}
@keyframes premium-dialog-in {
    from { opacity: 0; transform: translateY(14px) scale(.97); }
}
@keyframes premium-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 575.98px) {
    .premium-toast-region {
        inset-inline: 14px;
        width: auto;
    }

    .premium-dialog-layer {
        align-items: end;
        padding: 12px;
    }

    .premium-dialog {
        padding: 23px 20px calc(20px + env(safe-area-inset-bottom));
        border-radius: 22px;
    }

    .premium-dialog__actions {
        flex-direction: column-reverse;
    }

    .premium-dialog__button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .premium-toast,
    .premium-toast.is-leaving,
    .premium-dialog-layer,
    .premium-dialog,
    .premium-toast__progress::after {
        animation-duration: .01ms !important;
    }
}
