/* Shared approved message-only toast, independent of the surrounding page design. */
#toast-container {
    max-width: calc(100% - 2rem);
    position: fixed;
    top: max(1rem, env(safe-area-inset-top));
    right: max(1rem, env(safe-area-inset-right));
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 380px;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    pointer-events: none;
}
#toast-container .toast {
    display: none;
    flex: none;
    margin: 0;
    box-shadow: 0 9px 32px #172d6020;
    --toast-accent: #487ac4;
    --toast-tint: #eff5ff;
    --toast-edge: #dce7f6;
    width: 380px;
    min-width: 0;
    max-width: 100%;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow: auto;
    border: 1px solid var(--toast-edge);
    border-left: 3px solid var(--toast-accent);
    border-radius: 11px;
    background: white;
    pointer-events: auto;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}
#toast-container .toast:has(.toast-header-success) { --toast-accent: #43947b; --toast-tint: #eaf7f0; --toast-edge: #dcebe4; }
#toast-container .toast:has(.toast-header-warning) { --toast-accent: #ba8b3e; --toast-tint: #fff6e7; --toast-edge: #eee4d3; }
#toast-container .toast:has(.toast-header-error) { --toast-accent: #d0636e; --toast-tint: #fff0f2; --toast-edge: #efdee2; }
#toast-container .toast-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 8px 13px 14px; border: 0; border-radius: 0; background: white; }
#toast-container .toast-header > div { position: relative; display: grid; flex: 1; align-items: center; min-width: 0; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; min-height: 32px; }
#toast-container .toast-header > div::before { content: ""; position: absolute; left: 0; top: calc(50% - 16px); width: 32px; height: 32px; border-radius: 9px; background: var(--toast-tint); }
#toast-container .toast-icon { position: relative; justify-self: center; width: 19px; height: 19px; margin: 0 !important; color: var(--toast-accent); }
#toast-container .toast-title { display: block; min-width: 0; overflow-wrap: anywhere; color: #3c5271; font-size: 12px; font-weight: 400; line-height: 1.6; white-space: pre-line; }
#toast-container .toast-close { flex-shrink: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; width: 44px; height: 44px; margin: 0 !important; padding: 0; border-radius: 7px; color: #8a9bb1; opacity: 1; }
#toast-container .toast-close:hover { background: #f1f5fa; color: #4d678b; }
#toast-container .toast-close i { width: 15px; height: 15px; }
#toast-container .toast-close:focus-visible { outline: 3px solid #86aff5; outline-offset: -3px; }


#toast-container .new-toast { opacity: 0; translate: calc(100% + 1rem) 0; transition: opacity .4s ease, translate .4s ease; }
#toast-container .toast-visible { opacity: 1; translate: 0 0; }
@media (prefers-reduced-motion: reduce) {
    #toast-container .new-toast { transition: none; animation: none; }
}
