/* == Module header (D6). Purpose/Status are hand-written; Module-Map.py --check verifies the rest. ==
   Purpose:   (add a one-line purpose)
   Status:    active
   Loaded by: alarm-monitoring.html, bug-report-markup.html, change-password.html,
              customer-portal.html, customer-welcome.html, dashboard.html, files.html,
              fire-inspections.html, inventory.html, login.html, phone-sign-in.html,
              proposal-scope-page.html, and 7 more (MODULES.md)
   Replaces:  none
   History:   284, 323, 520, 631
   == end of module header == */
/* LF 284 / BSS 323 (2026-10-16): one stylesheet for both suites. The accent comes from --bss-primary where the suite
   defines it (Brothers Sound Security blue) and falls back to the LogicFortress red, so each suite keeps its colour. */
@layer app {
    .themed-dialog-next {
        --dialog-accent: var(--bss-primary, #c31d2b);
        --dialog-focus: var(--bss-secondary, #c31d2b);
        width: min(440px, calc(100vw - 32px));
        max-height: calc(100dvh - 32px);
        box-sizing: border-box;
        padding: 20px;
        overflow: hidden auto;
        border: 0; /* LF 520 / BSS 631 (2026-11-01, one popup look): no side border, like the Engagements popups */
        border-top: 3px solid var(--dialog-accent);
        border-radius: 14px;
        background: var(--panel31, var(--panel, #fff));
        color: var(--ink31, var(--ink, #242424));
        box-shadow: 0 12px 40px #0004;
    }

    /* LF 284 / BSS 323 (2026-10-16): shared popup rule (same text in both suites). */
    .themed-dialog-next:focus {
        outline: none;
    }

    /* LF 284 / BSS 323 (2026-10-16): shared popup rule (same text in both suites). */
    .themed-dialog-next::backdrop {
        background: #0007;
    }

    /* LF 284 / BSS 323 (2026-10-16): shared popup rule (same text in both suites). */
    .dark .themed-dialog-next {
        background: var(--panel31, var(--panel, #202225));
        color: var(--ink31, var(--ink, #f4f4f4));
        border-top-color: var(--dialog-accent); /* LF 520 / BSS 631: no side border in dark mode either */
    }

    /* LF 284 / BSS 323 (2026-10-16): the title leaves room for the corner × so a long title never runs under it. */
    .themed-dialog-next h2 {
        margin: 0 44px 12px 0; /* LF 520 / BSS 631: title to text 12 px */
        font-size: 22px;
        font-weight: 500;
        overflow-wrap: anywhere;
    }

    /* LF 284 / BSS 323 (2026-10-16): shared popup rule (same text in both suites). */
    .themed-dialog-next p {
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        line-height: 1.5;
        margin: 0 0 20px; /* LF 520 / BSS 631: the same 20 px as the edges */
        text-box: trim-end text alphabetic; /* measured from the letters, not the line box */
    }

    /* LF 284 / BSS 323 (2026-10-16): shared popup rule (same text in both suites). */
    .themed-dialog-next.no-actions p {
        margin-bottom: 4px;
    }

    /* LF 284 / BSS 323 (2026-10-16): shared popup rule (same text in both suites). */
    .themed-dialog-next p[hidden] {
        display: none;
    }

    /* LF 284 / BSS 323 (2026-10-16): shared popup rule (same text in both suites). */
    .themed-dialog-next p[role=alert] {
        color: var(--danger, #ba3333);
    }

    /* LF 284 / BSS 323 (2026-10-16): shared popup rule (same text in both suites). */
    .themed-dialog-next>.dialog-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-end;
    }

    /* LF 284 / BSS 323 (2026-10-16): shared popup rule (same text in both suites). */
    .themed-dialog-next button {
        font: inherit;
        min-height: 42px;
        max-width: 100%;
        border: 1px solid var(--line31, var(--line, #bbb));
        border-radius: 8px;
        padding: 10px 18px;
        background: transparent;
        color: inherit;
        cursor: pointer;
    }

    /* LF 284 / BSS 323 (2026-10-16): shared popup rule (same text in both suites). */
    .themed-dialog-next .primary {
        background: var(--dialog-accent);
        border-color: var(--dialog-accent);
        color: #fff;
    }

    /* LF 284 / BSS 323 (2026-10-16): the same corner × as every other popup (36 px, top right, no border). */
    .themed-dialog-next>.dialog-close {
        position: absolute;
        top: 14px;
        right: 14px;
        width: 36px;
        height: 36px;
        min-height: 0;
        padding: 0;
        display: grid;
        place-items: center;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: inherit;
        opacity: .7;
        font-size: 22px;
        line-height: 1;
    }

    /* LF 284 / BSS 323 (2026-10-16): shared popup rule (same text in both suites). */
    .themed-dialog-next>.dialog-close:hover {
        opacity: 1;
        background: var(--u-hover, #8882);
    }

    /* LF 284 / BSS 323 (2026-10-16): shared popup rule (same text in both suites). */
    .themed-dialog-next button:focus-visible {
        outline: 3px solid var(--dialog-focus);
        outline-offset: -3px;
    }

    /* LF 284 / BSS 323 (2026-10-16): shared popup rule (same text in both suites). */
    .themed-dialog-next button:disabled {
        opacity: .6;
        cursor: wait;
    }

    /* LF 284 / BSS 323 (2026-10-16): shared popup rule (same text in both suites). */
    .field-error-note {
        display: block;
        color: var(--danger, #ba3333);
        margin: 4px 0 8px;
    }
}
