.flash-stack {
    position: fixed;
    top: calc(var(--header-height) + 12px);
    right: var(--page-gutter);
    z-index: 100;
    display: grid;
    width: min(420px, calc(100vw - 2 * var(--page-gutter)));
    gap: 8px;
    pointer-events: none;
}

.flash-message {
    display: flex;
    min-height: 48px;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
    color: var(--color-heading);
    box-shadow: var(--shadow-md);
    pointer-events: auto;
    animation: flash-in 180ms ease-out both;
}

.flash-message--success {
    border-left: 3px solid #28885f;
}

.flash-message--error {
    border-left: 3px solid #bb4d4d;
}

.flash-message__icon {
    flex: 0 0 19px;
    color: #28885f;
}

.flash-message--error .flash-message__icon {
    color: #bb4d4d;
}

.flash-message__icon svg,
.flash-message__close svg {
    width: 19px;
    height: 19px;
}

.flash-message__text {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
}

.flash-message__close {
    display: grid;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
}

.flash-message__close:hover {
    background: var(--color-surface-soft);
    color: var(--color-heading);
}

@keyframes flash-in {
    from { opacity: 0; transform: translateY(-7px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 560px) {
    .flash-stack {
        left: var(--page-gutter);
        right: var(--page-gutter);
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .flash-message { animation: none; }
}
