/* #blazor-error-ui is now a self-contained overlay styled INLINE in App.razor (it must render
   with no external CSS/fonts — the failure state it covers is exactly "assets didn't load").
   Only the hidden default lives here as a belt-and-braces fallback. */
#blazor-error-ui {
    display: none;
}

:root {
    --rz-primary: #1862F8;
    font-size: var(--rz-root-font-size);
    /* Filled form-field tint derived from primary + the THEME's surface colour, not a hard-coded
       light blue: the old #D7E4FE persisted into dark mode (this file loads after the theme css),
       leaving light text on a light fill — unreadable inputs. Light theme renders ~the same
       #D7E4FE; dark theme gets a dark navy tint. Also follows tenant brand primaries. */
    --rz-form-field-filled-background-color: color-mix(in srgb, var(--rz-primary) 16%, var(--rz-base-background-color, #ffffff));
    /* Theme-adaptive brand accent for icons/labels: the tenant primary pulled toward the theme's
       text colour, so a dark brand (e.g. SEC navy) stays visible on the dark theme and a light
       brand deepens on the light theme. Use instead of raw var(--rz-primary) for foreground
       accents on cards. */
    --eqp-brand-icon-color: color-mix(in srgb, var(--rz-primary) 50%, var(--rz-text-color, #4f4f50));
    --equiprove-dark-blue-color: #0C2A52;
    --equiprove-light-blue-color: #1862F8;
    --rz-on-warning: #000000;
    /* Radzen themes never define --rz-border-color, yet ~40 of our components draw
       "border: 1px solid var(--rz-border-color)" — an undefined var makes the whole declaration
       invalid, so those borders silently vanished (e.g. the booking wizard's item rows and the
       pale-blue "Added" row, prod 261202). Derived from the theme's text + surface colours so it is
       a soft grey in BOTH themes (the dark theme's --rz-base-300 is a bright #c9cacd on #242527). */
    --rz-border-color: color-mix(in srgb, var(--rz-text-color, #4f4f50) 20%, var(--rz-base-background-color, #ffffff));
    /* Radzen ships --rz-on-warning-lighter as raw amber (#ffae11) in BOTH themes — 1.7:1 on the
       lighter warning wash (booking-wizard "non-refundable" alert, warning badges). Pull it toward
       the theme's text colour: 4.6:1 light / 6.5:1 dark, wash + icon keep the warning semantics. */
    --rz-on-warning-lighter: color-mix(in srgb, var(--rz-warning, #ffae11) 30%, var(--rz-text-color, #4f4f50));
    /* Text selection (::selection uses this var, defaulting to --rz-primary-lighter) must stay
       visible for EVERY tenant brand: a white/near-white PrimaryColour renders a 20% white wash —
       invisible on the white editor surface (SEC CMS editor incident 260720). Mix the brand into
       the theme's neutral base tone instead of transparent so a light brand still darkens the
       selection and a dark brand still lightens it, on both themes. */
    --rz-text-selection-background-color: color-mix(in srgb, var(--rz-primary, #1862f8) 25%, var(--rz-base-300, #dbe4f1));
    --rz-tabs-tab-padding-inline: 0.8rem;
/*    --rz-text-font-family: 'Open Sans', sans-serif;
    --rz-root-font-size: 16px;*/
}

.rz-heading {
    font-family: 'Montserrat', sans-serif;
}

/* Filled primary buttons: a faint inner edge derived from the button's own text colour. Tenant
   primaries can be near-black (e.g. SEC), so filled buttons melt into dark-theme surfaces
   (booking wizard Add/Next, login Sign in, dashboard CTAs). Inset shadow, not border — no layout
   shift; Radzen's focus ring is outline-based so this doesn't fight it. In the light theme a 30%
   on-primary wash over a saturated fill is barely perceptible. Flat/outlined/text variants keep
   their transparent backgrounds untouched. */
.rz-button.rz-primary:not(.rz-variant-flat):not(.rz-variant-outlined):not(.rz-variant-text) {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rz-on-primary, #ffffff) 30%, transparent);
}

body {
    font-family: var(--rz-text-font-family);
    color: var(--rz-text-color);
    font-size: var(--rz-body-font-size);
    line-height: var(--rz-body-line-height);
    background-color: var(--rz-body-background-color);
}

.rz-body {
    --rz-body-padding: 0;
}

a {
    color: var(--rz-link-color);
}

a:hover,
a:focus {
    color: var(--rz-link-hover-color);
}

.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."
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #1b6ec2;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* Font Awesome 6 Free font CSS */

@font-face {
    font-family: 'Font Awesome 6 Free';
    font-style: normal;
    font-weight: 900;
    src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/webfonts/fa-solid-900.woff2') format('woff2');
}

.font-awesome {
    --rz-icon-font-family: 'Font Awesome 6 Free'
}

/* Font Awesome 6 Free font CSS */

.equiprove-blue-gradient-background {
    background-color: transparent;
    /* Tenant-branded page-header gradient: a dark→brand sweep derived from the tenant's primary
       (--tenant-brand-colour, emitted by TenantThemeProvider). The Equiprove blue remains the
       fallback on the master / unbranded tenancies. Both stops mix toward a near-black anchor so
       the white header text keeps contrast even on lighter brand colours. */
    background-image: linear-gradient(100deg,
        color-mix(in srgb, var(--tenant-brand-colour, var(--equiprove-light-blue-color)) 45%, #0a1220) 0%,
        color-mix(in srgb, var(--tenant-brand-colour, var(--equiprove-light-blue-color)) 85%, #0a1220) 100%);
}

/* wrapper that ensures the grid can grow to full available width */
.eqp-grid-fullwidth .rz-grid-table {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
}

/* Size the table to the sum of its column widths instead of stretching to 100%.
   Stops the widest column ballooning to absorb leftover space (and the rest
   getting crushed) — used by the People / Organisation list grids, which set an
   explicit width on every column. Cells wrap rather than truncate. */
.eqp-grid-autowidth .rz-grid-table {
    width: 100% !important;
    table-layout: fixed;
}
.eqp-grid-autowidth .rz-grid-table td,
.eqp-grid-autowidth .rz-grid-table th {
    white-space: normal;
    word-break: break-word;
    vertical-align: top;
}

/* Wrap cell text instead of Radzen's default single-line ellipsis — for full-width grids whose
   flexible column must show whole names (event Classes / Sub-events lists, user-reported 260808). */
.eqp-grid-wrap-cells .rz-grid-table td,
.eqp-grid-wrap-cells .rz-grid-table td .rz-cell-data {
    white-space: normal;
    overflow-wrap: anywhere;
}

.highlight-text {
    width: fit-content;
    padding: 6px 12px;
    position: relative;
    font-size: 32px;
    font-weight: 600;
    user-select: none;
    text-align: center;
    white-space: nowrap;

    &:before {
        content: '';
        position: absolute;
        inset: 0;
        z-index: -1;
        border-radius: 3px 5px 3px 5px;
        background: conic-gradient(at 0 100%, rgb(var(--mark-color) / 100%) 1%, #fff0 3%) no-repeat 0 0 / auto 120%, conic-gradient(from 180deg at 100% 0, #fff0, rgb(var(--mark-color) / 100%) 1%, #fff0 4%) no-repeat 100% 100% / auto 120%, linear-gradient(var(--mark-bg-angle), rgb(var(--mark-color) / 60%), rgb(var(--mark-color) / 20%) 75%, rgb(var(--mark-color) / 55%)) no-repeat center / auto;
    }

    &.yellow-mark:before {
        rotate: 1deg;
        scale: 1.1;
        transform: skew(-5deg);
        --mark-color: 255 232 62;
        --mark-bg-angle: 50deg;
    }

    &.green-mark:before {
        scale: 0.92;
        transform: skew(7deg);
        --mark-color: 91 233 92;
        --mark-bg-angle: 30deg;
    }

    &.red-mark:before {
        rotate: 0.5deg;
        transform: skew(5deg);
        --mark-color: 255 100 185;
        --mark-bg-angle: 150deg;
    }
}

/* ==== Calendar appointment bars + hover cards (CalendarItemBar) ====
   Global because the hover card renders in Radzen's tooltip portal, outside
   any component's markup, and the bar is used by multiple scheduler surfaces. */
.cal-bar { display: flex; align-items: center; gap: 0.25rem; min-width: 0; height: 100%; }
.cal-bar__logo { width: 1rem; height: 1rem; border-radius: 2px; object-fit: cover; flex: 0 0 auto; background: #fff; margin-right: 0.3rem; }
.cal-bar__icon { flex: 0 0 auto; display: inline-flex; align-items: center; line-height: 1; margin-right: 0.3rem; }
.cal-bar__icon .rzi { font-size: 0.85rem; }
.cal-bar__icon .fa-solid { font-size: 0.7rem; }
/* Scheduler (day/week/multi-day) bars are TALL — wrap the title instead of truncating it
   (user-requested 260806: "Alexandria Geeves · EB-202…" told nobody anything). Month-view
   bars are one line high, so wrapping there would clip mid-line — they keep the ellipsis. */
.cal-bar__text { overflow: hidden; overflow-wrap: anywhere; white-space: normal; }
.rz-month-view .cal-bar__text { white-space: nowrap; text-overflow: ellipsis; }
.cal-hover { max-width: 320px; display: flex; flex-direction: column; gap: 0.4rem; }
/* The hover card must never capture the pointer: it opens UNDER the cursor, which fired
   mouseleave on the bar -> close -> mouseenter -> open in a rapid flicker loop. */
.rz-tooltip:has(.cal-hover) { pointer-events: none; }
.cal-hover__head { display: flex; align-items: flex-start; gap: 0.5rem; }
.cal-hover__logo { width: 2.25rem; height: 2.25rem; border-radius: 4px; object-fit: contain; background: #fff; flex: 0 0 auto; }
.cal-hover__icon { width: 2rem; height: 2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: 0 0 auto; }
.cal-hover__titles { flex: 1; min-width: 0; }
.cal-hover__title { font-weight: 600; font-size: 0.9rem; }
.cal-hover__subtitle { font-size: 0.78rem; opacity: 0.85; }
.cal-hover__row { font-size: 0.8rem; display: flex; align-items: center; gap: 0.3rem; }
.cal-hover__row .rzi { font-size: 0.9rem; }
.cal-hover__desc { font-size: 0.78rem; white-space: pre-line; opacity: 0.9; max-height: 7rem; overflow: hidden; }
.cal-hover__hint { opacity: 0.6; font-size: 0.72rem; }

/* ==== Sidebar tenant branding on short viewports (MainLayout) ====
   The tenant logo (up to 200px) sits between the nav menu and the footer in a
   fixed-height flex column — on short screens it squeezes the menu until no
   items are visible. Shrink it first, then hide it entirely; the tenant name
   text below it stays as the branding. */
@media (max-height: 850px) {
    .sidebar-tenant-logo img {
        max-width: 120px !important;
        max-height: 120px !important;
    }
}
@media (max-height: 720px) {
    .sidebar-tenant-logo {
        display: none;
    }
}
/* Last resort on very short screens / long menus: scroll the sidebar content
   instead of clipping the menu out of reach. */
.sidebar-content {
    overflow-y: auto;
}

/* ==== Header action buttons on phones (MainLayout .header-actions) ====
   Five controls (Help, Feedback/Support, culture picker, theme toggle, account
   name) overflow the header row on phones. Below 768px: buttons drop to icon
   only (title tooltips remain), the culture picker (currently disabled anyway)
   hides, and the account menu shows just the avatar + chevron. */
@media (max-width: 768px) {
    .header-actions .rz-button .rz-button-text {
        display: none;
    }
    /* Help / Feedback set an inline min-width (5rem / 10rem) so their labels don't
       truncate at mid widths. Once the label is hidden the button must shrink back to
       icon size, otherwise it stays a wide button around a lone icon. The reset has to
       sit on the BUTTON (the old min-width:auto above was on the hidden text span, so it
       did nothing), and needs !important — an inline style beats any selector without it. */
    .header-actions .rz-button {
        min-width: auto !important;
    }
    .header-culture {
        display: none;
    }
    .bar-account-name {
        display: none;
    }
}

/* ==== Dialogs whose body is a list or grid (People > Equids / Registrations) ====
   .rz-dialog is a flex column sized to DialogOptions.Height, but .rz-dialog-content is
   flex:0 1 auto with overflow:auto — so a body taller than the dialog grows the content
   box and scrolls INSIDE it, giving two scrollbars side by side (and pushing the dialog
   buttons out of reach). Opt a dialog in with DialogOptions.CssClass="eqp-dialog-grid":
   the content box then takes exactly the leftover height, never scrolls itself, and the
   inner list is the only thing that scrolls. */
.eqp-dialog-grid .rz-dialog-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

    /* The component the dialog hosts — one child, filling the content box. */
    .eqp-dialog-grid .rz-dialog-content > * {
        flex: 1 1 auto;
        min-height: 0;
    }

/* ==== Full-page dialogs on phones ====
   Big wizard dialogs (the registration wizard, opened by "Register Now" etc.) are sized as a
   percentage of the viewport, which on a phone left a framed box with its own scrollbars and
   clipped buttons (staging feedback "Register Now opens the registration application in a
   dialog"). Opt a dialog in with DialogOptions.CssClass="eqp-dialog-mobile-full": under the md
   breakpoint it fills the screen like a page. Radzen sizes .rz-dialog with INLINE width/height,
   hence !important. Desktop is unchanged. */
@media (max-width: 767.98px) {
    .rz-dialog.eqp-dialog-mobile-full {
        width: 100% !important;
        height: 100% !important;
        max-height: 100%;
        top: 0 !important;
        left: 0 !important;
        border-radius: 0;
    }
}

/* Body of a "related records" dialog: heading above, buttons below, this in between.
   min-height:0 is what actually lets it shrink — a flex item defaults to min-height:auto
   and would refuse to go below its content, which is the whole bug. */
.eqp-related-dialog {
    height: 100%;
}

.eqp-related-body {
    flex: 1 1 auto;
    min-height: 0;
}

    /* The host scrolls (card/grid list with no scroller of its own). */
    .eqp-related-body-scroll {
        overflow: auto;
    }

    /* The GRID scrolls (RadzenDataGrid given height:100%) — the host must not. The list
       component renders siblings above the grid (FusionError, PageHeader), so only the grid
       itself may flex; stretching every child would stretch those too. .rz-data-grid is
       already display:flex/column with a scrolling body, so it just needs the height. */
    .eqp-related-body-fill {
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

        .eqp-related-body-fill > .eqp-grid-fullwidth {
            flex: 1 1 auto;
            min-height: 0;
        }

/* Fee-disclosure captions ("Prices include GST. Includes <fee label> of ..." on the booking
   wizard, registration wizard and booking details) — user-reported 260826: people were not
   seeing them in the muted caption grey. Bold + the tenant's SECONDARY brand colour, blended
   with the theme text colour so it stays readable on any surface: a pale brand secondary gains
   ~30% of near-black on light themes, and the same rule lightens toward near-white on dark
   themes. Tenant branding only overrides --rz-secondary itself (TenantThemeProvider), so the
   -dark/-darker theme variants would lose the brand hue — the blend keeps it. */
/* The doubled selector out-specifies Radzen's own .rz-text-caption font-size (the theme
   stylesheet loads after this one, so a single-class selector lost the tie — verified 260826:
   captions stayed 12px). All five call sites render as TextStyle.Caption. */
.fee-disclosure,
.rz-text-caption.fee-disclosure {
    font-weight: 600;
    /* Up from the Caption default (0.75rem) — part of the same not-being-seen fix. */
    font-size: 0.875rem;
    color: color-mix(in srgb, var(--rz-secondary) 72%, var(--rz-text-color) 28%);
}

/* Page header (shared PageHeader component's gradient card) on SMALL screens — the desktop
   sizing (DisplayH6 heading + a 0.75rem-padded enlarged badge inside a default-padded card)
   ate a third of a phone viewport and wrapped titles over three lines (user-reported 260826,
   booking wizard). Type + padding step down under the md breakpoint. The badge's enlarged
   size is set INLINE in PageHeader.razor (kept for desktop), so the mobile override needs
   !important to beat it. */
@media (max-width: 767.98px) {
    .page-header-card {
        padding: 0.6rem 0.75rem;
    }

        /* Heading: RadzenHeading/RadzenText DisplayH6 in either rendering (rz-text-display-h6
           class or a bare h1–h6 tag). */
        .page-header-card .rz-text-display-h6,
        .page-header-card .rz-heading,
        .page-header-card h1,
        .page-header-card h2,
        .page-header-card h3,
        .page-header-card h4,
        .page-header-card h5,
        .page-header-card h6 {
            font-size: 1.25rem;
            line-height: 1.25;
            margin-bottom: 0;
        }

        /* Context badge ("EVENT BOOKING", "SYSADMIN", ...). */
        .page-header-card .rz-badge {
            padding: 0.35rem 0.5rem !important;
            font-size: 0.75rem !important;
        }

        /* Restack (staging feedback 261106, person/equid/organisation records). The title group
           (badge, name, "Source: …") and the action buttons sat in one flex-wrap:nowrap row
           (inline, from RadzenStack), so the name and source wrapped into narrow columns and the
           52px buttons ran ~220px past the screen edge, scrolling the whole page sideways.
           Now: badge + name on the first line (a long name wraps beside the badge), the source as
           one ellipsed line under it, and the buttons at 36px beside a short title (list pages:
           "Equids  [Add] [i]") or on their own wrapping row below a long one. A record header
           stays about as tall as before (person 102px → 106px at 375px). Inline styles and
           Radzen's .rz-flex-row/justify utilities need !important. */
        .page-header-card > .rz-stack {
            flex-wrap: wrap !important;
            row-gap: 0.4rem;
        }

            .page-header-card > .rz-stack > .rz-stack:first-child {
                flex: 1 1 auto;
                flex-wrap: wrap !important;
                min-width: 0;
                row-gap: 0.1rem;
                column-gap: 0.5rem;
            }

                /* Heading (or the equid's affix + name stack) takes the rest of the badge line. */
                .page-header-card > .rz-stack > .rz-stack:first-child > .rz-heading,
                .page-header-card > .rz-stack > .rz-stack:first-child > .rz-stack {
                    flex: 1 1 0;
                    min-width: 0;
                }

                .page-header-card > .rz-stack > .rz-stack:first-child > .rz-text-caption {
                    flex: 1 1 100%;
                    min-width: 0;
                    margin: 0 !important;
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                }

            .page-header-card > .rz-stack > .rz-stack + .rz-stack {
                flex: 0 1 auto;
                max-width: 100%;
                flex-wrap: wrap !important;
                justify-content: flex-start !important;
                row-gap: 0.4rem;
                --rz-gap: 0.4rem !important;
            }

                .page-header-card > .rz-stack > .rz-stack + .rz-stack .rz-button {
                    /* rz-button-lg carries min-width 52px (icon-only buttons stayed 52px wide). */
                    min-width: 0;
                    min-height: 0;
                    height: 2.25rem;
                    padding: 0 0.6rem;
                    font-size: 0.875rem;
                    line-height: 1;
                }

                    .page-header-card > .rz-stack > .rz-stack + .rz-stack .rz-button.rz-button-icon-only {
                        width: 2.25rem;
                        padding: 0;
                        justify-content: center;
                    }

                    .page-header-card > .rz-stack > .rz-stack + .rz-stack .rz-button .rz-button-icon-left {
                        font-size: 1.15rem;
                    }
}

/* Nested gutters on SMALL screens (app-wide; staging feedback 261106 — person page first, then a
   375px audit of the whole site: /profile, /tenant/settings, /sysadmin/help, /admin ...).
   Each level of nesting added its own gutter: tab panel 20px, a nested side-tab panel 20px, a
   section's rz-p-4 stack 16px, an rz-p-4 card 16px, an rz-p-3 fieldset 12px + its content 20px —
   ~100px a side by the person page's Date of Birth field, so text wrapped two or three words a
   line. Under md: tab panels keep a slim pad and nested ones lose their frame, bare layout stacks
   keep 0.25rem, cards keep 0.75rem (0.5rem when nested or inside a tab), fieldsets a thin pad.
   Radzen's rz-p-* utilities and .rz-flex-row are !important, hence the !important here.
   Desktop unchanged. */
@media (max-width: 767.98px) {
    .rz-body .rz-tabview-panel {
        padding: 0.5rem 0.4rem;
    }

        /* Nested tab sets (person About side tabs, Contact, Registrations ...): no second frame. */
        .rz-body .rz-tabview-panel .rz-tabview-panels {
            border: 0;
        }

        .rz-body .rz-tabview-panel .rz-tabview-panel {
            padding: 0.25rem 0 0;
        }

    .rz-body .rz-stack:is(.rz-p-2, .rz-p-3, .rz-p-4, .rz-p-5, .rz-p-6) {
        padding: 0.25rem !important;
    }

    .rz-body .rz-tabview-panel .rz-stack:is(.rz-p-2, .rz-p-3, .rz-p-4, .rz-p-5, .rz-p-6) {
        padding: 0 !important;
    }

    .rz-body .rz-card:is(.rz-p-3, .rz-p-4, .rz-p-5, .rz-p-6) {
        padding: 0.75rem !important;
    }

    .rz-body .rz-card .rz-card,
    .rz-body .rz-card .rz-card:is(.rz-p-2, .rz-p-3, .rz-p-4, .rz-p-5, .rz-p-6),
    .rz-body .rz-tabview-panel .rz-card,
    .rz-body .rz-tabview-panel .rz-card:is(.rz-p-2, .rz-p-3, .rz-p-4, .rz-p-5, .rz-p-6) {
        padding: 0.5rem !important;
    }

    .rz-body .rz-fieldset,
    .rz-body .rz-fieldset:is(.rz-p-2, .rz-p-3, .rz-p-4, .rz-p-5, .rz-p-6) {
        padding: 0 0.5rem 0.5rem !important;
        margin-inline: 0;
    }

    .rz-body .rz-fieldset-content {
        padding: 0.25rem 0 0;
    }

    /* Section heading — a horizontal stack of a 20px title ("Person Details", "Equid
       Connections", "Organisation Memberships" ...) and its caption — title above caption. */
    .rz-body .rz-stack.rz-flex-row:has(> [style*="font-size:20px"] + *) {
        flex-direction: column !important;
        align-items: flex-start !important;
        --rz-gap: 0.15rem !important;
    }

    /* Horizontal RadzenStacks default to an inline flex-wrap:nowrap, so a row of a title plus
       badges or buttons ran past the screen edge and scrolled the whole page sideways
       (/refund-policies, /admin/tenants ... in the 375px audit). On phones every horizontal
       stack may wrap — it only changes anything when the row would otherwise overflow. */
    .rz-body .rz-stack.rz-flex-row {
        flex-wrap: wrap !important;
    }

    /* Long badges ("IRISH DRAUGHT AND SPORT HORSE SOCIETY OF ...") are nowrap: cap at the row. */
    .rz-body .rz-badge {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* A long RadzenSelectBar (/sysadmin/imports kinds) scrolls inside itself, not the page. */
    .rz-body .rz-selectbar-horizontal {
        max-width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }

        .rz-body .rz-selectbar-horizontal > .rz-button {
            flex: 0 0 auto;
        }
}

/* Layout content gutters on SMALL screens (app-wide) — .rz-body's 16px each side plus page
   padding cost ~15% of a phone's width (user-reported 260826, booking wizard). The doubled
   selector out-specifies the Radzen layout stylesheet, which loads after this one. */
@media (max-width: 767.98px) {
    .rz-layout .rz-body,
    .rz-body.rz-body {
        padding: 0.4rem 0.35rem;
    }
}

/* Tabs on SMALL screens (app-wide; staging feedback 260820/260821). Radzen 11 has no overflow
   mode, so a long tab strip ran off the right edge (My Account) and left-positioned tabs (person,
   equid, organisation records) took half a phone's width, squeezing the content into a sliver.
   Under the md breakpoint: tab strips scroll sideways, and left/right tabs sit ABOVE the content
   as a scrolling strip. Doubled selectors out-specify the Radzen theme stylesheet (loads later). */
@media (max-width: 767.98px) {
    .rz-tabview .rz-tabview-nav.rz-tabview-nav {
        overflow-x: auto;
        /* Sideways only: the strip could be dragged up/down too, revealing both scroll bars
           (staging feedback 261021, calendar tabs on a phone). No visible bar — swipe to scroll. */
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        touch-action: pan-x;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        max-width: 100%;
    }

        .rz-tabview .rz-tabview-nav.rz-tabview-nav::-webkit-scrollbar {
            display: none;
        }

        .rz-tabview .rz-tabview-nav.rz-tabview-nav > li {
            flex: 0 0 auto;
            white-space: nowrap;
        }

    .rz-tabview.rz-tabview-left.rz-tabview-left,
    .rz-tabview.rz-tabview-right.rz-tabview-right {
        flex-direction: column;
    }

        .rz-tabview-left.rz-tabview-left > .rz-tabview-nav,
        .rz-tabview-right.rz-tabview-right > .rz-tabview-nav {
            flex-direction: row;
            width: 100%;
        }

        .rz-tabview-left.rz-tabview-left > .rz-tabview-panels,
        .rz-tabview-right.rz-tabview-right > .rz-tabview-panels {
            width: 100%;
            min-width: 0;
        }
}

/* Side menu 230px, not Radzen's 250px (user request 261118): 20px more content width on a small
   laptop window. 230 is the narrowest that keeps "Invoices & receipts" on one line (220 wrapped it).
   Set on .rz-layout — the theme defines the variable below :root, so a :root override is ignored. */
.rz-layout {
    --rz-sidebar-width: 230px;
}

/* Tabs from the md breakpoint up: a long TOP tab strip wraps onto further rows instead of running
   off the right edge. With the side menu open on a ~1000px window the content area is only ~735px,
   and the 12 tabs of an equid or person record (10 on a venue) are 780-1250px wide — the whole page
   then scrolled sideways (261118 review at 1000px). Phones keep the scrolling strip / picker above. */
@media (min-width: 768px) {
    .rz-tabview.rz-tabview-top > .rz-tabview-nav.rz-tabview-nav {
        flex-wrap: wrap;
    }
}

/* MobileTabPicker (SharedUI/Components/Shared/MobileTabPicker.razor; user request 261106, person
   page). Hidden at desktop widths; under md it replaces the host RadzenTabs' strip with a full-width
   dropdown listing every tab. Only the host's DIRECT nav is hidden — nested tab strips are untouched. */
.mobile-tab-picker {
    display: none;
}

.mobile-tab-picker-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

    .mobile-tab-picker-item > span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.mobile-tab-picker-icon.mobile-tab-picker-icon {
    font-size: 1.15rem;
    width: 1.25rem;
    text-align: center;
    flex: 0 0 auto;
    color: var(--rz-primary);
}

@media (max-width: 767.98px) {
    .mobile-tab-picker {
        display: block;
        margin-bottom: 0.5rem;
    }

        .mobile-tab-picker .rz-dropdown {
            font-weight: 600;
        }

    .rz-tabview.mobile-tab-picker-host.mobile-tab-picker-host > .rz-tabview-nav.rz-tabview-nav {
        display: none;
    }
}

/* Every reflowed grid (Responsive="true", ≤768px): a stacked cell is a full-width block, so its
   value should wrap. Radzen keeps the desktop single-line ellipsis, which on a phone cut names
   short - and where a cell holds text plus a badge (event Bookable products) it showed only the
   tail of the name (261116 responsive review). .rz-text-truncate is !important, hence these. */
@media (max-width: 768px) {
    .rz-datatable-reflow .rz-data-row > td > .rz-cell-data {
        white-space: normal !important;
        overflow-wrap: anywhere;
        text-overflow: clip !important;
    }

    /* A badge is nowrap + overflow:hidden, so a long one (a tenancy's full name on the user
       lists) lost its end inside a stacked card. */
    .rz-datatable-reflow .rz-data-row > td .rz-badge {
        white-space: normal;
        max-width: 100%;
    }
}

/* Opt-in compact reflow for Responsive RadzenDataGrids (first used on the person page's Equid
   Connections, 261106). Radzen's reflow (≤768px) stacks every cell as title-over-value, so a 7-column
   row became a very tall card. With this class each cell is a label | value row instead, roughly
   halving the card height. Cells whose column has no title (action buttons) span both columns.
   Also applied to every grid on the person page (.eqp-person-page), 261106. */
@media (max-width: 768px) {
    :is(.eqp-grid-reflow-compact, .eqp-person-page .rz-data-grid).rz-datatable-reflow .rz-data-row > td {
        display: grid;
        grid-template-columns: minmax(5.5rem, 32%) minmax(0, 1fr);
        align-items: center;
        column-gap: 0.75rem;
        padding-top: 0.2rem;
        padding-bottom: 0.2rem;
    }

        :is(.eqp-grid-reflow-compact, .eqp-person-page .rz-data-grid).rz-datatable-reflow .rz-data-row > td > .rz-column-title {
            margin: 0;
            font-weight: 600;
            color: var(--rz-text-secondary-color);
        }

        /* Values wrap rather than ellipsis-truncate (a long Notes value lost its end). Radzen's
           .rz-text-truncate utility is !important, hence the !important here. */
        :is(.eqp-grid-reflow-compact, .eqp-person-page .rz-data-grid).rz-datatable-reflow .rz-data-row > td > .rz-cell-data {
            white-space: normal !important;
            overflow-wrap: anywhere;
            text-overflow: clip !important;
        }

        :is(.eqp-grid-reflow-compact, .eqp-person-page .rz-data-grid).rz-datatable-reflow .rz-data-row > td > .rz-column-title:empty {
            display: none;
        }

        :is(.eqp-grid-reflow-compact, .eqp-person-page .rz-data-grid).rz-datatable-reflow .rz-data-row > td > .rz-column-title:empty + * {
            grid-column: 1 / -1;
        }

    :is(.eqp-grid-reflow-compact, .eqp-person-page .rz-data-grid).rz-datatable-reflow .rz-data-row {
        border-bottom: var(--rz-grid-cell-border);
        padding: 0.35rem 0;
    }
}

/* News & notices summary — rich HTML (NewsSummaryHtml.razor). Keeps authored images and tables
   inside the card and stops the editor's block margins bloating the compact feed rows. */
.eqp-news-summary {
    color: var(--rz-text-secondary-color);
    font-size: 0.9rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

    .eqp-news-summary > :first-child { margin-top: 0; }
    .eqp-news-summary > :last-child { margin-bottom: 0; }
    .eqp-news-summary p { margin: 0 0 0.5rem; }

    .eqp-news-summary img {
        max-width: 100%;
        height: auto;
        border-radius: 6px;
    }

    .eqp-news-summary table { border-collapse: collapse; max-width: 100%; }

    .eqp-news-summary td, .eqp-news-summary th {
        border: 1px solid var(--rz-border-color);
        padding: 0.3rem 0.5rem;
    }
