/* =============================================================
   Dvelopin Cloud — Custom Styles
   Built on Bootstrap 5.3.8 (no SB Admin)
   ============================================================= */

/* Source Sans 3 and Source Serif 4 (SIL OFL, web/fonts/OFL-*.txt): brand v2 type, the same self-hosted
   files www.dvelopin.com loads, with its unicode-range. The system emails keep their own -email subsets. */
@font-face {
    font-family: 'Source Sans 3';
    src: url('../fonts/source-sans-3.woff2') format('woff2');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Source Serif 4';
    src: url('../fonts/source-serif-4.woff2') format('woff2');
    font-weight: 600 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* -------------------------------------------------------------
   1. CSS Custom Properties
   ------------------------------------------------------------- */
:root {
    --bs-primary: #1E5A82;
    --bs-primary-rgb: 30, 90, 130;
    --dv-navy: #0F2E44;
    --dv-ink: var(--dv-navy);                           /* navy text and fills on white: header title, avatar, primary hover, focus ring (theme.php darkens it for a light navy) */
    --dv-teal: #1E5A82;
    --dv-dark-accent: #18303e;
    --dv-sidebar-width: 60px;
    --dv-navbar-height: 60px;
    --dv-side-fg: #A3B4C1;            /* sidebar and drawer labels on Steel Deep */
    --dv-page-bg: #FAF7F2;
    --bs-border-color: #D9D3CA;
    --dv-control-border: #8C8579;     /* button and field edges (portal 2a) */
    --bs-secondary-color: #5C6670;
    --bs-body-color: #2B3440;
    /* Brand v2 type (BRAND.md): Source Sans 3 text, Source Serif 4 headings. */
    --bs-font-sans-serif: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    /* Status colors (BRAND.md "Status colors"): status pills, check icons and status text only. */
    --bs-success-text-emphasis: #146C43;
    --bs-success-bg-subtle: #E3F4EA;
    --bs-warning-text-emphasis: #8A4B00;
    --bs-warning-bg-subtle: #FFF1D6;
    --bs-danger-text-emphasis: #A1251B;
    --bs-danger-bg-subtle: #FBE8E6;
    --bs-success: #146C43;
    --bs-success-rgb: 20, 108, 67;
    --bs-danger: #A1251B;
    --bs-danger-rgb: 161, 37, 27;
    --bs-form-valid-color: #146C43;
    --bs-form-valid-border-color: #146C43;
    --bs-form-invalid-color: #A1251B;
    --bs-form-invalid-border-color: #A1251B;
    /* Theme hooks (G10). Each defaults to exactly the value the rule below used before, so an un-themed page
       computes the same styles; theme.php sets readable values for a tenant that brings its own colors. */
    --dv-rail-bg: var(--dv-navy);                     /* sidebar and mobile menu background */
    --dv-rail-text: #fff;                               /* hovered and active labels, expanded Back label, active bar, focus ring */
    --dv-rail-text-muted: var(--dv-side-fg);            /* inactive labels, Expand/Collapse, locked label on hover */
    --dv-rail-label: #E3EEF6;                           /* the label under the sidebar logo */
    --dv-rail-text-locked: rgba(255,255,255,0.55);      /* locked (not in plan) label */
    --dv-rail-back: rgba(255,255,255,0.6);              /* sidebar Back arrow */
    --dv-rail-active-bg: var(--dv-teal);                /* active rail item */
    --dv-drawer-text: var(--dv-side-fg);                /* mobile menu labels */
    --dv-drawer-text-locked: rgba(255,255,255,0.55);          /* mobile menu locked label */
    --dv-drawer-heading: rgba(255,255,255,0.5);         /* mobile menu "Admin" heading */
    --dv-drawer-back: rgba(255,255,255,0.6);            /* mobile menu Back */
    --dv-drawer-active-bg: var(--dv-teal);              /* active mobile menu item */
    --dv-muted-text: #5C6670;                           /* gray labels the chassis sets on the page background */
    --dv-auth-footer-bg: #FAF7F2;                       /* sign-in card footer */
    --dv-hover-tint: color-mix(in srgb, var(--bs-primary) 12%, #fff); /* menu-row and outline-button hover (portal 2a) */
    /* Dark mode P4b (2026-11-03): new tokens; their dark values are in the [data-bs-theme="dark"] block below. */
    --dv-surface: #fff;
    --dv-surface-2: #FAF7F2;
    --dv-heading: #0F2E44;
    --dv-title: var(--dv-ink);
    --dv-link: var(--bs-primary);
    --dv-link-hover: color-mix(in srgb, var(--bs-primary) 76%, black);
    --dv-accent-fg: var(--dv-teal);
    --dv-neutral-bg: #EFEBE4;
    --dv-info-bg: #E3EEF6;
    --dv-info-accent: #1E5A82;
    --dv-copper-fg: #AD5A2C;
    --dv-veil: rgba(255, 255, 255, 0.85);
    --dv-ink-fill: var(--dv-ink);
}

/* Dark mode (P4b, 2026-11-03). Bootstrap 5.3.8 keys dark only on [data-bs-theme="dark"]; color-mode.js sets it.
   Slate hex converted from the bs6 oklch values; tenant-derived tokens use relative color syntax. */
[data-bs-theme="dark"] {
    --dv-page-bg: #1A1F24;
    --bs-body-bg: #22282F;
    --bs-body-bg-rgb: 34, 40, 47;
    --bs-tertiary-bg: #2A3138;
    --bs-secondary-bg: #2F363D;
    --dv-auth-footer-bg: #2A3138;
    --bs-border-color: #394149;
    --dv-control-border: #7A838C;
    --bs-body-color: #E8EBEF;
    --bs-secondary-color: #A7AFB8;
    --dv-muted-text: #A7AFB8;
    --bs-emphasis-color: #F3F5F8;
    --dv-hover-tint: color-mix(in oklch, var(--bs-primary) 18%, #22282F);
    --dv-rail-bg: #0F2E44;
    --bs-success-text-emphasis: #00C07E;
    --bs-success-bg-subtle: #002414;
    --bs-warning-text-emphasis: #FFDB84;
    --bs-warning-bg-subtle: #403000;
    --bs-danger-text-emphasis: #F47A80;
    --bs-danger-bg-subtle: #360309;
    --bs-form-valid-color: #00C07E;
    --bs-form-valid-border-color: #00C07E;
    --bs-form-invalid-color: #F47A80;
    --bs-form-invalid-border-color: #F47A80;
    --dv-surface: #22282F;
    --dv-surface-2: #2A3138;
    --dv-heading: #F3F5F8;
    --dv-title: #F3F5F8;
    --dv-link: oklch(from var(--bs-primary) max(l, 0.78) min(c, 0.14) h);
    --dv-link-hover: oklch(from var(--bs-primary) max(l, 0.86) min(c, 0.1) h);
    --dv-accent-fg: oklch(from var(--dv-teal) max(l, 0.78) min(c, 0.14) h);
    --dv-neutral-bg: #394149;
    --dv-info-bg: #233849;
    --dv-info-accent: #7DB4E4;
    --dv-copper-fg: #E3966A;
    --dv-veil: rgba(26, 31, 36, 0.85);
    --dv-ink: var(--dv-title);
    --dv-ink-fill: #2B6F9E;
}

/* The header grows to 64px once the title shows (lg and up). */
@media (min-width: 992px) {
    :root {
        --dv-navbar-height: 64px;
    }
}

/* -------------------------------------------------------------
   2. Global
   ------------------------------------------------------------- */
html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--dv-page-bg);
    font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.925rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--bs-body-color);
    overflow-x: hidden;
}

a { color: var(--dv-link); }
a:hover { color: var(--dv-link-hover); }

h1, h2, h3, h4, h5, h6 {
    font-family: "Source Serif 4", Georgia, serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--dv-heading);
}

/* -------------------------------------------------------------
   3. Top Navbar
   ------------------------------------------------------------- */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    height: var(--dv-navbar-height);
    background-color: var(--dv-surface);
    border-bottom: 1px solid var(--bs-border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px 0 16px;
}

@media (min-width: 992px) {
    .top-navbar {
        left: var(--dv-sidebar-width);
        padding: 0 32px;
        transition: left 0.2s ease;
    }
}

.top-navbar .navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    min-width: 0;
}

.top-navbar .navbar-brand img {
    height: 29px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}

/* The page title in the header row: hidden on phones (the page header bar carries
   it there), shown from lg, where the page header bar hides. */
.top-navbar-title {
    display: none;
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--dv-ink);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 992px) {
    .top-navbar-title {
        display: block;
    }
}

.top-navbar-title[hidden] {
    display: none !important; /* js.js hides it on an AJAX page with no title */
}

/* Navbar right section (Menu button + avatar dropdown) */
.navbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    align-self: stretch;
}

.top-navbar .navbar-right > .dropdown {
    display: flex;
    align-items: center;
    align-self: stretch;
}

/* Menu button (drawer toggle, mobile only: d-lg-none hides it from 992px) */
.menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--dv-control-border);
    border-radius: 6px;
    background: var(--dv-surface);
    color: var(--dv-title);
    font-weight: 700;
    font-size: 0.9375rem;
    cursor: pointer;
}

.menu-btn:hover {
    background-color: var(--dv-hover-tint);
}

/* Avatar toggle button */
.avatar-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    align-self: stretch;
}

/* Avatar circle */
.avatar-circle-small {
    width: 44px;
    height: 44px;
    background-color: var(--dv-ink-fill);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    flex-shrink: 0;
}

@media (min-width: 992px) {
    .avatar-circle-small {
        width: 38px;
        height: 38px;
    }
}

/* Remove dropdown caret */
.top-navbar .dropdown-toggle::after {
    display: none;
}

/* User dropdown: hangs from the header rule, so square top corners */
.top-navbar .dropdown-menu {
    width: 260px;
    padding: 6px;
    background-color: var(--dv-surface);
    border: 1px solid var(--bs-border-color);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 16px -10px rgba(15, 46, 68, 0.24);
}

/* User dropdown header */
.dropdown-header-user {
    padding: 10px 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--bs-border-color);
    color: var(--bs-body-color);
    font-size: 1rem;
}

.dropdown-header-user strong {
    display: block;
    font-weight: 700;
    color: var(--dv-title);
}

.dropdown-header-user span {
    display: block;
    font-size: 0.875rem;
    color: var(--dv-muted-text);
    overflow-wrap: anywhere;
}

.top-navbar .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    color: var(--bs-body-color);
}

.top-navbar .dropdown-item:hover {
    background-color: var(--dv-hover-tint);
    color: var(--dv-title);
}

/* -------------------------------------------------------------
   4. Sidebar (desktop ≥992px only)
   ------------------------------------------------------------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--dv-sidebar-width);
    background-color: var(--dv-rail-bg);
    z-index: 1020;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.2s ease;
    padding: 22px 0 16px;
}

/* Brand at the top of the rail: the icon on the 60px rail, the full lockup and
   the subtitle label once the sidebar is expanded. */
.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 0 8px 22px;
    flex-shrink: 0;
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    border-radius: 6px;
}

.sidebar-brand-logo {
    display: none;
    height: auto;
    width: 132px;
    max-width: 100%;
}

.sidebar-brand-icon {
    display: block;
    width: 36px;
    height: 36px;
    object-fit: contain;
}

/* A tenant logo, which has no icon, in the icon rail */
.sidebar-brand-link:has(.sidebar-brand-logo:only-child) .sidebar-brand-logo {
    display: block;
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.sidebar-brand-label {
    display: none;
    color: var(--dv-rail-label);
    font-weight: 700;
    font-size: 0.9375rem;
    padding: 0 0 8px;
    align-self: stretch;
}

/* Nav icons wrapper — enables drill-down sliding */
.sidebar-nav-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Each nav level (for drill-down animation) */
.sidebar-nav-level {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    padding: 0 8px;
    gap: 2px;
    transition: transform 0.2s ease;
    /* On a short window the rows compress first (flex-shrink, down to about
       their icon or label height), as they always have, so every item stays
       visible. Only past that, on a very short window, does the level scroll:
       by wheel, trackpad or keyboard focus, with the bar hidden, since a
       scrollbar in a 60px column crowds the icons. */
    overflow-y: auto;
    scrollbar-width: none;
}

.sidebar-nav-level::-webkit-scrollbar {
    display: none;
}

.sidebar-nav-level.active {
    transform: translateX(0);
}

.sidebar-nav-level.slide-out-left {
    transform: translateX(-100%);
}

.sidebar-nav-level.slide-in-right {
    transform: translateX(100%);
}

/* Individual sidebar nav items (links and buttons) */
.sidebar-nav-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    width: 100%;
    height: 44px;
    padding: 0 10px; /* the 24px icon, centered, in the 60px sidebar; the icon stays put when it widens */
    color: var(--dv-rail-text-muted);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    transition: color 0.15s, background-color 0.15s;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
}

.sidebar-nav-item:hover {
    color: var(--dv-rail-text);
    background-color: color-mix(in srgb, var(--dv-rail-active-bg) 45%, transparent);
}

.sidebar-nav-item.active {
    color: var(--dv-rail-text);
    background-color: var(--dv-rail-active-bg);
}

.sidebar-nav-item i,
.sidebar-back i {
    font-size: 1.1rem;
    width: 24px;
    flex-shrink: 0;
    text-align: center;
}

/* Back arrow in drill-down */
.sidebar-back {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    width: 100%;
    height: 44px;
    padding: 0 10px;
    color: var(--dv-rail-back);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 0.25rem;
    border-radius: 6px;
    font-size: 1rem;
}

.sidebar-back:hover {
    color: var(--dv-rail-text);
    background-color: rgba(255,255,255,0.08);
}

/* Divider between sections */
.sidebar-divider {
    height: 1px;
    background: color-mix(in srgb, var(--dv-rail-bg), white 14%);
    margin: 10px 4px;
}

/* Gear icon pinned to bottom — height matches footer */
.sidebar-bottom {
    flex-shrink: 0;
    border-top: 1px solid color-mix(in srgb, var(--dv-rail-bg), white 14%);
    margin: 10px 8px 0;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Keyboard focus: the global Steel Deep ring (section 10) is invisible on the Steel Deep
   sidebar, so draw the surface's ring (--dv-focus-ring: Sky, or the rail text on a light rail) inside the item. */
.sidebar-nav-item:focus-visible,
.sidebar-back:focus-visible {
    outline-color: var(--dv-focus-ring) !important;
    outline-offset: -3px;
}

/* Labels. Icon-only sidebar: visually hidden, but still each item's accessible
   name. Expanded sidebar (body.sidebar-expanded, set by head.php from the
   user's preference, flipped by the toggle in js.js): shown beside the icon. */
.sidebar-label,
.sidebar-back-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* Two classes: Font Awesome's .fas { display: inline-block } loads after this
   file and would win a one-class tie. */
.sidebar-nav-item .sidebar-chevron {
    display: none;
}

/* Toggle ("Let me switch"): the arrows point right to expand, left to collapse */
.sidebar-toggle i {
    transition: transform 0.2s ease;
}

/* Expanded applies from 1200px. Below that (992-1199px, tablets and small
   windows) 220px of labels squeezes tables until their actions scroll out of
   view, so the sidebar stays icon-only there whatever the preference, and the
   toggle hides. Measured 2026-09-29 on /admin/users at 1024px. */
@media (max-width: 1199.98px) {
    .sidebar-toggle {
        display: none !important;
    }
}

@media (min-width: 1200px) {
    .sidebar-expanded {
        --dv-sidebar-width: 240px;
    }

    .sidebar-expanded .sidebar-brand {
        align-items: flex-start;
        padding: 0 24px 22px;
    }

    .sidebar-expanded .sidebar-brand-logo {
        display: block;
    }

    .sidebar-expanded .sidebar-brand-icon {
        display: none;
    }

    .sidebar-expanded .sidebar-brand-link:has(.sidebar-brand-logo:only-child) .sidebar-brand-logo {
        width: 132px;
        height: auto;
        max-height: 48px;
    }

    /* A tenant logo beside its dark icon (the stock lockup carries width/height attributes) */
    .sidebar-expanded .sidebar-brand-link:has(.sidebar-brand-icon) .sidebar-brand-logo:not([width]) {
        width: auto;
        max-width: 100%;
        height: auto;
        max-height: 72px;
        object-fit: contain;
    }

    .sidebar-expanded .sidebar-brand-label {
        display: block;
    }

    .sidebar-expanded .sidebar-nav-level {
        padding: 0 12px;
    }

    .sidebar-expanded .sidebar-bottom {
        margin: 10px 12px 0;
    }

    .sidebar-expanded .sidebar-nav-item,
    .sidebar-expanded .sidebar-back {
        padding: 0 12px;
    }

    .sidebar-expanded .sidebar-label,
    .sidebar-expanded .sidebar-back-label {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        clip: auto;
        min-width: 0;
        text-overflow: ellipsis;
        font-size: 1rem;
        font-weight: 600;
    }

    .sidebar-expanded .sidebar-back-label {
        font-weight: 600;
        color: var(--dv-rail-text);
    }

    .sidebar-expanded .sidebar-chevron {
        display: inline-block;
        width: auto;
        margin-left: auto;
        font-size: 0.8rem;
        opacity: 0.7;
    }

    .sidebar-expanded .sidebar-toggle i {
        transform: rotate(180deg);
    }

    /* The labels are showing, so the sidebar's tooltips (customClass from js.js,
       appended to <body>) would only repeat them. */
    .sidebar-expanded .sidebar-tooltip {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .sidebar-toggle i,
    .top-navbar,
    .content-wrapper {
        transition: none !important;
    }
}

/* Hide sidebar on mobile */
@media (max-width: 991.98px) {
    .sidebar {
        display: none;
    }
}

/* -------------------------------------------------------------
   5. Content Wrapper
   ------------------------------------------------------------- */
.content-wrapper {
    margin-top: var(--dv-navbar-height);
    min-height: calc(100vh - var(--dv-navbar-height));
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    .content-wrapper {
        margin-left: var(--dv-sidebar-width);
        transition: margin-left 0.2s ease;
    }
}

.content-wrapper main {
    flex: 1;
}

/* Signed-in content stops growing at 1680px (padding included), left-aligned under the header
   title, so fields and card rows do not stretch across a 2560 or 3840 viewport. */
.app-main {
    max-width: 1680px;
    margin-inline: 0;
}

/* From lg the header title and the footer sit 32px in; content starts at the same line (Bootstrap's px-4 is 24px). */
@media (min-width: 992px) {
    .app-main {
        padding-inline: 32px !important;
    }
}

/* A lone prompt card (passkey offer, step-up, reauth, recovery codes, upgrade) lines up with
   the header title instead of centering in the capped column, which put it off to one side
   on viewports wider than 1920. The utility sits at the same specificity later, hence !important. */
.app-main .row.justify-content-center {
    justify-content: flex-start !important;
}

/* -------------------------------------------------------------
   6. Page Header Bar
   ------------------------------------------------------------- */
.page-header-bar {
    background: transparent;
    padding: 20px 1.5rem 0;
}

.page-header-bar h1 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
    color: var(--dv-ink);
}

@media (min-width: 992px) {
    .page-header-bar {
        display: none; /* the header row carries the title from lg */
    }
}

/* -------------------------------------------------------------
   7. Footer
   ------------------------------------------------------------- */
.site-footer {
    background-color: transparent;
    border-top: 1px solid var(--bs-border-color);
    color: var(--dv-muted-text);
    padding: 18px 32px;
    font-size: 0.9375rem;
    margin-top: auto;
}

.site-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
}

.site-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer-links a {
    color: var(--dv-link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.site-footer-links a:hover {
    color: var(--dv-title);
    text-decoration-thickness: 2px;
}

.site-footer-links a:focus-visible {
    color: var(--dv-title);
    outline: 3px solid var(--dv-focus-ring, var(--dv-ink)) !important;
    outline-offset: 2px;
}

@media (max-width: 991.98px) {
    .site-footer {
        padding: 1.25rem 1rem;
    }
    .site-footer-inner {
        flex-direction: column;
        text-align: center;
    }
    .site-footer-links {
        justify-content: center;
    }
    .site-footer-links a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }
}

/* -------------------------------------------------------------
   8. Offcanvas — Mobile Menu
   ------------------------------------------------------------- */
.offcanvas.mobile-nav {
    width: 300px;
    background-color: var(--dv-rail-bg);
    color: var(--dv-rail-text);
    border: 0;
}

.offcanvas.mobile-nav .offcanvas-header {
    border-bottom: 0;
    padding: 16px 16px 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.offcanvas.mobile-nav .offcanvas-header .btn-close {
    width: 44px;
    height: 44px;
}

.drawer-brand-logo {
    width: 124px;
    height: auto;
}

.offcanvas.mobile-nav .offcanvas-body {
    padding: 8px 12px 20px;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 6px;
    color: var(--dv-drawer-text);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    transition: background-color 0.15s;
}

.mobile-nav-item:focus-visible {
    outline-offset: -3px;
}

.mobile-nav-item:hover,
.mobile-nav-item:focus {
    color: var(--dv-rail-text);
    background-color: color-mix(in srgb, var(--dv-drawer-active-bg) 45%, transparent);
}

.mobile-nav-item.active {
    color: var(--dv-rail-text);
    background-color: var(--dv-drawer-active-bg);
}

/* Navy scrim behind the drawer, no blur (portal 2a). Bootstrap 5.3 sets the
   backdrop color and opacity directly, so both are restyled here. */
.offcanvas-backdrop {
    background-color: #0F2E44;
}

.offcanvas-backdrop.show {
    opacity: 0.55;
}

.mobile-nav-item i,
.mobile-nav-item svg {
    width: 24px;
    text-align: center;
    margin-right: 1rem;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Mobile nav drill-down wrapper */
.mobile-nav-wrapper {
    position: relative;
    overflow: hidden;
    min-height: 100%;
}

.mobile-nav-level {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    min-height: 100%;
    padding: 0.5rem 0;
    transition: transform 0.2s ease;
}

.mobile-nav-level.active {
    transform: translateX(0);
}

.mobile-nav-level.slide-out-left {
    transform: translateX(-100%);
}

.mobile-nav-level.slide-in-right {
    transform: translateX(100%);
}

/* Mobile back button */
.mobile-nav-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    color: var(--dv-drawer-back);
    font-size: 0.85rem;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 0.25rem;
}

.mobile-nav-back:hover {
    color: var(--dv-rail-text);
    background-color: rgba(255,255,255,0.08);
}

/* Chevron on parent items */
.mobile-nav-chevron {
    margin-left: auto;
    font-size: 0.7rem;
    opacity: 0.5;
}

.mobile-nav-heading {
    padding: 12px 12px 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dv-drawer-heading);
    font-weight: 600;
}

/* -------------------------------------------------------------
   9. Auth Pages (preserved from previous work)
   ------------------------------------------------------------- */
body.auth-page {
    background: var(--dv-navy);
    min-height: 100vh;
}

.auth-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-brand-logo {
    display: block;
    margin: 0 auto;
    filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

/* B6a: a tenant's dark-surface logo is shown as uploaded, so it keeps its own colors */
.auth-brand-logo-dark {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.auth-brand-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

body.auth-page .card {
    border: none;
    border-radius: 0.5rem;
    overflow: hidden;
}

body.auth-page .card-header {
    background-color: var(--dv-surface);
    border-bottom: 2px solid var(--bs-primary);
}

body.auth-page .card-header h3 {
    color: var(--dv-heading);
    font-size: 1.35rem;
    margin: 0;
}

/* The /ui-kit showcase in the public shell shows app cards, not auth cards. */
body.auth-page .ui-kit-public .card-header {
    border-bottom: 1px solid var(--bs-border-color);
}
body.auth-page .ui-kit-public .card-header h3 {
    font-size: 1rem;
}

body.auth-page .card-footer {
    background-color: var(--dv-auth-footer-bg);
    border-top: 1px solid var(--bs-border-color);
}

/* Email-verify activation page: the divider and link-style toggle that reveal
   the set-a-new-password form (2026-09-26 scan F2, F3). Hover and keyboard
   focus fill with the brand accent, as other secondary actions do. */
body.auth-page .verify-set-divider {
    border-top: 1px solid var(--bs-border-color);
    margin-top: 1.5rem;
    padding-top: 1rem;
    text-align: center;
}
body.auth-page .verify-set-toggle {
    color: var(--dv-link);
    font-weight: 600;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
}
body.auth-page .verify-set-toggle:hover,
body.auth-page .verify-set-toggle:focus-visible {
    color: #fff;
    background-color: var(--bs-primary);
}
body.auth-page #verifySetPassword {
    padding-top: 1rem;
}

#layoutAuthentication {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#layoutAuthentication_content {
    flex: 1;
}

body.auth-page #layoutAuthentication_footer footer {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.5);
}

body.auth-page #layoutAuthentication_footer .text-muted {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* A non-stock sign-in page (tenant logo or INSTANCE_LOGO) stays on the Steel Deep page: the light footer's
   Stone rule and Steel links would vanish there, so its links are white and its ring is Sky. */
body.auth-page:not(.auth-stock) #layoutAuthentication_footer .site-footer {
    border-top: 0;
}
body.auth-page:not(.auth-stock) #layoutAuthentication_footer .site-footer-links {
    --dv-focus-ring: #E3EEF6;
}
body.auth-page:not(.auth-stock) #layoutAuthentication_footer .site-footer-links a {
    color: rgba(255, 255, 255, 0.75);
}
body.auth-page:not(.auth-stock) #layoutAuthentication_footer .site-footer-links a:hover,
body.auth-page:not(.auth-stock) #layoutAuthentication_footer .site-footer-links a:focus-visible {
    color: #fff;
}

/* Portal 2a login (Claude Design 51e4cc41; ported from chassis bs6-brand-v2 46202c7 and 3897423): the stock
   Dvelopin look (no tenant logo, no INSTANCE_LOGO; head-public.php adds .auth-stock) is a light page. The
   lockup, a Stone rule and the subtitle sit centered over a 400px white card, the group centered on the page. */
body.auth-page.auth-stock {
    background: var(--dv-page-bg);
}
body.auth-page.auth-stock .auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 0 !important;
    margin-bottom: 28px;
}
.auth-lockup {
    width: 148px;
    height: auto;
}
@media (max-width: 575.98px) {
    .auth-lockup { width: 132px; }
}
.auth-brand-rule {
    width: 1px;
    align-self: stretch;
    background-color: var(--bs-border-color);
}
body.auth-page.auth-stock .auth-brand-text {
    margin-top: 0;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--dv-title);
}
body.auth-page.auth-stock #layoutAuthentication_content {
    display: flex;
    flex-direction: column;
}
body.auth-page.auth-stock #layoutAuthentication_content > main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-block: 48px;
}
body.auth-page.auth-stock .card {
    border: 1px solid var(--bs-border-color) !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    overflow: hidden;
    background-color: var(--dv-surface);
}
body.auth-page.auth-stock .card.mt-5 {
    margin-top: 0 !important;
}
body.auth-page.auth-stock .row.justify-content-center > :not(.col-lg-7) > .card {
    max-width: 400px;
    margin-inline: auto;
}
body.auth-page.auth-stock .card-header {
    background-color: var(--dv-surface);
    border-bottom: 1px solid var(--bs-border-color);
    padding: 20px 24px 16px;
}
body.auth-page.auth-stock .card-header h3 {
    margin: 0 !important;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dv-title);
}
body.auth-page.auth-stock .card-body {
    padding: 22px 24px 24px;
}
@media (max-width: 575.98px) {
    body.auth-page.auth-stock .card-body { padding: 20px 16px; }
}
body.auth-page.auth-stock .card-body p,
body.auth-page.auth-stock .card-body .form-text,
body.auth-page.auth-stock .card-body .alert,
body.auth-page.auth-stock .card-body .invalid-feedback {
    text-wrap: pretty;
}
body.auth-page.auth-stock .card-body .small { font-size: 0.9375rem; }
body.auth-page.auth-stock .card-footer {
    background-color: var(--dv-page-bg);
    border-top: 1px solid var(--bs-border-color);
    font-size: 0.9375rem;
}
body.auth-page.auth-stock #layoutAuthentication_footer footer {
    color: var(--bs-secondary-color);
}
body.auth-page.auth-stock #layoutAuthentication_footer .text-muted {
    color: var(--bs-secondary-color) !important;
}
body.auth-page.auth-stock .site-footer-links {
    --dv-focus-ring: var(--dv-teal);
}
body.auth-page.auth-stock .site-footer-links a {
    color: var(--dv-title);
}
body.auth-page.auth-stock .site-footer-links a:hover,
body.auth-page.auth-stock .site-footer-links a:focus-visible {
    color: var(--dv-title);
}

/* -------------------------------------------------------------
   10. Component Overrides
   ------------------------------------------------------------- */

/* Buttons. Every primary shade derives from --bs-primary, which theme.php sets per tenant, so a
   non-teal tenant gets its own hover and active colors. 88% and 73% reproduce the hand-picked
   hover and active teals they replace within 2/255. Disabled was unset, so Bootstrap's stock
   blue showed on a disabled primary button (the Stripe pay button while it processes). */
.btn-primary {
    --bs-btn-bg: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: var(--dv-ink-fill);
    --bs-btn-hover-border-color: var(--dv-ink-fill);
    --bs-btn-active-bg: var(--dv-ink-fill);
    --bs-btn-active-border-color: var(--dv-ink-fill);
    --bs-btn-disabled-bg: var(--bs-primary);
    --bs-btn-disabled-border-color: var(--bs-primary);
    --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}

.btn-outline-primary {
    --bs-btn-color: var(--dv-link);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: var(--dv-hover-tint);
    --bs-btn-hover-color: var(--dv-title);
    --bs-btn-hover-border-color: var(--bs-primary);
    --bs-btn-active-bg: color-mix(in srgb, var(--bs-primary) 88%, black);
    --bs-btn-active-border-color: color-mix(in srgb, var(--bs-primary) 88%, black);
    --bs-btn-disabled-color: var(--dv-link);
    --bs-btn-disabled-border-color: var(--bs-primary);
    --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}

/* Portal 2a controls: buttons and fields are 44px (9px + 24px line + 9px + borders),
   small ones 36px, 6px corners. On phones small controls grow back to 44px. */
.btn {
    --bs-btn-padding-y: 0.5625rem;
    --bs-btn-padding-x: 1.125rem;
    --bs-btn-font-weight: 700;
    min-height: 2.75rem;
}

.btn-sm {
    --bs-btn-padding-y: 0.375rem;
    --bs-btn-padding-x: 0.875rem;
    min-height: 2.25rem;
}

.btn-lg {
    --bs-btn-padding-x: 1.25rem;
}

@media (max-width: 575.98px) {
    .btn-sm {
        --bs-btn-padding-y: 0.65625rem;
        min-height: 2.75rem;
    }
}

/* A link-styled button reads as a link (portal 2a "Cancel"), not a bold button label. */
.btn-link {
    --bs-btn-font-weight: 500;
    --bs-btn-color: var(--dv-link);
    --bs-btn-hover-color: var(--dv-link-hover);
    --bs-btn-active-color: var(--dv-link-hover);
}

/* An inline link button (padding 0, in a line of text) keeps the text line's height, not the 44px control. */
.btn-link.p-0 {
    min-height: 0;
}

/* Fields: the Stone-edge control border, 44px tall (36px small). */
.form-control, .form-select {
    border-color: var(--dv-control-border);
}

/* Checks, radios, switches and input-group addons carry the same control edge (WCAG 1.4.11, 3:1). */
.form-check-input {
    border-color: var(--dv-control-border);
}

.input-group-text {
    border-color: var(--dv-control-border);
}

.form-control:not([type="file"]),
.form-select {
    min-height: 2.75rem;
    padding-top: 0.5625rem;
    padding-bottom: 0.5625rem;
}

.form-control-sm:not([type="file"]),
.form-select-sm {
    min-height: 2.25rem;
    padding-top: 0.3125rem;
    padding-bottom: 0.3125rem;
}

/* Field errors: a 2px danger edge drawn inside the 1px border, so the text does not shift. */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--bs-form-invalid-border-color);
    box-shadow: inset 0 0 0 1px var(--bs-form-invalid-border-color);
}

.invalid-feedback {
    margin-top: 6px;
    font-size: 0.9375rem;
    font-weight: 700;
}

/* Brand v2: status colors never fill or outline a button (BRAND.md "Status colors"). Affirmative actions
   take the brand Steel, like .btn-primary; destructive and caution actions take Copper Deep, the brand's
   button copper (white text 4.91:1). */
.btn-success {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: color-mix(in srgb, var(--bs-primary) 88%, black);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--bs-primary) 88%, black);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: color-mix(in srgb, var(--bs-primary) 73%, black);
    --bs-btn-active-border-color: color-mix(in srgb, var(--bs-primary) 73%, black);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--bs-primary);
    --bs-btn-disabled-border-color: var(--bs-primary);
    --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}

.btn-outline-success {
    --bs-btn-color: var(--dv-link);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--bs-primary);
    --bs-btn-hover-border-color: var(--bs-primary);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--bs-primary);
    --bs-btn-active-border-color: var(--bs-primary);
    --bs-btn-disabled-color: var(--dv-link);
    --bs-btn-disabled-border-color: var(--bs-primary);
    --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}

.btn-danger {
    --bs-btn-color: #fff;
    --bs-btn-bg: #AD5A2C;
    --bs-btn-border-color: #AD5A2C;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: color-mix(in srgb, #AD5A2C 88%, black);
    --bs-btn-hover-border-color: color-mix(in srgb, #AD5A2C 88%, black);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: color-mix(in srgb, #AD5A2C 73%, black);
    --bs-btn-active-border-color: color-mix(in srgb, #AD5A2C 73%, black);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #AD5A2C;
    --bs-btn-disabled-border-color: #AD5A2C;
    --bs-btn-focus-shadow-rgb: 173, 90, 44;
}

.btn-outline-danger {
    --bs-btn-color: var(--dv-copper-fg);
    --bs-btn-border-color: #AD5A2C;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #AD5A2C;
    --bs-btn-hover-border-color: #AD5A2C;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #AD5A2C;
    --bs-btn-active-border-color: #AD5A2C;
    --bs-btn-disabled-color: var(--dv-copper-fg);
    --bs-btn-disabled-border-color: #AD5A2C;
    --bs-btn-focus-shadow-rgb: 173, 90, 44;
}

.btn-warning {
    --bs-btn-color: #fff;
    --bs-btn-bg: #AD5A2C;
    --bs-btn-border-color: #AD5A2C;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: color-mix(in srgb, #AD5A2C 88%, black);
    --bs-btn-hover-border-color: color-mix(in srgb, #AD5A2C 88%, black);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: color-mix(in srgb, #AD5A2C 73%, black);
    --bs-btn-active-border-color: color-mix(in srgb, #AD5A2C 73%, black);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #AD5A2C;
    --bs-btn-disabled-border-color: #AD5A2C;
    --bs-btn-focus-shadow-rgb: 173, 90, 44;
}

.btn-outline-warning {
    --bs-btn-color: var(--dv-copper-fg);
    --bs-btn-border-color: #AD5A2C;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #AD5A2C;
    --bs-btn-hover-border-color: #AD5A2C;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #AD5A2C;
    --bs-btn-active-border-color: #AD5A2C;
    --bs-btn-disabled-color: var(--dv-copper-fg);
    --bs-btn-disabled-border-color: #AD5A2C;
    --bs-btn-focus-shadow-rgb: 173, 90, 44;
}

/* Pills and list groups carried Bootstrap's stock blue for their active state. */
.nav-pills {
    --bs-nav-link-color: var(--dv-link);
    --bs-nav-link-hover-color: var(--dv-link-hover);
    --bs-nav-pills-link-active-bg: var(--bs-primary);
}
.list-group {
    --bs-list-group-active-bg: var(--bs-primary);
    --bs-list-group-active-border-color: var(--bs-primary);
}

/* Cards */
.card {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card-header {
    background-color: var(--dv-surface);
    border-bottom: 1px solid var(--bs-border-color);
    font-weight: 600;
}

/* Dashboard cards */
.dash-card {
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
    display: block;
}

.dash-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    color: inherit;
}

.dash-card .card-body {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dash-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* Dashboard data widgets (richer, data-bearing cards vs. the nav cards above) */
.dash-widget {
    height: 100%;
}
.dash-widget .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background-color: transparent;
}
.dash-widget-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
    font-weight: 600;
}
.dash-widget-title .dash-card-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
}

/* Security-checklist widget */
.sec-check-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sec-check-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.85rem 0;
    border-top: 1px solid var(--bs-border-color);
}
.sec-check-item:first-child {
    border-top: 0;
}
.sec-check-status {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}
.sec-check-status.is-done {
    background-color: rgba(20, 108, 67, 0.12);
    color: var(--bs-success-text-emphasis);
}
.sec-check-status.is-todo {
    background-color: var(--bs-warning-bg-subtle);
    color: var(--bs-warning-text-emphasis);
}
.sec-check-body {
    flex: 1 1 180px;
    min-width: 0;
}
.sec-check-label {
    margin: 0;
    font-weight: 600;
}
.sec-check-hint {
    margin: 0.1rem 0 0;
    color: var(--bs-secondary-color);
}
.sec-check-action {
    flex-shrink: 0;
    margin-left: auto;
}
.sec-check-done {
    flex-shrink: 0;
    margin-left: auto;
    color: var(--bs-success-text-emphasis);
    font-weight: 600;
    white-space: nowrap;
}

/* Recent sign-ins widget */
.dw-log-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.dw-log-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-top: 1px solid var(--bs-border-color);
}
.dw-log-item:first-child {
    border-top: 0;
}
.dw-log-status {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    margin-top: 0.1rem;
}
.dw-log-status.is-ok {
    background-color: rgba(20, 108, 67, 0.12);
    color: var(--bs-success-text-emphasis);
}
.dw-log-status.is-bad {
    background-color: rgba(161, 37, 27, 0.12);
    color: var(--bs-danger-text-emphasis);
}
.dw-log-body {
    flex: 1 1 auto;
    min-width: 0;
}
.dw-log-primary {
    margin: 0;
    font-weight: 600;
}
.dw-log-meta {
    margin: 0.1rem 0 0;
    color: var(--bs-secondary-color);
    word-break: break-word;
}
.dw-empty {
    color: var(--bs-secondary-color);
    margin: 0.25rem 0;
}
.dw-widget-foot {
    margin-top: 0.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--bs-border-color);
}

/* Figure / alert widgets (next charge, payment due) */
.dash-widget-alert {
    border-color: rgba(161, 37, 27, 0.4);
}
.dw-figure {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.15;
}
.dw-alert-lead {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
    font-weight: 700;
}

/* Server-status widget */
.dw-header-link {
    font-weight: 600;
    white-space: nowrap;
}
.dw-server-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.dw-server-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0;
    border-top: 1px solid var(--bs-border-color);
}
.dw-server-item:first-child {
    border-top: 0;
}
.dw-server-dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #8C8579;
}
.dw-dot-online {
    background-color: var(--bs-success-text-emphasis);
}
.dw-dot-degraded {
    background-color: var(--bs-warning-text-emphasis);
}
.dw-dot-stopped {
    background-color: var(--bs-danger-text-emphasis);
}
.dw-dot-unknown {
    background-color: #8C8579;
}
.dw-server-name {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dw-server-state {
    flex-shrink: 0;
    color: var(--bs-secondary-color);
    white-space: nowrap;
}
.dw-server-updated {
    margin: 0.75rem 0 0;
    color: var(--bs-secondary-color);
}

/* Customize-dashboard modal rows — each widget is a roomy, clickable row */
.dw-customize-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
    margin-bottom: 0.6rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.dw-customize-row:last-child {
    margin-bottom: 0;
}
.dw-customize-row:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
    border-color: rgba(var(--bs-primary-rgb), 0.45);
}
.dw-customize-row .form-check-input {
    margin: 0.15rem 0 0;
    flex-shrink: 0;
    cursor: pointer;
}
.dw-customize-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.dw-customize-label {
    font-weight: 600;
}
.dw-customize-desc {
    color: var(--bs-secondary-color);
    margin-top: 0.1rem;
}
@media (prefers-reduced-motion: reduce) {
    .dw-customize-row {
        transition: none;
    }
}

/* Customize side drawer (offcanvas) — responsive width, scrolling list, pinned footer */
.dw-customize-offcanvas {
    --bs-offcanvas-width: min(440px, 100vw);
}
.dw-customize-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.dw-customize-list {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}
.dw-customize-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--bs-border-color);
}

/* Dropdown active */
.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--bs-primary);
}

/* Form focus: the brand edge; the 3px tint ring sits flush with it (portal 2a). */
.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--bs-primary) 35%, transparent);
}

/* Focus outlines — accessible: hide the ring for mouse/touch, but always show a
   clear focus ring for keyboard and switch users (:focus-visible). Previously
   *:focus{outline:none} removed focus indication entirely, an accessibility
   failure for keyboard navigation.
   !important is required: Bootstrap's own component rules (.btn:focus-visible,
   .form-control:focus, .nav-link:focus-visible, .page-link:focus, …) set
   `outline: 0` at specificity (0,2,0), which beats a plain :focus-visible
   (0,1,0). The theme also zeroes Bootstrap's box-shadow ring, so without this
   buttons and inputs get NO visible keyboard focus indicator at all (verified
   live). !important on the outline wins the cascade regardless of specificity
   and never affects layout; the mouse-focus suppression below stays scoped. */
:focus:not(:focus-visible) {
    outline: none;
}
:focus-visible {
    outline: 3px solid var(--dv-focus-ring, var(--dv-ink)) !important;
    outline-offset: 2px;
}
/* Sky ring on the dark sidebar and drawer (Steel Deep on Steel Deep would vanish); a light tenant rail
   uses its derived dark rail text instead. */
.sidebar, .mobile-nav { --dv-focus-ring: #E3EEF6; }
.sidebar.rail-light, .mobile-nav.rail-light { --dv-focus-ring: var(--dv-rail-text); }
.top-navbar .dropdown-item:focus-visible { outline-offset: -2px; }
/* Status pills (BRAND.md "Status colors"): Bootstrap's status badges become the brand pill pairs. The
   utilities they override (.bg-*, .text-bg-*, .text-dark) are !important, so these are too. */
.badge.bg-success, .badge.text-bg-success { background-color: var(--bs-success-bg-subtle) !important; color: var(--bs-success-text-emphasis) !important; }
.badge.bg-warning, .badge.text-bg-warning { background-color: var(--bs-warning-bg-subtle) !important; color: var(--bs-warning-text-emphasis) !important; }
.badge.bg-danger, .badge.text-bg-danger { background-color: var(--bs-danger-bg-subtle) !important; color: var(--bs-danger-text-emphasis) !important; }
.badge.bg-secondary, .badge.text-bg-secondary { background-color: var(--dv-neutral-bg) !important; color: var(--bs-body-color) !important; }
.badge.bg-info, .badge.text-bg-info { background-color: var(--dv-info-bg) !important; color: var(--dv-heading) !important; }

/* Buttons: suppress the Bootstrap box-shadow ring on mouse focus/active; the
   :focus-visible outline above still shows for keyboard users. */
button:active,
.btn:active,
button:focus:not(:focus-visible),
.btn:focus:not(:focus-visible) {
    box-shadow: none;
}

/* Pagination */
.page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}
.page-link { color: var(--dv-link); }

/* CSP-safe utility classes — moved out of inline style="" attributes, which the
   nonce-based CSP (no style-src 'unsafe-inline') silently strips. */
.scan-report-pre {
    max-height: 480px;
    overflow: auto;
    font-size: .8rem;
    white-space: pre-wrap;
    word-break: break-all;
}
.mw-220 { max-width: 220px; }

/* Touch targets: on coarse pointers (phones) give small in-table action buttons
   a comfortable tap size (~WCAG 2.5.5) without changing desktop table density. */
@media (pointer: coarse) {
    .table td .btn-sm { min-height: 40px; min-width: 38px; }
}
.page-link:hover { color: var(--dv-link-hover); }

/* Nav tabs */
.nav-tabs-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.nav-tabs-scroll::-webkit-scrollbar { display: none; }
.nav-tabs-scroll .nav-tabs { border-bottom: 1px solid var(--bs-border-color); }
.nav-tabs-scroll .nav-link { white-space: nowrap; }
/* Overflow hint: js.js adds .overflow-start / .overflow-end while the strip has
   more tabs hidden on that side. A mask fades the tabs themselves, so it needs no
   color and follows any page background. No animation, so nothing to reduce. */
.nav-tabs-scroll {
    --tab-fade-start: 0px;
    --tab-fade-end: 0px;
}
.nav-tabs-scroll.overflow-start { --tab-fade-start: 2.5rem; }
.nav-tabs-scroll.overflow-end { --tab-fade-end: 2.5rem; }
.nav-tabs-scroll.overflow-start,
.nav-tabs-scroll.overflow-end {
    -webkit-mask-image: linear-gradient(to right, transparent, black var(--tab-fade-start), black calc(100% - var(--tab-fade-end)), transparent);
    mask-image: linear-gradient(to right, transparent, black var(--tab-fade-start), black calc(100% - var(--tab-fade-end)), transparent);
}
.nav-tabs .nav-link {
    color: var(--dv-muted-text);
    font-size: 0.9rem;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0.5rem 1rem;
    background: none;
}
/* --dv-muted-text is derived against the page background; tabs inside a white surface keep the stock gray. */
:where(.card, .modal, .offcanvas, .dropdown-menu) .nav-tabs .nav-link {
    color: var(--bs-secondary-color);
}
.nav-tabs .nav-link:hover {
    color: var(--dv-link);
    border-bottom-color: var(--bs-border-color);
    background: none;
}
.nav-tabs .nav-link.active {
    color: var(--dv-link);
    font-weight: 600;
    border: none;
    border-bottom: 2px solid var(--bs-primary);
    background: none;
}

/* Tables */
.table > thead {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--bs-secondary-color);
}

/* Tooltips */
.tooltip {
    font-size: 0.8rem;
}

.tooltip .tooltip-inner {
    background-color: var(--dv-rail-bg);
    color: var(--dv-rail-text);
    padding: 0.35rem 0.65rem;
}

.bs-tooltip-top .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^='top'] .tooltip-arrow::before {
    border-top-color: var(--dv-rail-bg);
}

.bs-tooltip-end .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^='right'] .tooltip-arrow::before {
    border-right-color: var(--dv-rail-bg);
}

.bs-tooltip-bottom .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^='bottom'] .tooltip-arrow::before {
    border-bottom-color: var(--dv-rail-bg);
}

.bs-tooltip-start .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^='left'] .tooltip-arrow::before {
    border-left-color: var(--dv-rail-bg);
}

/* Alerts (portal 2a): 6px corners, a soft edge in the status color, 15px text. */
.alert {
    --bs-alert-padding-y: 12px;
    --bs-alert-padding-x: 14px;
    --bs-alert-border-radius: 6px;
    font-size: 0.9375rem;
    line-height: 1.45;
}

/* The brand status pairs (BRAND.md): a tint, the status text, and a 18% edge in the status color. */
.alert-success {
    --bs-alert-bg: var(--bs-success-bg-subtle);
    --bs-alert-color: var(--bs-success-text-emphasis);
    --bs-alert-border-color: color-mix(in srgb, var(--bs-success-text-emphasis) 18%, var(--bs-success-bg-subtle));
}

.alert-warning {
    --bs-alert-bg: var(--bs-warning-bg-subtle);
    --bs-alert-color: var(--bs-warning-text-emphasis);
    --bs-alert-border-color: color-mix(in srgb, var(--bs-warning-text-emphasis) 18%, var(--bs-warning-bg-subtle));
}

.alert-danger {
    --bs-alert-bg: var(--bs-danger-bg-subtle);
    --bs-alert-color: var(--bs-danger-text-emphasis);
    --bs-alert-border-color: color-mix(in srgb, var(--bs-danger-text-emphasis) 18%, var(--bs-danger-bg-subtle));
}

.alert-info {
    --bs-alert-bg: var(--dv-info-bg);
    --bs-alert-color: var(--dv-heading);
    --bs-alert-border-color: color-mix(in srgb, var(--dv-info-accent) 18%, var(--dv-info-bg));
}

/* Badges (portal 2a): 4px corners, never pills. */
.badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.3;
}

.badge.rounded-pill {
    border-radius: 4px !important;
}

.badge.bg-primary {
    background-color: var(--bs-primary) !important;
}

/* Dropdowns general (portal 2a menu): Stone edge, 8px corners, 6px inset, 44px rows. */
.dropdown-menu {
    padding: 6px;
    font-size: 1rem;
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 12px 32px rgba(15, 46, 68, 0.16);
    border-radius: 8px;
}

.dropdown-item {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 6px;
}

.dropdown-item:hover:not(.active),
.dropdown-item:focus-visible:not(.active) {
    background-color: var(--dv-hover-tint);
    color: var(--dv-title);
}

/* Form check */
.form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* -------------------------------------------------------------
   11. AJAX Loading Bar
   ------------------------------------------------------------- */
#ajax-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--dv-veil);
    z-index: 9999;
    opacity: 0;
    width: 0;
    pointer-events: none;
}

#ajax-loading-bar.loading {
    opacity: 1;
    animation: ajax-load 1.2s ease-in-out forwards;
}

#ajax-loading-bar.done {
    width: 100%;
    opacity: 0;
    transition: opacity 0.3s 0.1s;
}

@keyframes ajax-load {
    0%   { width: 0; }
    30%  { width: 40%; }
    60%  { width: 70%; }
    100% { width: 90%; }
}

/* -------------------------------------------------------------
   12. Toast Notifications
   ------------------------------------------------------------- */
.toast-container {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 1090;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
    max-width: 360px;
    pointer-events: none;
}

.dv-toast {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: #fff;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s, transform 0.3s;
}

.dv-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.dv-toast.hiding {
    opacity: 0;
    transform: translateX(100%);
}

.dv-toast-success { background-color: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); border: 1px solid rgba(20, 108, 67, 0.3); }
.dv-toast-error   { background-color: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); border: 1px solid rgba(161, 37, 27, 0.3); }
.dv-toast-warning { background-color: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); border: 1px solid rgba(138, 75, 0, 0.3); }
.dv-toast-info    { background-color: var(--bs-primary); }
/* Pill toasts carry their own text color, so the close button follows it. */
.dv-toast-success .dv-toast-close,
.dv-toast-error .dv-toast-close,
.dv-toast-warning .dv-toast-close { color: inherit; opacity: 0.75; }

.dv-toast-icon {
    flex-shrink: 0;
    margin-right: 0.625rem;
    font-size: 1.1rem;
}

.dv-toast-body {
    flex: 1;
}

.dv-toast-close {
    flex-shrink: 0;
    margin-left: 0.5rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

.dv-toast-close:hover {
    color: #fff;
}

/* -------------------------------------------------------------
   13. Banner Notifications
   ------------------------------------------------------------- */
.banner-container {
    position: sticky;
    top: var(--dv-navbar-height);
    z-index: 1030;
}

.dv-banner {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid transparent;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.3s ease, padding 0.35s ease;
    padding-top: 0;
    padding-bottom: 0;
}

.dv-banner.show {
    max-height: 80px;
    opacity: 1;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.dv-banner-success {
    background-color: var(--bs-success-bg-subtle);
    color: var(--bs-success-text-emphasis);
    border-color: color-mix(in srgb, var(--bs-success-text-emphasis) 18%, var(--bs-success-bg-subtle));
}

.dv-banner-error {
    background-color: var(--bs-danger-bg-subtle);
    color: var(--bs-danger-text-emphasis);
    border-color: rgba(161, 37, 27, 0.3);
}

.dv-banner-warning {
    background-color: var(--bs-warning-bg-subtle);
    color: var(--bs-warning-text-emphasis);
    border-color: rgba(138, 75, 0, 0.3);
}

.dv-banner-info {
    background-color: var(--dv-info-bg);
    color: var(--dv-heading);
    border-color: color-mix(in srgb, var(--dv-info-accent) 18%, var(--dv-info-bg));
}

.dv-banner-icon {
    flex-shrink: 0;
    margin-right: 0.625rem;
    font-size: 1.1rem;
}

.dv-banner-body {
    flex: 1;
}

.dv-banner-close {
    flex-shrink: 0;
    margin-left: 0.75rem;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.5;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.dv-banner-close:hover {
    opacity: 1;
}

@media (max-width: 767.98px) {
    .toast-container {
        right: 0.75rem;
        bottom: 0.75rem;
        left: 0.75rem;
        max-width: none;
    }
    .dv-toast {
        width: 100%;
        transform: translateY(100%);
    }
    .dv-toast.show {
        transform: translateY(0);
    }
    .dv-toast.hiding {
        transform: translateY(100%);
    }
}

/* Inline-style replacements (APP-2 Stage B) */
.dash-card-icon-primary { background-color: rgba(var(--bs-primary-rgb), 0.1); color: var(--dv-link); }
.dash-card-icon-success { background-color: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
.dash-card-icon-warning { background-color: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); }
.dash-card-icon-danger  { background-color: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); }
.icon-passkey           { width: 16px; height: 16px; vertical-align: text-bottom; }
.icon-passkey-lg        { width: 20px; height: 20px; vertical-align: text-bottom; }
.icon-passkey-hero      { width: 56px; height: 56px; vertical-align: text-bottom; }
.logo-invert            { filter: brightness(0) invert(1); }
.btn-close-invert       { filter: invert(1); }
/* Light tenant rail (nav.php adds .rail-light when the derived rail text is dark): black logo, no white filters, dark tints. */
.rail-light .logo-invert { filter: brightness(0); }
.rail-light .btn-close-invert { filter: none; }
.rail-light .sidebar-nav-item:not(.active):hover,
.rail-light .mobile-nav-item:not(.active):hover,
.rail-light .mobile-nav-item:not(.active):focus { background-color: rgba(0,0,0,0.08); }
.rail-light .sidebar-back:hover,
.rail-light .mobile-nav-back:hover { background-color: rgba(0,0,0,0.06); }
.rail-light .sidebar-back,
.rail-light .mobile-nav-back { border-bottom-color: rgba(0,0,0,0.1); }
.rail-light .sidebar-divider { background: rgba(0,0,0,0.12); }
.rail-light .sidebar-bottom { border-top-color: rgba(0,0,0,0.12); }
.mw-200                 { max-width: 200px; }
.mw-300                 { max-width: 300px; }
.stripe-card-element    { padding-top: 10px; height: auto; }
/* admin server-detail metric chart (static parts; bar height/colour set via CSSOM) */
.metric-chart           { height: 80px; gap: 1px; }
.metric-bar             { flex: 1; opacity: 0.7; }
/* Stripe split card fields — vertically center the iframe inside .form-control */
.stripe-input           { padding-top: 0.55rem; padding-bottom: 0.55rem; }

/* Feature teaser / upsell (chassis) — locked nav entries + the /upgrade page.
   A disabled 'teaser' feature shows a dimmed, lock-badged nav item that leads
   to an upsell page instead of being hidden. */
.sidebar-nav-item.nav-locked  { color: var(--dv-rail-text-locked); }
.sidebar-nav-item.nav-locked:hover { color: var(--dv-rail-text-muted); }
.sidebar-lock-badge {
    position: absolute;
    right: 11px;
    bottom: 8px;
    font-size: 0.6rem !important;
    opacity: 0.85;
}
@media (min-width: 1200px) { /* the expanded sidebar's breakpoint, section 4 */
    .sidebar-expanded .sidebar-lock-badge {
        position: static;
        width: auto;
        margin-left: auto;
        font-size: 0.8rem !important;
    }
}
.mobile-nav-item.nav-locked   { color: var(--dv-drawer-text-locked); }
.nav-lock-inline              { font-size: 0.7rem; opacity: 0.6; margin-left: 0.35rem; }

.upsell-card .upsell-icon     { position: relative; display: inline-block; font-size: 2.6rem; color: var(--dv-link); }
.upsell-icon-lock             { position: absolute; right: -0.55rem; bottom: -0.25rem; font-size: 1rem; color: var(--bs-secondary-color); }
.upsell-points                { max-width: 22rem; }
.upsell-points li             { font-size: 0.95rem; }

/* -------------------------------------------------------------
   Step-up re-authentication ("Confirm Your Identity")
   -------------------------------------------------------------
   The account is SHOWN rather than hidden: it names whose
   credentials are being asked for, and a password field with no
   adjacent username leaves password managers unable to offer the
   right entry. But it is not editable, so it must not be dressed
   as a text box the way a plain .form-control is. This renders it
   as an identity row instead — still a real readonly input
   underneath, carrying autocomplete="username".
   Tokens only; no new colour literals. */
.stepup-identity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    background-color: var(--dv-page-bg);
}

.stepup-avatar {
    flex: 0 0 auto;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--dv-navy);
    color: var(--bs-white);
    font-weight: 600;
    line-height: 1;
}

/* min-width:0 so a long address ellipsises instead of pushing the
   avatar off the row at 390px. */
.stepup-identity-body {
    min-width: 0;
}

.stepup-identity .stepup-account {
    padding: 0;
    border: 0;
    color: var(--bs-body-color);
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The recovery-code format sample. Bootstrap's default <code> is
   pink, which reads as an error inside a security prompt. */
.stepup-code-sample {
    color: var(--bs-body-color);
    background-color: var(--bs-secondary-bg);
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

/* -------------------------------------------------------------
   My Account > Preferences: option cards (my-account-preferences.php)
   -------------------------------------------------------------
   A real radio (.btn-check, visually hidden by Bootstrap) drives each
   card, so keyboard, form submit and screen readers work as a radio
   group. Each card carries a small drawing of the layout it picks. */
/* Past ~62rem three cards stop reading as a choice and become long strips */
.pref-options {
    max-width: 62rem;
}
.pref-option {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    height: 100%;
    padding: 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    background-color: var(--dv-surface);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.pref-option:hover {
    border-color: var(--dv-teal);
}
.btn-check:focus-visible + .pref-option {
    outline: 2px solid var(--dv-accent-fg);
    outline-offset: 2px;
}
.btn-check:checked + .pref-option {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 1px var(--bs-primary);
}
.btn-check:disabled + .pref-option {
    cursor: not-allowed;
    opacity: 0.65;
}
.pref-option-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.pref-option-title {
    font-weight: 600;
    color: var(--dv-title);
}
.pref-option-check {
    font-size: 1.1rem;
    color: var(--dv-link);
    visibility: hidden;
}
.btn-check:checked + .pref-option .pref-option-check {
    visibility: visible;
}
.pref-option-desc {
    color: var(--bs-secondary-color);
}

/* Add customer (admin-customer-new.php, onboarding P1). The account type cards are .pref-option
   cards laid out as a row, with a drawn radio circle that fills when its .btn-check is checked. */
.acct-type-option {
    flex-direction: row;
    align-items: flex-start;
    gap: 0.75rem;
}
.acct-type-radio {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    border: 2px solid var(--bs-border-color);
    border-radius: 50%;
    background-color: var(--bs-body-bg);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.btn-check:checked + .acct-type-option .acct-type-radio {
    border-color: var(--bs-primary);
    box-shadow: inset 0 0 0 3px var(--bs-body-bg), inset 0 0 0 10px var(--bs-primary);
}
@media (prefers-reduced-motion: reduce) {
    .acct-type-radio { transition: none; }
}
/* "More details (optional)": a native disclosure with a 44px tap row and a turning chevron. */
.customer-more-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    font-weight: 600;
    color: var(--dv-link);
    cursor: pointer;
    list-style: none;
}
.customer-more-summary::-webkit-details-marker { display: none; }
.customer-more-summary::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.15s;
}
.customer-more[open] > .customer-more-summary::before { transform: rotate(45deg); }
.customer-more-summary:focus-visible {
    outline: 2px solid var(--dv-accent-fg);
    outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    .customer-more-summary::before { transition: none; }
}

/* Your details (settings-details.php, onboarding P3, design 3a with the 3b preview line). */
/* A field hint at body size: Bootstrap's .form-text is 0.875em, below the body size the UI standard allows. */
.form-hint {
    margin-top: 0.25rem;
    color: var(--bs-secondary-color);
}
/* Account type: two radios drawn as one segmented control; full width on a phone. */
.details-seg {
    display: flex;
    width: 100%;
    max-width: 22rem;
}
.details-seg > .btn {
    flex: 1 1 0;
}
/* The radios are visually hidden, so the global :focus-visible ring would draw on nothing: ring the label. */
.details-seg > .btn-check:focus-visible + .btn {
    position: relative;
    z-index: 1;
    outline: 3px solid var(--dv-focus-ring, var(--dv-ink));
    outline-offset: 2px;
}
@media (max-width: 575.98px) {
    .details-seg { max-width: none; }
}
.details-group {
    font-weight: 600;
    color: var(--dv-title);
}
/* The agreement line, set in the heading serif so it reads as document text. */
.details-preview {
    padding: 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    background-color: var(--dv-surface);
    font-family: "Source Serif 4", Georgia, serif;
    line-height: 1.55;
    overflow-wrap: anywhere;
}
/* Read-only view for members who cannot edit: label column and value column, stacked on a phone. */
.details-ro-row {
    display: grid;
    grid-template-columns: 11rem minmax(0, 1fr);
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--bs-border-color);
}
.details-ro-row:last-child {
    border-bottom: 0;
}
.details-ro-row dt {
    font-weight: 600;
    color: var(--bs-secondary-color);
}
.details-ro-row dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}
@media (max-width: 575.98px) {
    .details-ro-row { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
}

/* The layout drawing: a sidebar strip beside a page with two cards */
.pref-preview {
    display: flex;
    height: 96px;
    border-radius: 0.375rem;
    overflow: hidden;
    background-color: var(--dv-page-bg);
    border: 1px solid var(--bs-border-color);
}
.pref-preview-bar {
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: 22px;
    padding: 10px 6px;
    background-color: var(--dv-teal);
    flex-shrink: 0;
}
.pref-preview-expanded .pref-preview-bar {
    width: 72px;
}
.pref-preview-row {
    display: flex;
    align-items: center;
    gap: 5px;
}
.pref-preview-icon {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background-color: rgba(255,255,255,0.8);
    flex-shrink: 0;
}
.pref-preview-text {
    display: none;
    height: 5px;
    flex: 1;
    border-radius: 3px;
    background-color: rgba(255,255,255,0.55);
}
.pref-preview-expanded .pref-preview-text {
    display: block;
}
.pref-preview-switch {
    margin-top: auto;
    color: #fff;
    font-size: 0.7rem;
    line-height: 1;
    text-align: center;
}
.pref-preview-page {
    display: flex;
    flex: 1;
    gap: 8px;
    padding: 12px;
}
.pref-preview-card {
    flex: 1;
    border-radius: 3px;
    background-color: var(--dv-surface);
    border: 1px solid var(--bs-border-color);
}
@media (prefers-reduced-motion: reduce) {
    .pref-option {
        transition: none;
    }
}

/* Staff email log (P1c) */
.email-stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
}
.email-subject-cell {
    display: inline-block;
    max-width: 28rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}
.email-log-card:hover,
.email-log-card:focus-visible {
    border-color: var(--bs-primary) !important;
    background-color: rgba(var(--bs-primary-rgb), 0.04);
}
.email-log-card:focus-visible {
    outline: 2px solid var(--dv-link);
    outline-offset: 2px;
}
.email-clear-reason {
    min-width: 12rem;
    max-width: 20rem;
}
.email-timeline {
    position: relative;
    padding-left: 1.5rem;
}
.email-timeline::before {
    content: "";
    position: absolute;
    left: 0.4rem;
    top: 0.3rem;
    bottom: 0.3rem;
    width: 2px;
    background-color: var(--bs-border-color);
}
.email-timeline-item {
    position: relative;
    padding-bottom: 1rem;
}
.email-timeline-item:last-child {
    padding-bottom: 0;
}
.email-timeline-item::before {
    content: "";
    position: absolute;
    left: -1.5rem;
    top: 0.35rem;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    border: 2px solid var(--bs-body-bg);
    background-color: #8C8579;
}
.email-tl-ok::before {
    background-color: var(--bs-success-text-emphasis);
}
.email-tl-bad::before {
    background-color: var(--bs-danger-text-emphasis);
}
.email-tl-warn::before {
    background-color: var(--bs-warning-text-emphasis);
}

/* HIPAA H1b D6: the absolute-limit notice. Fixed to the bottom of the viewport
   so it stays in view while the user saves their work, and clear of the top
   navigation, which holds the account menu. It cannot be dismissed. */
.session-limit-notice {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1080;
    margin: 0;
    padding: 0.875rem 1rem;
    border-radius: 0;
    border-width: 1px 0 0 0;
    text-align: center;
    font-weight: 600;
}
/* Room for the notice under the page content: two lines at 390px, one above md. */
body.session-limit-notice-open {
    padding-bottom: 5.5rem;
}
@media (min-width: 768px) {
    body.session-limit-notice-open {
        padding-bottom: 3.5rem;
    }
}
/* The idle-logoff countdown: larger than body text, digits that do not jump. */
.session-warning-countdown {
    font-size: 2rem;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
/* Settings > Security: the select holds "12 hours" at most; full width reads
   as unfinished at 1920 and wider. */
.session-limit-select {
    max-width: 16rem;
}
/* Settings > Security: the lockout select holds "50 failed attempts" at most. */
.lockout-select {
    max-width: 16rem;
}

/* H2c: audit trail outcome indicator (modeled on .dw-server-dot).
   The word is always shown next to the dot; color carries the state. */
.audit-outcome {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.audit-outcome-dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #8C8579;
}
.audit-outcome-dot-success {
    background-color: var(--bs-success-text-emphasis);
}
.audit-outcome-dot-denied {
    background-color: var(--bs-warning-text-emphasis);
}
.audit-outcome-dot-failure {
    background-color: var(--bs-danger-text-emphasis);
}

/* G9 honeypot: off screen, not display:none (some bots skip hidden fields). */
.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* G9 /cookies: a document card on the auth background. 46rem keeps lines
   near 80 characters at every width. */
.doc-card {
    max-width: 46rem;
    margin-left: auto;
    margin-right: auto;
}
.doc-card .card-header h1 {
    color: var(--dv-title);
    font-size: 1.35rem;
    margin: 0;
}
.doc-card .card-body {
    padding: 1.5rem;
}
.doc-card code {
    color: var(--dv-title);
}
.doc-summary {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.375rem;
    background-color: rgba(30, 90, 130, 0.1);
    color: var(--dv-title);
    font-weight: 600;
}
.doc-summary .fas {
    color: var(--dv-accent-fg);
    font-size: 1.25rem;
    margin-top: 0.1rem;
}
.doc-version {
    color: var(--bs-secondary-color);
    margin-bottom: 1rem;
}
.doc-draft {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.375rem;
    background-color: var(--bs-warning-bg-subtle);
    color: var(--bs-warning-text-emphasis);
    font-weight: 600;
}
.doc-draft .fas {
    color: var(--bs-warning-text-emphasis);
    font-size: 1.25rem;
    margin-top: 0.1rem;
}
.doc-list {
    padding-left: 1.25rem;
}
.doc-list li + li {
    margin-top: 0.25rem;
}
.legal-ack-line {
    color: var(--bs-secondary-color);
    text-align: center;
    margin: 0.75rem 0 0;
}
.doc-section-title {
    color: var(--dv-title);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.75rem 0 0.75rem;
}
.doc-item {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    padding: 1rem;
}
.doc-item + .doc-item {
    margin-top: 0.75rem;
}
.doc-item-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
}
.doc-meta dt {
    color: var(--bs-secondary-color);
    font-weight: 600;
}
.doc-meta dd {
    margin-bottom: 0.25rem;
}
.doc-origins dt {
    font-weight: 400;
    margin-top: 0.5rem;
}
.doc-origins dd {
    color: var(--bs-secondary-color);
    margin: 0.125rem 0 0;
}
@media (max-width: 575.98px) {
    .doc-card .card-body {
        padding: 1rem;
    }
}

/* G4: verified email change (my-account + /my-account/email) */
.account-email-display {
    flex: 1 1 18rem;
    min-width: 0;
}
.email-change-pending {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.email-change-pending-text {
    flex: 1 1 20rem;
    min-width: 0;
}

/* Dark accent tile (admin sales tax report). Same class as the cloud portal;
   here it follows the tenant navy token. */
.bg-dark-2 {
    background-color: var(--dv-navy) !important;
}

/* Tax-exemption documents (org detail, Tax card). Below md the row stacks:
   document and status side by side, the actions on their own full-width
   line, so a long name or reject reason is not squeezed beside the buttons. */
@media (max-width: 767.98px) {
    .tax-docs-table thead { display: none; }
    .tax-docs-table > tbody > tr:not(.collapse) { display: flex; flex-wrap: wrap; align-items: flex-start; }
    .tax-docs-table > tbody > tr:not(.collapse) > td:first-child { flex: 1 1 0; min-width: 0; border-bottom-width: 0; }
    .tax-docs-table > tbody > tr:not(.collapse) > td:nth-child(2) { flex: 0 0 auto; border-bottom-width: 0; }
    .tax-docs-table > tbody > tr:not(.collapse) > td.tax-doc-actions { flex: 0 0 100%; padding-top: 0; padding-bottom: .75rem; }
    .tax-docs-table .tax-doc-actions > .d-flex { justify-content: flex-start !important; }
}

/* Browser support notice (web/js/browser-check.js). Reuses .dv-banner and
   .dv-banner-warning from section 13. The base banner caps its height at 80px
   (it assumes one line), which would clip the wrapped text on a phone, so the
   notice lifts the cap. */
.dv-banner-browser.show {
    max-height: none;
}

/* The script adds its own container, in flow rather than sticky: a notice of
   several lines pinned under the navbar would cover the content on a phone. */
.banner-container-static {
    position: static;
}

.dv-banner-browser .dv-banner-body {
    min-width: 0;
}

.dv-banner-browser .dv-banner-body a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.dv-banner-browser .dv-banner-body a:hover {
    color: inherit;
    text-decoration-thickness: 2px;
}

.dv-banner-browser .dv-banner-body a:focus-visible,
.dv-banner-browser .dv-banner-close:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* A 2.75rem (44px) tap target for the close button, with negative margins so
   the banner is not taller than its text needs. Opacity 0.8, not the base 0.5,
   keeps the glyph above 3:1 on the warning background. */
.dv-banner-browser .dv-banner-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    margin: -0.5rem -0.5rem -0.5rem 0.25rem;
    opacity: 0.8;
}

.dv-banner-browser .dv-banner-close:hover,
.dv-banner-browser .dv-banner-close:focus-visible {
    opacity: 1;
}

/* H10a access review (ra-*) */

/* tables */
.ra-table td, .ra-table th { padding: .85rem .75rem; }
.ra-table th { white-space: nowrap; }
.ra-table .btn-sm { min-height: 36px; }
.ra-table > tbody > tr.ra-row-warn > * { --bs-table-bg: var(--bs-warning-bg-subtle); --bs-table-hover-bg: var(--bs-warning-bg-subtle); } /* no-MFA row tint, hover tint */
.ra-pcell { min-width: 280px; }                                   /* keeps an email on one line */

/* summary tiles */
.ra-tiles { display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .ra-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* S13: the KB page tiles number five; five columns from lg (leaves .ra-tiles alone). */
@media (min-width: 992px) { .ra-tiles-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.ra-tile { display: block; text-align: left; background: var(--dv-surface); border: 1px solid var(--bs-border-color); border-radius: .375rem;
           padding: .85rem 1rem; box-shadow: 0 1px 3px rgba(0, 0, 0, .04); color: inherit; text-decoration: none;
           font: inherit;                                          /* tiles are <button>s on the org report */
           transition: border-color .15s, box-shadow .15s; }       /* #D9D3CA: same literal style.css uses for .card */
a.ra-tile:hover, button.ra-tile:hover { border-color: var(--bs-primary); box-shadow: 0 4px 12px rgba(0, 0, 0, .08); color: inherit; }
a.ra-tile:focus-visible, button.ra-tile:focus-visible { outline: 2px solid var(--dv-accent-fg); outline-offset: 2px; }
.ra-tile.is-active { border-color: var(--bs-primary); box-shadow: 0 0 0 1px var(--bs-primary); }
.ra-tile-static { cursor: default; }
.ra-tile-n { font-size: 1.6rem; font-weight: 700; line-height: 1.2; color: var(--dv-title); }
.ra-tile-n.is-warn { color: var(--bs-warning-text-emphasis); }                              /* amber number, passes AA on white */
.ra-tile-l { color: var(--bs-secondary-color); }
@media (prefers-reduced-motion: reduce) { .ra-tile { transition: none; } }

/* phone cards (below md) */
.ra-card-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.ra-card.is-warn { background: var(--bs-warning-bg-subtle); }                           /* no-MFA card tint */
.ra-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem 1rem; }
.ra-fl { color: var(--bs-secondary-color); font-weight: 600; font-size: .875rem; }   /* fact label; a class, never <small> */
.ra-orgs { border-top: 1px solid var(--bs-border-color); margin-top: 1rem; padding-top: .75rem; }   /* #D9D3CA: same as .card-header border */
.ra-orgline { display: flex; justify-content: space-between; gap: .75rem; padding: .2rem 0; }
.ra-orgline > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.ra-minw0 { min-width: 0; }

/* "+N more" fold (Bootstrap collapse, label swapped by CSS, no JS of our own) */
.ra-fold { background: none; border: 0; padding: 0; color: var(--dv-link); font: inherit; cursor: pointer; }
.ra-fold:hover { text-decoration: underline; }
.ra-fold:focus-visible { outline: 2px solid var(--dv-accent-fg); outline-offset: 2px; }
.ra-fold[aria-expanded="true"] .ra-fold-closed { display: none; }
.ra-fold[aria-expanded="false"] .ra-fold-open { display: none; }

/* phone tap targets and modal footer stacking */
@media (max-width: 767.98px) { .ra-filters .btn, .ra-tap { min-height: 44px; } }
@media (max-width: 575.98px) {
    .ra-footer { flex-direction: column-reverse; }
    .ra-footer .btn { width: 100%; min-height: 44px; }
}

/* E-signature (E7) */
/* Staff Documents page (admin-esign.php). Reuses the .ra-* access-review
   primitives; only the additions live here. */
.ra-factwide { grid-column: 1 / -1; }    /* a ra-facts cell spanning both columns */

/* Status as a dot plus a bold word (the audit trail's .audit-outcome pattern). */
/* nowrap: a wrapped label once left its dot stranded across the card (390, 2026-10-11). */
.esign-status { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; white-space: nowrap; }
.esign-status-dot { flex-shrink: 0; width: 10px; height: 10px; border-radius: 50%; background-color: #8C8579; }
.esign-status-dot-waiting { background-color: var(--bs-warning-text-emphasis); }
.esign-status-dot-action { background-color: var(--bs-primary); }
.esign-status-dot-done { background-color: var(--bs-success-text-emphasis); }
.esign-status-dot-stopped { background-color: var(--bs-danger-text-emphasis); }

/* N5 addendum thread (settings-document.php, admin-esign-envelope.php). One
   negotiated round per .esign-round; the proposed text is plain text. The
   'neutral' tone needs no class: it is the base .esign-status-dot color. */
.esign-round { padding: 0.75rem 0; }
.esign-round + .esign-round { border-top: 1px solid var(--bs-border-color); }
.esign-round-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 0.75rem; margin-bottom: 0.4rem; }
.esign-ptext { white-space: normal; overflow-wrap: anywhere; }
/* A round's outcome line is a sentence, not a badge: it wraps on a phone. */
.esign-round .esign-status { white-space: normal; align-items: flex-start; }
.esign-round .esign-status .esign-status-dot { margin-top: 0.45em; }
.esign-round .ra-fl { margin-top: 0.5rem; }
[data-esign-clamp-toggle]:not(.d-none) + .form-text { margin-left: 0.5rem; }
.esign-addendum-card summary, .esign-sign-card summary { padding: 0.6875rem 0; }
.esign-ptext.esign-clamped { max-height: 12rem; overflow: hidden; }
/* PRD 3.7: at phone width with the counter form open, Accept is an outline so
   "Send to <op>" is the only primary button. */
@media (max-width: 767.98px) { .esign-accept-demote { --bs-btn-color: var(--dv-link); --bs-btn-bg: transparent; --bs-btn-border-color: var(--bs-primary); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--bs-primary); } }

/* Staff envelope page (admin-esign-envelope.php). */
@media (min-width: 992px) { .esign-action-card { position: sticky; top: calc(var(--dv-navbar-height) + 1rem); } }
.esign-hash-full { word-break: break-all; }
/* Hashes in the brand navy, as on document cards (.doc-card code), not the
   framework's default code pink. */
.esign-hash, .esign-hash-full { color: var(--dv-title); }
/* "or" between the passkey button and the password-and-code proof. */
.esign-proof-or {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
    color: var(--bs-secondary-color);
}
.esign-proof-or::before,
.esign-proof-or::after {
    content: '';
    flex: 1;
    border-top: 1px solid var(--bs-border-color);
}

/* E-signature (E8) */
/* Org document page (settings-document.php). The review HTML is the frozen
   document's <main class="esign-body">; typography here, nothing inline. */
.esign-review .esign-body { font-size: 1rem; line-height: 1.6; color: var(--bs-body-color); }
.esign-review .esign-body h1 { font-size: 1.5rem; line-height: 1.3; margin-bottom: 0.75rem; }
.esign-review .esign-body h2 { font-size: 1.25rem; line-height: 1.3; margin-top: 1.25rem; margin-bottom: 0.5rem; }
.esign-review .esign-body h3 { font-size: 1.1rem; margin-top: 1rem; margin-bottom: 0.5rem; }
.esign-review .esign-body p { margin-bottom: 1rem; }
.esign-review .esign-body ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.esign-review .esign-body ul { margin-bottom: 1rem; padding-left: 1.5rem; }
.esign-review .esign-body table { width: 100%; margin-bottom: 1rem; border-collapse: collapse; }
/* Phones: a fixed layout lets long cells wrap inside 390 px; desktop keeps columns sized to content. */
@media (max-width: 767.98px) { .esign-review .esign-body table { table-layout: fixed; } }
.esign-review .esign-body table th, .esign-review .esign-body table td {
    border: 1px solid var(--bs-border-color); padding: 0.5rem 0.75rem; vertical-align: top; overflow-wrap: anywhere;
}

/* Collapsed preview: only when esign.js has marked <html class="js"> (the
   codebase has no other JS gate). Without JS the whole document stays shown. */
.js .esign-review-collapsed {
    max-height: 480px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 75%, transparent);
    mask-image: linear-gradient(to bottom, #000 75%, transparent);
}
.esign-review-toggle { padding-left: 0; }

/* The signing panel sticks beside the document at lg and up. */
@media (min-width: 992px) { .esign-sign-card { position: sticky; top: calc(var(--dv-navbar-height) + 1rem); } }

/* Phone: the sticky bottom bar, and room for it below the last field. */
.esign-bottom-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    display: flex; gap: 0.5rem; padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    background-color: var(--bs-body-bg); border-top: 1px solid var(--bs-border-color);
}
@media (max-width: 991.98px) { .esign-doc-page.esign-has-bar { padding-bottom: 5rem; } }

/* ---- Support (S3/S6) ---- */

/* Bootstrap 5.3 has no responsive width utilities: the support filter and
   search rows run full width on phones (w-100) and size to content from md. */
@media (min-width: 768px) { .w-md-auto { width: auto !important; } }

/* S1: a link with no underline at rest, underlined on hover and focus. */
.support-link { text-decoration: none; }
.support-link:hover,
.support-link:focus-visible { text-decoration: underline; }

/* S4: the help index article links read as links (list-group-item-action is grey). */
.help-list-link { color: var(--dv-link); }

/* S17: the read-only allowlist textareas do not offer a resize handle. */
.support-readonly { resize: none; }

/* S9: the author role chip is body-size text, never a shrunk .badge. */
.support-msg-role { margin-left: 0.5rem; }
.support-msg-role-customer { color: var(--bs-secondary-color); }
.support-msg-role-public { color: var(--dv-link); }
.support-msg-role-internal { color: var(--bs-warning-text-emphasis); }

/* Ticket thread message (customer view and staff view). */
.support-msg {
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    overflow-wrap: anywhere;
}

/* Internal staff note: amber, dashed border (D32). */
.support-msg-internal {
    background-color: var(--bs-warning-bg-subtle);
    border: 1px dashed var(--bs-warning-border-subtle);
}

/* Reply attachment input: auto width beside the send button, but never
   wider than its card. A file input's intrinsic width passed a 390px
   viewport by 10px (demo QA, 2026-10-13). */
.support-file {
    max-width: 100%;
}

/* Composer: the visibility radios are styled as tabs, so the choice
   works without JS; support.js only adds the amber state. Pinned markup
   (review S9-S11 S4): each radio is an input.btn-check immediately
   followed by its label, so the rules below only ever match that pair. */
.support-composer {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    overflow: hidden;
}
.support-composer input[name="visibility"] + label {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin: 0 0.5rem 0.5rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.25rem;
    background-color: transparent;
    color: var(--bs-body-color);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}
.support-composer input[name="visibility"] + label:hover {
    border-color: var(--bs-primary);
}
/* S8: the selected tab is the tinted one, not the grey-filled one. */
.support-composer input[name="visibility"]:checked + label {
    background-color: color-mix(in srgb, var(--bs-primary) 12%, var(--bs-body-bg));
    border-color: var(--bs-primary);
    color: var(--dv-link);
    font-weight: 600;
}
.support-composer input[name="visibility"]:focus-visible + label {
    outline: 2px solid var(--dv-accent-fg);
    outline-offset: 1px;
}
/* Amber state, toggled by support.js when "Internal note" is chosen. */
.support-composer-internal {
    border-color: var(--bs-warning-border-subtle);
    background-color: var(--bs-warning-bg-subtle);
}

/* D26 refusal screen: a matched value in the posted text. */
.kb-finding {
    background-color: var(--bs-warning-bg-subtle);
    border-bottom: 1px dashed var(--bs-warning-border-subtle);
    padding: 0 0.125rem;
    border-radius: 0.125rem;
}

/* D26 refusal screen: live text beside the posted text. */
.kb-sidebyside {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 992px) {
    .kb-sidebyside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.kb-sidebyside > div {
    min-width: 0;
    padding: 0.75rem 1rem;
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
}
.kb-sidebyside pre {
    margin: 0;
    font-size: 0.925rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
/* S15: outside the red alert the side-by-side reads in body color, and the
   posted revision carries the amber border. */
.kb-refusal-sidebyside { color: var(--bs-body-color); }
.kb-sidebyside > div.kb-sidebyside-warn { border-color: var(--bs-warning); }

/* D27 approval queue: the line diff against live. */
.kb-diff-add,
.kb-diff-del {
    display: block;
    padding: 0 0.25rem;
    overflow-wrap: anywhere;
}
.kb-diff-add { background-color: var(--bs-success-bg-subtle); }
.kb-diff-del { background-color: var(--bs-danger-bg-subtle); text-decoration: line-through; }

/* D29 help article body: images and wide tables stay inside the card. */
/* S3: body headings below the title weight, and a readable measure. */
.kb-article { max-width: 72ch; }
.kb-article h2 { font-size: 1.25rem; }
.kb-article h3 { font-size: 1.1rem; }
.kb-article img {
    max-width: 100%;
    height: auto;
}
.kb-article table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    margin-bottom: 1rem;
}
.kb-article th,
.kb-article td {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--bs-border-color);
}

/* D29 help article: the "On this page" rail. */
.help-toc {
    padding: 0.75rem 1rem;
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
}
.help-toc ul { list-style: none; margin: 0; padding-left: 0; }
.help-toc li { margin: 0.25rem 0; }
.help-toc a {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    color: var(--dv-link);
    text-decoration: none;
}
.help-toc a:hover {
    background-color: var(--bs-primary-bg-subtle);
    text-decoration: underline;
}
.help-toc a:focus-visible {
    outline: 2px solid var(--dv-accent-fg);
    outline-offset: 1px;
}

/* Open form: the help suggestions under the subject field. */
#support-suggestions {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0.375rem;
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
}
#support-suggestions li { margin: 0.125rem 0; }
#support-suggestions a {
    display: block;
    padding: 0.375rem 0.5rem;
    border-radius: 0.25rem;
    color: var(--dv-link);
    text-decoration: none;
}
#support-suggestions a:hover {
    background-color: var(--bs-primary-bg-subtle);
    text-decoration: underline;
}
#support-suggestions a:focus-visible {
    outline: 2px solid var(--dv-accent-fg);
    outline-offset: 1px;
}

/* Telecom (phone service) */
.telecom-history-group td, .list-group-item.telecom-history-group {
    background: var(--dv-surface-2);
    color: var(--bs-body-color);
    font-weight: 600;
}
.telecom-history-row td, .list-group-item.telecom-history-row {
    color: var(--bs-secondary-color);
}
.telecom-panel {
    background: var(--dv-surface-2);
}
.telecom-preview {
    background: var(--dv-surface-2);
}
@media (min-width: 992px) {
    .telecom-preview {
        border-left: 1px solid var(--bs-border-color);
    }
}
.telecom-timeline {
    list-style: none;
    padding-left: 0;
}
.telecom-timeline li {
    position: relative;
    padding-left: 1.5rem;
    padding-bottom: 1rem;
}
.telecom-timeline li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .45rem;
    width: 10px;
    height: 10px;
    background: #8C8579;
    border-radius: 50%;
}
.telecom-timeline li.is-current::before {
    background: var(--bs-success-text-emphasis);
}

/* MCP access (M3): admin-mcp*.php. Reuses the .ra-* card, fact, fold and tap
   primitives, .audit-outcome and the .dw-customize-row checklist rows. */
.mcp-form-card { max-width: 55rem; }                                  /* a one-column form does not stretch to 1920 */
.mcp-token { color: var(--dv-title); word-break: break-all; font-size: 1rem; }   /* the shown-once token, like .esign-hash-full */
.mcp-snippet { white-space: pre-wrap; word-break: break-all; color: var(--dv-title); }
.mcp-snippet code { color: inherit; }
.mcp-tool-group { font-weight: 600; margin: 1rem 0 .5rem; }
.table > tbody > tr.mcp-row-dead > * { color: var(--bs-secondary-color); }   /* revoked and expired tokens */

/* Dark mode (P4b): Bootstrap utilities that are light-only, under dark (no markup edits; D5). */
[data-bs-theme="dark"] .bg-white {
    background-color: var(--dv-surface) !important;
}
[data-bs-theme="dark"] .bg-light {
    background-color: var(--dv-surface-2) !important;
}
[data-bs-theme="dark"] .text-dark {
    color: var(--bs-body-color) !important;
}
[data-bs-theme="dark"] .btn-light {
    --bs-btn-color: var(--bs-body-color);
    --bs-btn-bg: var(--dv-surface-2);
    --bs-btn-border-color: var(--bs-border-color);
    --bs-btn-hover-color: var(--bs-body-color);
    --bs-btn-hover-bg: var(--dv-hover-tint);
    --bs-btn-hover-border-color: var(--bs-border-color);
    --bs-btn-active-color: var(--bs-body-color);
    --bs-btn-active-bg: var(--dv-hover-tint);
    --bs-btn-active-border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .table-light {
    --bs-table-color: var(--bs-body-color);
    --bs-table-bg: var(--dv-surface-2);
    --bs-table-border-color: var(--bs-border-color);
    --bs-table-striped-bg: var(--bs-secondary-bg);
    --bs-table-striped-color: var(--bs-body-color);
    --bs-table-active-bg: var(--bs-secondary-bg);
    --bs-table-active-color: var(--bs-body-color);
    --bs-table-hover-bg: var(--bs-secondary-bg);
    --bs-table-hover-color: var(--bs-body-color);
}

/* Dark mode (P4b): the stock lockups come in pairs; show the one for the mode (D6). */
.brand-on-dark {
    display: none;
}
[data-bs-theme="dark"] .brand-on-light {
    display: none;
}
[data-bs-theme="dark"] .brand-on-dark {
    display: inline;
}

/* Dark mode (P4b): the Appearance options (avatar menu and public toggle; .active marks the current one) and the
   public corner toggle (44px; translucent white on the navy login, tokens on the stock light login). */
.dropdown-item[data-color-mode-option] {
    display: flex;
    align-items: center;
}
.dropdown-item[data-color-mode-option].active {
    color: var(--bs-body-color);
    background-color: transparent;
}
.color-mode-check {
    visibility: hidden;
    margin-left: auto;
}
.dropdown-item[data-color-mode-option].active .color-mode-check {
    visibility: visible;
}
.dropdown-item[data-color-mode-option].active:hover,
.dropdown-item[data-color-mode-option].active:focus-visible {
    background-color: var(--dv-hover-tint);
}
.color-mode-public {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
}
.color-mode-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.5rem;
    background-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.125rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.color-mode-toggle:hover,
.color-mode-toggle[aria-expanded="true"] {
    background-color: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}
.color-mode-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
body.auth-page.auth-stock .color-mode-toggle {
    border-color: var(--dv-control-border);
    background-color: var(--dv-surface);
    color: var(--bs-body-color);
}
body.auth-page.auth-stock .color-mode-toggle:hover,
body.auth-page.auth-stock .color-mode-toggle[aria-expanded="true"] {
    border-color: var(--dv-control-border);
    background-color: var(--dv-hover-tint);
    color: var(--dv-title);
}
body.auth-page.auth-stock .color-mode-toggle:focus-visible {
    outline: 2px solid var(--dv-accent-fg);
}

/* Dark mode fix batch 1: stock Bootstrap pieces that were light-only. */
[data-bs-theme="dark"] .btn-outline-secondary {
    --bs-btn-color: var(--bs-secondary-color);
    --bs-btn-border-color: var(--dv-control-border);
    --bs-btn-hover-bg: var(--dv-hover-tint);
    --bs-btn-hover-color: var(--dv-title);
    --bs-btn-hover-border-color: var(--dv-control-border);
    --bs-btn-active-bg: var(--bs-secondary-color);
    --bs-btn-active-color: var(--bs-body-bg);
    --bs-btn-active-border-color: var(--bs-secondary-color);
}
[data-bs-theme="dark"] .dropdown-menu {
    --bs-dropdown-header-color: var(--bs-secondary-color);
}
[data-bs-theme="dark"] .text-success {
    color: var(--bs-success-text-emphasis) !important;
}
[data-bs-theme="dark"] .text-danger {
    color: var(--bs-danger-text-emphasis) !important;
}
[data-bs-theme="dark"] .text-primary {
    color: var(--dv-link) !important;
}
[data-bs-theme="dark"] .bg-dark {
    background-color: var(--dv-neutral-bg) !important;
}
[data-bs-theme="dark"] .btn-dark {
    --bs-btn-bg: var(--dv-neutral-bg);
    --bs-btn-border-color: var(--dv-neutral-bg);
}
[data-bs-theme="dark"] .text-bg-light {
    color: var(--bs-body-color) !important;
    background-color: var(--dv-neutral-bg) !important;
}
[data-bs-theme="dark"] .btn-outline-primary {
    --bs-btn-border-color: var(--dv-link);
    --bs-btn-hover-border-color: var(--dv-link);
}
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    border-color: var(--dv-link);
}
/* A focused invalid field keeps its red border (this rule is after the dark focus rule above). */
[data-bs-theme="dark"] .form-control.is-invalid:focus,
[data-bs-theme="dark"] .form-select.is-invalid:focus,
[data-bs-theme="dark"] .was-validated .form-control:invalid:focus,
[data-bs-theme="dark"] .was-validated .form-select:invalid:focus {
    border-color: var(--bs-form-invalid-border-color);
}

/* -------------------------------------------------------------
   Setup guide ("Set up your account", onboarding P5)
   -------------------------------------------------------------
   The guide is server-rendered by private/inc/setup-guide-view.php and
   behaves through web/js/setup-guide.js, so this block styles states the
   script sets (the hidden attribute, .sg-collapsed) and never sets one
   itself: no inline style, and no display rule on a wrapper whose visibility
   the markup already carries through the d-* utilities (R4, R6). The desktop
   piece is a floater fixed to the bottom right at lg and up; below lg the
   same tasks are the Dashboard card and the menu row (R1). Type is never
   smaller than the body size: hierarchy comes from weight and color (R5).
   Colors are the portal tokens, so the [data-bs-theme="dark"] values at the
   top of this file carry the dark mode; only the panel shadow is a literal,
   as it is elsewhere in this stylesheet (R10). */

/* 1. The desktop floater (R6): under modals (1055) and offcanvas (1045). */
.sg-floater {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 23rem;
    max-width: calc(100vw - 3rem);
    background-color: var(--dv-surface);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    box-shadow: 0 10px 28px rgba(15, 46, 68, 0.18), 0 2px 6px rgba(15, 46, 68, 0.08);
    z-index: 1030;
}

/* Existing fixed notices and toasts must leave the guide controls clear. */
@media (min-width: 992px) {
    .sg-floater {
        bottom: max(1.5rem, calc(var(--sg-floater-lift, 0px) + 0.75rem));
    }
    body.session-limit-notice-open .sg-floater {
        bottom: max(5rem, calc(var(--sg-floater-lift, 0px) + 0.75rem));
    }
    .toast-container {
        bottom: calc(1.5rem + var(--sg-floater-h, 0px) + var(--sg-floater-lift, 0px) + 0.75rem);
    }
    body.session-limit-notice-open .toast-container {
        bottom: calc(5rem + var(--sg-floater-h, 0px) + var(--sg-floater-lift, 0px) + 0.75rem);
    }
}

/* 2. The phone card: in the page flow, not floating (R1). */
.sg-card {
    background-color: var(--dv-surface);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(15, 46, 68, 0.06);
    margin-bottom: 1.25rem;
    padding-bottom: 0.25rem;
}

/* 3. Header: title plus the live count line, and the collapse toggle. */
.sg-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 0.75rem 0.85rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}
.sg-head-text {
    flex: 1 1 auto;
    min-width: 0;
}
.sg-title {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.3;
    color: var(--dv-heading);
}
.sg-sub {
    margin: 0.15rem 0 0;
    color: var(--dv-muted-text);
}
.sg-card .sg-head {
    padding: 0.9rem 0.75rem 0.6rem 1rem;
}

/* The collapse toggle: a 44px square with a chevron that the collapsed state
   turns. Its label and aria-expanded are set by the script. */
.sg-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    min-height: 2.75rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    background-color: transparent;
}
.sg-chev {
    width: 0.5625rem;
    height: 0.5625rem;
    border-right: 2px solid var(--dv-heading);
    border-bottom: 2px solid var(--dv-heading);
    transform: rotate(-135deg) translate(-2px, -2px);
}
.sg-toggle:hover {
    background-color: var(--dv-hover-tint);
    border-color: var(--bs-border-color);
}
.sg-toggle:focus-visible {
    outline: 2px solid var(--dv-accent-fg);
    outline-offset: 2px;
}
.sg-collapsed .sg-chev {
    transform: rotate(45deg) translate(-2px, -2px);
}

/* 4. Progress (R7): the fill's width comes from a percent class, never from an
   inline width. sg-p-* are the 21 steps of five percent the view can emit. */
.sg-bar {
    height: 0.375rem;
    margin: 0.75rem 1rem 0;
    border-radius: 0.1875rem;
    background-color: var(--dv-info-bg);
    overflow: hidden;
}
.sg-bar-fill {
    display: block;
    height: 100%;
    width: var(--sg-p, 0%);
    border-radius: 0.1875rem;
    background-color: var(--bs-primary);
}

/* 5. The task list (R3: the engine's label, escaped and truncated). A row is the
   link; the mark shows done, skipped or next. */
.sg-list {
    list-style: none;
    margin: 0;
    padding: 0.25rem 0 0;
    max-height: 20rem;
    overflow: auto;
}
.sg-li {
    margin: 0;
}
/* The rows the phone card folds away with "Show all" are hidden by the
   [hidden] attribute the markup carries, and the script clears it in place. */
.sg-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-height: 3.25rem;
    padding: 0.7rem 1rem;
    border-radius: 0.375rem;
    color: var(--bs-body-color);
    text-decoration: none;
}
.sg-item-label {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.sg-act {
    flex: none;
    align-self: center;
    color: var(--dv-link);
    font-weight: 700;
}
.sg-dot {
    flex: none;
    width: 1.375rem;
    height: 1.375rem;
    margin-top: 0.1rem;
    border: 2px solid var(--dv-control-border);
    border-radius: 50%;
    background-color: var(--dv-surface);
}
.sg-dot-next {
    border-color: var(--bs-primary);
}
.sg-dot-skip {
    background-color: var(--dv-neutral-bg);
}
/* The done tick and the skip dash are drawn, not typed, so the row's text stays
   exactly what the engine wrote. */
.sg-dot-done {
    border-color: var(--bs-success-text-emphasis);
    background-color: var(--bs-success-text-emphasis);
}
.sg-dot-done::after {
    content: "";
    display: block;
    width: 0.375rem;
    height: 0.6875rem;
    margin: -0.0625rem 0 0 0.375rem;
    border: solid var(--dv-surface);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.sg-dot-skip::after {
    content: "";
    display: block;
    width: 0.625rem;
    height: 2px;
    margin: 0.4375rem auto 0;
    background-color: var(--dv-muted-text);
}
.sg-p-0 { --sg-p: 0%; }
.sg-p-5 { --sg-p: 5%; }
.sg-p-10 { --sg-p: 10%; }
.sg-p-15 { --sg-p: 15%; }
.sg-p-20 { --sg-p: 20%; }
.sg-p-25 { --sg-p: 25%; }
.sg-p-30 { --sg-p: 30%; }
.sg-p-35 { --sg-p: 35%; }
.sg-p-40 { --sg-p: 40%; }
.sg-p-45 { --sg-p: 45%; }
.sg-p-50 { --sg-p: 50%; }
.sg-p-55 { --sg-p: 55%; }
.sg-p-60 { --sg-p: 60%; }
.sg-p-65 { --sg-p: 65%; }
.sg-p-70 { --sg-p: 70%; }
.sg-p-75 { --sg-p: 75%; }
.sg-p-80 { --sg-p: 80%; }
.sg-p-85 { --sg-p: 85%; }
.sg-p-90 { --sg-p: 90%; }
.sg-p-95 { --sg-p: 95%; }
.sg-p-100 { --sg-p: 100%; }
/* 6. The footer: the hide control on desktop, "Show all" on phone. Both are
   real controls at 44px, never shrunk text (R5). */
.sg-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.5rem 0.75rem 0.5rem 1rem;
    border-top: 1px solid var(--bs-border-color);
}
.sg-hide-form {
    margin: 0;
}
.sg-btn.sg-show-all,
.sg-btn.sg-hide {
    min-height: 2.75rem;
    padding: 0 0.5rem;
    font-weight: 400;
    color: var(--dv-muted-text);
    background-color: transparent;
    border-color: transparent;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.sg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--dv-control-border);
    border-radius: 0.375rem;
    background-color: var(--dv-surface);
    color: var(--bs-body-color);
    font-weight: 700;
    text-align: center;
    cursor: pointer;
}
.sg-btn-primary {
    border-color: var(--bs-primary);
    background-color: var(--bs-primary);
    color: var(--dv-surface);
}
.sg-btn-outline {
    border-color: var(--bs-primary);
    color: var(--dv-link);
}
.sg-row:hover {
    background-color: var(--dv-hover-tint);
    color: var(--dv-title);
}
.sg-row:focus-visible {
    outline: 2px solid var(--dv-accent-fg);
    outline-offset: -2px;
}
.sg-btn:hover {
    background-color: var(--dv-hover-tint);
    border-color: var(--bs-primary);
    color: var(--dv-title);
}
.sg-btn:focus-visible {
    outline: 2px solid var(--dv-accent-fg);
    outline-offset: 2px;
}
/* Links in look (design gd-link.muted): .sg-btn:hover's tint and border do not apply. */
.sg-btn.sg-show-all:hover,
.sg-btn.sg-hide:hover {
    background-color: transparent;
    border-color: transparent;
    color: var(--dv-title);
}
.sg-show-all:focus-visible,
.sg-hide:focus-visible {
    outline: 2px solid var(--dv-accent-fg);
    outline-offset: 2px;
}

/* 7. The two states the guide can be in but does not show on its own (R15).
   They are emitted hidden and only the script ever reveals them, so their job
   here is to be readable the moment that happens. */
.sg-state {
    padding: 1rem;
}
.sg-state-text {
    margin: 0 0 0.25rem;
    font-weight: 700;
    color: var(--dv-heading);
}
.sg-state-note {
    margin: 0 0 0.75rem;
    color: var(--dv-muted-text);
}

/* 8. The account-menu and phone-menu count rows. They keep the host menu's own
   metrics; this only carries the count to the right and the guide's link color
   in the drawer, where the labels are light on the rail. */
.sg-menu {
    color: inherit;
    text-decoration: none;
}
.sg-menu .sg-count {
    margin-left: auto;
    padding-left: 0.75rem;
    color: var(--dv-muted-text);
    font-weight: 400;
}
.offcanvas.mobile-nav .sg-menu .sg-count {
    color: var(--dv-drawer-text);
    opacity: 0.85;
}
.sg-menu-plain {
    cursor: default;
}
.sg-menu:hover {
    color: inherit;
}
.sg-menu:focus-visible {
    outline: 2px solid var(--dv-accent-fg);
    outline-offset: -2px;
}

/* 9. Dark mode (R10): the tokens above already flip the surfaces, borders and
   text, so what is left is the one literal in this block, the panel shadow, and
   the white tick on a done mark. No new palette. */
[data-bs-theme="dark"] .sg-floater {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35);
}
[data-bs-theme="dark"] .sg-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
[data-bs-theme="dark"] .sg-dot {
    border-color: var(--bs-secondary-color);
}
[data-bs-theme="dark"] .sg-dot-next {
    border-color: var(--dv-link);
}
/* Dark progress: the track clears 3:1 on the panel and the fill is the tenant's light link color. */
[data-bs-theme="dark"] .sg-bar {
    background-color: var(--dv-control-border);
}
[data-bs-theme="dark"] .sg-bar-fill {
    background-color: var(--dv-link);
}
[data-bs-theme="dark"] .sg-dot-done {
    border-color: var(--bs-success-text-emphasis);
    background-color: var(--bs-success-text-emphasis);
}
[data-bs-theme="dark"] .sg-dot-done::after {
    border-color: var(--dv-surface);
}
[data-bs-theme="dark"] .sg-btn-primary {
    border-color: var(--dv-link);
    background-color: var(--dv-link);
    color: var(--dv-page-bg);
}

/* The floater and the card carry no animation unless the customer wants one:
   the collapse is a state change, not a show. */
@media (prefers-reduced-motion: no-preference) {
    .sg-floater {
        transition: box-shadow 150ms ease;
    }
    .sg-bar-fill {
        transition: width 200ms ease;
    }
}

/* App shell seam (B6b, web/js/app-shell.js): the quick exit in the header row (same height and edge as .menu-btn),
   and the public row beside the Appearance toggle. Its colors are the Menu button's tokens, and hover fills with the
   ink like the primary action, so it reads as a safety control. */
.dv-quick-exit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 10px;
    border: 1px solid var(--dv-control-border);
    border-radius: 6px;
    background-color: var(--dv-hover-tint);
    color: var(--dv-title);
    font-weight: 700;
    font-size: 0.9375rem;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
@media (min-width: 768px) {
    .dv-quick-exit {
        padding: 0 12px;
    }
}
.dv-quick-exit:hover,
.dv-quick-exit:active {
    background-color: var(--dv-ink-fill);
    border-color: var(--dv-ink-fill);
    color: #fff;
    text-decoration: none;
}
.dv-quick-exit:focus-visible {
    outline: 2px solid var(--dv-accent-fg);
    outline-offset: 2px;
}
.dv-quick-exit .fa-xmark {
    font-size: 1.125rem;
}
.dv-quick-exit kbd {
    padding: 0 5px;
    border: 1px solid currentColor;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.4;
}
.dv-qx-public {
    position: absolute;
    top: 1rem;
    right: calc(1rem + 44px + 0.5rem);
    z-index: 2;
}
/* Top-aligned public pages (legal, 404) start the lockup at mt-5 (3rem), under the exit's 1rem + 44px: start the
   container below it. Pages that center their card already clear it. */
.dv-qx-public + .container-xl {
    padding-top: 1.5rem;
}
.dv-qx-leaving body {
    visibility: hidden;
    opacity: 0 !important; /* visibility is inherited: a descendant set to visible would still paint (review r1 LOW-2) */
}
