/* One notification surface for the PHP app and the standalone designer. */
.sg-toaster {
    --toast-ink: var(--d-ink, #3b586d);
    --toast-muted: var(--d-ink-2, #607787);
    --toast-line: var(--d-line, #e5ebef);
    position: fixed;
    z-index: 200000;
    right: max(24px, env(safe-area-inset-right));
    bottom: max(24px, env(safe-area-inset-bottom));
    width: min(376px, calc(100vw - 48px));
    color: var(--toast-ink);
    font: 400 13px/1.5 var(--sg-font, Inter, system-ui, sans-serif);
    text-align: left;
    isolation: isolate;
}
.sg-toaster[hidden], .sg-toaster [hidden] { display: none !important; }
.sg-toaster *, .sg-toaster *::before, .sg-toaster *::after { box-sizing: border-box; }
.sg-toast-list {
    position: relative;
    height: var(--toast-front-height, 76px);
    padding: 0;
    margin: 0;
    list-style: none;
}
.sg-toast {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 24px;
    gap: 12px;
    align-items: start;
    padding: 16px;
    margin: 0;
    color: var(--toast-ink);
    background: #fff;
    border: 1px solid var(--toast-line);
    border-radius: 14px;
    box-shadow: 0 6px 24px -8px rgba(39, 62, 78, .18), 0 2px 5px rgba(39, 62, 78, .04);
    transform: translateY(calc(var(--toast-index) * -10px)) scale(calc(1 - var(--toast-index) * .04));
    transform-origin: center top;
    transition: transform 180ms ease, opacity 180ms ease;
    animation: sg-toast-enter 200ms ease both;
}
.sg-toast[aria-hidden="true"] { height: var(--toast-front-height); pointer-events: none; }
.sg-toast[aria-hidden="true"] > * { visibility: hidden; }
.sg-toast-icon { display: flex; padding-top: 1px; color: var(--d-blue, #3e65b8); }
.sg-toast--success .sg-toast-icon { color: #287052; }
.sg-toast--error .sg-toast-icon { color: var(--d-rose-ink, #b52448); }
.sg-toast--warning .sg-toast-icon { color: #9a671e; }
.sg-toast-icon svg, .sg-toast-close svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sg-toast-content { min-width: 0; overflow-wrap: anywhere; }
.sg-toast-title { display: block; margin: 0; color: var(--toast-ink); font: 600 13px/1.5 var(--sg-font, Inter, system-ui, sans-serif); }
.sg-toast-message { margin: 0; font: inherit; white-space: pre-line; color: var(--toast-ink); }
.sg-toast-title + .sg-toast-message { margin-top: 3px; color: var(--toast-muted); }
.sg-toaster button {
    appearance: none;
    min-height: 0;
    margin: 0;
    font: inherit;
    text-transform: none;
    cursor: pointer;
    box-shadow: none;
}
.sg-toaster .sg-toast-close {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin: -3px -5px -3px -1px;
    padding: 5px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--toast-muted);
}
.sg-toast-close svg { width: 16px; height: 16px; }
.sg-toaster .sg-toast-close:hover { background: var(--d-mist, #f5f8fa); color: var(--toast-ink); }
.sg-toaster button:focus-visible { outline: 2px solid var(--d-blue, #3e65b8); outline-offset: 3px; }
.sg-toaster .sg-toast-action {
    margin-top: 10px;
    padding: 5px 10px;
    border: 1px solid var(--toast-line);
    border-radius: 7px;
    color: var(--toast-ink);
    background: var(--d-mist, #f5f8fa);
    font-weight: 600;
}
.sg-toaster .sg-toaster-summary {
    display: block;
    position: relative;
    z-index: 1;
    margin: 0 0 32px auto;
    padding: 4px 9px;
    color: var(--toast-muted);
    background: #fff;
    border: 1px solid var(--toast-line);
    border-radius: 7px;
    font-size: 11px;
    line-height: 1.5;
}
.sg-toaster.is-expanded .sg-toaster-summary { margin-bottom: 8px; }
.sg-toaster.is-expanded .sg-toast-list {
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    height: auto;
    max-height: min(560px, calc(100dvh - 110px));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 4px;
    margin: -4px;
}
.sg-toaster.is-expanded .sg-toast { position: relative; flex: 0 0 auto; transform: none; }
.sg-toast--loading .sg-toast-icon svg { animation: sg-toast-spin 1s linear infinite; }
.sg-toast-announcements { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@keyframes sg-toast-enter { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
@keyframes sg-toast-spin { to { transform: rotate(360deg); } }
@media (max-width: 767.98px) {
    .sg-toaster { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); width: calc(100vw - 24px); }
    .sg-toast { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .sg-toaster .sg-toast, .sg-toast--loading .sg-toast-icon svg { animation: none; transition: none; }
}
