/* ------------------------------------------------------------------------------------------------
   DWToast — reusable toast notifications (paired with js/toast.js).
   Framework-free; theme-aware via the console CSS custom properties (with hard fallbacks so it also
   works outside .cms-theme). Toasts stack in a fixed region, top-right.
   ------------------------------------------------------------------------------------------------ */
.dw-toast-region {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(360px, calc(100vw - 40px));
    pointer-events: none; /* let clicks through the gaps; individual toasts re-enable it */
}

.dw-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    border-left: 4px solid var(--theme-text-muted, #64748b);
    background: var(--theme-surface, #ffffff);
    color: var(--theme-text-body, #24405c);
    box-shadow: 0 8px 24px rgba(5, 47, 88, 0.18);
    font-family: var(--font-family-base, inherit);
    font-size: var(--font-body-sm-size, 14px);
    line-height: 1.45;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.dw-toast.is-visible { opacity: 1; transform: translateY(0); }
.dw-toast.is-leaving { opacity: 0; transform: translateY(8px); }

.dw-toast--success { border-left-color: var(--theme-success, #0a7d34); }
.dw-toast--error   { border-left-color: var(--theme-error, #dc3545); }
.dw-toast--info    { border-left-color: var(--theme-accent, #0891b2); }

.dw-toast-body { flex: 1 1 auto; word-break: break-word; }

.dw-toast-close {
    flex: 0 0 auto;
    margin: -2px -4px 0 0;
    padding: 2px 4px;
    border: 0;
    background: none;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.55;
}
.dw-toast-close:hover { opacity: 1; }

@media (max-width: 520px) {
    .dw-toast-region { bottom: 10px; right: 10px; left: 10px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .dw-toast { transition: opacity 0.2s ease; transform: none; }
    .dw-toast.is-visible, .dw-toast.is-leaving { transform: none; }
}
