h1:focus {
    outline: none;
}

.mud-drawer-mini:not(.mud-drawer--open) .rivalitas-sidebar-label,
.mud-drawer-mini:not(.mud-drawer--open) .rivalitas-sidebar-brand {
    display: none;
}

.rivalitas-user-name {
    display: none;
    font-size: 13px;
    color: var(--color-slate-700);
}

@media (min-width: 480px) {
    .rivalitas-user-name {
        display: inline;
    }
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* Real estate form header — switch label text white on dark background.
   MudBlazor 9.x renders label text as:
   <span class="mud-typography mud-typography-body1 mud-switch mud-input-content-placement-end"> */
.re-form-toggles span.mud-switch {
    color: #fff !important;
}

/* Leads floating selection bar — ghost button overrides */
.leads-sel-bar .mud-button-outlined-inherit {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.25);
}
.leads-sel-bar .mud-button-outlined-inherit:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Document upload dialog — hide the native InputFile element; the styled label is used instead */
#doc-upload-input {
    display: none;
}

/* Admin save bar: offset left to clear the mini sidebar on desktop.
   The scoped .razor.css does not set `left` so this is the sole source of truth.
   MudBlazor mini drawer widths: open=220px, closed=52px (matches RivalitasSideNav Width/MiniWidth). */
.re-save-bar {
    left: 0;
}

@media (min-width: 960px) {
    .re-save-bar {
        left: 52px;
        transition: left 225ms cubic-bezier(0.4, 0, 0.6, 1) 0ms;
    }
    .mud-layout.mud-drawer-open-mini-md-left .re-save-bar {
        left: 220px;
    }
}

/* Generate showing template dialog — allow buyer picker dropdown to overflow dialog bounds */
.gt-showing-dialog,
.gt-showing-dialog .mud-dialog-content {
    overflow: visible;
}

/* Admin sidebar on phones: the admin layout is statically rendered, so the
   sidebar can't use a Blazor toggle. The top-bar hamburger (browser-native JS in
   AdminLayout) slides the MudBlazor drawer in/out as an off-canvas overlay via the
   `rivalitas-mnav-open` body class. A "phone" is any viewport under 960px WIDE or
   under 600px TALL: the 960px width covers large phones and foldables (e.g. Galaxy
   Z Fold unfolded ~884px) that are wider than any iPhone but still handheld touch
   devices; the 600px height keeps landscape phones on the overlay. Desktops (>=960px
   wide and >=600px tall) are untouched — every rule below lives inside the media
   query, the scrim is display:none by default, and the cutoff aligns with the
   `min-width: 960px` save-bar rule above and Breakpoint.Md in RivalitasSideNav. */
.rivalitas-nav-scrim {
    display: none;
}

.rivalitas-admin-content {
    padding: 1.5rem 2rem;
}

@media (max-width: 959px), (max-height: 599px) {
    .mud-drawer.mud-drawer-pos-left {
        transform: translateX(-100%);
        transition: transform 225ms cubic-bezier(0.4, 0, 0.6, 1);
        /* !important to beat MudBlazor's own drawer z-index (1302), which would
           otherwise sit below the scrim (1390) and let the scrim intercept taps. */
        z-index: 1400 !important;
    }

    /* The drawer is an off-canvas overlay on phones, so it must not reserve any
       layout space. MudBlazor keeps a margin-left on the main content for the
       mini drawer (220px open / 52px closed) — strip it so the content uses the
       full viewport width instead of being squeezed to the right. */
    .mud-main-content {
        margin-left: 0 !important;
    }

    /* Tighten padding on phones — 2rem each side wastes scarce width.

       DO NOT set `min-width` (or any width that exceeds the viewport) here. Doing
       so forces the document to overflow horizontally, which on real mobile
       browsers expands the LAYOUT viewport to the content width. `window.innerWidth`
       then reports that inflated width (e.g. 1024) instead of the device's visual
       width (~411), so rivalitasIsMobile() (innerWidth < 960) returns false, the
       hamburger runs the desktop branch, and the off-canvas menu never opens. This
       breaks on phones only — desktop Chromium emulation does not inflate innerWidth,
       so the bug hides in testing and keeps regressing. Wide content (data grids)
       already scrolls inside its own container (.mud-table-container); let it. */
    .rivalitas-admin-content {
        padding: 1rem;
    }

    body.rivalitas-mnav-open .mud-drawer.mud-drawer-pos-left {
        transform: translateX(0);
    }

    body.rivalitas-mnav-open .rivalitas-nav-scrim {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1390;
    }
}

/* Screen-reader-only utility — visually hidden but announced by assistive tech */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Collapsible nav group (RivalitasNavGroup) ──────────────────────────────
   Inline accordion styling for the expanded rail and mobile overlay. The
   collapsed mini-rail flyout overrides these below. */
.rivalitas-nav-group > summary {
    list-style: none;               /* remove default disclosure triangle (Firefox) */
    display: flex;
    align-items: center;
    gap: 12px;
    height: 48px;
    padding: 0 16px;
    cursor: pointer;
    user-select: none;
    color: var(--color-slate-300);
}
.rivalitas-nav-group > summary::-webkit-details-marker {
    display: none;                  /* remove default disclosure triangle (WebKit) */
}
.rivalitas-nav-group > summary:hover {
    background: var(--color-slate-800);
    color: var(--color-slate-100);
}
.rivalitas-nav-group-icon {
    display: inline-flex;
    flex-shrink: 0;
}
.rivalitas-nav-group-title {
    flex: 1 1 auto;
    font-size: 14px;
}
.rivalitas-nav-group-chevron {
    display: inline-flex;
    flex-shrink: 0;
    color: var(--color-slate-500);
    transition: transform 150ms ease;
}
.rivalitas-nav-group[open] > summary .rivalitas-nav-group-chevron {
    transform: rotate(180deg);
}
/* Indent sub-items under the group when inline */
.rivalitas-nav-group-items .mud-nav-link {
    padding-left: 44px;
}

/* Collapsed desktop mini-rail: show only the group icon; reveal sub-items as a
   click-triggered flyout to the right. `position: fixed` escapes the drawer's
   horizontal clipping; JS (rivalitasPositionGroupFlyout) sets `top`. */
.mud-drawer-mini:not(.mud-drawer--open) .rivalitas-nav-group-title,
.mud-drawer-mini:not(.mud-drawer--open) .rivalitas-nav-group-chevron {
    display: none;
}
.mud-drawer-mini:not(.mud-drawer--open) .rivalitas-nav-group > summary {
    justify-content: center;
    padding: 0;
}
.mud-drawer-mini:not(.mud-drawer--open) .rivalitas-nav-group-items {
    display: none;
}
.mud-drawer-mini:not(.mud-drawer--open) .rivalitas-nav-group[open] > .rivalitas-nav-group-items {
    display: block;
    position: fixed;
    left: 52px;                     /* width of the collapsed mini rail (MiniWidth) */
    min-width: 200px;
    max-height: calc(100vh - 16px);
    overflow-y: auto;
    padding: 6px 0;
    background: var(--color-slate-900);
    border: 1px solid var(--color-slate-800);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1410;                  /* above the drawer */
}
/* No extra indent inside the flyout */
.mud-drawer-mini:not(.mud-drawer--open) .rivalitas-nav-group[open] > .rivalitas-nav-group-items .mud-nav-link {
    padding-left: 16px;
}
/* MudBlazor hides nav-link labels while the rail is collapsed; the flyout is
   expanded, so restore the labels for its sub-items. MudBlazor's mini-drawer
   rule has higher specificity (8 classes), so `!important` is required to win
   — a deliberate override of a vendor rule, scoped to the open flyout only. */
.mud-drawer-mini:not(.mud-drawer--open) .rivalitas-nav-group[open] > .rivalitas-nav-group-items .mud-nav-link-text {
    display: block !important;
}
