/* Top-right timed toast notifications (site flash + system notices) */
/* Sit below sticky header/topbar so nav actions stay clickable */

.aw-toasts {
    position: fixed;
    top: var(--aw-toast-offset, 4.75rem);
    right: 1rem;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.65rem;
    width: min(22.5rem, calc(100vw - 2rem));
    max-height: calc(100vh - var(--aw-toast-offset, 4.75rem) - 1rem);
    overflow: visible;
    pointer-events: none;
}

.aw-toast {
    width: 100%;
    pointer-events: auto;
    background: linear-gradient(180deg, rgba(46, 56, 74, 0.98) 0%, rgba(28, 34, 48, 0.96) 100%);
    border: 1px solid rgba(201, 162, 39, 0.35);
    border-radius: 0.75rem;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 12px 32px rgba(0, 0, 0, 0.4);
    animation: aw-toast-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.aw-toast.is-leaving {
    animation: aw-toast-out 0.2s ease forwards;
}

.aw-toast-inner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
}

.aw-toast-icon {
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    margin-top: 0.05rem;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
}

.aw-toast-icon::before {
    content: "i";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #dbeafe;
}

.aw-toast-success {
    border-color: rgba(74, 222, 128, 0.4);
    background: linear-gradient(180deg, rgba(28, 58, 42, 0.98) 0%, rgba(18, 36, 28, 0.96) 100%);
}

.aw-toast-success .aw-toast-icon::before {
    content: "✓";
    color: #bbf7d0;
}

.aw-toast-warning {
    border-color: rgba(251, 191, 36, 0.45);
    background: linear-gradient(180deg, rgba(74, 58, 28, 0.98) 0%, rgba(42, 32, 18, 0.96) 100%);
}

.aw-toast-warning .aw-toast-icon::before {
    content: "!";
    color: #fde68a;
}

.aw-toast-error {
    border-color: rgba(248, 113, 113, 0.45);
    background: linear-gradient(180deg, rgba(74, 28, 28, 0.98) 0%, rgba(42, 18, 18, 0.96) 100%);
}

.aw-toast-error .aw-toast-icon::before {
    content: "×";
    color: #fecaca;
    font-size: 1.05rem;
}

.aw-toast-body {
    flex: 1 1 auto;
    min-width: 0;
}

.aw-toast-message {
    margin: 0;
    color: rgba(248, 250, 252, 0.96);
    font-size: 0.92rem;
    line-height: 1.45;
}

.aw-toast-action {
    display: inline-block;
    margin-top: 0.35rem;
    color: #f5e6a3;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
}

.aw-toast-action:hover {
    color: #fff;
    text-decoration: underline;
}

.aw-toast-close {
    flex: 0 0 auto;
    width: 1.7rem;
    height: 1.7rem;
    border: 0;
    border-radius: 0.4rem;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(248, 250, 252, 0.75);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.aw-toast-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

@keyframes aw-toast-in {
    from {
        opacity: 0;
        transform: translateX(0.75rem);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes aw-toast-out {
    to {
        opacity: 0;
        transform: translateX(0.6rem);
    }
}

@media (max-width: 520px) {
    .aw-toasts {
        top: var(--aw-toast-offset, 5.75rem);
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
        align-items: stretch;
        max-height: calc(100vh - var(--aw-toast-offset, 5.75rem) - 0.75rem);
    }
}
