.toast-container {
    position: fixed;
    top: auto !important;
    bottom: 60px !important;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 99999 !important;
    align-items: center !important;
    pointer-events: none;
}

/* Base card — QuickDent Electric Blue Glass Capsule */
.toast {
    pointer-events: auto;
    width: auto;
    min-width: 220px;
    max-width: min(440px, calc(100vw - 32px));
    background: linear-gradient(135deg, rgba(0, 128, 255, 0.90) 0%, rgba(0, 102, 238, 0.86) 100%);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-radius: 9999px;
    padding: 9px 12px 9px 16px;
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.32);
    box-shadow: 0 14px 34px -4px rgba(0, 128, 255, 0.48), 
                0 4px 12px rgba(0, 0, 0, 0.12), 
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
    position: relative;
    overflow: hidden;
    transform: translateY(28px);
    opacity: 0;
    transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, box-shadow 0.25s ease;
    cursor: default;
}

/* Glowing Pulsing Status LED Indicator */
.toast::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 11px;
    display: inline-block;
    background: #ffffff;
    box-shadow: 0 0 8px #ffffff, 0 0 16px rgba(255, 255, 255, 0.8);
    animation: toastPulse 2.2s infinite ease-in-out;
}

@keyframes toastPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.92;
    }
    50% {
        transform: scale(1.22);
        opacity: 1;
    }
}

/* Show animation — moves upward into position */
.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Hide animation — moves upward then closes */
.toast.hide,
.toast-container.is-bottom-center .toast.hide,
.toast-container[data-position="bottom-center"] .toast.hide,
.patient-auth-body .toast.hide,
.patient-auth-html .toast.hide,
body:has(.figma-canvas) .toast.hide,
body:has(#patientLoginModal:not(.hidden)) .toast.hide {
    opacity: 0 !important;
    transform: translateY(-28px) !important;
    pointer-events: none !important;
    transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.32s ease !important;
}

/* Hide legacy icons and titles if any exist */
.toast-left,
.toast-inner,
.toast-left-icon,
.toast-title {
    display: none !important;
}

/* SUCCESS (QuickDent Primary Blue Glass with crisp white/emerald glow) */
.toast-success {
    background: linear-gradient(135deg, rgba(0, 128, 255, 0.90) 0%, rgba(0, 102, 238, 0.86) 100%);
    border: 1px solid rgba(255, 255, 255, 0.34);
    box-shadow: 0 14px 34px -4px rgba(0, 128, 255, 0.5), 
                0 4px 12px rgba(0, 0, 0, 0.12), 
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.toast-success::before {
    background: #ffffff;
    box-shadow: 0 0 8px #ffffff, 0 0 16px rgba(255, 255, 255, 0.85);
}

/* ERROR (Rose Glass) */
.toast-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.90) 0%, rgba(220, 38, 38, 0.86) 100%);
    border: 1px solid rgba(255, 255, 255, 0.34);
    box-shadow: 0 14px 34px -4px rgba(239, 68, 68, 0.5), 
                0 4px 12px rgba(0, 0, 0, 0.12), 
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.toast-error::before {
    background: #ffffff;
    box-shadow: 0 0 8px #ffffff, 0 0 16px rgba(255, 255, 255, 0.85);
}

/* WARNING (Amber Glass) */
.toast-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.90) 0%, rgba(217, 119, 6, 0.86) 100%);
    border: 1px solid rgba(255, 255, 255, 0.34);
    box-shadow: 0 14px 34px -4px rgba(245, 158, 11, 0.5), 
                0 4px 12px rgba(0, 0, 0, 0.12), 
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.toast-warning::before {
    background: #ffffff;
    box-shadow: 0 0 8px #ffffff, 0 0 16px rgba(255, 255, 255, 0.85);
}

/* INFO (QuickDent Electric Blue Glass) */
.toast-info {
    background: linear-gradient(135deg, rgba(0, 128, 255, 0.90) 0%, rgba(0, 102, 238, 0.86) 100%);
    border: 1px solid rgba(255, 255, 255, 0.34);
    box-shadow: 0 14px 34px -4px rgba(0, 128, 255, 0.5), 
                0 4px 12px rgba(0, 0, 0, 0.12), 
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.toast-info::before {
    background: #ffffff;
    box-shadow: 0 0 8px #ffffff, 0 0 16px rgba(255, 255, 255, 0.85);
}

/* Body & Message */
.toast-body {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}

.toast-message {
    margin: 0;
    font-family: 'Urbanist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.35;
    letter-spacing: 0.015em;
    word-break: break-word;
}

/* Close Button — Circular Glass Target */
.toast-close {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    cursor: pointer;
    outline: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    margin-left: 14px;
    padding: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ffffff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.32);
    color: #ffffff;
    transform: scale(1.08);
}

.toast-close svg,
.toast-close span {
    font-size: 13px;
    width: 12px;
    height: 12px;
    line-height: 1;
    display: block;
}

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 2px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.6);
    animation: progress linear;
}

@keyframes progress {
    from {
        width: calc(100% - 32px);
    }
    to {
        width: 0%;
    }
}

/* Hover Effects */
.toast:hover .toast-progress {
    animation-play-state: paused;
}

.toast:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px -4px rgba(0, 128, 255, 0.6), 
                0 6px 16px rgba(0, 0, 0, 0.16), 
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Bottom-center toast variant */
.toast-container.is-bottom-center,
.toast-container[data-position="bottom-center"],
.patient-auth-body .toast-container,
.patient-auth-html .toast-container,
body:has(.figma-canvas) .toast-container,
body:has(#patientLoginModal:not(.hidden)) .toast-container {
    top: auto !important;
    bottom: 60px !important;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    align-items: center !important;
    z-index: 99999 !important;
}

.toast-container.is-bottom-center .toast,
.toast-container[data-position="bottom-center"] .toast,
.patient-auth-body .toast,
.patient-auth-html .toast,
body:has(.figma-canvas) .toast,
body:has(#patientLoginModal:not(.hidden)) .toast {
    transform: translateY(28px);
}

.toast-container.is-bottom-center .toast.show,
.toast-container[data-position="bottom-center"] .toast.show,
.patient-auth-body .toast.show,
.patient-auth-html .toast.show,
body:has(.figma-canvas) .toast.show,
body:has(#patientLoginModal:not(.hidden)) .toast.show {
    transform: translateY(0);
}

