/* == Module header (D6). Purpose/Status are hand-written; Module-Map.py --check verifies the rest. ==
   Purpose:   The look of the one shared toast (core-toast.js): Gmail's dark bar, bottom left on a
              wide screen and full width on a phone, dark in both themes.
   Status:    active
   Loaded by: alarm-monitoring.html, bug-report-markup.html, change-password.html, core-toast.js,
              customer-portal.html, customer-welcome.html, dashboard.html, files.html,
              fire-inspections.html, inventory.html, login.html, phone-sign-in.html, and 12 more
              (MODULES.md)
   Replaces:  none
   History:   520, 582, 631, 699
   == end of module header == */
/* LF 520 / BSS 631 (2026-11-01, one shared toast): one dark bar in light and dark mode (a white bar showed in
   dark mode before). The action word is the suite colour lightened for the dark bar: LogicFortress red falls back
   below; Brothers Sound Security sets --brand-fill to its blue, so each suite keeps its own colour. */
@layer app {
    .core-toast {
        --core-toast-bar: #2b2f33;
        --core-toast-ink: #f1f3f4;
        --core-toast-edge: transparent;
        --core-toast-action: color-mix(in srgb, var(--brand-fill, #c41e2b) 45%, #fff);
        position: fixed;
        left: 24px;
        /* LF 582 / BSS 699 (2026-11-03): --core-toast-lift raises the bar above a row pinned to the window's bottom (the
           Proposals builder's Back/Next, proposal-step-fill.js); 0 elsewhere */
        bottom: calc(24px + var(--core-toast-lift, 0px) + env(safe-area-inset-bottom, 0px));
        z-index: 2147483000;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        gap: 4px;
        min-height: 48px;
        max-width: min(560px, calc(100vw - 48px));
        margin: 0;
        padding: 6px 8px 6px 16px; /* the X glyph sits 16 px from the edge, like the text */
        border: 1px solid var(--core-toast-edge);
        border-radius: 8px;
        background: var(--core-toast-bar);
        color: var(--core-toast-ink);
        box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
        font-family: inherit;
        font-size: 14px;
        font-weight: 400;
        line-height: 20px;
        animation: core-toast-in .18s ease-out;
    }
    /* LF 520 / BSS 631: on a dark page the bar is one step lighter than the page and keeps a thin edge, so it still reads as raised. */
    :root.dark .core-toast { --core-toast-bar: #33373c; --core-toast-edge: #474c53; }
    .core-toast.is-error { --core-toast-bar: #8f1320; --core-toast-edge: transparent; }
    .core-toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity .18s ease-in, transform .18s ease-in; }
    .core-toast-text { flex: 1 1 auto; min-width: 0; padding: 8px 12px 8px 0; overflow-wrap: anywhere; }
    .core-toast .core-toast-action {
        flex: none;
        height: 36px;
        min-height: 0;
        margin: 0;
        padding: 0 12px;
        border: 0;
        border-radius: 6px;
        background: transparent;
        color: var(--core-toast-action);
        font-family: inherit;
        font-size: 14px;
        font-weight: 600;
        line-height: 1;
        cursor: pointer;
    }
    .core-toast.is-error .core-toast-action { color: #fff; text-decoration: underline; }
    .core-toast .core-toast-close {
        flex: none;
        display: grid;
        place-items: center;
        width: 36px;
        height: 36px;
        min-width: 0;
        min-height: 0;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: transparent;
        color: #c4c7c5;
        cursor: pointer;
    }
    .core-toast .core-toast-close svg { width: 20px; height: 20px; fill: currentColor; }
    .core-toast :is(.core-toast-action, .core-toast-close):hover { background: rgba(255, 255, 255, .10); }
    .core-toast :is(.core-toast-action, .core-toast-close):focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
    @keyframes core-toast-in { from { opacity: 0; transform: translateY(8px); } }
    /* LF 520 / BSS 631: phone and iPad split, the bar spans the screen above the home bar, like Gmail on a phone. */
    @media (max-width: 600px) {
        .core-toast { left: 8px; right: 8px; bottom: calc(8px + var(--core-toast-lift, 0px) + env(safe-area-inset-bottom, 0px)); max-width: none; }
    }
    @media (prefers-reduced-motion: reduce) {
        .core-toast, .core-toast.is-leaving { animation: none; transition: none; transform: none; }
    }
}
