
.notifications-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--ui-z-toast, 10000);
    pointer-events: none;
    width: 100%;
}

.notification {
    width: 100%;
    padding: 0.75rem 1.25rem;
    box-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.3);
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: auto;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 3.75rem;
    font-weight: 500;
    font-size: 1rem;
    /* Плашка прижата к top: 0, поэтому весь верхний «хром» — системные зоны
       Telegram, нативной оболочки и полоса #ios-chrome-top — компенсируется
       отступом, иначе текст уезжает под статус-бар.
       Фолбэки обязательны: вне Telegram переменные --tg-* не объявлены,
       и calc() без них становится невалидным, роняя всё правило. */
    --notification-top-inset: 0px;
    padding-top: calc(
        var(--tg-safe-area-inset-top, 0px) +
        var(--tg-content-safe-area-inset-top, 0px) +
        var(--notification-top-inset) +
        0.75rem
    ) !important;
}

/* Полоса #ios-chrome-top существует только в мобильном браузере на iOS —
   компенсируем её ровно там же, иначе на Android появится лишний отступ. */
body.has-web-top-bar.ios-mobile-web:not(.web-desktop) .notification {
    --notification-top-inset: calc(var(--app-top-chrome-height, 0.75rem) + env(safe-area-inset-top, 0px));
}

/* Нативная оболочка не отдаёт ни --tg-*, ни env(safe-area-*): статус-бар
   компенсируется только вручную. */
body.native-app:not(.web-desktop) .notification {
    --notification-top-inset: var(--native-inset-top);
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.notification.hide {
    transform: translateY(0);
    opacity: 0;
    transition: opacity 0.25s ease-out;
}

.notification-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

.notification-icon.success {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.notification-icon.error {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.notification-icon.warning {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.notification-icon.info {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
}

.notification-title {
    display: none;
}

.notification-message {
    margin: 0;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-line;
}

.notification-close {
    display: none;
}

.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 0.1875rem;
    background: rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.notification-progress-bar {
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    transition: width 0.05s ease-out;
    width: 100%;
}

.notification-progress-bar.animate {
    animation: notificationProgress linear;
}

@keyframes notificationProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

.notification.success {
    background-color: var(--ui-color-success, #3D9966);
}

.notification.error {
    background-color: var(--ui-color-danger, #DC4E41);
}

.notification.warning {
    background-color: var(--ui-color-warning, #f59e0b);
}

.notification.info {
    background-color: var(--ui-color-info, #3b82f6);
}

@media (max-width: 600px) {
    .notification {
        padding: 0.875rem 1rem;
        min-height: 3.5rem;
        font-size: 0.9375rem;

    }

    .notification-icon {
        width: 1.125rem;
        height: 1.125rem;
        font-size: 0.6875rem;
        margin-right: 0.375rem;
    }

}

@media (min-width: 600px) {
    .notification {
        max-width: 37.5rem;
        left: 0;
        right: 0;
        margin: 0 auto;
        border-radius: 1.25rem;
    }
}

body.web-desktop .notification {
    top: 0.625rem;
    padding: 0 1.25rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.web-desktop .notification-progress {
    display: none;
}

.notification.important {
    animation: pulseShadow 2s infinite;
}

@keyframes pulseShadow {
    0% {
        box-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0.25rem 1.25rem rgba(239, 68, 68, 0.3);
    }
    100% {
        box-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.3);
    }
}
