/* =============================================================
   ez-v6.css - the fresh start. Bootstrap 6 plus only what Bootstrap 6 cannot do.

   The app renders with Bootstrap 6 and Font Awesome alone (App.razor, Development, on the
   bootstrap6-markup branch), and this is the one sheet of ours that loads with them.

   The split: every region's LOOK (spacing, borders, colours, the menu itself) is Bootstrap 6
   classes in the markup, so a Bootstrap 6 theme restyles all of it. This sheet holds only
   STRUCTURE Bootstrap 6 has no part for - where the shell's regions sit for each layout - plus
   the one sanctioned custom control (the burger).

   Rules:
   - Everything sits in @layer custom: after v6's components (so a rule can adjust one), before
     its utilities (so a utility class in markup always wins).
   - v6 tokens only (--bs-bg-*, --bs-fg-*, --bs-{role}-*, --bs-spacer-*, --bs-radius-*,
     --bs-z-*). Breakpoints in range syntax: sm 576, md 768, lg 1024, xl 1280, 2xl 1536.
   - Hooks are ez-* classes on the markup, used only for placement.
   ============================================================= */

@layer custom {

    /* ── App shell (.ez-app) ─────────────────────────────────────────────────────────
       One markup for every app (ChromeLayout + AdminLayout/AppLayout): the regions are direct
       children of .ez-app in a fixed order - banners, header, nav, main, aside, footer, tabs -
       and one grid places them by name. data-nav and data-width (PlatformLayoutOptions, per host)
       pick the layout; data-aside is reserved.

       Base = the phone layout, used by EVERY layout below xl: one column, the menu is a drawer
       (opened by layout.js) and the tab bar sticks to the bottom. The layouts below change only
       the xl-and-up placement. */
    /* The page is a column: the banners (ChromeLayout renders them before the shell, so they span the top
       of the page in every layout, boxed included), then the shell, which fills the rest of the screen. */
    body:has(> .ez-app) {
        display: flex;
        flex-direction: column;
        min-height: 100dvh;
    }
    /* ── The theme contract (Theme Studio 2) ─────────────────────────────────────────
       The live theme's stylesheet (/branding/theme.css, unlayered, after this sheet) writes the
       --ez-c-* colour slots, the --ez-m-* metrics, the --ez-t-* type settings and --ez-scale. With
       no theme live none of them exist, so every read below falls back to stock Bootstrap 6 and the
       app looks exactly as it does without a theme. Colours are light-dark() pairs, resolved by the
       page's own colour mode, so no region switches data-bs-theme to change its colours.

       The menu (.ez-app-nav) re-points v6's text and border tokens at the side slots, so every
       stock part inside it (links, headings, the close button, utilities like fg-3) follows a
       dark or tinted sidebar, while the menus that pop out of it put the page's tokens back. A
       custom property naming itself is a cycle, so the page's own values are captured here, one
       level up, for both directions. */
    .ez-app {
        --ez-page-fg-1: var(--bs-fg-1);
        --ez-page-fg-2: var(--bs-fg-2);
        --ez-page-fg-3: var(--bs-fg-3);
        --ez-page-fg-4: var(--bs-fg-4);
        --ez-page-border-color: var(--bs-border-color);
        /* The sidebar width: the theme's metric, else the menu template's setting (--ez-sidebar-width /
           --ez-rail-width), else the platform's. */
        --ez-nav-width: var(--ez-m-sidebar-width, var(--ez-sidebar-width, 16rem));
        /* --ez-box-width: a theme's box width (Theme Studio, Layout); 90rem is the platform's. It is a page
           size, not a type size: the theme's base size (--ez-scale) is taken back out, so 1320 px stays
           1320 px on a 13 px theme, while each user's own text size still widens it. */
        --ez-app-max-width: calc(var(--ez-box-width, 90rem) / var(--ez-scale, 1));
        display: grid;
        flex: 1 0 auto;
        /* The page's ground behind the cards: the theme's bg slot (--ez-ground is the older name);
           unset, the body's own. */
        background-color: var(--ez-c-bg, var(--ez-ground, transparent));
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto 1fr auto auto;
        grid-template-areas: "banners" "header" "main" "footer" "tabs";
    }
    .ez-app-header  { grid-area: header; }
    .ez-app-nav     { grid-area: nav; }
    .ez-app-main    { grid-area: main; min-width: 0; }
    .ez-app-aside   { grid-area: aside; }
    .ez-app-footer  { grid-area: footer; }
    .ez-app-tabs    { grid-area: tabs; }

    /* The page's padding (main and aside), from the theme's metrics; unset, v6's spacer 7 all round.
       Not a p-7 utility, which would beat the theme. The bottom is twice the top (48px unset), so a
       long page's last card does not end against the window's edge (owner, 2026-11-10).
       The side padding (--ez-page-px, the header's too) is capped at v6's spacer 5 on a phone (below): a desktop's
       2.5rem each side left a 390px phone a 315px page (audit, 2026-11-12). A page that bleeds to the edge cancels
       this variable, not the theme's. */
    .ez-app { --ez-page-px: var(--ez-m-page-px, var(--bs-spacer-7)); }
    :is(.ez-app-main, .ez-app-aside) {
        padding: var(--ez-m-page-py, var(--bs-spacer-7)) var(--ez-page-px);
        padding-bottom: calc(var(--ez-m-page-py, var(--bs-spacer-7)) * 2);
    }
    /* Under a header bar (every header but inline), where the title is in the bar, the page starts one gap below
       it: the same gap as between the toolbar and the content, so the toolbar reads as part of the page top and
       not as a row floating under a blank one (owner, 2026-11-12). The page's top padding (2.75rem in JobSpark)
       plus the toolbar's own margin was the page's top margin when the title sat in that row. */
    .ez-app:not([data-header="inline"]) > :is(.ez-app-main, .ez-app-aside) {
        padding-top: var(--ez-m-gap, var(--bs-spacer-7));
    }
    .ez-app:not([data-header="inline"]) > .ez-app-main > .page-actions { margin-top: 0; }
    /* The theme's gap between the page's action bar and its content (the page's own blocks keep
       their own spacing). Only while the bar has something in it, or an empty bar would leave a gap. */
    .ez-app-main:has(> .page-actions :is(.page-actions-search, .page-actions-buttons) > *) > .content-area {
        margin-top: var(--ez-m-gap, var(--bs-spacer-5));
    }

    /* The page title (EzBreadcrumb's h1 and its parent crumb): the theme's size and weight; unset,
       v6's fs-lg and bold. Here rather than utilities in the markup, which would beat the theme. */
    .ez-page-title,
    .ez-page-title-link {
        font-size: var(--ez-t-title-size, var(--bs-font-size-lg));
    }
    .ez-page-title { font-weight: var(--ez-t-title-weight, var(--bs-font-weight-bold)); }
    /* The back link: flush with the page's left edge (no v6 link padding), and on hover only its arrow and words go to the
       heading's colour (the page title's: white in the dark theme): no hover background or rounding. The divider keeps its own room. */
    .ez-breadcrumb .breadcrumb-link {
        padding-inline: 0;
        border-radius: 0;
        --bs-breadcrumb-link-hover-bg: transparent;
        --bs-breadcrumb-link-hover-color: var(--bs-heading-color);
    }
    .ez-breadcrumb .breadcrumb-divider { margin-inline: var(--bs-spacer-3); }
    /* On a phone the title shares the bar with four buttons: a desktop's display size (JobSpark's 1.75rem) left a
       customer's name as "Jare..." (audit, 2026-11-12), so it is capped at v6's fs-lg there. */
    @media (width < 768px) {
        .ez-page-title, .ez-page-title-link { font-size: min(var(--ez-t-title-size, var(--bs-font-size-lg)), var(--bs-font-size-lg)); }
    }
    .ez-heading { letter-spacing: var(--ez-t-heading-tracking, normal); }

    /* The menu as a drawer. Fixed, so it is out of the grid's flow; layout.js adds .open and shows
       the backdrop. Bootstrap 6's own drawer is a native <dialog>, which our password-manager rule
       does not allow for a modal drawer, so this one is ours. */
    .ez-app-nav {
        /* The side slots, in place of the page's text and border tokens (see the theme contract above). */
        --bs-fg-1: var(--ez-c-side-text, var(--ez-page-fg-1));
        --bs-fg-2: var(--ez-c-side-text, var(--ez-page-fg-2));
        --bs-fg-3: var(--ez-c-side-muted, var(--ez-page-fg-3));
        --bs-fg-4: var(--ez-c-side-muted, var(--ez-page-fg-4));
        --bs-border-color: var(--ez-c-side-border, var(--ez-page-border-color));
        --bs-hr-border-color: var(--bs-border-color);
        position: fixed;
        inset-block: 0;
        inset-inline-start: 0;
        z-index: var(--bs-z-drawer);
        width: min(20rem, 85vw);
        overflow-y: auto;
        /* The theme's padding; unset, v6's spacer 5 (it was a p-5 utility, which would beat the theme). */
        padding: var(--ez-m-sidebar-py, var(--bs-spacer-5)) var(--ez-m-sidebar-px, var(--bs-spacer-5));
        /* A little more under the last link than above the first (24px unset), so the menu's foot is easy
           to reach (owner, 2026-11-10). */
        padding-bottom: calc(var(--ez-m-sidebar-py, var(--bs-spacer-5)) + var(--bs-spacer-3));
        color: var(--ez-c-side-text, var(--bs-fg-body));
        /* The side slot; --ez-menu-bg is the older theme's menu colour. Its own border colour: a side
           border equal to the side colour is simply invisible. */
        background: var(--ez-c-side, var(--ez-menu-bg, var(--bs-bg-body)));
        border-inline-end: var(--bs-border-width) solid var(--bs-border-color);
        transform: translateX(-100%);
        /* v6's drawer slide (its --bs-drawer-* duration is scoped to .drawer, so only the timing is a token). */
        transition: transform .3s var(--bs-transition-timing-overlay);
    }
    .ez-app-nav.open { transform: none; }
    /* What pops out of the menu (the rail's flyouts, the top bar's dropdowns, the account and bell
       panels, the bell's arrival toast) is a surface of its own: the page's tokens again. */
    .ez-app-nav :is(.menu, .toast) {
        --bs-fg-1: var(--ez-page-fg-1);
        --bs-fg-2: var(--ez-page-fg-2);
        --bs-fg-3: var(--ez-page-fg-3);
        --bs-fg-4: var(--ez-page-fg-4);
        --bs-border-color: var(--ez-page-border-color);
        --bs-hr-border-color: var(--ez-page-border-color);
    }

    /* The menu's items: v6's nav and pills tokens, re-pointed at the theme's side slots and metrics.
       Every template (Standard, Compact) and layout (sidebar, drawer, rail, top bar) renders this one
       .nav, so they all follow. Unset, each falls back to v6's own value. The weight token is left
       undefined without a theme, exactly as v6 leaves it. The menu's own blocks (Theme Studio 3: favourites,
       recent, the footer's help link and switch) wrap their links in a .nav of their own inside .ez-nav-block,
       so they take the same tokens. */
    .ez-app-nav > .nav, .ez-nav-block > .nav {
        --bs-nav-gap: var(--ez-m-nav-gap, 0.125rem);
        --bs-nav-link-padding-x: var(--ez-m-nav-px, 0.75rem);
        --bs-nav-link-color: var(--ez-c-side-text, var(--bs-fg-2));
        --bs-nav-link-hover-color: var(--ez-c-side-text, var(--bs-fg-1));
        --bs-nav-link-hover-bg: var(--ez-c-side-hover-bg, var(--bs-bg-1));
        --bs-nav-link-active-color: var(--ez-c-side-text, var(--bs-fg-body));
        --bs-nav-link-active-bg: var(--ez-c-side-hover-bg, var(--bs-bg-2));
        --bs-nav-link-font-weight: var(--ez-m-nav-weight);
        --bs-nav-pills-link-active-color: var(--ez-c-side-active-text, var(--bs-primary-contrast));
        --bs-nav-pills-link-active-bg: var(--ez-c-side-active-bg, var(--bs-primary-bg));
        --bs-nav-pills-link-border-radius: var(--ez-m-radius, 3rem);
        font-size: var(--ez-m-nav-fs, 1em);
    }
    :is(.ez-app-nav > .nav, .ez-nav-block > .nav) .nav-link { min-height: var(--ez-m-nav-h, auto); }
    :is(.ez-app-nav > .nav, .ez-nav-block > .nav) .nav-link.active { font-weight: var(--ez-m-nav-active-weight, var(--bs-nav-link-font-weight)); }
    :is(.ez-nav-links, .ez-nav-item) > .nav-link > i:first-child { font-size: var(--ez-m-nav-icon, 1em); }
    /* The drawer's backdrop: its position is utilities (AdminLayout/AppLayout), its dim and blur the shared
       backdrop rule (EzModal section). Here: one step
       under the drawer tier (v6's z scale has no "minus one"), and hidden until layout.js adds .show
       (plain display, not d-none, which is !important and would beat .show). */
    .nav-backdrop {
        display: none;
        z-index: calc(var(--bs-z-drawer) - 1);
    }
    .nav-backdrop.show { display: block; }

    /* The phone tab bar rides the bottom of the screen while the page scrolls under it: a row of
       equal columns, however many tabs the app has. */
    .ez-app-tabs {
        position: sticky;
        bottom: 0;
        z-index: var(--bs-z-sticky);
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(0, 1fr);
        padding-bottom: env(safe-area-inset-bottom);
        /* The bar's own height, named so the More menu can sit right on top of it. Its tabs come to just under
           this, so the bar never changes size; min-height, so nothing is ever clipped. */
        --ez-tab-bar-h: 3.75rem;
        min-height: calc(var(--ez-tab-bar-h) + env(safe-area-inset-bottom));
    }
    /* A thumb-sized icon over a small bold label, and a maturity or count badge that sits on the
       icon's top-right corner rather than over it (v6's badge is never under 12px text or 22px tall on its own). */
    /* The "More" tab (.ez-tab-more) is an EzActionMenu trigger, drawn exactly like the link tabs beside it. */
    .ez-app-tabs > a > i, .ez-tab-more .btn > i { font-size: 1.25rem; line-height: 1; }
    .ez-app-tabs > a > span:not(.position-absolute),
    .ez-tab-more .btn > span:not(.position-absolute) { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.01em; }
    .ez-app-tabs > a > .position-absolute, .ez-tab-more .btn > .position-absolute { margin-inline-start: 1.5rem; }
    .ez-tab-more .btn { --bs-btn-hover-bg: transparent; --bs-btn-active-bg: transparent; min-height: 0; }
    /* The More tab's menu is pinned to the screen, just above the bar at its right edge, not anchored to the tab. The
       bar is sticky inside the page's scroller, and an anchored panel is placed against the bar's place in the
       content: on a page taller than the screen (stacked studio posters, My saves) that is below the screen, so the
       menu opened out of sight and the tab looked dead (owner, 2026-11-20). It sits just above the bar (its
       --ez-tab-bar-h). Its thumb-sized rows are every menu's on a phone ("Touch targets", below).
       v6 has no fixed-position-with-offset utility. */
    .ez-tab-more .ez-action-menu__panel {
        position: fixed;
        inset: auto var(--bs-spacer-3) calc(var(--ez-tab-bar-h) + env(safe-area-inset-bottom) + var(--bs-spacer-1)) auto;
        position-try-fallbacks: none;
    }
    .ez-app-tabs .badge { --bs-badge-font-size: 0.5625rem; --bs-badge-padding-x: 0.4em; --bs-badge-padding-y: 0.2em; min-height: 0; }
    /* A maturity badge on a tab ("New", "Beta": NavBadge Compact, its icon only) is just the coloured glyph on the icon's
       corner: the chip box behind it crowded the icon on a phone (owner, 2026-11-29). The word stays for a screen reader. */
    .ez-app-tabs .ez-nav-badge-chip { background: none; border: 0; padding: 0; font-size: 0.6875rem; }

    /* One top bar at every width (owner decision, 2026-11-12): the menu button (below xl), the page title, the
       page's one search box, the bell and the account in ONE row; the logo lives in the menu (the top-bar menu
       keeps its own, below). The title gives, so it truncates rather than the actions wrapping. */
    .ez-app-header {
        display: flex;
        align-items: center;
        /* The bar from the theme's header slots and height, lined up with the page's side padding;
           unset, v6's spacers 5 and 7 and the plain rule under it. Not utilities, which would beat
           the theme. */
        min-height: var(--ez-m-header-h, auto);
        padding: var(--bs-spacer-5) var(--ez-page-px, var(--bs-spacer-7));
        color: var(--ez-c-header-text, var(--bs-fg-body));
        background-color: var(--ez-c-header, transparent);
        border-block-end: var(--bs-border-width) solid var(--ez-c-header-border, var(--bs-border-color));
    }
    /* v6's .nav-pills is inline-flex, so the menu list would only be as wide as its longest label:
       the active pill and the dividers stopped short of the column, and the rail's icons sat left. */
    .ez-app-nav > .nav { display: flex; }

    /* Menu sections (NavMenu): a section and its links stack like the list they sit in. The section's
       toggle is for the top bar and the rail only. */
    .ez-nav-section, .ez-nav-links { display: flex; flex-direction: column; gap: var(--bs-nav-gap); }
    .ez-nav-dropdown, .ez-nav-more { display: none; }

    /* A collapsed sidebar section's links stay in the markup (NavMenu), hidden here. */
    .ez-nav-collapsed { display: none; }

    /* ── The brand block at the head of the menu (NavBrand, the theme's BrandBlock) ──────
       "mark-name" and "name": the app's name (and a muted line under it) in the side colours the menu
       already carries. The mark is the logo mark, or a monogram in the primary colours; 28px at the
       13px base the mock-ups are drawn at, so it scales with the theme's text size. */
    .ez-brand-mark {
        width: calc(28rem / 13);
        height: calc(28rem / 13);
        border-radius: var(--ez-m-radius, var(--bs-radius-5));
        object-fit: contain;
    }
    .ez-brand-monogram {
        font-size: calc(14rem / 13);
        line-height: 1;
        color: var(--ez-c-on-primary, var(--bs-primary-contrast));
        background-color: var(--ez-c-primary, var(--bs-primary-bg));
    }

    /* ── The Compact menu template (NavMenu Compact, data-variant="compact") ────────────
       One flat list: no section headings or dividers, smaller items (--ez-nav-font-size is the
       template's "Menu text" setting; a theme's menu text size beats it). */
    .ez-app-nav[data-variant="compact"] :is(.ez-nav-heading, .ez-nav-divider) { display: none; }
    .ez-app-nav[data-variant="compact"] > .nav {
        font-size: var(--ez-m-nav-fs, var(--ez-nav-font-size, 0.875rem));
        --bs-nav-link-padding-y: 0.25rem;
    }
    /* Its top-bar dropdowns and More menu take the same text size. */
    .ez-app-nav[data-variant="compact"] .ez-nav-menu { --bs-menu-font-size: var(--ez-m-nav-fs, var(--ez-nav-font-size, 0.875rem)); }

    /* ── The account and the bell placed in the side menu (.ez-nav-account, SidebarWidgets) ──────────
       Its buttons are v6 outline-secondary buttons, whose colours v6 resolves once on the page, so
       here they are re-pointed at the side slots like the links; the avatar takes the active item's
       colours. The panels pop out as surfaces (the reset above). */
    .ez-app-nav {
        --ez-side-button-fg: var(--ez-c-side-text, var(--bs-secondary-fg));
        --ez-side-button-hover-fg: var(--ez-c-side-text, var(--bs-secondary-contrast));
        --ez-side-button-hover-bg: var(--ez-c-side-hover-bg, var(--bs-secondary-bg));
        --ez-side-button-border: var(--ez-c-side-border, var(--bs-secondary-border));
    }
    .ez-nav-account :is(.user-card, .notif-wrap > .btn) {
        --bs-secondary-fg: var(--ez-side-button-fg);
        --bs-secondary-contrast: var(--ez-side-button-hover-fg);
        --bs-secondary-bg: var(--ez-side-button-hover-bg);
        --bs-secondary-border: var(--ez-side-button-border);
    }
    /* At the foot of the menu the account's and the bell's panels open upward. */
    .ez-nav-account--up :is(.user-menu, .notif-menu, .business-menu) {
        position: absolute;
        top: auto;
        bottom: calc(100% + var(--bs-spacer-2));
        inset-inline: 0 auto;
    }
    .ez-nav-account .user-card { width: 100%; }
    .ez-nav-account .ez-user-card-name { display: block; min-width: 0; }
    /* A narrow menu: the name gets the room, not the platform-admin crown beside it. */
    .ez-nav-account .user-card .badge:not(.theme-danger) { display: none; }
    /* In the menu the card is a row of the menu, not a framed button: no outline, and no chevron
       taking the name's room (the whole row still opens the account menu). */
    .ez-nav-account .btn.user-card.user-card { --bs-secondary-border: transparent; padding-inline: var(--bs-spacer-2); }
    .ez-nav-account .user-card > .md\:d-inline-block { display: none !important; }

    /* ── The aside region (a page fills it with EzAside; ChromeLayout sets data-aside) ───
       Hidden until a page has something in it; on a phone it follows the page. Its width on a desktop is
       --ez-aside-width (a theme can set it). */
    .ez-app-aside { display: none; }
    .ez-app[data-aside="on"] .ez-app-aside { display: block; }
    .ez-app[data-aside="on"] {
        grid-template-rows: auto auto 1fr auto auto auto;
        grid-template-areas: "banners" "header" "main" "aside" "footer" "tabs";
    }

    /* ── Full screen (data-screen="full", ChromeLayout: ShellLayout.FullScreen) ──────
       A page that is the whole window (Theme Studio's editor): no banners, header, menu or tab bar are
       rendered, and the shell is exactly the window, so the page lays out its own panes and nothing
       scrolls the page itself. v6 has no app frame for this. Its main has no padding: the page's own
       top bar runs edge to edge. */
    .ez-app[data-screen="full"] {
        height: 100dvh;
        overflow: hidden;
        grid-template-rows: minmax(0, 1fr);
        grid-template-areas: "main";
    }
    .ez-app[data-screen="full"] > .ez-app-main {
        display: flex;
        flex-direction: column;
        min-height: 0;
        padding: 0;
    }
    .ez-app[data-screen="full"] > .ez-app-main > .content-area {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
    }

    .ez-header-title { flex: 1 1 auto; min-width: 0; }
    /* !important: the logo's wrapper carries v6's d-flex utility, which a rule in this layer cannot otherwise beat. */
    .ez-app:not([data-nav="top"]) .ez-header-logo { display: none !important; }
    /* Where the logo shows beside the title (a rail with fly-outs, below xl), a gap keeps the title's back arrow off it. */
    .ez-app:not([data-nav="top"]) .ez-header-logo { margin-inline-end: var(--bs-spacer-4); }
    .ez-header-actions { flex: none; }
    /* The business name can shrink (xl, below), so it gives way before the page title. */
    .ez-app-header .btn.ez-header-business { min-width: 0; max-width: 100%; }
    /* The page's one-line description under the title, on a desktop only. */
    .ez-header-description:empty { display: none; }
    @media (width < 1024px) { .ez-header-description { display: none; } }

    /* ── The top bar's controls (owner decision, 2026-11-12: a quiet top bar) ─────────────────────────────────
       One soft grey for all of them, and no borders: the search (.ez-header-find, the one box on every page; it opens
       the search window, scoped to the page's list where it has one), the page's filter button, the bell, the business
       and the avatar (and a consumer app's credits and the Ask button) each sit on the soft grey, a shade darker on
       hover or while open. Low or empty credits keep their warning or danger outline, which says so.
       Why custom: v6 has no soft field look for a button, and these buttons come from several components and theme
       placements, so the bar's look is set here once. */
    .ez-header-filters:empty { display: none; }
    .ez-app-header .btn.ez-header-find {
        width: clamp(10rem, 18vw, 16rem);
        justify-content: flex-start;
        background-color: var(--bs-bg-2);
        border-color: transparent;
        color: var(--bs-fg-3);
    }
    .ez-app-header .btn.ez-header-find:hover { background-color: var(--bs-bg-3); color: var(--bs-fg-2); }
    .ez-header-find-label { flex: 1 1 auto; text-align: start; }
    .ez-header-find-kbd {
        font: inherit;
        font-size: 0.75rem;
        padding: 0 var(--bs-spacer-2);
        color: var(--bs-fg-3);
        background: transparent;
        border: var(--bs-border-width) solid var(--bs-border-color);
        border-radius: var(--bs-radius-2);
    }
    .ez-app-header :is(.ez-header-filter, .ez-header-business, .ez-header-ask, .user-card, .notif-wrap > .btn, .btn.billing-badge.theme-secondary) {
        border-color: transparent;
        background-color: var(--bs-bg-2);
        color: var(--bs-fg-2);
    }
    .ez-app-header :is(.ez-header-filter, .ez-header-business, .ez-header-ask, .user-card, .notif-wrap > .btn, .btn.billing-badge.theme-secondary):is(:hover, .active, [aria-expanded="true"]) {
        border-color: transparent;
        background-color: var(--bs-bg-3);
        color: var(--bs-fg-1);
    }
    /* The account button is just the avatar, a round button; its name shows only in the side menu (below). */
    .ez-app-header .btn.user-card { aspect-ratio: 1; justify-content: center; border-radius: 50%; }
    .ez-app-header .ez-user-card-name { display: none; }
    .ez-header-business-name { max-width: 16rem; }
    @media (width < 768px) {
        .ez-app { --ez-page-px: min(var(--ez-m-page-px, var(--bs-spacer-7)), var(--bs-spacer-5)); }
        .ez-app-header { position: relative; }
        /* The bar's large buttons drop to the normal size on a phone, so the page title keeps its room. */
        .ez-app-header .btn-lg {
            --bs-btn-min-height: var(--bs-btn-input-min-height);
            --bs-btn-padding-y: var(--bs-btn-input-padding-y);
            --bs-btn-padding-x: var(--bs-btn-input-padding-x);
        }
        .ez-app-header .btn.ez-header-find { width: auto; aspect-ratio: 1; padding-inline: 0; justify-content: center; }
        .ez-header-find :is(.ez-header-find-label, .ez-header-find-kbd) { display: none; }
    }
    /* The business button is its icon below xl; its menu names the business. On a tablet its name (up to 16rem) left
       the page title no room at all (audit, 2026-11-12). */
    @media (width < 1280px) {
        .ez-header-business-name { display: none; }
    }
    /* The narrowest phones (320px): the bar's buttons drop to 36px, the menu button to its smallest and the title to
       fs-md, or the title was left 40px ("Cus...") (audit, 2026-11-13). The parent crumb's arrow STAYS: it is the
       only way back inside the Android app, whose own Back left the app (owner, 2026-11-21), so a long title
       truncates beside it instead. */
    @media (width < 400px) {
        .ez-app-header .btn-lg { --bs-btn-min-height: 2.25rem; }
        .ez-app-header :is(.btn-lg.btn-icon, .btn.user-card, .btn.ez-header-find) { width: 2.25rem; height: 2.25rem; min-width: 0; }
        /* The credits pill to the same 36px, top and bottom in line with the bell beside it (its 24px line and the
           input padding made it 37.5px, so it stood out of the row), and a little narrower. */
        .ez-app-header .btn.billing-badge { height: 2.25rem; padding-inline: var(--bs-spacer-3); }
        .ez-app-header .ez-burger { width: 24px; }
        .ez-app-header :is(.ez-page-title, .ez-page-title-link) { font-size: var(--bs-font-size-md); }
    }

    @media (width >= 1280px) {
        /* Every layout at xl: the header is one row (logo where the layout wants it, title, then the
           actions on the right; the top bar splits it, below), the menu's drawer controls and the
           phone tab bar have no job. */
        .ez-app-header { display: flex; }
        /* The title keeps its whole width (up to half the bar) and the actions sit at the right end, shrinking the
           business name (the one part of them that can) when the two do not fit: at 1280px an invoice's title read
           "Invoices > I..." beside the full business name (audit, 2026-11-12). */
        .ez-header-title { flex: 0 0 auto; max-width: 50%; }
        .ez-header-actions { flex: 0 1 auto; min-width: 0; margin-inline-start: auto; }
        .ez-app :is(.ez-burger, .ez-nav-close, .ez-app-tabs) { display: none; }
        /* Except the admin menu's burger: platform staff open the admin drawer (AdminNavDrawer) from it at every
           width, since the app's own menu never holds the admin sections (owner decision, 2026-11-19). */
        .ez-app .ez-burger.ez-admin-burger { display: flex; }

        /* ── Sidebar and rail ────────────────────────────────────────────────────────
           The menu is a column beside header, page and footer, the full height of the page, and
           scrolls with it: one scrollbar, the page's (owner decision, 2026-10-23). In the sidebar the
           logo lives in the menu, so the header drops its copy. */
        .ez-app[data-nav="rail"] { --ez-nav-width: var(--ez-rail-width, 6rem); }
        /* The side menu's head (the logo) is exactly the top bar's height, with the logo centred in it, so the bar's
           bottom border runs straight across into the menu and Create starts on that line (owner, 2026-11-12). The bar
           is its padding, a large button and its border (or the theme's header height when that is taller); the head
           starts at the menu's top, above the menu's own padding. A logo taller than the bar makes the head taller.
           !important on the margins: the head's mb utility, and a theme's own pull-up of Create, win otherwise. */
        .ez-app[data-nav="side"] {
            --ez-top-h: max(var(--ez-m-header-h, 0px), calc(2 * var(--bs-spacer-5) + var(--bs-btn-input-lg-min-height) + var(--bs-border-width)));
        }
        .ez-app[data-nav="side"] > .ez-app-header { min-height: var(--ez-top-h); }
        .ez-app[data-nav="side"] > .ez-app-nav > .ez-nav-head {
            min-height: var(--ez-top-h);
            margin-top: calc(-1 * var(--ez-m-sidebar-py, var(--bs-spacer-5)));
            margin-bottom: 0 !important;
            padding-block: 0;
            align-items: center;
        }
        .ez-app[data-nav="side"] > .ez-app-nav > .ez-nav-head + .ez-nav-block--create { margin-top: 0 !important; }
        .ez-app:is([data-nav="side"], [data-nav="rail"]) {
            grid-template-columns: var(--ez-nav-width) minmax(0, 1fr);
            grid-template-rows: auto auto 1fr auto;
            grid-template-areas:
                "banners banners"
                "nav     header"
                "nav     main"
                "nav     footer";
        }
        .ez-app:is([data-nav="side"], [data-nav="rail"]) .ez-app-nav {
            /* Back in the grid's flow (the drawer is fixed), stretched down the column so its colour runs
               the page's length, with no scroll of its own. */
            position: static;
            width: auto;
            overflow: visible;
            transform: none;
            transition: none;
        }
        .ez-app[data-nav="side"] .ez-header-logo { display: none !important; }

        /* ── Inline header (a theme's Header: inline, data-header="inline") ──────────────
           No bar: the header loses its rule and its bottom padding, and starts at the page's own top
           padding, so the title reads as the page's first line. */
        .ez-app[data-header="inline"] .ez-app-header {
            padding-top: var(--ez-m-page-py, var(--bs-spacer-5));
            padding-bottom: 0;
            border-block-end-width: 0;
            /* Part of the page, not a bar: the page's own ground shows through. */
            color: inherit;
            background-color: transparent;
        }
        .ez-app[data-header="inline"][data-nav="side"] .ez-app-nav {
            display: flex;
            flex-direction: column;
        }

        /* ── Icon rail ─────────────────────────────────────────────────────────────────
           One entry per SECTION, not per page: its icon (IModuleDescriptor.NavSectionIcon) over a short
           label, the way a navigation rail does it. A click opens the section's pages in a flyout (the
           same v6 .menu the top bar drops down); a one-page section is that page's link. The headings,
           dividers and page links of the sidebar drop out, and the logo sits in the header. */
        /* The pill radius is v6's own token, reset to a rounded square: a 3rem pill on a two-line,
           icon-over-label entry turns it into a blob that clips the label's ends. */
        .ez-app[data-nav="rail"] .ez-app-nav { padding-inline: var(--bs-spacer-2); }
        .ez-app[data-nav="rail"] .ez-app-nav > .nav { --bs-nav-pills-link-border-radius: var(--ez-m-radius, var(--bs-radius-7)); }
        .ez-app[data-nav="rail"] :is(.ez-nav-head, .ez-nav-heading, .ez-nav-divider, .ez-nav-links, .ez-nav-chevron) { display: none !important; }
        .ez-app[data-nav="rail"] .ez-nav-dropdown {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: var(--bs-spacer-1);
            padding: var(--bs-spacer-2) var(--bs-spacer-1);
            font-size: var(--bs-font-size-xs);
            line-height: 1.2;
            text-align: center;
            white-space: normal;
            overflow-wrap: break-word;
            /* A long one-word label ("Organizations") is hyphenated where it breaks, never cut bare. */
            -webkit-hyphens: auto;
            hyphens: auto;
        }
        /* A rail-sized icon: v6's xl type step, about the 24px a navigation rail uses. */
        .ez-app[data-nav="rail"] .ez-nav-section-icon { font-size: var(--bs-font-size-xl); }

        /* The flyout opens beside its rail entry. The rail column scrolls, which would clip an
           absolutely placed menu, so it is fixed to the viewport and tied to the open entry with CSS
           anchor positioning (one open at a time, so one anchor name). It flips upward when the entry
           is too low for it to fit below.
           Without anchor positioning (Safari before 26, so the iOS 17.5 floor) a fixed panel with no anchor
           would land at the viewport's edge, so it hangs absolutely beside its own section instead: the
           rail has no scroll of its own on a desktop (overflow: visible above), so nothing clips it. */
        .ez-app[data-nav="rail"] .ez-nav-menu { margin-inline-start: var(--bs-spacer-3); }
        @supports (anchor-name: --ez-a) {
            .ez-app[data-nav="rail"] .ez-nav-section.is-open > .ez-nav-dropdown { anchor-name: --ez-rail-open; }
            .ez-app[data-nav="rail"] .ez-nav-menu {
                position: fixed;
                position-anchor: --ez-rail-open;
                top: anchor(top);
                inset-inline-start: anchor(right);
                position-try-fallbacks: flip-block;
            }
        }
        @supports not (anchor-name: --ez-a) {
            .ez-app[data-nav="rail"] .ez-nav-section { position: relative; }
            .ez-app[data-nav="rail"] .ez-nav-menu {
                position: absolute;
                top: 0;
                inset-inline-start: 100%;
            }
        }

        /* ── Top bar ───────────────────────────────────────────────────────────────────
           Row 1 is the bar: logo, menu, then the account controls (credits, bell, user menu) on the
           right, as every top-nav site does. Row 2 is the page's title and breadcrumb. The header
           steps out of the way (display: contents) so its logo, title and actions become grid items
           of the shell and land in their own cells round the menu. For apps with a handful of
           sections: section headings and dividers drop out, and each section is a dropdown. */
        .ez-app[data-nav="top"] {
            grid-template-columns: auto minmax(0, 1fr) auto;
            grid-template-rows: auto auto auto 1fr auto;
            grid-template-areas:
                "banners banners banners"
                "logo    nav     actions"
                "title   title   title"
                "main    main    main"
                "footer  footer  footer";
        }
        .ez-app[data-nav="top"] .ez-app-header { display: contents; }
        .ez-app[data-nav="top"] .ez-header-logo    { grid-area: logo; padding-inline-start: var(--bs-spacer-7); }
        .ez-app[data-nav="top"] .ez-header-actions { grid-area: actions; padding-inline-end: var(--bs-spacer-7); }
        .ez-app[data-nav="top"] .ez-header-title   {
            grid-area: title;
            padding: var(--bs-spacer-3) var(--bs-spacer-7);
            border-bottom: var(--bs-border-width) solid var(--bs-border-color);
        }
        .ez-app[data-nav="top"] :is(.ez-header-logo, .ez-app-nav, .ez-header-actions) {
            align-self: stretch;
            align-items: center;
            padding-block: var(--bs-spacer-3);
            border-bottom: var(--bs-border-width) solid var(--ez-c-side-border, var(--ez-page-border-color));
        }
        /* The side colour paints the whole bar, not only its middle (menu) cell; --ez-menu-bg is the
           older theme's menu colour. */
        .ez-app[data-nav="top"] :is(.ez-header-logo, .ez-header-actions) { background: var(--ez-c-side, var(--ez-menu-bg, transparent)); }
        /* ...so the bar's account controls (search, bell, user card) take the side slots too, as the menu's own
           account block does (.ez-nav-account, above): on a dark side colour they were the page's muted text on it.
           What pops out of them (the account and bell panels, the arrival toast) is the page's surface again. */
        .ez-app[data-nav="top"] .ez-header-actions {
            --bs-fg-1: var(--ez-c-side-text, var(--ez-page-fg-1));
            --bs-fg-2: var(--ez-c-side-text, var(--ez-page-fg-2));
            --bs-fg-3: var(--ez-c-side-muted, var(--ez-page-fg-3));
            --bs-fg-4: var(--ez-c-side-muted, var(--ez-page-fg-4));
            color: var(--ez-c-side-text, var(--bs-fg-body));
            --ez-side-button-fg: var(--ez-c-side-text, var(--bs-secondary-fg));
            --ez-side-button-hover-fg: var(--ez-c-side-text, var(--bs-secondary-contrast));
            --ez-side-button-hover-bg: var(--ez-c-side-hover-bg, var(--bs-secondary-bg));
            --ez-side-button-border: var(--ez-c-side-border, var(--bs-secondary-border));
        }
        .ez-app[data-nav="top"] .ez-header-actions :is(.user-card, .notif-wrap > .btn, .ez-header-find, .ez-header-ask) {
            --bs-secondary-fg: var(--ez-side-button-fg);
            --bs-secondary-contrast: var(--ez-side-button-hover-fg);
            --bs-secondary-bg: var(--ez-side-button-hover-bg);
            --bs-secondary-border: var(--ez-side-button-border);
        }
        .ez-app[data-nav="top"] .ez-header-actions :is(.menu, .toast) {
            --bs-fg-1: var(--ez-page-fg-1);
            --bs-fg-2: var(--ez-page-fg-2);
            --bs-fg-3: var(--ez-page-fg-3);
            --bs-fg-4: var(--ez-page-fg-4);
            color: var(--bs-fg-body);
        }
        .ez-app[data-nav="top"] .ez-app-nav {
            position: static;
            /* The drawer's z-index would make this grid item a stacking context, trapping the open
               section's menu under the click-away backdrop: the menu showed but took no clicks. */
            z-index: auto;
            display: flex;
            width: auto;
            overflow: visible;
            padding: var(--bs-spacer-3) var(--bs-spacer-5);
            border-inline-end: 0;
            transform: none;
            transition: none;
        }
        /* Each section is one dropdown in the bar: its toggle shows; its heading, divider and sidebar
           links do not. The open section renders a stock v6 .menu (NavMenu keeps one open at a time and
           closes it on a link, Escape, a click away or navigation); all that is ours is where it hangs,
           since v6 leaves .menu placement to its JS positioner. */
        .ez-app[data-nav="top"] .ez-app-nav { min-width: 0; }
        .ez-app[data-nav="top"] .ez-app-nav .nav {
            position: relative;
            flex: 1;
            min-width: 0;
            flex-direction: row;
        }
        .ez-app[data-nav="top"] .ez-nav-section { position: relative; }
        .ez-app[data-nav="top"] :is(.ez-nav-head, .ez-nav-heading, .ez-nav-divider, .ez-nav-links, .side-menu-pad) { display: none !important; }
        .ez-app[data-nav="top"] .ez-nav-dropdown { display: flex; width: auto; white-space: nowrap; }
        /* The bar names each section on its toggle, so the toggle's rail icon and the menu's own
           section heading (for the rail's flyout) would only repeat it. */
        .ez-app[data-nav="top"] :is(.ez-nav-section-icon, .ez-nav-menu-title) { display: none !important; }
        .ez-nav-menu { top: calc(100% + var(--bs-spacer-1)); inset-inline-start: 0; }

        /* The bar is one row. Sections that do not fit go in the More menu at its end (NavMenu, told how
           many fit by nav-overflow.js). A section in More is hidden with visibility rather than display,
           so it keeps its width for the next measure; pinned to the bar's start so it can never widen
           the page. More itself is measured the same way while it has nothing in it. */
        .ez-app[data-nav="top"] .ez-nav-more { display: flex; }
        .ez-app[data-nav="top"] .ez-nav-overflowed {
            position: absolute;
            inset-block-start: 0;
            inset-inline-start: 0;
            visibility: hidden;
            pointer-events: none;
        }
        .ez-nav-more .ez-nav-menu { inset-inline: auto 0; }
        /* Until nav-overflow.js has measured (the prerendered page, before the circuit starts), the row
           cannot know what fits: keep it invisible rather than let it run over the account controls. */
        .ez-app[data-nav="top"] .ez-app-nav .nav:not([data-measured]) { visibility: hidden; overflow: hidden; }

        /* ── No menu ───────────────────────────────────────────────────────────────────
           Focus pages (studios, editors, builders): header and page only. */
        .ez-app[data-nav="none"] .ez-app-nav { display: none; }

        /* ── Aside on a desktop: a column to the right of the page, per layout ───────── */
        .ez-app[data-aside="on"]:is([data-nav="side"], [data-nav="rail"]) {
            grid-template-columns: var(--ez-nav-width) minmax(0, 1fr) var(--ez-aside-width, 18rem);
            grid-template-rows: auto auto 1fr auto;
            grid-template-areas:
                "banners banners banners"
                "nav     header  header"
                "nav     main    aside"
                "nav     footer  footer";
        }
        .ez-app[data-aside="on"][data-nav="top"] {
            grid-template-columns: auto minmax(0, 1fr) auto var(--ez-aside-width, 18rem);
            grid-template-areas:
                "banners banners banners banners"
                "logo    nav     actions actions"
                "title   title   title   title"
                "main    main    main    aside"
                "footer  footer  footer  footer";
        }
        .ez-app[data-aside="on"][data-nav="none"] {
            grid-template-columns: minmax(0, 1fr) var(--ez-aside-width, 18rem);
            grid-template-rows: auto auto 1fr auto;
            grid-template-areas:
                "banners banners"
                "header  header"
                "main    aside"
                "footer  footer";
        }
        .ez-app[data-aside="on"] .ez-app-aside { border-inline-start: var(--bs-border-width) solid var(--bs-border-color); }

        /* ── Boxed: the whole shell is a centred card with a gutter round it ──────────── */
        /* Round the box: the theme's outer page colour (Theme Studio's page background), else the body's. */
        body:has(> .ez-app[data-width="boxed"]) { background-color: var(--ez-c-outer, var(--ez-ground-outer, var(--bs-bg-body))); }
        .ez-app[data-width="boxed"] {
            /* The gutter holds at the sides too, so the frame still reads as a box on a screen no wider than it. */
            width: calc(100% - 2 * var(--bs-spacer-7));
            max-width: var(--ez-app-max-width);
            margin: var(--bs-spacer-7) auto;
            border: var(--bs-border-width) solid var(--bs-border-color);
            border-radius: var(--bs-radius-7);
            overflow: clip;
        }
    }

    /* ── Each user's display settings (data-text-size / data-density / data-motion on <html>) ─
       Set from the user's profile (pre-painted from a cookie, like colour mode), within the defaults and
       choices the theme allows. Text size scales the root, as browser zoom does, so spacing keeps its
       proportion; density moves Bootstrap 6's own control tokens; reduced motion stops animation and
       transitions for someone who asked, whatever their device says.
       The theme's own base size (--ez-scale, its base text size over 16px) scales the root first, and
       each text size multiplies it, so a user's choice is always relative to the theme. */
    :root { font-size: calc(var(--ez-scale, 1) * 100%); }
    :root[data-text-size="small"] { font-size: calc(var(--ez-scale, 1) * 93.75%); }
    :root[data-text-size="large"] { font-size: calc(var(--ez-scale, 1) * 112.5%); }
    :root[data-text-size="x-large"] { font-size: calc(var(--ez-scale, 1) * 125%); }
    /* The control tokens themselves are set OUTSIDE this layer, at the end of the file: Bootstrap 6
       declares its :root tokens unlayered, so no layered rule can change them.
       Menus and tables declare their own padding tokens on themselves (layered), so density sets them here. */
    :root[data-density="compact"] .nav { --bs-nav-link-padding-y: 0.25rem; }
    :root[data-density="compact"] .table { --bs-table-cell-padding-y: 0.375rem; }
    :root[data-density="comfortable"] .nav { --bs-nav-link-padding-y: 0.5rem; }
    :root[data-density="compact"] .menu { --bs-menu-item-padding-y: 0.125rem; }
    :root[data-density="compact"] .list-group { --bs-list-group-item-padding-y: var(--bs-spacer-1); }
    :root[data-density="comfortable"] .menu { --bs-menu-item-padding-y: 0.375rem; }
    :root[data-density="comfortable"] .list-group { --bs-list-group-item-padding-y: var(--bs-spacer-3); }
    :root[data-density="comfortable"] .table { --bs-table-cell-padding-y: 0.75rem; }
    :root[data-motion="reduce"] *,
    :root[data-motion="reduce"] *::before,
    :root[data-motion="reduce"] *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* ── Blazor UI ───────────────────────────────────────────────────────────────────
       Blazor's own messages are Bootstrap 6 markup (ChromeLayout's error bar is a danger alert,
       ReconnectModal is a v6 .dialog). What is left here is the part only Blazor's contract decides:
       which element is visible in which state. */

    /* The circuit error bar: hidden until blazor.web.js sets style.display on it. Not [hidden] or
       d-none - both are !important and would beat Blazor's inline style. */
    #blazor-error-ui {
        display: none;
        z-index: calc(var(--bs-z-toast) - 1);
        padding-bottom: calc(var(--bs-alert-padding-y) + env(safe-area-inset-bottom));
    }

    /* Reconnect dialog: Blazor puts components-reconnect-show / -retrying / -failed / -paused /
       -resume-failed on the dialog, and each message shows only in its state. revert-layer hands a
       shown element back its Bootstrap display (a <p> block, a .btn inline-flex). */
    #components-reconnect-modal :is(.components-reconnect-first-attempt-visible,
                                    .components-reconnect-repeated-attempt-visible,
                                    .components-reconnect-failed-visible,
                                    .components-pause-visible,
                                    .components-resume-failed-visible,
                                    .ez-reconnect-offline-visible,
                                    .components-rejoining-animation) {
        display: none;
    }
    #components-reconnect-modal.components-reconnect-show :is(.components-reconnect-first-attempt-visible, .components-rejoining-animation),
    #components-reconnect-modal.components-reconnect-retrying :is(.components-reconnect-repeated-attempt-visible, .components-rejoining-animation),
    #components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible,
    #components-reconnect-modal.components-reconnect-paused .components-pause-visible,
    #components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible,
    #components-reconnect-modal.ez-reconnect-offline:is(.components-reconnect-show, .components-reconnect-retrying) .ez-reconnect-offline-visible {
        display: revert-layer;
    }
    /* Offline: the offline line replaces the retry lines. */
    #components-reconnect-modal.ez-reconnect-offline :is(.components-reconnect-first-attempt-visible, .components-reconnect-repeated-attempt-visible) {
        display: none;
    }

    /* The pill stage: the dialog shrinks to a one-line chip near the top of the screen (above the
       tab bar on phones), where a short drop can come and go without covering the page. */
    #components-reconnect-modal.ez-reconnect--pill {
        width: max-content;
        margin: calc(var(--bs-spacer-5) + env(safe-area-inset-top)) auto auto;
        border-radius: var(--bs-radius-pill);
    }
    #components-reconnect-modal.ez-reconnect--pill .components-reconnect-container {
        flex-direction: row !important;
        padding-block: var(--bs-spacer-2);
    }
    @media (width < 1280px) {
        #components-reconnect-modal.ez-reconnect--pill {
            margin: auto auto calc(var(--bs-spacer-5) + env(safe-area-inset-bottom));
        }
        :root:has(.ez-app-tabs) #components-reconnect-modal.ez-reconnect--pill {
            margin-bottom: calc(4.25rem + var(--bs-spacer-5) + env(safe-area-inset-bottom));
        }
    }

    /* ══ Components: overlays ══════════════════════════════════════════════════ */
    /* ── EzSensitive ("Hide my info") ──────────────────────────────────────────────────
       Why custom: the mask is driven by data-privacy="on" on <html> (written during SSR from the
       ez-privacy cookie, flipped live by ezPrivacy in layout.js), so it is right in the first painted
       frame with no circuit. v6 has no state-on-an-ancestor utility and no blur filter.
       - Text and markup: blurred in place, still selectable and copyable. No hover reveal.
       - Form fields given .ez-sensitive directly: only the typed value is smeared (transparent glyphs
         plus a doubled text-shadow), so the field's border, background and caret stay sharp, and a
         selection cannot repaint the real glyphs.
       - Mask="EzMask.FixedWidth": the component renders the real value AND a constant-width token;
         these rules pick one. The real value is display:none while masked, so its width (the number's
         magnitude) cannot leak, and it cannot be selected or read out. */
    .ez-sensitive {
        transition-property: filter, color, text-shadow;
        transition-duration: var(--bs-control-transition-duration);
    }
    [data-privacy="on"] .ez-sensitive:not(input, textarea, select) {
        filter: blur(9px);
        border-radius: var(--bs-radius-2);
    }
    [data-privacy="on"] :is(input, textarea, select).ez-sensitive {
        color: transparent;
        text-shadow: 0 0 11px var(--bs-fg-body), 0 0 11px var(--bs-fg-body);
        caret-color: var(--bs-fg-body);
    }
    [data-privacy="on"] :is(input, textarea, select).ez-sensitive::selection {
        color: transparent;
        text-shadow: none;
    }
    .ez-sensitive-token { display: none; }
    [data-privacy="on"] .ez-sensitive-fixed > .ez-sensitive-real { display: none; }
    [data-privacy="on"] .ez-sensitive-fixed > .ez-sensitive-token { display: inline; }
    @media (prefers-reduced-motion: reduce) {
        .ez-sensitive { transition: none; }
    }

    /* ── EzToastHost (.ez-toast-host on a v6 .toast-container) ─────────────────────────
       The end edge and the gap round the stack are utilities (end-0 p-5). Why custom: v6's position
       utilities have no responsive or calc() form, and VCR's tryon.css moves the bottom above its
       selection bar (a bottom-0 utility would beat that).
       - Below xl the phone tab bar (.ez-app-tabs) is on screen; lift the stack clear of it, or a tap
         aimed at Undo lands on the tab underneath once the toast times out. Same 4.25rem clearance the
         reconnect pill uses. body:has(), not :root:has(), so VCR's own override still outranks it.
       - Phones: full width, like an Android snackbar. */
    .ez-toast-host { bottom: 0; }
    @media (width < 1280px) {
        body:has(.ez-app-tabs) .ez-toast-host {
            bottom: calc(4.25rem + env(safe-area-inset-bottom));
        }
    }
    @media (width < 576px) {
        .ez-toast-host { inset-inline-start: 0; width: auto; }
        .ez-toast-host .toast { width: 100%; }
    }

    /* ── EzActionMenu (a v6 .menu panel on a native popover) ──────────────────────────
       Why custom: v6's Menu plugin positions its own menus with its own script; this one is a native
       popover (popover="auto", opened by its trigger's popovertarget), so it sits in the browser's top
       layer. Nothing around it can cut it off there - not overflow, not a wide table's fade mask, not
       a transform, filter or stacking context - and it needs no z-index. CSS anchor positioning places
       it against its trigger; the anchor name is per instance (a GUID custom ident on the wrapper and
       the panel, emitted by EzActionMenu.razor).
       - v6 shows a .menu with .show; a popover is shown by the browser, so :popover-open stands in for
         it (and @starting-style for its entry). The UA popover box (inset 0, margin auto) is reset
         before the anchor edges are set. overlay keeps the panel in the top layer while it fades out.
       - Alignment (EzActionMenu's Align): --left / --right pin that edge of the panel to the same edge
         of the trigger. --auto (the default) starts end-aligned and lets the browser pick the side with
         more room (position-try-order: most-inline-size), so a first-column row menu opens rightward and
         a page-header or card-corner menu opens leftward. Inside .col-actions the base itself is
         start-aligned, which also holds on a browser without position-try-order. Every alignment flips
         up and/or across when the panel would leave the viewport.
       - Without anchor positioning (Safari before 26) the panel keeps the popover's own placement,
         centred on the screen: still never clipped, just not beside its button. */
    /* The trigger keeps its own height when its menu sits in a taller flex row: a square icon button stretched to the
       row's height and so to the same width (a customer's site row made it 275px wide on a phone, audit 2026-11-13). */
    .ez-action-menu > .btn { align-self: flex-start; }
    .ez-action-menu__panel {
        --bs-menu-transition-property: opacity, transform, display, overlay;
        inset: auto;
        margin: 0;
        top: calc(anchor(bottom) + var(--bs-spacer-2));
        position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
    }
    .ez-action-menu__panel:popover-open {
        display: flex;
        opacity: 1;
        transform: none;
    }
    @starting-style {
        .ez-action-menu__panel:popover-open {
            opacity: 0;
            transform: scale(0.95);
        }
    }
    .ez-action-menu__panel--right,
    .ez-action-menu__panel--auto { right: anchor(right); left: auto; }
    .ez-action-menu__panel--left,
    .col-actions .ez-action-menu__panel--auto { left: anchor(left); right: auto; }
    .ez-action-menu__panel--auto { position-try-order: most-inline-size; }
    /* Inside a dialog the trigger sits in a fixed layer (.ez-dialog-layer), which does not scroll with
       the page. An absolute panel is placed in page coordinates, so on a scrolled page it opened that far
       above its button, off screen (the History's "How it was made" menus, 2026-11-12). A fixed panel is
       placed in the same viewport coordinates as its trigger. */
    .ez-dialog-layer .ez-action-menu__panel { position: fixed; }
    /* The side menu's Create list (NavCreateMenu) opens BESIDE the menu, never over it (owner decision, 2026-11-12):
       from past the menu's right edge, level with the button, lifted by a shadow, under its "Create new" heading, with
       each kind's icon in a chip, so it can never read as more menu links. In the phone drawer it drops under the
       button as before, and the button's arrow turns down to say so. It floats on the dropdown shadow below. */
    .ez-nav-block--create .ez-action-menu__panel { min-width: 15rem; }
    /* Every dropdown floats on a shadow, even in a theme whose Shadows setting is None (owner decision, 2026-11-12:
       a flat list on a white page looked pasted on; WinUI's menus float the same way). v6's menu shadow is
       --bs-box-shadow-lg, scaled by --bs-shadow-strength, which such a theme sets to 0 for the whole page and which
       is resolved once on :root, so a menu cannot simply take the strength back: this is v6's lg shadow written out
       with the menu's own strength (v6's 1, and 2.4 in dark). Cards stay flat. A theme's own Menus shadow (its
       stylesheet is unlayered) still wins. The search palette's list sits inside its own dialog and is not a
       dropdown. */
    .menu:not(.ez-menu-search-list) {
        --ez-menu-shadow-strength: 1;
        --bs-menu-box-shadow:
            0 .125rem .375rem -.0625rem oklch(from var(--bs-shadow-color) l c h / calc(.05 * var(--ez-menu-shadow-strength))),
            0 .375rem 1rem -.1875rem oklch(from var(--bs-shadow-color) l c h / calc(.06 * var(--ez-menu-shadow-strength))),
            0 .75rem 2rem -.375rem oklch(from var(--bs-shadow-color) l c h / calc(.07 * var(--ez-menu-shadow-strength))),
            0 1.5rem 3.5rem -.75rem oklch(from var(--bs-shadow-color) l c h / calc(.08 * var(--ez-menu-shadow-strength)));
    }
    @media (prefers-color-scheme: dark) {
        :root:not([data-bs-theme=light]) .menu:not(.ez-menu-search-list) { --ez-menu-shadow-strength: 2.4; }
    }
    [data-bs-theme=dark] .menu:not(.ez-menu-search-list) { --ez-menu-shadow-strength: 2.4; }
    [data-bs-theme=light] .menu:not(.ez-menu-search-list) { --ez-menu-shadow-strength: 1; }
    .ez-nav-block--create .ez-action-menu__panel .menu-item-icon {
        /* Font Awesome draws its glyph through --fa-display and sizes it through --fa-width (1.25em, which beat the
           inline-size below and left the chip narrow); a grid centres it in the chip. */
        --fa-display: inline-grid;
        --fa-width: 1.75rem;
        place-items: center;
        inline-size: 1.75rem;
        block-size: 1.75rem;
        border-radius: var(--bs-radius-3);
        /* The brand colour itself, not --bs-primary-fg: that is the text-safe shade, which a theme may set to black
           (JobSpark's orange fails 4.5:1 as text). The icon is decorative, beside its label. */
        color: var(--bs-primary-base);
        background-color: var(--bs-primary-bg-subtle);
    }
    /* A hub tile's icon (EzNavHub soft tiles): the brand colour, as the Create chips above (owner, 2026-11-12).
       v6's fg-primary is the text-safe shade, black in a theme whose brand colour fails as text. */
    .ez-nav-hub-icon { color: var(--bs-primary-base); }
    /* The brand colour itself on a section's icon and heading (a quote's Messages page: Email, Text message, Files; owner,
       2026-11-16: orange headings at their usual size, the owner's call, knowing a light brand colour can fall short of the
       4.5:1 text contrast that v6's fg-primary, the text-safe shade, keeps). */
    .ez-brand-ink { color: var(--bs-primary-base); }
    /* A box of words a person changes in place (a quote's Messages page: the subject, the text message), dashed so it
       reads as "yours to change" against the solid boxes around it (owner, 2026-11-16). v6 has no border-style utility. */
    .ez-edit-zone { border-style: dashed; }
    @media (width >= 1280px) {
        .ez-app-nav .ez-nav-block--create .ez-action-menu__panel {
            top: anchor(top);
            left: calc(anchor(right) + var(--ez-m-sidebar-px, var(--bs-spacer-5)) + var(--bs-spacer-3));
            right: auto;
        }
    }
    @media (width < 1280px) {
        .ez-nav-block--create .btn > i:last-child { rotate: 90deg; }
    }
    @supports not (anchor-name: --ez-a) {
        .ez-action-menu__panel,
        .ez-action-menu__panel--right,
        .ez-action-menu__panel--left,
        .ez-action-menu__panel--auto,
        .col-actions .ez-action-menu__panel--auto { inset: 0; margin: auto; }
    }

    /* The invisible click-away layer under the Blazor-driven dropdowns that are not native popovers
       (EzActionBar's overflow, NavMenu's top-bar section, NotificationBell, UserMenu); its full-screen
       position is utilities. Why custom: one step under the popover tier (panels use z-popover), and
       v6's z scale has no "minus one". */
    .ez-menu-backdrop {
        z-index: calc(var(--bs-z-popover) - 1);
    }

    /* ── EzModal (a v6 .dialog on a plain div, never a native <dialog>) ────────────────
       Why custom: a native <dialog> gets its backdrop, centring and top layer from the browser; on a div
       (the password-manager rule in AGENTS.md) the markup supplies them with utilities, and these rules
       cover what no utility can:
       - the backdrop sits one step under the dialog tier;
       - the layer is hidden until EzModal (Blazor) or ezModal.js (static SSR) adds d-block, and keeps a
         scroll inside it from chaining to the page;
       - v6 caps .dialog at 100% of its parent, which resolves to nothing in a min-height layer, so a
         dialog-scrollable one is capped to the viewport here (its body then scrolls, header and footer
         stay on screen);
       - ezModal.js's scroll lock: data-ez-scroll-lock on <body> while any modal holds it, padding back
         the scrollbar's width (--ez-scrollbar-gap) so the page does not jump sideways;
       - the backdrop darkens AND blurs the page (owner decision, 2026-11-18: an open dialog or drawer is
         the one thing in focus, the page only just shows through). No utility blurs what is behind an
         element, and the theme sets both (Studio > Components > Backdrop: --ez-backdrop-dim,
         --ez-backdrop-blur). Every backdrop shares it: dialogs, the filter and assistant drawers, and the
         phone menu drawer. */
    .ez-dialog-backdrop { z-index: calc(var(--bs-z-dialog) - 1); }
    .ez-dialog-backdrop, .ez-filter-backdrop, .nav-backdrop {
        background-color: rgb(0 0 0 / var(--ez-backdrop-dim, 80%));
        -webkit-backdrop-filter: blur(var(--ez-backdrop-blur, 8px));
        backdrop-filter: blur(var(--ez-backdrop-blur, 8px));
    }
    .ez-dialog-layer {
        display: none;
        overscroll-behavior: contain;
    }
    .ez-dialog-center > .dialog { max-height: none; }
    .ez-dialog-center > .dialog.dialog-scrollable { max-height: calc(100dvh - 2 * var(--bs-spacer-5)); }
    body[data-ez-scroll-lock] {
        overflow: hidden;
        padding-inline-end: var(--ez-scrollbar-gap, 0px);
    }

    /* ── EzImageViewer (full-screen photo lightbox) ────────────────────────────────────
       Why custom: a full-screen takeover above dialogs and toasts (v6's top tier is z-toast), padding
       that clears the status bar and home indicator in the edge-to-edge app (env() has no utility), the
       zoom-out / grab cursors, touch-action for the pinch, viewport-relative caps on the photo, and the
       open animation. ezImageViewer.js writes only --ezv-z / --ezv-x / --ezv-y and the data-ezv-zoomed /
       data-ezv-panning markers; the transform they drive lives here. The overlay's position, flex
       centring, clipping and dim (bg-black bg-80), and the photo's size cap (max-w-100 max-h-100 inside
       the padded overlay), radius and shadow, are utilities. */
    .ez-imgviewer {
        z-index: calc(var(--bs-z-toast) + 10);
        padding: calc(var(--bs-spacer-9) + env(safe-area-inset-top)) var(--bs-spacer-9) calc(var(--bs-spacer-9) + env(safe-area-inset-bottom));
        cursor: zoom-out; /* the backdrop closes on click */
        touch-action: none; /* the lightbox handles pinch itself */
        animation: ez-imgviewer-fade .15s ease-out;
    }
    .ez-imgviewer-img {
        cursor: default; /* clicking the photo itself does not close */
        animation: ez-imgviewer-pop .2s cubic-bezier(.2, 1.2, .4, 1);
    }
    .ez-imgviewer-img[data-ezv-zoomed] {
        transform: translate(var(--ezv-x, 0px), var(--ezv-y, 0px)) scale(var(--ezv-z, 1));
        cursor: grab;
        /* The open pop is a transform animation too, and a running animation beats this rule. */
        animation: none;
    }
    .ez-imgviewer-img[data-ezv-panning] { cursor: grabbing; }
    /* The close button's side offset is a utility (end-0 me-6); its top clears the status bar. */
    .ez-imgviewer-close { top: calc(var(--bs-spacer-5) + env(safe-area-inset-top)); }
    @keyframes ez-imgviewer-fade {
        from { opacity: 0; }
        to   { opacity: 1; }
    }
    @keyframes ez-imgviewer-pop {
        from { transform: scale(.94); opacity: 0; }
        to   { transform: scale(1); opacity: 1; }
    }
    @media (prefers-reduced-motion: reduce) {
        .ez-imgviewer,
        .ez-imgviewer-img { animation: none; }
    }

    /* ── EzFilterDrawer (v6 .drawer.drawer-end on an <aside>, never a native <dialog>) ──
       Why custom: v6's drawer expects a <dialog> opened by its plugin, which supplies the ::backdrop and
       the slide (the transform transition runs when [open] is toggled on an element already in the
       page). This one holds form fields, so it stays a div (password-manager rule) and Blazor renders
       it already [open]:
       - the backdrop div sits one step under the drawer tier (its position is utilities, its dim and blur
         the shared backdrop rule in the EzModal section);
       - @starting-style gives the freshly inserted drawer v6's own off-screen transform, so v6's
         transition still plays the slide-in (it stays in the page after, so closing plays it back), and
         the backdrop fades with it;
       - the inset clears the status bar and home indicator in the edge-to-edge app.
       Each field's label-over-control stack inside it is utilities (d-flex flex-column gap-3). */
    .ez-filter-backdrop { z-index: calc(var(--bs-z-drawer) - 1); }
    .ez-filter-drawer {
        inset-block-start: calc(var(--bs-drawer-inset) + env(safe-area-inset-top));
        inset-block-end: calc(var(--bs-drawer-inset) + env(safe-area-inset-bottom));
    }
    @starting-style {
        .ez-filter-drawer[open] { transform: translateX(calc(100% + var(--bs-drawer-inset))); }
    }
    .ez-filter-backdrop:not(.show) { display: none; opacity: 0; }
    @starting-style { .ez-filter-backdrop.show { opacity: 0; } }
    @media (prefers-reduced-motion: no-preference) {
        .ez-filter-backdrop { transition: opacity 0.3s, display 0.3s allow-discrete; }
    }

    /* ── EzImpersonationBanner ──────────────────────────────────────────────────────────
       Why custom: the bar is sticky (position-sticky in the markup) but sticks BELOW the status bar in
       the edge-to-edge app, and sits one step above the fixed bars (announcement, tab bar) yet under
       drawers and dialogs. Neither env() nor "z-fixed plus one" has a utility. Its look is bg-warning /
       fg-contrast-warning and a v6 badge. */
    .ez-impersonation-banner {
        top: env(safe-area-inset-top);
        z-index: calc(var(--bs-z-fixed) + 1);
    }

    /* ══ Components: media ══════════════════════════════════════════════════ */
    /* ── EzImage (.ez-img-frame) ───────────────────────────────────────────────────────────
       The frame's border, ground, radius, flex centring and clipping are utilities, its shape is a
       v6 ratio class, and the Small thumbnail's width is w-3. What stays:
       - ratio-3x4: v6's ratio utility ([class*=ratio-] { aspect-ratio: var(--bs-ratio) }) ships 1x1,
         4x3, 16x9 and 21x9 but no portrait entry, and 3:4 is the shape of everything these apps
         generate. This only adds the entry; v6's own rule applies it.
       - container-type: the placeholder glyph is sized against the FRAME with container query units,
         so one rule fits a 2.6rem table thumbnail and a full-width tile. No utility sets either.
       - isolation: keeps the image's z-index inside the frame, so a later row's photo never paints
         over an open action menu in a table.
       - the letterbox backdrop: a blurred, darkened blow-up of the same photo filling the bars beside a
         contained image (v6 has no filter or transform utility).
       - the broken-image state: js/missing-image.js tags a failed <img> with .ez-img-missing. */
    .ratio-3x4 {
        --bs-ratio: 3 / 4;
    }
    .ez-img-frame {
        container-type: size;
        isolation: isolate;
    }
    .ez-img-frame--viewable {
        cursor: zoom-in;
    }
    .ez-img-ph {
        /* cqmin is 1% of the frame's smaller side, so the glyph keeps its proportion at every size. A
           percentage would resolve against the inherited font size, not the box. */
        font-size: clamp(1rem, 42cqmin, 3.5rem);
    }
    .ez-img-fill {
        --ez-img-blur: 24px;
        transform: scale(1.2);
        filter: blur(var(--ez-img-blur)) brightness(.32) saturate(1.2);
    }
    /* A thumbnail-sized frame needs a softer blur, or the backdrop turns to flat grey. */
    .ez-img-frame--sm > .ez-img-fill {
        --ez-img-blur: 6px;
    }
    /* A 404: both copies hide and the placeholder behind them shows. No display utility is ever put on
       these images, so this plain display: none is not beaten. */
    .ez-img-frame > img.ez-img-missing {
        display: none;
    }
    /* Any other broken <img> app-wide: a muted block instead of the browser's broken-image glyph. */
    img.ez-img-missing {
        color: transparent;
        background-color: var(--bs-bg-1);
        border-radius: var(--bs-radius-4);
    }

    /* ── EzUpload ──────────────────────────────────────────────────────────────────────────
       The zone, previews, prompt and overlays are utilities (border border-2, rounded-5, bg-1, flex,
       padding, fs-*, fg-*, position/z). What stays:
       - the dashed border: v6 has no border-style utility, so the zone re-points v6's own
         --bs-border-style (and --bs-border-color on hover and drag-over); the .border utility reads both.
       - the drag-over and hover states (toggled by ezUpload.js), the disabled dim and the cursors: v6
         has no state or cursor utilities.
       - sizes v6 has no utility for: the 8rem / 15rem zone minimums and the Large preview strip's
         height (no h-* rem scale). A small preview is w-5 ratio-1x1 in the markup.
       - the tile's shape, radius and border: VCR's tryon.css resizes and reshapes the tile through
         these hooks in @layer custom (.st-up / .st-photo), and a utility would beat it.
       - the instant-busy overlay's show/hide (ezUpload.js adds .ez-upload-zone--instant).
       - the pointer-type copy swap and the kept line breaks in the hint. */
    .ez-upload-zone {
        --bs-border-style: dashed;
        min-height: 8rem;
        /* Here, not a utility: the drag-over tint below has to replace it. White (the page's own background, not
           v6's near-white bg-1), so a drop zone reads as a white box wherever it sits, on a card or on grey
           (owner, 2026-11-17). */
        background-color: var(--bs-bg-body);
        cursor: pointer;
        transition-property: border-color, background-color;
        transition-duration: var(--bs-control-transition-duration);
        transition-timing-function: ease-in-out;
    }
    .ez-upload-zone:hover,
    .ez-upload-zone--dragging {
        --bs-border-color: var(--bs-primary-base);
    }
    .ez-upload-zone--dragging {
        background-color: var(--bs-primary-bg-subtle);
    }
    /* On the glyph itself: its wrapper carries fg-2, which a rule here could not override. */
    .ez-upload-zone:is(:hover, .ez-upload-zone--dragging) .ez-upload-icon > i {
        color: var(--bs-primary-fg);
    }

    /* The transparent native input fills the zone (utilities) so a click and a native drop land on it. */
    .ez-upload-input {
        cursor: pointer;
    }
    .ez-upload-input:disabled {
        cursor: default;
    }

    /* What makes a good file: capped so a two-line requirement balances, and a "\n" is a line break. */
    .ez-upload-req {
        max-width: 18rem;
        white-space: pre-line;
    }
    /* The auto hint is "TYPES\n(up to N MB)": the size sits on its own line. */
    .ez-upload-hint {
        white-space: pre-line;
    }

    /* Mice read the drag & drop wording and the format list; touch screens read a tap instruction and
       just the size cap. Plain display, not d-none: a utility would beat the media query. */
    .ez-upload-copy-touch {
        display: none;
    }
    @media (pointer: coarse) {
        .ez-upload-copy-full { display: none; }
        .ez-upload-copy-touch { display: inline; }
    }

    /* Large previews: a fixed-height strip showing each image whole, each as wide as its image. */
    .ez-upload-thumb--lg {
        height: 8.75rem;
    }
    .ez-upload-thumb--lg img {
        max-width: 15rem;
    }

    /* Tile variant: a fixed 3:4 frame whatever the image's shape. */
    .ez-upload-zone--tile {
        aspect-ratio: 3 / 4;
        min-height: 15rem;
        max-height: 60vh;
        border-radius: var(--bs-radius-5);
    }
    /* Filled, the tile IS the platform image frame (EzImage): a hairline border, the ground, and the
       photo contain-fitted edge to edge over an .ez-img-fill blow-up of itself. Keep the two in step. */
    .ez-upload-zone--filled {
        border: var(--bs-border-width) solid var(--bs-border-color);
        cursor: default;
    }
    .ez-upload-zone--viewable {
        cursor: zoom-in;
    }

    /* The checklist tile (EzUpload Title/Checks) fits whatever height its host gives it: it reads its own box as a
       size container and steps down as the box gets shorter (a smaller icon, then no icon and a small button, then
       smaller rules, then no rules), so nothing ever spills over its edges on a short phone (owner, 2026-11-21: the
       studios overflowed on a Galaxy S24). Why custom: v6 has no container-query utilities, and these sizes must
       follow the tile, which a fixed utility cannot. */
    .ez-upload-zone--checklist {
        container: ez-check / size;
        /* Safe: if a tile is ever shorter still, its prompt runs off the bottom, never off the top. !important
           because the zone's justify-content-center utility would otherwise win. */
        justify-content: safe center !important;
    }
    .ez-upload-check-icon {
        padding: var(--bs-spacer-4);
        font-size: var(--bs-font-size-2xl);
    }
    .ez-upload-check-title {
        margin-top: var(--bs-spacer-3);
        font-size: var(--bs-font-size-xl);
    }
    .ez-upload-check-list {
        gap: var(--bs-spacer-2);
        margin-top: var(--bs-spacer-3);
        font-size: var(--bs-font-size-sm);
    }
    .ez-upload-check-btn {
        margin-top: var(--bs-spacer-5);
        padding-inline: var(--bs-spacer-7);
    }
    .ez-upload-check-drop {
        margin-top: var(--bs-spacer-2);
    }
    @container ez-check (height < 18rem) {
        .ez-upload-check-icon { padding: var(--bs-spacer-3); font-size: var(--bs-font-size-xl); }
        .ez-upload-check-title { font-size: var(--bs-font-size-lg); }
        .ez-upload-check-list { gap: var(--bs-spacer-1); }
        .ez-upload-check-btn { margin-top: var(--bs-spacer-4); }
    }
    @container ez-check (height < 14rem) {
        .ez-upload-check-icon { display: none !important; }
        .ez-upload-check-title { margin-top: 0; }
        .ez-upload-check-btn {
            --bs-btn-gap: var(--bs-btn-input-sm-gap);
            --bs-btn-min-height: var(--bs-btn-input-sm-min-height);
            --bs-btn-padding-y: var(--bs-btn-input-sm-padding-y);
            --bs-btn-font-size: var(--bs-btn-input-sm-font-size);
            --bs-btn-line-height: var(--bs-btn-input-sm-line-height);
            margin-top: var(--bs-spacer-3);
        }
    }
    @container ez-check (height < 10rem) {
        .ez-upload-check-list { gap: 0; font-size: var(--bs-font-size-xs); }
        .ez-upload-check-drop { display: none !important; }
    }
    @container ez-check (height < 7.5rem) {
        .ez-upload-check-list { display: none !important; }
    }
    @container ez-check (height < 6rem) {
        .ez-upload-check-title { font-size: var(--bs-font-size-md); }
    }
    /* A narrow tile (a phone held sideways, three cards across) takes the title down a size, so it stays on one line. */
    @container ez-check (width < 13rem) {
        .ez-upload-check-title { font-size: var(--bs-font-size-md); }
    }
    /* The filled tile's one remove, top right. top/right rather than utilities: VCR moves it. */
    .ez-upload-tile-close {
        position: absolute;
        top: var(--bs-spacer-3);
        inset-inline-end: var(--bs-spacer-3);
        z-index: var(--bs-z-3);
    }

    /* Instant busy: pre-rendered in every zone and revealed the moment the native change or drop fires,
       before any server round trip, then held through the server Busy state. Opaque (bg-body) so the
       prompt or old image never bleeds through the spinner. */
    .ez-upload-instant {
        display: none;
        border-radius: inherit;
    }
    .ez-upload-zone:is(.ez-upload-zone--instant, .ez-upload-zone--busy) .ez-upload-instant {
        display: flex;
    }

    /* Disabled and busy: no pointer, no hover highlight; only disabled dims (busy is covered by the
       opaque overlay, which an element opacity would wash out). */
    .ez-upload-zone--busy,
    .ez-upload--disabled .ez-upload-zone {
        cursor: default;
    }
    .ez-upload--disabled .ez-upload-zone {
        opacity: var(--bs-control-disabled-opacity);
    }
    .ez-upload-zone--busy:hover,
    .ez-upload--disabled .ez-upload-zone:hover {
        --bs-border-color: inherit;
    }
    .ez-upload-zone--busy:hover .ez-upload-icon > i,
    .ez-upload--disabled .ez-upload-zone:hover .ez-upload-icon > i {
        color: inherit;
    }

    /* ── EzUploadingIndicator ──────────────────────────────────────────────────────────────
       Nothing: it is v6 utilities and the v6 spinner (its Large size is fs-lg / fs-2xl). */

    /* ── EzCompareOverlay (.ez-cmp) ────────────────────────────────────────────────────────
       The overlay is v6: fixed and flex-laid by utilities, dimmed with bg-black bg-90, and dark by
       data-bs-theme="dark", so its EzButtons, the zoom divider (border-start), the grip (avatar
       theme-primary) and the captions (badge) all take v6's dark tokens. What stays is interactive
       structure no utility expresses:
       - the tier above toasts (a full-screen takeover, like EzImageViewer), safe-area padding (env()),
         the cursors, touch-action, and the open animation.
       - the zoom/pan transform: ezCompare.js publishes --cmp-z / --cmp-x / --cmp-y and the
         .ez-cmp-zoomed marker; the transform is declared here.
       - the wipe: a box that hugs the painted image (--cmp-ar, measured by ezCompare.js) so the divider
         can never be dragged past it, the clip on the top image and the divider at --cmp.
       - the captions' offset either side of the centre seam. */
    .ez-cmp {
        z-index: calc(var(--bs-z-toast) + 10);
        padding: calc(var(--bs-spacer-6) + env(safe-area-inset-top)) var(--bs-spacer-6) calc(var(--bs-spacer-6) + env(safe-area-inset-bottom));
        cursor: zoom-out; /* the backdrop closes on click */
        animation: ez-cmp-fade .15s ease-out;
    }
    /* Side offset is a utility (end-0 me-6); the top clears the status bar. */
    .ez-cmp-close {
        top: calc(var(--bs-spacer-5) + env(safe-area-inset-top));
    }
    .ez-cmp-toggle {
        cursor: default;
    }
    /* One body for both modes: takes the remaining height and clips the zoomed stage. */
    .ez-cmp-body {
        flex: 1 1 0;
        cursor: default;
        touch-action: none;
    }
    .ez-cmp-stage {
        will-change: transform;
        transform: translate(var(--cmp-x, 0px), var(--cmp-y, 0px)) scale(var(--cmp-z, 1));
    }
    .ez-cmp-zoomed,
    .ez-cmp-zoomed .ez-cmp-wipe {
        cursor: grab;
    }
    /* Side by side: each image hugs its painted width, so the two meet in one real seam. */
    .ez-cmp-img {
        max-width: 44vw;
    }
    /* Height-driven normally, width-driven via max-height once the width cap binds: an exact fit with
       no letterbox either way. */
    .ez-cmp-wipe {
        --cmp: 50%;
        --cmp-ar: .75;
        flex: none;
        height: 100%;
        width: auto;
        aspect-ratio: var(--cmp-ar);
        max-width: min(92vw, 60rem);
        max-height: calc(min(92vw, 60rem) / var(--cmp-ar));
        cursor: ew-resize;
    }
    .ez-cmp-over {
        clip-path: inset(0 calc(100% - var(--cmp)) 0 0);
    }
    /* The divider: a 2px line centred on --cmp, a runtime position no utility can take. Its full height,
       colour (bg-primary) and pointer-events-none (so every drag reaches the body) are utilities. */
    .ez-cmp-bar {
        left: var(--cmp);
        width: 2px;
        margin-left: -1px;
    }
    /* Keyboard focus on the invisible range shows as a ring on the grip, in the overlay's light ink so
       it reads against the primary chip. */
    .ez-cmp-range:focus-visible ~ .ez-cmp-bar .ez-cmp-grip {
        outline: var(--bs-focus-ring-width) solid var(--bs-fg-body);
        outline-offset: var(--bs-focus-ring-offset);
    }
    .ez-cmp-tag--left {
        right: calc(50% + var(--bs-spacer-3));
    }
    .ez-cmp-tag--right {
        left: calc(50% + var(--bs-spacer-3));
    }
    @keyframes ez-cmp-fade {
        from { opacity: 0; }
        to   { opacity: 1; }
    }
    @media (prefers-reduced-motion: reduce) {
        .ez-cmp { animation: none; }
    }

    /* ── EzDragHandle (.ez-drag-handle) ────────────────────────────────────────────────────
       Size and colour are utilities (lh-1 fs-sm fg-2). Why custom: v6 has no cursor utilities, and
       the grab/grabbing cursor is the whole point of the component. The inline-flex layout is here
       rather than a utility so a caller's hook can still re-align or hide the handle (the form
       builder's .fb-field-handle, and its preview mode's display: none). While dragging, every
       SortableJS list (ezUpload.js, sortableList.js, formBuilderDnd.js) marks the row .fb-field--chosen. */
    .ez-drag-handle {
        display: inline-flex;
        align-items: center;
        cursor: grab;
    }
    .ez-drag-handle:active,
    .fb-field--chosen .ez-drag-handle {
        cursor: grabbing;
    }

    /* ══ Components: rest ══════════════════════════════════════════════════ */
    /* ── Tables (EzTable conventions) ─────────────────────────────────────────────────────
       Why custom: these classes are written by the PAGES, not by EzTable (col-actions on ~140 pages,
       row-archived on ~70, td-clamp on ~13), and what they do needs selectors v6 utilities cannot carry:
       - .col-actions, the row-action column, is always the first column and stays put while a wide
         table scrolls sideways (sticky, first-child only), raised above its neighbours while its menu
         is open (:has). It needs no background of its own: every v6 table cell paints --bs-table-bg.
         width: 1px shrinks a table column to its content (EzTable's checkbox column does the same
         with w-1 in its own markup).
       - .row-archived fades every cell of an archived row except its actions.
       - .td-clamp truncates a long cell at a readable width (v6 text-truncate has no width of its own,
         and a table cell has none either, so it would never truncate).
       - .ez-row-detail (EzTable RowDetail) joins a detail row to its main row: no divider between the
         two and one hover for the pair (sibling selectors and :has), and a table carrying detail rows
         keeps its main-row cells on one line, since the long text lives in the detail row.
       - .ez-table-scroll--sticky (EzTable Sticky): the table scrolls in its own box (the overflow is a
         utility; the 70vh cap is not on v6's scale) and its header row stays pinned. A th's own border
         would scroll away (the table collapses borders), so the divider is an inset hairline.
       - Every cell lines up on its first line (owner decision 2026-11-12): baseline, so the action button, the badge,
         the number and each cell's first line sit on one line and a second line (a stage, "due in 11 days") hangs below.
         v6 tops cells, which put a badge or button off the text's line; centring floated one-line cells between the two
         lines of a two-line cell. v6's own variable, so a table can still set its own. Columns: money, numbers, counts
         and percentages are text-end, header and cells alike; everything else starts. */
    .table {
        --bs-table-cell-vertical-align: baseline;
    }
    .col-actions {
        width: 1px;
        white-space: nowrap;
        padding-inline-end: 0;
    }
    .table tr > .col-actions:first-child {
        position: sticky;
        inset-inline-start: 0;
        z-index: var(--bs-z-1);
    }
    .table thead tr > .col-actions:first-child {
        z-index: var(--bs-z-2);
    }
    .row-archived td:not(.col-actions) {
        opacity: 0.5;
        text-decoration: line-through;
    }
    .row-archived td:not(.col-actions) .badge {
        text-decoration: none;
    }
    .td-clamp {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 20rem;
    }
    .td-clamp.td-clamp--narrow {
        max-width: 12rem;
    }
    @media (width < 768px) {
        .td-clamp {
            max-width: 12rem;
        }
    }
    .table:has(> tbody > .ez-row-detail) > :is(thead, tbody) > tr:not(.ez-row-detail) > * {
        white-space: nowrap;
    }
    .table > tbody > tr:has(+ .ez-row-detail) > * {
        border-block-end-width: 0;
    }
    .table > tbody > .ez-row-detail > * {
        padding-block: var(--bs-spacer-1) var(--bs-spacer-4);
    }
    /* The same state v6's .table-hover puts on a hovered row, spread to its partner. */
    .table-hover > tbody > tr:hover + .ez-row-detail > *,
    .table-hover > tbody > tr:has(+ .ez-row-detail:hover) > * {
        --bs-table-color-state: var(--bs-theme-fg, var(--bs-table-hover-color));
        --bs-table-bg-state: color-mix(in srgb, var(--bs-theme-fg, var(--bs-table-color)) var(--bs-table-hover-bg-factor), transparent);
    }
    .ez-table-scroll--sticky {
        max-height: 70vh;
    }
    .ez-table-scroll--sticky > .table > thead > tr > * {
        position: sticky;
        top: 0;
        z-index: var(--bs-z-1);
        box-shadow: inset 0 calc(-1 * var(--bs-table-border-width)) 0 var(--bs-table-border-color);
    }

    /* ── EzSearchInput (.ez-search-input, a v6 .form-control.form-adorn) ─────────────────
       Why custom: the field brings its own clear button (a v6 btn-text), so the browser's built-in one
       would show a second X beside it in Chromium and Safari. That button is a pseudo-element of the
       input, which no class can reach, and v6's reboot deliberately keeps it. */
    .ez-search-input [type="search"]::-webkit-search-cancel-button {
        -webkit-appearance: none;
        appearance: none;
    }

    /* ── EzAnnouncementBanner (.annc-body) ────────────────────────────────────────────────
       Why custom: the strip itself is v6 colour, badge, avatar and button classes, and its stacking is
       utilities (position-relative z-fixed on the group, position-relative z-2 on each dismiss so it
       stays clickable above the stretched link). What is left is the body, which is admin-authored
       HTML: its paragraphs, links and code cannot carry classes, so from here they drop their margins
       and take the strip's own colour (v6's reboot keeps the underline and code font). The 90ch
       measure is off v6's width scale. */
    .annc-body {
        max-width: 90ch;
    }
    .annc-body :is(p, ul, ol) {
        margin: 0;
    }
    .annc-body :is(a, code) {
        color: inherit;
    }

    /* ── Alerts (EzAlert and any .alert): a gap below, unless last ───────────────────────────
       Why custom: Bootstrap 5 gave every alert margin-bottom: 1rem; Bootstrap 6 dropped it, so the ~700
       alerts written without a margin of their own sat flush on whatever followed them (the diary's
       rain warning on its grid) in every app. An alert followed by more content gets spacer 5 below
       it; the last thing in its card or box gets none, so cards do not grow a gap at the bottom; and
       one in a flex or grid stack leaves the spacing to the stack's gap. Any m-/mb- utility on the
       alert still wins (utilities sit in a later layer). Owner approved, 2026-11-10. */
    .alert:not(:last-child):not(:is(.d-flex, .d-grid, .vstack, .hstack, .row, [class*="gap-"]) > .alert) {
        margin-bottom: var(--bs-spacer-5);
    }

    /* ── EzActionBar (.page-actions, EzyPlatform.UI/Layout/EzActionBar.razor) ─────────────
       Search on the left, actions on the right, active filter chips below. The spacing, alignment and
       the open panel's surface (bg-body border rounded-5 p-2 mt-2) are utilities in the markup. Why
       custom: what decides whether and where things show, which no class can:
       - each zone hides itself when the page supplied nothing (:has), and the row's top margin goes
         with it (a utility cannot be conditional). Plain display: none, not d-none, because a utility
         would beat the :has() rule that reveals the zone;
       - below md the action buttons collapse to the primary button, label and all, plus the
         More trigger, by turning the buttons zone into display: contents while closed, and into an
         absolutely placed panel under the row while open. The primary keeps its
         label (a bare "+", flag or signature said nothing; audit 2026-11-12). The same markup serves both sizes (a
         SectionOutlet renders once and the server cannot know the viewport);
       - below md a button in the search zone (Filters, a view toggle) shows its icon alone, its label
         kept for screen readers, while a count badge (.ez-btn-badge) stays visible. */
    .page-actions:has(.page-actions-search > *, .page-actions-buttons > *) {
        margin-top: var(--bs-spacer-5);
    }
    .page-actions-search,
    .page-actions-buttons,
    .page-current-filters,
    .page-actions-toggle-zone {
        display: none;
    }
    .page-actions-search:has(*),
    .page-actions-buttons:has(*),
    .page-current-filters:has(*) {
        display: flex;
    }
    @media (width < 768px) {
        .page-actions {
            position: relative;
        }
        .page-actions-search > .btn {
            flex: none;
            aspect-ratio: 1;
            padding-inline: 0;
        }
        .page-actions-search > .btn > span:not(.ez-btn-badge) {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }
        /* Fields wrap (a report's From and To did not fit 320px side by side, audit 2026-11-13). */
        .page-actions-search:has(select.form-control, input.form-control, .form-field) {
            flex-wrap: wrap;
            row-gap: var(--bs-spacer-3);
        }
        /* The More trigger: only when the page supplied something beyond its primary action. After the
           primary, so the row reads [search] [primary] [more]. */
        .page-actions:has(.page-actions-buttons > :not(.btn-solid)) .page-actions-toggle-zone {
            display: flex;
            align-items: center;
            flex: none;
            order: 1;
        }
        /* With no primary to push it right, More sat alone at the row's left (the run sheet, audit 2026-11-12). */
        .page-actions:not(:has(.page-actions-buttons > .btn-solid, .page-actions-buttons > .ez-action-menu > .btn-solid)) .page-actions-toggle-zone {
            margin-inline-start: auto;
        }
        /* Closed: no box of its own, so its children sit in the row. Same specificity as the base
           :has(*) rule and declared later; .is-open below then wins on specificity. */
        .page-actions-buttons:has(*) {
            display: contents;
        }
        .page-actions-buttons:not(.is-open) > :not(.btn-solid) {
            display: none;
        }
        /* An EzActionMenu among the actions carries the d-inline-flex utility, which is !important; an
           important declaration in this layer beats one in the utilities layer, so it folds away too. */
        .page-actions-buttons:not(.is-open) > .ez-action-menu {
            display: none !important;
        }
        .page-actions-buttons:not(.is-open) > .btn-solid {
            margin-inline-start: auto; /* the zone's ms-auto, which display: contents no longer applies */
        }
        /* A primary that is a menu (a customer's Create: quote, job, invoice...) stays in the row like a primary
           button; it folded away with the other menus and left the row a lone More (audit, 2026-11-12). */
        .page-actions-buttons:not(.is-open) > .ez-action-menu:has(> .btn-solid) {
            display: inline-flex !important;
            margin-inline-start: auto;
        }
        .page-actions-buttons.is-open:has(*) {
            display: flex;
            flex-direction: column;
            position: absolute;
            top: 100%;
            inset-inline-end: 0;
            z-index: var(--bs-z-popover); /* above .ez-menu-backdrop (popover - 1) */
            min-width: 12rem;
            max-width: min(20rem, calc(100vw - 2 * var(--bs-spacer-6)));
        }
        .page-actions-buttons.is-open .btn {
            width: 100%;
            justify-content: flex-start;
        }
    }

    /* ── EzStatTile's figure ────────────────────────────────────────────────────────────
       v6's fs-2xl, shrinking with a narrow tile (two to a row on a phone), and wrapping only between words: the
       card's break-word split a sum of money mid-figure ("$25,054" over ".52", audit 2026-11-12), while a figure
       that is a name ("Brightside Post Hole Boring") still wraps. v6 has no size that follows its container. */
    .card.ez-stat { container-type: inline-size; }
    .ez-stat-value { font-size: min(var(--bs-font-size-2xl), 11.5cqi); overflow-wrap: normal; }

    /* ── EzTable's phone cards (CardTemplate) ───────────────────────────────────────────
       Below md the table gives way to a card per row (EzListCard), so the table's own card steps back: no border,
       ground or clipping of its own, or every card would sit inside a second card. v6 has no "card only from md". */
    @media (width < 768px) {
        .card.ez-table--cards {
            --bs-card-border-width: 0;
            --bs-card-bg: transparent;
            --bs-card-box-shadow: none;
            background-color: transparent;
            border: 0;
            box-shadow: none;
            overflow: visible;
        }
    }

    /* ── Utilities Bootstrap 6 lacks ──────────────────────────────────────────────────────
       Only what v6 has no class for: .text-pre-wrap keeps the line breaks a person typed (comments,
       notes, messages) while still wrapping long lines; v6's text-wrap is white-space: normal. */
    .text-pre-wrap {
        white-space: pre-wrap;
    }

    /* ── EzCardSection (.ez-card-section, EzyPlatform.Components/EzCardSection.razor) ────────
       A form's sub-sections sit a section's space apart, and the first sits flush. Why custom: the space
       depends on the section's position among its siblings (:first-child), which a utility in the
       component's markup cannot know. Moved here from ez-shell.css, which no host loads. */
    .ez-card-section { margin-top: var(--bs-spacer-7); }
    .ez-card-section.border-top { padding-top: var(--bs-spacer-7); }
    .ez-card-section-sub { margin-top: var(--bs-spacer-5); }
    .ez-card-section:first-child { margin-top: 0; }

    /* ── Switches and checkboxes: 24 px targets ───────────────────────────────────────────
       v6 draws a switch 20 px tall and a checkbox 20 px square; WCAG 2.2's target size (2.5.8) asks for
       24 px. Why custom: v6 sizes them through its own component tokens and has no larger size class for
       either. Switches everywhere (they are tapped on their own, often without the label); checkboxes on
       touch screens only, where a fingertip (or a glove on site) is the pointer. */
    .switch { --bs-switch-height: 1.5rem; }
    @media (pointer: coarse) {
        .check { --bs-check-size: 1.5rem; }
    }

    /* ── Touch targets ────────────────────────────────────────────────────────────────────
       Close buttons, the small icon buttons and menu rows were too small to hit with a thumb (owner, 2026-11-25).
       Why custom: v6 sizes a close button at 20px, a small button at 32px and a menu row at 29px, with no touch
       size for any of them. A menu's rows grow (and their text); a button keeps near the size it is drawn at and
       takes an invisible margin that answers the tap, so nothing round it moves. Not in a joined group, where the
       margin would be the next button's. :where() so a component's own position always wins. */
    @media (width < 768px), (pointer: coarse) {
        :where(.menu) { --bs-menu-item-padding-y: var(--bs-spacer-4); --bs-menu-font-size: var(--bs-font-size-md); }
    }
    @media (pointer: coarse) {
        /* A close button is a mask, which cuts an invisible margin off, so its own box grows instead and pulls its
           neighbours back over it: 24px drawn, 44px to tap. */
        .btn-close {
            --bs-btn-close-size: 1.5rem;
            padding: 10px;
            margin-block: -10px;
            margin-inline-end: -10px;
            mask-size: var(--bs-btn-close-size);
            -webkit-mask-size: var(--bs-btn-close-size);
        }
        :where(.btn-icon.btn-sm, .ez-on-media .btn, .btn.ez-on-media, .ez-app-header :is(.btn-lg, .billing-badge)) { position: relative; }
        :is(.btn-icon.btn-sm, .ez-on-media .btn, .btn.ez-on-media, .ez-app-header :is(.btn-lg, .billing-badge)):not(.btn-group *, .input-group *)::after {
            content: "";
            position: absolute;
            inset: calc(-1 * var(--ez-tap-y, 7px)) calc(-1 * var(--ez-tap-x, 7px));
        }
        .ez-app-header :is(.btn-lg, .billing-badge) { --ez-tap-x: 0px; }
        /* Over a photo: side by side buttons share the gap between them; one on its own is drawn larger too. */
        .ez-on-media .btn { --ez-tap-x: 4px; }
        span.ez-on-media:not(.ez-upload-thumb-remove) > .btn-icon:only-child, .btn-icon.ez-on-media {
            --bs-btn-min-height: 2.5rem;
            --ez-tap-x: 8px;
            --ez-tap-y: 8px;
        }
    }

    /* ── Week grids (.ez-week-grid on a table of seven day columns) ───────────────────────
       Every day the same width, however full: an auto table gives a busy day more room than a quiet
       one, so the week reads unevenly. Why custom: v6 has no table-layout utility, and the time column
       needs a fixed width while the days share the rest. */
    .ez-week-grid { table-layout: fixed; }
    .ez-week-grid > :is(thead, tbody) > tr > :first-child { width: 4.5rem; }

    /* ── Theme Studio 2 (the editor page, /admin/platform/themes/{id}) ─────────────────────
       Full screen, like Shopify's and WordPress's theme editors: the shell gives the page the whole window
       (data-screen="full", above) and the studio is a top bar over the control panel and the preview stage,
       each pane scrolling on its own, with no page scroll. Why custom: v6 has no app frame that is exactly
       the window with two panes scrolling apart, no toolbar that regroups its controls by width, no device
       frame that renders a page at a real device width and shows it at a scale (themeStudio.js sets the
       size and scale; the width per device lives here, as --ez-studio-w on a modifier class), and no image
       overlay.
       The top bar is one row from 1800px (exit and name, preview controls, More and Publish); below that the
       preview controls take a row of their own under the name and the actions. The preview controls need about
       75rem on their own (Theme Studio 4 added Inspect and the shortcuts), so one row at a laptop width squeezed
       the name to nothing, laid the health badge over Undo and wrapped the shortcuts button under it. Below lg the panel stacks
       above the stage (two parts to three), each still scrolling on its own. */
    .ez-studio-screen {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        flex: 1 1 auto;
        min-height: 0;
    }
    .ez-studio-bar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "id actions" "view view";
        align-items: center;
        gap: var(--bs-spacer-3) var(--bs-spacer-5);
        padding: var(--bs-spacer-3) var(--bs-spacer-5);
    }
    .ez-studio-bar-id { grid-area: id; }
    .ez-studio-bar-view { grid-area: view; }
    .ez-studio-bar-actions { grid-area: actions; }
    @media (width >= 1800px) {
        .ez-studio-bar {
            grid-template-columns: minmax(10rem, 1fr) auto auto;
            grid-template-areas: "id view actions";
        }
    }
    /* The toolbar's selects and path box: wide enough for their longest choice, never the whole row. */
    .ez-studio-zoom { width: 6rem; }
    .ez-studio-page-picker { width: 14rem; }
    .ez-studio-path { width: 12rem; }
    .ez-studio {
        display: grid;
        grid-template-rows: minmax(0, 2fr) minmax(0, 3fr);
        min-height: 0;
    }
    .ez-studio-panel {
        display: flex;
        flex-direction: column;
        min-height: 0;
        border-bottom: var(--bs-border-width) solid var(--bs-border-color);
    }
    .ez-studio-panel-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    .ez-studio-stage {
        display: flex;
        flex-direction: column;
        gap: var(--bs-spacer-3);
        min-width: 0;
        min-height: 0;
        padding: var(--bs-spacer-3);
        background: var(--bs-bg-2);
    }
    @media (width >= 768px) {
        .ez-studio-stage { padding: var(--bs-spacer-5); }
    }
    @media (width >= 1024px) {
        .ez-studio {
            grid-template-columns: 24rem minmax(0, 1fr);
            grid-template-rows: minmax(0, 1fr);
        }
        .ez-studio-panel {
            border-bottom: 0;
            border-inline-end: var(--bs-border-width) solid var(--bs-border-color);
        }
    }
    /* The frames sit in the middle of the stage. Fit never needs a scrollbar; a fixed zoom scrolls the
       stage (safe centring keeps a frame wider than the stage reachable from its left edge). Fit stacks
       two frames when that keeps them larger (themeStudio.js sets data-stack); stacked, they share the
       height. */
    .ez-studio-frames {
        display: flex;
        justify-content: safe center;
        gap: var(--bs-spacer-5);
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
    }
    .ez-studio-frames[data-zoom="fixed"] { overflow: auto; }
    .ez-studio-frames[data-stack] {
        flex-direction: column;
        align-items: safe center;
        gap: var(--bs-spacer-3);
    }
    .ez-studio-frames[data-stack] > .ez-studio-device { flex: 1 1 0; }
    .ez-studio-device {
        display: flex;
        flex-direction: column;
        gap: var(--bs-spacer-1);
        min-height: 0;
        margin: 0;
        --ez-studio-w: 1440px;
    }
    .ez-studio-device--phone { --ez-studio-w: 390px; }
    .ez-studio-device--tablet { --ez-studio-w: 820px; }
    .ez-studio-device--desktop { --ez-studio-w: 1440px; }
    .ez-studio-caption {
        font-size: var(--bs-font-size-xs);
        color: var(--bs-fg-3);
        text-align: center;
    }
    .ez-studio-viewport {
        position: relative;
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
        border: var(--bs-border-width) solid var(--bs-border-color);
        border-radius: var(--bs-radius-3);
        background: var(--bs-bg-body);
    }
    /* Absolutely placed so its scaled size never stretches the viewport; the script sets width, height
       and the scale. A reloading frame sits invisibly on top of the old one until it has painted. */
    .ez-studio-frame {
        position: absolute;
        inset: 0 auto auto 0;
        border: 0;
        transform-origin: 0 0;
        background: var(--bs-bg-body);
    }
    .ez-studio-frame--loading {
        visibility: hidden;
    }
    .ez-studio-spinner {
        position: absolute;
        inset: 0;
        z-index: 3;
        margin: auto;
    }
    .ez-studio-spinner--corner {
        inset: var(--bs-spacer-3) var(--bs-spacer-3) auto auto;
        margin: 0;
    }
    .ez-studio-overlay {
        position: absolute;
        inset: 0 auto auto 0;
        z-index: 2;
        width: 100%;
        height: auto;
        pointer-events: none;
    }
    .ez-studio-overlay--difference {
        mix-blend-mode: difference;
    }

    /* ── Animated hamburger (#navToggle in LayoutHeader) ─────────────────────────────
       The one sanctioned non-EzButton button (AGENTS.md, owner decision 2026-10-22): the
       marketing site's three-line burger, kept so the app's mobile header matches the site.
       No Bootstrap 6 part draws it. The middle line grows to full width on hover. */
    .ez-burger {
        display: flex;
        /* Never squeezed by the bar's buttons (it shrank to a 1px sliver on a phone). */
        flex: none;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 20px;
        padding: 0;
        border: 0;
        background: none;
        cursor: pointer;
    }
    .ez-burger-line {
        width: 100%;
        height: 2px;
        border-radius: var(--bs-radius-1);
        background: var(--bs-fg-body);
        transition: width .4s cubic-bezier(.4, 0, .2, 1);
    }
    .ez-burger-line:nth-child(2) { width: 60%; align-self: flex-end; }
    .ez-burger:hover .ez-burger-line:nth-child(2) { width: 100%; }
}

/* ── Outside the custom layer: density's control tokens ───────────────────────────────
   Bootstrap 6 declares its :root tokens unlayered, and an unlayered declaration beats every layered
   one, so a density inside @layer custom never reached them (buttons and fields stayed 38px). These two
   rules are unlayered too and win on specificity (:root plus the attribute). Only tokens belong here. */
:root[data-density="compact"] {
    --bs-btn-input-min-height: 2rem;
    --bs-btn-input-padding-y: 0.25rem;
    --bs-btn-input-padding-x: 0.625rem;
    --bs-btn-input-sm-min-height: 1.75rem;
    --bs-btn-input-sm-padding-y: 0.1875rem;
    --bs-btn-input-lg-min-height: 2.375rem;
    --bs-btn-input-lg-padding-y: 0.375rem;
}
:root[data-density="comfortable"] {
    --bs-btn-input-min-height: 2.75rem;
    --bs-btn-input-padding-y: 0.5625rem;
    --bs-btn-input-padding-x: 1rem;
    --bs-btn-input-sm-min-height: 2.25rem;
    --bs-btn-input-sm-padding-y: 0.375rem;
    --bs-btn-input-lg-min-height: 3rem;
    --bs-btn-input-lg-padding-y: 0.625rem;
}

/* ── Theme Studio 3: page section styles, per-part styles, icon style ─────────────────
   The page title's second copy in the action bar (EzActionBar's .page-actions-title, an EzBreadcrumb with
   PageRow). Why custom: it exists only so a theme's inline page header can put the title, the search and
   the actions on one row (the header and the page are separate grid regions, so no class can move the
   title between them); hidden here, the theme stylesheet shows it and hides the header's. Plain display:
   none, not d-none or [hidden], because those win over the theme's rule. */
@layer custom {
    .page-actions-title {
        display: none;
    }
}

/* ── Theme Studio 3: accessibility tools ── */
@layer custom {
    /* The preview toolbar's vision simulation select: wide enough for its longest choice. */
    .ez-studio-vision { width: 13rem; }
}

/* ── Theme Studio 3: menu templates (Floating, Mega, Rail with fly-outs) ─────────────────
   The templates are NavMenu variants (data-variant on .ez-app-nav), so these rules only place parts
   the menu already renders; every colour and item metric is still the menu's side tokens (--ez-c-side-*,
   --ez-m-nav-*) set above. Bootstrap 6 has no inset card sidebar, no multi-column
   drop-down and no hover fly-out, hence ours. Each template's settings arrive as the --ez-float-*, --ez-mega-* and --ez-flyout-* variables the theme stylesheet writes (a
   closed list per setting, IMenuTemplate.Settings); unset, the fallback here is the template's default.
   Below xl every layout's menu is the phone drawer: the
   floating drawer floats, and the mega and fly-out menus show the standard list. */
@layer custom {

    /* ── Floating: the menu as an inset rounded card, clear of the window edge ─────────────────────
       The phone drawer floats the same way; parked, it moves its own width plus the gap and its shadow.
       On a desktop only the sidebar and the rail float (below); a top bar keeps the standard bar. */
    @media (width < 1280px) {
        .ez-app-nav[data-variant="floating"] {
            inset-block: var(--ez-float-gap, 0.75rem);
            inset-inline-start: var(--ez-float-gap, 0.75rem);
            border: var(--bs-border-width) solid var(--bs-border-color);
            border-radius: var(--ez-float-radius, 1rem);
            box-shadow: var(--ez-float-shadow, var(--bs-box-shadow));
            transform: translateX(calc(-100% - var(--ez-float-gap, 0.75rem) - var(--bs-spacer-12)));
        }
        .ez-app-nav[data-variant="floating"].open { transform: none; }
    }

    /* ── Mega: the open section's links in columns (the More menu: one column per section) ────────── */
    /* The columns are the shared .ez-mega-cols grid (Theme Studio 4: mega panel settings, at the end). */
    :is(.ez-nav-mega-grid, .ez-nav-mega-columns) {
        display: grid;
        row-gap: var(--bs-menu-gap);
    }
    .ez-nav-mega-column { display: flex; flex-direction: column; gap: var(--bs-menu-gap); min-width: 0; }
    .ez-nav-mega {
        --bs-menu-padding-x: var(--bs-spacer-5);
        --bs-menu-padding-y: var(--bs-spacer-5);
        --bs-menu-item-padding-y: var(--bs-spacer-3);
        --bs-menu-icon-size: var(--bs-font-size-lg);
    }

    @media (width >= 1280px) {
        /* Floating on a desktop sidebar or rail: the card sits inside its column with the gap all round
           (the page's own padding is the gap on the inner side), and runs the page's length. */
        .ez-app:is([data-nav="side"], [data-nav="rail"]) > .ez-app-nav[data-variant="floating"] {
            margin: var(--ez-float-gap, 0.75rem);
            margin-inline-end: 0;
            border: var(--bs-border-width) solid var(--bs-border-color);
            border-radius: var(--ez-float-radius, 1rem);
            box-shadow: var(--ez-float-shadow, var(--bs-box-shadow));
        }

        /* Mega in the top bar: the open panel hangs from the whole menu row (the sections stop being its
           containing block), as wide as the "Panel width" setting allows. */
        .ez-app[data-nav="top"] > .ez-app-nav[data-variant="mega"] .ez-nav-section:not(.ez-nav-overflowed) { position: static; }
        .ez-app[data-nav="top"] > .ez-app-nav[data-variant="mega"] .ez-nav-mega {
            inset-inline: 0 auto;
            /* The Panel width setting, never past the row (Theme Studio 4: mega panel settings, --ez-mega-w). */
            width: min(100%, max(var(--ez-mega-w), min(var(--ez-mega-fit), calc((1rem - var(--ez-mega-w)) * 100000))));
        }
        /* A rail's flyout is one narrow column. */
        .ez-app[data-nav="rail"] .ez-nav-mega :is(.ez-nav-mega-grid, .ez-nav-mega-columns) { grid-template-columns: minmax(0, 1fr); }

        /* Rail with fly-outs: an icon rail in a sidebar layout too, the logo back in the header. */
        .ez-app:is([data-nav="side"], [data-nav="rail"]):has(> .ez-app-nav[data-variant="rail-flyout"]) {
            --ez-nav-width: var(--ez-flyout-rail-width, 5rem);
        }
        .ez-app[data-nav="side"]:has(> .ez-app-nav[data-variant="rail-flyout"]) .ez-header-logo { display: flex !important; }
        .ez-app:is([data-nav="side"], [data-nav="rail"]) > .ez-app-nav[data-variant="rail-flyout"] {
            display: block;
            padding-inline: var(--bs-spacer-2);
        }
        .ez-app:is([data-nav="side"], [data-nav="rail"]) > .ez-app-nav[data-variant="rail-flyout"] > .nav {
            --bs-nav-pills-link-border-radius: var(--ez-m-radius, var(--bs-radius-7));
        }
        .ez-app:is([data-nav="side"], [data-nav="rail"]) > .ez-app-nav[data-variant="rail-flyout"] :is(.ez-nav-head, .ez-nav-heading, .ez-nav-divider, .ez-nav-links, .ez-nav-chevron) {
            display: none !important;
        }
        .ez-app:is([data-nav="side"], [data-nav="rail"]) > .ez-app-nav[data-variant="rail-flyout"] .ez-nav-dropdown {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: var(--bs-spacer-1);
            padding: var(--bs-spacer-2) var(--bs-spacer-1);
            font-size: var(--bs-font-size-xs);
            line-height: 1.2;
            text-align: center;
            white-space: normal;
            overflow-wrap: anywhere;
            -webkit-hyphens: auto;
            hyphens: auto;
        }
        .ez-app:is([data-nav="side"], [data-nav="rail"]) > .ez-app-nav[data-variant="rail-flyout"] .ez-nav-section-icon { font-size: var(--bs-font-size-xl); }
        .ez-app:is([data-nav="side"], [data-nav="rail"]) > .ez-app-nav[data-variant="rail-flyout"] .ez-nav-dropdown .ez-nav-section-label { display: var(--ez-flyout-labels, block); }
        /* The fly-out hangs beside its entry. The menu column has no scroll of its own on a desktop, so the
           section is its containing block (no anchor needed). Hover and keyboard focus show it (v6's .menu is
           hidden until then); a click adds .show and pins it. */
        .ez-app:is([data-nav="side"], [data-nav="rail"]) > .ez-app-nav[data-variant="rail-flyout"] .ez-nav-section { position: relative; }
        .ez-app:is([data-nav="side"], [data-nav="rail"]) > .ez-app-nav[data-variant="rail-flyout"] .ez-nav-flyout {
            position: absolute;
            top: 0;
            inset-inline-start: 100%;
            margin-inline-start: var(--bs-spacer-3);
            min-width: var(--ez-flyout-width, 14rem);
            position-try-fallbacks: none;
        }
        /* The pointer crosses the gap between entry and fly-out on this strip, so the hover holds. On the
           section, not the fly-out: the fly-out scrolls, which would clip anything hung outside it. */
        .ez-app:is([data-nav="side"], [data-nav="rail"]) > .ez-app-nav[data-variant="rail-flyout"] .ez-nav-section:has(> .ez-nav-flyout)::after {
            position: absolute;
            inset-block: 0;
            inset-inline-start: 100%;
            width: var(--bs-spacer-3);
            content: "";
        }
        .ez-app:is([data-nav="side"], [data-nav="rail"]) > .ez-app-nav[data-variant="rail-flyout"] .ez-nav-section:is(:hover, :focus-within) > .ez-nav-flyout {
            display: flex;
            opacity: 1;
            transform: none;
        }
        /* Escape dismisses a fly-out that hover or focus opened, until focus moves or the pointer leaves. */
        .ez-app:is([data-nav="side"], [data-nav="rail"]) > .ez-app-nav[data-variant="rail-flyout"][data-flyouts="off"] .ez-nav-section:not(.is-open) > .ez-nav-flyout {
            display: none;
        }
    }
}

/* ── Theme Studio 3: end-to-end fixes ─────────────────────────────────────────────────────────
   A drop-down item's keyboard focus. Bootstrap 6's .menu-item marks focus only with its hover background
   (outline: 0), which a theme's quiet surface colours make all but invisible (1.04:1 on Harbour): WCAG 2.4.7
   and 1.4.11 need a visible indicator, so a focused item also takes the focus ring, inset so a scrolling
   menu never clips it. Every drop-down shares it: action menus, the top bar, the mega panel, the fly-outs. */
@layer custom {
    .menu-item:focus-visible {
        outline: var(--bs-focus-ring-width) solid var(--bs-focus-ring-color);
        outline-offset: calc(var(--bs-focus-ring-width) * -1);
    }
}

/* ── Theme Studio 3: mega menu templates (Mega tiles, Mega split, Mega full width, Mega with featured) ──
   The four are NavMenu variants (data-variant on .ez-app-nav) whose open section renders a MegaPanel: a
   stock v6 .menu holding the opened section's standard list (.ez-mega-standard) and the template's own body
   (.ez-mega-body). Why custom: Bootstrap 6 has no tile menu, no tabbed split menu, no site-map panel and no
   featured-card menu, and its .menu is placed by its own JS positioner, which these Blazor-rendered panels
   do not use. Colours come from the theme: a pop-out is a page surface (--ez-c-surface, --ez-c-surface-alt
   through v6's menu and bg tokens, set by the rule that re-points .ez-app-nav .menu above), the featured
   card's icon takes the menu's current-item pair (--ez-c-side-active-*), and every radius is the theme's
   (--ez-m-radius). Settings arrive as the --ez-mega-tile-*, --ez-mega-split-*, --ez-mega-full-* and
   --ez-mega-feature-* variables the theme stylesheet writes (closed lists, IMenuTemplate.Settings); unset,
   the fallback here is each one's first option.
   They are made for the top bar at xl. Anywhere else the body is hidden and the panel is its standard list
   (the rail's fly-out), and below xl the menu is the standard phone drawer, which never opens a panel. In
   the top bar the panel hangs from the whole app (anchored under the bar with CSS anchor positioning), so
   it can never run past the app's edges; without anchor positioning it hangs from the menu row instead. */
@layer custom {
    .ez-mega-body { display: none; }

    /* Keyboard focus is always visible: v6 shows a menu item's focus only as its hover fill. */
    .ez-mega-panel :is(.menu-item, .ez-mega-feature):focus-visible {
        outline: var(--bs-focus-ring);
        outline-offset: calc(-1 * var(--bs-focus-ring-width));
    }

    /* ── Mega tiles: a large icon over each label, so many tiles a row (the "Tiles per row" setting) ─── */
    /* A row is as wide as its tiles: the setting's count, or fewer when the section has fewer links (counted
       by :has up to the setting's largest option), never past the panel. */
    .ez-mega-tiles {
        --ez-mega-tile-count: 1;
        --ez-mega-tile-row: min(var(--ez-mega-n, 4), var(--ez-mega-tile-count));
        display: flex;
        flex-wrap: wrap;
        gap: var(--ez-mega-gap, var(--bs-spacer-2));
        width: calc(var(--ez-mega-tile-row) * var(--ez-mega-tile-size, 7rem) + (var(--ez-mega-tile-row) - 1) * var(--ez-mega-gap, var(--bs-spacer-2)));
        max-width: 100%;
    }
    .ez-mega-tiles:has(> :nth-child(2)) { --ez-mega-tile-count: 2; }
    .ez-mega-tiles:has(> :nth-child(3)) { --ez-mega-tile-count: 3; }
    .ez-mega-tiles:has(> :nth-child(4)) { --ez-mega-tile-count: 4; }
    .ez-mega-tiles:has(> :nth-child(5)) { --ez-mega-tile-count: 5; }
    .ez-mega-tiles:has(> :nth-child(6)) { --ez-mega-tile-count: 6; }
    .ez-mega-tile-group + .ez-mega-tile-group { margin-block-start: var(--bs-spacer-5); }
    .ez-mega-tile-group > .menu-header { padding-inline: 0; margin-block-end: var(--bs-spacer-2); }
    .ez-mega-tile {
        position: relative;
        flex: 0 1 var(--ez-mega-tile-size, 7rem);
        flex-direction: column;
        gap: var(--bs-spacer-2);
        align-items: center;
        justify-content: center;
        width: auto;
        min-height: calc(var(--ez-mega-tile-size, 7rem) * 0.8);
        padding: var(--bs-spacer-3) var(--bs-spacer-2);
        font-size: var(--bs-font-size-sm);
        line-height: 1.25;
        text-align: center;
        white-space: normal;
        overflow-wrap: anywhere;
        -webkit-hyphens: auto;
        hyphens: auto;
        background-color: color-mix(in oklch, var(--ez-c-surface-alt, var(--bs-bg-2)) 55%, transparent);
        border: var(--bs-border-width) solid var(--bs-border-color);
        border-radius: var(--ez-m-radius, var(--bs-radius-7));
    }
    /* Our fill above outranks v6's (custom is the later layer), so its hover and current states are restated. */
    .ez-mega-tile:is(:hover, :focus-visible) {
        color: var(--bs-menu-item-hover-color);
        background-color: var(--bs-menu-item-hover-bg);
        border-color: var(--bs-primary-border);
    }
    .ez-mega-tile.active {
        color: var(--bs-menu-item-active-color);
        background-color: var(--bs-menu-item-active-bg);
        border-color: transparent;
    }
    .ez-mega-tile-icon {
        font-size: calc(var(--ez-mega-tile-size, 7rem) * 0.26);
        color: var(--bs-primary-fg);
    }
    .ez-mega-tile.active .ez-mega-tile-icon { color: inherit; }
    .ez-mega-tile-badge {
        position: absolute;
        inset-block-start: var(--bs-spacer-1);
        inset-inline-end: var(--bs-spacer-1);
        font-size: var(--bs-font-size-xs);
    }

    /* ── Mega split: the sections down the start as a tab list, the shown one's links beside them ────── */
    .ez-mega-split {
        display: grid;
        grid-template-columns: min(var(--ez-mega-split-list, 14rem), 45%) minmax(0, 1fr);
    }
    .ez-mega-split-list {
        display: flex;
        flex-direction: column;
        gap: var(--bs-menu-gap);
        padding: var(--bs-spacer-3);
        background-color: var(--ez-c-surface-alt, var(--bs-bg-1));
        border-inline-end: var(--bs-border-width) solid var(--bs-border-color);
    }
    .ez-mega-split-tab { position: relative; white-space: normal; }
    .ez-mega-split-tab .menu-item-content { min-width: 0; }
    .ez-mega-split-tab.holds-active .menu-item-content { font-weight: var(--bs-font-weight-semibold); }
    .ez-mega-split-chevron { align-self: center; margin-inline-start: auto; opacity: 0; }
    .ez-mega-split-tab:dir(rtl) .ez-mega-split-chevron { transform: scaleX(-1); }
    /* The shown section reads as joined to its pane: the panel's own surface, a primary bar at its start. */
    .ez-mega-split-tab.is-shown {
        color: var(--bs-fg-1);
        background-color: var(--bs-menu-bg);
    }
    .ez-mega-split-tab.is-shown .ez-mega-split-chevron { opacity: 0.6; }
    .ez-mega-split-tab.is-shown::before {
        position: absolute;
        inset-block: var(--bs-spacer-2);
        inset-inline-start: 0;
        width: var(--bs-spacer-1);
        content: "";
        background-color: var(--bs-primary-bg);
        border-radius: var(--bs-radius-pill);
    }
    .ez-mega-split-pane { min-width: 0; padding: var(--ez-mega-panel-padding, var(--bs-spacer-5)); }
    .ez-mega-split-pane > .menu-header { padding-inline: var(--bs-menu-item-padding-x); margin-block-end: var(--bs-spacer-2); }
    .ez-mega-split-links {
        display: grid;
        row-gap: var(--bs-menu-gap);
    }

    /* ── Mega full width: a site map, every section a column, no more than the Panel's "Columns" setting */
    .ez-mega-sitemap {
        display: grid;
        row-gap: var(--bs-spacer-5);
        max-width: var(--ez-app-max-width, 90rem);
        margin-inline: auto;
    }
    .ez-mega-sitemap-column {
        display: flex;
        flex-direction: column;
        gap: var(--bs-menu-gap);
        min-width: 0;
        padding: var(--bs-spacer-2);
        border-radius: var(--ez-m-radius, var(--bs-radius-7));
    }
    /* The section whose toggle opened the map is marked, so the map still answers "where was I going". */
    .ez-mega-sitemap-column.is-opened { background-color: var(--ez-c-surface-alt, var(--bs-bg-1)); }
    .ez-mega-sitemap-heading {
        display: flex;
        gap: var(--bs-spacer-2);
        align-items: center;
        margin-block-end: var(--bs-spacer-1);
        font-weight: var(--bs-font-weight-semibold);
        color: var(--bs-fg-1);
        white-space: normal;
    }
    /* The "Section icons" setting. Font Awesome is unlayered and sets display through its own variable. */
    .ez-mega-sitemap-icon {
        --fa-display: var(--ez-mega-full-icons, inline-block);
        color: var(--bs-primary-fg);
    }
    :is(.ez-mega-sitemap, .ez-mega-split-links) .menu-item { white-space: normal; }

    /* ── Mega with featured: a card for the section's first page beside its other links in columns ──── */
    .ez-mega-featured {
        display: flex;
        gap: var(--bs-spacer-5);
        align-items: stretch;
    }
    .ez-mega-feature {
        position: relative;
        display: flex;
        flex: 0 0 15rem;
        flex-direction: column;
        gap: var(--bs-spacer-1);
        order: var(--ez-mega-feature-order, -1);
        min-width: 0;
        padding: var(--bs-spacer-5);
        color: var(--bs-fg-1);
        text-decoration: none;
        background-color: var(--ez-c-surface-alt, var(--bs-bg-2));
        border: var(--bs-border-width) solid var(--bs-border-color);
        border-radius: var(--ez-m-radius, var(--bs-radius-7));
    }
    .ez-mega-feature:hover {
        color: var(--bs-fg-1);
        background-color: color-mix(in oklch, var(--bs-primary-bg) 8%, var(--ez-c-surface-alt, var(--bs-bg-2)));
        border-color: var(--bs-primary-border);
    }
    .ez-mega-feature.active { border-color: var(--bs-primary-bg); }
    .ez-mega-feature-icon {
        display: inline-grid;
        place-items: center;
        width: var(--bs-spacer-11);
        height: var(--bs-spacer-11);
        margin-block-end: var(--bs-spacer-3);
        font-size: var(--bs-font-size-xl);
        color: var(--ez-c-side-active-text, var(--bs-primary-contrast));
        background-color: var(--ez-c-side-active-bg, var(--bs-primary-bg));
        border-radius: var(--ez-m-radius, var(--bs-radius-5));
    }
    .ez-mega-feature-section {
        font-size: var(--bs-font-size-xs);
        font-weight: var(--bs-font-weight-semibold);
        color: var(--bs-fg-3);
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }
    .ez-mega-feature-label {
        font-size: var(--bs-font-size-lg);
        font-weight: var(--bs-font-weight-semibold);
        line-height: 1.3;
        overflow-wrap: anywhere;
    }
    .ez-mega-feature-go { margin-block-start: auto; padding-block-start: var(--bs-spacer-3); color: var(--bs-primary-fg); }
    .ez-mega-feature-go:dir(rtl) { transform: scaleX(-1); }
    @media (prefers-reduced-motion: no-preference) {
        .ez-mega-feature-go { transition: translate 0.15s var(--bs-transition-timing-overlay, ease); }
        .ez-mega-feature:hover .ez-mega-feature-go { translate: var(--bs-spacer-1) 0; }
        .ez-mega-feature:dir(rtl):hover .ez-mega-feature-go { translate: calc(-1 * var(--bs-spacer-1)) 0; }
    }
    .ez-mega-feature-links {
        display: grid;
        flex: 1 1 auto;
        row-gap: var(--bs-menu-gap);
        align-content: start;
        min-width: 0;
    }
    .ez-mega-feature-links .menu-item { white-space: normal; }
    .ez-mega-feature-groups { gap: var(--bs-spacer-5); }

    @media (width >= 1280px) {
        /* In the top bar the body shows and the standard list does not. */
        .ez-app[data-nav="top"] > .ez-app-nav:is([data-variant="mega-tiles"], [data-variant="mega-split"], [data-variant="mega-full"], [data-variant="mega-featured"]) .ez-mega-standard { display: none; }
        .ez-app[data-nav="top"] > .ez-app-nav:is([data-variant="mega-tiles"], [data-variant="mega-split"], [data-variant="mega-full"], [data-variant="mega-featured"]) .ez-mega-body { display: block; }
        /* The panel hangs from the row, not from its own section (which would leave it as narrow as a toggle). */
        .ez-app[data-nav="top"] > .ez-app-nav:is([data-variant="mega-tiles"], [data-variant="mega-split"], [data-variant="mega-full"], [data-variant="mega-featured"]) .ez-nav-section:not(.ez-nav-overflowed) { position: static; }
        .ez-app[data-nav="top"] > .ez-app-nav:is([data-variant="mega-tiles"], [data-variant="mega-split"], [data-variant="mega-full"], [data-variant="mega-featured"]) .ez-mega-panel {
            inset-inline: 0 auto;
            max-width: 100%;
        }
        @supports not (anchor-name: --ez-a) {
            .ez-app[data-nav="top"] > .ez-app-nav:is([data-variant="mega-tiles"], [data-variant="mega-split"], [data-variant="mega-featured"]) .ez-nav-more .ez-mega-panel { inset-inline: auto 0; }
        }
        /* Widths: tiles and featured as wide as their content, split by its setting, full width all of it. */
        .ez-app[data-nav="top"] > .ez-app-nav:is([data-variant="mega-tiles"], [data-variant="mega-featured"]) .ez-mega-panel { width: max-content; }
        .ez-app[data-nav="top"] > .ez-app-nav[data-variant="mega-split"] .ez-mega-panel {
            --bs-menu-padding-x: 0px;
            --bs-menu-padding-y: 0px;
            width: min(100%, max(var(--ez-mega-w), min(var(--ez-mega-fit), calc((1rem - var(--ez-mega-w)) * 100000))));
        }
        .ez-app[data-nav="top"] > .ez-app-nav[data-variant="mega-full"] .ez-mega-panel {
            --bs-menu-padding-x: var(--ez-mega-panel-padding, var(--ez-m-page-px, var(--bs-spacer-7)));
            --bs-menu-padding-y: var(--ez-mega-panel-padding, var(--bs-spacer-7));
            inset-inline: 0;
            width: auto;
            margin-block-start: 0;
            border-inline: 0;
            border-start-start-radius: 0;
            border-start-end-radius: 0;
        }

        /* With anchor positioning: the app is the panels' containing block, so a panel can use the app's whole
           width and never pass its edges. It drops from under the menu row (--ez-mega-bar) and starts under its
           own toggle (--ez-mega-open; one is open at a time), or, when that would run past the app, ends where
           the row ends, or else starts at the app's start. Full width spans the app. */
        @supports (anchor-name: --ez-a) {
            .ez-app[data-nav="top"]:has(> .ez-app-nav:is([data-variant="mega-tiles"], [data-variant="mega-split"], [data-variant="mega-full"], [data-variant="mega-featured"])) { position: relative; }
            .ez-app[data-nav="top"] > .ez-app-nav:is([data-variant="mega-tiles"], [data-variant="mega-split"], [data-variant="mega-full"], [data-variant="mega-featured"]) { anchor-name: --ez-mega-bar; }
            .ez-app[data-nav="top"] > .ez-app-nav:is([data-variant="mega-tiles"], [data-variant="mega-split"], [data-variant="mega-full"], [data-variant="mega-featured"]) > .nav { position: static; }
            .ez-app[data-nav="top"] > .ez-app-nav:is([data-variant="mega-tiles"], [data-variant="mega-split"], [data-variant="mega-full"], [data-variant="mega-featured"]) .ez-nav-dropdown[aria-expanded="true"] { anchor-name: --ez-mega-open; }
            .ez-app[data-nav="top"] > .ez-app-nav:is([data-variant="mega-tiles"], [data-variant="mega-split"], [data-variant="mega-featured"]) .ez-mega-panel {
                position-anchor: --ez-mega-open;
                top: anchor(--ez-mega-bar bottom);
                inset-inline: anchor(start) auto;
                margin-block-start: var(--bs-spacer-1);
                position-try-fallbacks: --ez-mega-row-end, --ez-mega-app-start;
            }
            .ez-app[data-nav="top"] > .ez-app-nav[data-variant="mega-full"] .ez-mega-panel {
                top: anchor(--ez-mega-bar bottom);
                inset-inline: 0;
            }
        }
    }

    @position-try --ez-mega-row-end {
        inset-inline-start: auto;
        inset-inline-end: anchor(--ez-mega-bar end);
    }
    @position-try --ez-mega-app-start {
        inset-inline-start: 0;
        inset-inline-end: auto;
    }
}

/* ── Theme Studio 3: menu test view ── */
/* The studio's Menu preview (themeStudio.js "menu test"): the same page at the phone, tablet and desktop width
   side by side, each crop sized by the script (the viewport's width and height, the frame's scale and offset);
   on a row of its own for the desktop crop when that reads larger (data-wrap, a top bar is wide and short).
   And the keyboard test's numbered badges and Tab through ring, which the script draws in a layer it adds to
   each FRAME's document (every app page loads this sheet) and places from each menu item's box. Why custom: v6
   has no cropped device frame and nothing that marks a focus order; the badges invert the page's own colours
   (fg on bg, ringed in bg) so they read on a light page, a dark page and a dark sidebar alike, and
   --ez-focus-k (the script: one over the crop's scale) keeps them the same size on screen at any zoom. */
@layer custom {
    .ez-studio-frames[data-menu] {
        flex-wrap: wrap;
        align-items: flex-start;
        align-content: safe center;
    }
    .ez-studio-frames[data-menu] > .ez-studio-device { flex: none; }
    .ez-studio-frames[data-menu][data-wrap] > .ez-studio-device--desktop {
        flex-basis: 100%;
        align-items: center;
    }
    .ez-studio-device--menu > .ez-studio-viewport { flex: none; }

    .ez-studio-focus-layer {
        --ez-focus-k: 1;
        position: absolute;
        inset: 0 auto auto 0;
        z-index: calc(var(--bs-z-toast) + 20);
        width: 0;
        height: 0;
        overflow: visible;
        pointer-events: none;
    }
    .ez-studio-focus-badge {
        position: absolute;
        translate: 0 -50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: calc(var(--bs-spacer-6) * var(--ez-focus-k));
        height: calc(var(--bs-spacer-6) * var(--ez-focus-k));
        padding-inline: calc(var(--bs-spacer-1) * var(--ez-focus-k));
        border-radius: var(--bs-radius-pill);
        background: var(--bs-fg-body);
        box-shadow: 0 0 0 calc(var(--bs-border-width) * 2 * var(--ez-focus-k)) var(--bs-bg-body);
        color: var(--bs-bg-body);
        font-size: calc(var(--bs-font-size-xs) * var(--ez-focus-k));
        font-weight: 700;
        font-variant-numeric: tabular-nums;
        line-height: 1;
    }
    .ez-studio-focus-badge--current {
        background: var(--bs-warning-base);
        color: var(--bs-warning-contrast);
    }
    .ez-studio-focus-ring {
        position: absolute;
        border-radius: var(--bs-radius-3);
        box-shadow:
            0 0 0 calc(var(--bs-border-width) * 2 * var(--ez-focus-k)) var(--bs-bg-body),
            0 0 0 calc(var(--bs-border-width) * 5 * var(--ez-focus-k)) var(--bs-warning-base),
            0 0 0 calc(var(--bs-border-width) * 7 * var(--ez-focus-k)) var(--bs-fg-body);
    }
}

/* ── Theme Studio 3: chart colours and motion ─────────────────────────────────────────────────────
   Why custom: Bootstrap 6 has no chart palette. A chart draws each series in currentColor under one of these
   classes (stroke or fill "currentColor", a legend key with .ez-chart-key). A live theme writes eight series
   colours, --ez-c-chart-1 to -8, generated from its brand with even hue spacing and 3:1 on its cards (or set
   exactly per mode); with no theme live each class falls back to the colour charts have always used here.
   Motion needs nothing in this sheet: the theme stylesheet maps --ez-motion-* onto Bootstrap 6's own
   transition tokens, and the [data-motion="reduce"] rule above still overrides it. */
@layer custom {
    .ez-chart-1 { color: var(--ez-c-chart-1, var(--bs-primary-fg)); }
    .ez-chart-2 { color: var(--ez-c-chart-2, var(--bs-info-fg)); }
    .ez-chart-3 { color: var(--ez-c-chart-3, var(--bs-success-fg)); }
    .ez-chart-4 { color: var(--ez-c-chart-4, var(--bs-warning-fg)); }
    .ez-chart-5 { color: var(--ez-c-chart-5, var(--bs-danger-fg)); }
    .ez-chart-6 { color: var(--ez-c-chart-6, var(--bs-purple-500)); }
    .ez-chart-7 { color: var(--ez-c-chart-7, var(--bs-orange-500)); }
    .ez-chart-8 { color: var(--ez-c-chart-8, var(--bs-teal-500)); }
    /* The comparison line drawn behind series 1 (sessions behind visitors, impressions behind clicks): the
       theme's series 2, and without a theme the muted grey it has always been. */
    .ez-chart-compare { color: var(--ez-c-chart-2, var(--bs-fg-3)); }
    /* A legend key or bar drawn as a box: its series' colour as the fill. */
    .ez-chart-key { background-color: currentColor; }
    /* The demo dashboard's cash-flow bars and their legend have always been the roles' base colours. */
    .dash-chart .ez-chart-1, .dash-legend-dot.ez-chart-1 { color: var(--ez-c-chart-1, var(--bs-primary-base)); }
    .dash-chart .ez-chart-2, .dash-legend-dot.ez-chart-2 { color: var(--ez-c-chart-2, var(--bs-info-base)); }
}

/* ── Theme Studio 3: public and marketing pages ─────────────────────────────────────────
   The shared public components (PublicSiteLayout, EzPublicHeader, EzPublicHero, EzPublicSection,
   EzPublicFooter) and the sign-in shell (AuthLayout). Why custom: a public site's bands, its hero and its
   footer columns have no Bootstrap 6 part, and Theme Studio > Public pages varies them. Each value a theme
   can change is a --ez-pub-* variable declared on .ez-pub with the platform's own value, so the theme
   stylesheet (ThemeCssGenerator.Public.cs) changes one variable rather than restating a rule; colours are
   v6 tokens and the theme's --ez-c-* slots with v6 fallbacks. The sign-in shell's structure is here because
   this branch loads ez-v6.css without the old ez-platform-auth.css: split from lg (the brand panel beside
   the form), the form alone below it. */
@layer custom {
    .ez-pub {
        --ez-pub-header-h: 4.5rem;
        --ez-pub-logo-h: 2rem;
        --ez-pub-hero-py: clamp(4rem, 2.5rem + 5vw, 7rem);
        --ez-pub-hero-fs: clamp(2.5rem, 1.75rem + 3vw, 3.75rem);
        --ez-pub-hero-fw: 700;
        --ez-pub-hero-align: center;
        --ez-pub-hero-mx: auto;
        --ez-pub-hero-justify: center;
        --ez-pub-section-py: clamp(3rem, 2rem + 4vw, 5rem);
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        min-height: 100dvh;
        color: var(--bs-fg-body);
        background-color: var(--ez-c-bg, var(--bs-bg-body));
    }
    .ez-pub-main { flex: 1 0 auto; }

    /* Header: the logo, the menu and the actions on one row from lg; below it the menu takes a row of
       its own and scrolls sideways. */
    .ez-pub-header {
        position: relative;
        z-index: 2;
        color: var(--ez-c-header-text, var(--bs-fg-body));
        background-color: var(--ez-c-header, var(--bs-bg-body));
        border-block-end: var(--bs-border-width) solid var(--ez-c-header-border, var(--bs-border-color));
    }
    .ez-pub-header-inner {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--bs-spacer-2) var(--bs-spacer-5);
        min-height: var(--ez-pub-header-h);
        padding-block: var(--bs-spacer-3);
    }
    .ez-pub-brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
    .ez-pub-brand img { width: auto; height: var(--ez-pub-logo-h); }
    .ez-pub-nav {
        display: flex;
        flex: 1 0 100%;
        order: 3;
        gap: var(--bs-spacer-1);
        overflow-x: auto;
        scrollbar-width: none;
    }
    .ez-pub-nav-link {
        padding: var(--bs-spacer-2) var(--bs-spacer-3);
        font-weight: var(--bs-font-weight-medium);
        color: var(--bs-fg-2);
        white-space: nowrap;
        text-decoration: none;
        border-radius: var(--bs-radius-5);
    }
    .ez-pub-nav-link:hover,
    .ez-pub-nav-link.active { color: var(--bs-fg-body); }
    .ez-pub-actions { display: flex; align-items: center; gap: var(--bs-spacer-2); margin-inline-start: auto; }
    @media (width >= 1024px) {
        .ez-pub-header-inner { flex-wrap: nowrap; padding-block: 0; }
        .ez-pub-nav { flex: 1 1 auto; order: 0; justify-content: center; }
    }

    /* Hero: the headline, the lead and the actions, centred by default. */
    .ez-pub-hero { padding-block: var(--ez-pub-hero-py); text-align: var(--ez-pub-hero-align); }
    .ez-pub-hero-inner { max-width: 48rem; margin-inline: var(--ez-pub-hero-mx); }
    .ez-pub-hero-title {
        margin-bottom: var(--bs-spacer-4);
        font-size: var(--ez-pub-hero-fs);
        font-weight: var(--ez-pub-hero-fw);
        line-height: 1.1;
        letter-spacing: -0.02em;
        text-wrap: balance;
    }
    .ez-pub-hero-lead { text-wrap: pretty; }
    .ez-pub-hero-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: var(--ez-pub-hero-justify);
        gap: var(--bs-spacer-3);
        margin-top: var(--bs-spacer-7);
    }
    .ez-pub-hero-media { margin-top: var(--bs-spacer-8); }

    /* Sections: bands of content under the hero. */
    .ez-pub-section { padding-block: var(--ez-pub-section-py); }
    .ez-pub-section-head { max-width: 40rem; margin: 0 auto var(--bs-spacer-7); text-align: center; }
    .ez-pub-section-title { font-size: var(--bs-font-size-3xl); font-weight: var(--bs-font-weight-bold); text-wrap: balance; }

    /* Footer: the logo and the link groups in columns, then the copyright line. */
    .ez-pub-footer {
        padding-block: var(--bs-spacer-8) var(--bs-spacer-6);
        color: var(--bs-fg-2);
        background-color: var(--bs-bg-1);
        border-block-start: var(--bs-border-width) solid var(--bs-border-color);
    }
    .ez-pub-footer-cols {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
        gap: var(--bs-spacer-6);
    }
    .ez-pub-footer-heading {
        margin-bottom: var(--bs-spacer-3);
        font-size: var(--bs-font-size-sm);
        font-weight: var(--bs-font-weight-semibold);
        color: var(--bs-fg-body);
    }
    .ez-pub-footer-links { display: grid; gap: var(--bs-spacer-2); padding: 0; margin: 0; list-style: none; }
    .ez-pub-footer a { color: inherit; text-decoration: none; }
    .ez-pub-footer a:hover { color: var(--bs-fg-body); text-decoration: underline; }
    .ez-pub-footer-foot {
        display: flex;
        flex-wrap: wrap;
        gap: var(--bs-spacer-3);
        margin-top: var(--bs-spacer-7);
        padding-top: var(--bs-spacer-5);
        font-size: var(--bs-font-size-sm);
        border-top: var(--bs-border-width) solid var(--bs-border-color);
    }
}

/* ── Theme Studio 3: print styles (outputs outside the main pages) ─────────────────
   Every page prints cleanly with or without a theme: in light mode (paper is white), as one column, with
   no menu, header bar, banners, toolbars, tab bar, Theme Studio widget, toasts or consent banner; the page
   title stays. External links show their address after the text; table rows, cards, figures and alerts are
   not cut across pages; nothing casts a shadow. Bootstrap 6 has no print layer for an app shell, hence ours.
   A theme's Print settings (Theme Studio > Layout > Print) change this from its own stylesheet
   (ThemeCssGenerator.Print.cs): keep the menu and the header's logo, black on white, a serif, the margins.
   The hiding rules carry !important because a menu template sets its own display with a longer selector;
   print only. */
@layer custom {
    @page { margin: 15mm; }

    @media print {
        /* !important: Bootstrap 6 sets [data-bs-theme=dark] { color-scheme: dark } unlayered. */
        :root { color-scheme: light !important; }
        body { print-color-adjust: exact; }
        body:has(> .ez-app) { display: block; min-height: 0; }
        .ez-app { display: block; background: none; }

        /* Never on paper. */
        .ez-app-banners, .ez-app-tabs, .ez-burger, .ez-header-actions, .nav-backdrop,
        .page-actions-search, .page-actions-buttons, .page-actions-toggle-zone, .btn-toolbar, [role="toolbar"],
        .pagination, .ez-filter-drawer, .ez-filter-backdrop,
        .ez-toast-host, .ez-consent-banner, .visually-hidden-focusable {
            display: none !important;
        }

        /* The menu and the header's bar (Hide navigation and header, on by default): the title stays. */
        .ez-app-nav, .ez-header-logo { display: none !important; }
        .ez-app-header {
            display: block;
            min-height: 0;
            padding: 0 0 var(--bs-spacer-5);
            background: none;
            border: 0;
        }
        :is(.ez-app-main, .ez-app-aside) { padding: 0; }

        /* External links say where they go; buttons and linked images do not. */
        a:is([href^="http://"], [href^="https://"]):not(.btn):not(:has(img))::after {
            content: " (" attr(href) ")";
            font-size: 0.875em;
            overflow-wrap: anywhere;
        }

        /* Rows, cards, figures and alerts are not cut across pages; a table repeats its header. */
        tr, img, svg, figure, .card, .alert { break-inside: avoid; }
        thead { display: table-header-group; }
        :is(h1, h2, h3, h4, h5, h6) { break-after: avoid; }

        /* Nothing floats on paper. */
        *, *::before, *::after { box-shadow: none !important; text-shadow: none !important; }
    }
}

/* ── Theme Studio 3: revision compare ─────────────────────────────────────────────────
   The Revisions dialog's before/after pictures (StudioRevisionCompare, themeCompare.js): two scaled
   same-origin frames of the specimen, side by side or one over the other with a split. Why custom: the
   frames are placed and scaled by the script (like the studio's own stage above), the split is a runtime
   position (--studio-split, set by the script from the range) that clips the after frame and places the
   bar, and v6 has no cursor or clip-path utilities. The colour swatches are SVG, so they need no rule. */
@layer custom {
    .studio-compare-stage {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: var(--bs-spacer-3);
        height: min(70dvh, 40rem);
    }
    .studio-compare-frames { display: contents; }
    .studio-compare-pane {
        display: flex;
        flex-direction: column;
        gap: var(--bs-spacer-1);
        min-width: 0;
        min-height: 0;
        margin: 0;
    }
    .studio-compare-caption {
        font-size: var(--bs-font-size-xs);
        color: var(--bs-fg-3);
        text-align: center;
    }
    .studio-compare-port {
        position: relative;
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
        border: var(--bs-border-width) solid var(--bs-border-color);
        border-radius: var(--bs-radius-3);
        background: var(--bs-bg-body);
    }
    .studio-compare-frame {
        position: absolute;
        inset: 0 auto auto 0;
        border: 0;
        transform-origin: 0 0;
        background: var(--bs-bg-body);
    }
    /* Split: both panes fill the stage, the after one clipped from the left at the split. */
    .studio-compare-stage[data-view="split"] { display: block; }
    .studio-compare-stage[data-view="split"] .studio-compare-pane {
        position: absolute;
        inset: 0;
    }
    .studio-compare-stage[data-view="split"] .studio-compare-pane[data-side="before"] .studio-compare-caption { text-align: start; }
    .studio-compare-stage[data-view="split"] .studio-compare-pane[data-side="after"] .studio-compare-caption { text-align: end; }
    .studio-compare-stage[data-view="split"] .studio-compare-pane[data-side="after"] {
        clip-path: inset(0 0 0 var(--studio-split, 50%));
    }
    .studio-compare-stage[data-dragging] .studio-compare-frame { pointer-events: none; }
    /* The split's bar: a 44px drag target round a 2px line, with a grip. Shown in the split view only. */
    .studio-compare-bar {
        position: absolute;
        top: 0;
        bottom: 0;
        left: var(--studio-split, 50%);
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2.75rem;
        margin-left: -1.375rem;
        cursor: ew-resize;
        touch-action: none;
    }
    .studio-compare-bar::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 50%;
        width: 2px;
        margin-left: -1px;
        background: var(--bs-primary-bg);
    }
    .studio-compare-grip {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2rem;
        height: 2rem;
        border-radius: 50%;
        background: var(--bs-primary-bg);
        color: var(--bs-primary-contrast);
        box-shadow: var(--bs-box-shadow-sm);
    }
    .studio-compare-range:focus-visible ~ .studio-compare-bar .studio-compare-grip {
        outline: var(--bs-focus-ring-width) solid var(--bs-focus-ring-color);
        outline-offset: var(--bs-focus-ring-offset);
    }
    .studio-compare-stage:not([data-view="split"]) :is(.studio-compare-range, .studio-compare-bar) { display: none; }
    /* Custom CSS line diff: lines keep their indentation and wrap rather than scroll the dialog sideways. */
    .studio-compare-lines {
        max-height: 20rem;
        overflow: auto;
    }
    .studio-compare-lines > span { white-space: pre-wrap; overflow-wrap: anywhere; }
}

/* ── Theme Studio 3: menu blocks, link details, menu search and behaviour ─────────────────────────────
   The side menu's widgets (SidebarWidgets: the Menus page's layout) render as .ez-nav-block children of the menu,
   every link's details (NavLinkDetails: description, live count, text badge, external icon; featured; divider
   above), and a star on each link while Your pages is placed (.ez-nav-item / .ez-nav-pin). Behaviour arrives as
   data attributes on .ez-app-nav: data-row-descriptions and data-hover-open ("flyouts", "panels"), which
   menu-behaviour.js reads. Every colour is the menu's side tokens, set
   above; Bootstrap 6 has no menu blocks, no pin-on-hover row and no command palette, hence ours. */
@layer custom {

    /* ── Link details ───────────────────────────────────────────────────────────────────────────────
       A description shows where the template has room: (as v6's own
       .menu-item-description) every drop-down, fly-out and mega panel. A sidebar row keeps one line unless the
       theme asks for descriptions there too (data-row-descriptions). */
    .ez-nav-desc { display: none; line-height: 1.3; white-space: normal; overflow-wrap: break-word; }
    .ez-app-nav[data-row-descriptions="on"] .ez-nav-desc { display: block; }
    .ez-app-nav .menu .menu-item-description { max-width: 22rem; white-space: normal; }
    .ez-nav-featured { font-weight: var(--bs-font-weight-semibold); }
    .menu-item.ez-nav-featured .menu-item-description { font-weight: var(--bs-font-weight-normal); }
    .ez-mega-tile.is-featured .ez-mega-tile-label { font-weight: var(--bs-font-weight-semibold); }
    .ez-mega-tile .menu-item-description { text-align: center; white-space: normal; }
    .ez-mega-feature-description { white-space: normal; }
    .ez-nav-link-divider { margin-inline: var(--bs-nav-link-padding-x); }

    /* ── Blocks ─────────────────────────────────────────────────────────────────────────────────────
       Buttons in the menu's blocks (the search box, the stars) are v6 secondary buttons,
       re-pointed at the side slots like the footer's. */
    .ez-app-nav :is(.ez-nav-block, .ez-nav-item) .btn.theme-secondary {
        --bs-secondary-fg: var(--ez-side-button-fg);
        --bs-secondary-contrast: var(--ez-side-button-hover-fg);
        --bs-secondary-bg: var(--ez-side-button-hover-bg);
        --bs-secondary-border: var(--ez-side-button-border);
    }
    .ez-nav-search .ez-nav-search-kbd {
        --bs-kbd-bg: transparent;
        --bs-kbd-color: currentcolor;
        border: var(--bs-border-width) solid var(--bs-border-color);
        opacity: 0.8;
    }
    .ez-nav-block-empty { white-space: normal; }

    /* The star on a link (favourites block on): beside the link, shown on hover or keyboard focus, and always
       while the link is pinned or on a touch screen. */
    .ez-nav-item:not(.ez-nav-collapsed) { display: flex; align-items: center; gap: var(--bs-spacer-1); }
    .ez-nav-item > .nav-link { flex: 1 1 auto; min-width: 0; }
    /* In a narrow row (a starred link, or descriptions on) the label is what gives: it wraps, while the badge, the
       external-link icon and the star keep their size and never slide under one another. */
    /* A grid, not a wrapping row: the icon and the label keep their columns, the label takes what is left and
       wraps between words, and each badge, the external-link icon or the lock gets a column of its own. */
    /* Not the section toggles (.ez-nav-dropdown, also a .nav-link): those stay hidden in a sidebar. In a starred row
       or one with its description showing, the badge goes on its own line under the label rather than taking a
       column: a 168px menu has no width to spare beside a description. */
    :is(.ez-nav-item, .ez-app-nav[data-row-descriptions="on"]) .nav-link:not(.ez-nav-dropdown) {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
    }
    :is(.ez-nav-item, .ez-app-nav[data-row-descriptions="on"]) .nav-link:not(.ez-nav-dropdown) > .ez-nav-label { white-space: normal; }
    :is(.ez-nav-item, .ez-app-nav[data-row-descriptions="on"]) .nav-link:not(.ez-nav-dropdown) > :not(.ez-nav-label, :first-child) {
        grid-column: 2;
        justify-self: start;
    }
    .ez-app-nav .nav-link > :not(.ez-nav-label, :first-child) { flex-shrink: 0; }
    .ez-nav-pin { opacity: 0; }
    .ez-nav-item:is(:hover, :focus-within) .ez-nav-pin,
    .ez-nav-item.is-pinned .ez-nav-pin { opacity: 1; }
    @media (hover: none) {
        .ez-nav-pin { opacity: 1; }
    }

    /* The footer's tools (help link, light and dark switch) sit at the foot of a column menu. */
    .ez-nav-tools .switch { margin-inline-start: auto; }

    /* Header copies of the side menu's widgets (HeaderWidgets, .ez-header-mirror): shown wherever the side menu is not
       on screen - below xl, where it is a drawer, and in the layouts that hide its blocks (the rail, the top bar, no
       menu, Rail with fly-outs: below) - so a count, a balance and the account are always in sight. A plain item of
       the header's row (display: contents). */
    .ez-header-mirror { display: contents; }

    /* One orange button on a phone (owner decision, 2026-11-12): while the tab bar holds the round +, the header's copy
       of the menu's Create goes (the tab bar's is the one Create), and the + is drawn in the text colour, so the page's
       main action is the screen's only button in the brand colour. */
    @media (width < 1280px) {
        .ez-app:has(.ez-app-tabs .ez-action-menu:not(.ez-tab-more)) .ez-header-mirror:has(> .ez-action-menu) { display: none; }
    }
    .ez-app-tabs .ez-action-menu:not(.ez-tab-more) .btn-solid {
        --bs-btn-bg: var(--ez-c-heading, var(--bs-fg-body));
        --bs-btn-border-color: var(--ez-c-heading, var(--bs-fg-body));
        --bs-btn-color: var(--ez-c-surface, var(--bs-bg-body));
        --bs-btn-hover-bg: var(--ez-c-text, var(--bs-fg-1));
        --bs-btn-hover-border-color: var(--ez-c-text, var(--bs-fg-1));
        --bs-btn-hover-color: var(--ez-c-surface, var(--bs-bg-body));
        background-image: none;
    }

    @media (width >= 1280px) {
        /* The rail and the top bar show sections only: the blocks are the sidebar's and the drawer's. A head left
           with nothing but the drawer's close button (the brand placed further down) takes no room. */
        .ez-app:is([data-nav="rail"], [data-nav="top"]) .ez-nav-block,
        .ez-app:is([data-nav="side"], [data-nav="rail"]) > .ez-app-nav[data-variant="rail-flyout"] .ez-nav-block { display: none !important; }
        .ez-nav-head:not(:has(> :not(.ez-nav-close))) { display: none; }

        .ez-app[data-nav="side"]:not(:has(> .ez-app-nav[data-variant="rail-flyout"])) .ez-header-mirror { display: none; }

        /* Hover opening (menu-behaviour.js): the click-away layer lets the pointer through, so leaving the
           section can close it; a press outside still closes it (the script). */
        .ez-app[data-nav="top"] > .ez-app-nav[data-hover-open~="panels"] .ez-menu-backdrop,
        .ez-app[data-nav="rail"] > .ez-app-nav[data-hover-open~="flyouts"] .ez-menu-backdrop { pointer-events: none; }

        /* Rail with fly-outs set to open on a click: hover and focus no longer show a fly-out; a click pins it. */
        .ez-app:is([data-nav="side"], [data-nav="rail"]) > .ez-app-nav[data-variant="rail-flyout"]:not([data-hover-open~="flyouts"]) .ez-nav-section:not(.is-open) > .ez-nav-flyout {
            display: none;
        }
        /* Its hover shows after the theme's hover delay (only when the theme picks one; unset, at once). */
        .ez-app:is([data-nav="side"], [data-nav="rail"]) > .ez-app-nav[data-variant="rail-flyout"] .ez-nav-section:hover > .ez-nav-flyout {
            transition-delay: var(--ez-menu-hover-delay, 0s);
        }
    }

    /* ── The menu search (MenuSearch: an EzModal) ───────────────────────────────────────────────────
       The results are a v6 .menu laid flat in the dialog: a listbox whose active option (aria-activedescendant,
       moved by the arrow keys) takes the hover colours and the focus ring, since focus stays in the input. */
    .ez-menu-search-list {
        position: static;
        min-width: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
    }
    .ez-menu-search-option { white-space: normal; }
    .ez-menu-search-option.is-active {
        color: var(--bs-menu-item-hover-color);
        background-color: var(--bs-menu-item-hover-bg);
        outline: var(--bs-focus-ring-width) solid var(--bs-focus-ring-color);
        outline-offset: calc(var(--bs-focus-ring-width) * -1);
    }
}

/* ── Theme Studio 4: inspect, settings search, preset thumbnails, shortcuts ─────────────────────────
   Inspect (themeStudio.js) draws an outline and a name tag round the part under the pointer in a layer it adds
   to each preview FRAME's own document (every app page loads this sheet), placed from the part's box, with a
   crosshair over the whole page while it is on. Why custom: v6 has nothing that marks an element on a page from
   outside it. Like the menu test's badges they invert the page's own colours (fg on bg, with the warning colour
   as the outline) so they read on any theme, and --ez-inspect-k (the script: one over the frame's scale) keeps
   them the same size on screen at any zoom.
   In the studio itself: the control a search result or an inspected part opened is marked for a moment
   (.ez-studio-found); the shortcuts panel hangs under its button at the popover layer; the Element picker is as
   wide as its longest name. The preset thumbnails (ThemeThumb) show dark mode while their card is hovered or
   focused, which needs a rule: v6 has no hover-reveal utility. */
@layer custom {
    .ez-studio-inspect-layer {
        --ez-inspect-k: 1;
        position: absolute;
        inset: 0 auto auto 0;
        z-index: calc(var(--bs-z-toast) + 20);
        width: 0;
        height: 0;
        overflow: visible;
        pointer-events: none;
    }
    .ez-studio-inspect-box {
        position: absolute;
        border-radius: var(--bs-radius-2);
        background-color: color-mix(in oklch, var(--bs-warning-base) 12%, transparent);
        box-shadow:
            0 0 0 calc(var(--bs-border-width) * 2 * var(--ez-inspect-k)) var(--bs-warning-base),
            0 0 0 calc(var(--bs-border-width) * 3 * var(--ez-inspect-k)) var(--bs-fg-body);
    }
    .ez-studio-inspect-label {
        position: absolute;
        translate: 0 calc(-100% - var(--bs-spacer-1) * var(--ez-inspect-k));
        padding: calc(var(--bs-spacer-1) * var(--ez-inspect-k)) calc(var(--bs-spacer-3) * var(--ez-inspect-k));
        border-radius: var(--bs-radius-2);
        background: var(--bs-fg-body);
        color: var(--bs-bg-body);
        font-size: calc(var(--bs-font-size-xs) * var(--ez-inspect-k));
        font-weight: 600;
        line-height: 1.3;
        white-space: nowrap;
    }
    .ez-studio-inspect-label--inside { translate: calc(var(--bs-spacer-1) * var(--ez-inspect-k)) calc(var(--bs-spacer-1) * var(--ez-inspect-k)); }
    html[data-ez-inspect],
    html[data-ez-inspect] * { cursor: crosshair !important; }

    .ez-studio-found {
        outline: calc(var(--bs-border-width) * 2) solid var(--bs-primary-base);
        outline-offset: var(--bs-spacer-2);
        border-radius: var(--bs-radius-2);
    }
    .ez-studio-shortcuts {
        z-index: var(--bs-z-popover);
        width: 22rem;
        max-width: calc(100vw - var(--bs-spacer-9));
    }
    .ez-studio-element { width: 12rem; }

    .ez-theme-thumb-light { display: block; }
    .ez-theme-thumb-dark { display: none; }
    .ez-theme-thumb-dark--always,
    :is(.btn:hover, .btn:focus-visible) .ez-theme-thumb-dark { display: block; }
    :is(.btn:hover, .btn:focus-visible) .ez-theme-thumb-light { display: none; }
}

/* ── Theme Studio 4: mega panel settings, the Admin menu and the padlock ─────────────────────────────
   Mega panel settings. Every mega template (Mega, Mega tiles, Mega split, Mega full width, Mega with featured)
   shares one Panel group of closed-list settings (MegaPanelSettings), written to the --ez-mega-panel-* variables:
   width, alignment (the panel's inset-inline against the app), maximum height, padding, columns, minimum column
   width and column gap. Each one's first option is "initial", which leaves the variable unset, so every
   fallback here is the template's own look. Every column grid in a panel is .ez-mega-cols: at most the Columns
   setting's columns, none narrower than the Minimum column width, wrapping to fewer rather than overflowing. A
   panel is never wider than the app (the box in a boxed layout): its width is the Panel width capped at 100% of
   the app, and "Fit the content" (0rem) is what its columns need at their minimum width (12rem unless set),
   plus its padding and the featured card or split list. Mega tiles' columns are its tiles per row; a tile's
   width is its Tile size, and the panel is as wide as its tiles (at least the Panel width).
   The Admin menu. In the top bar every admin-console section sits under one Admin item (NavTopBar), so the bar
   hides the separate admin sections (.ez-nav-locked) and shows .ez-nav-admin; every other layout (the sidebar,
   the rail, the phone drawer) does the opposite. nav-overflow.js measures only the toggles the bar shows.
   The padlock (.ez-nav-lock, NavLock) marks every admin-console link and section in every template; a section
   toggle's lock sits in the corner of a rail or strip entry. Colours are the menu's own tokens. */
@layer custom {

    /* ── Columns: the shared grid, and each template's own defaults ─────────────────────────────────── */
    .ez-nav-mega {
        --ez-mega-n: var(--ez-mega-panel-columns, var(--ez-mega-n-own, 3));
        --ez-mega-colmin: var(--ez-mega-panel-column-min, var(--ez-mega-colmin-own, 0rem));
        --ez-mega-gap: var(--ez-mega-panel-gap, var(--ez-mega-gap-own, var(--bs-spacer-5)));
        /* What the columns need at their minimum width (12rem when the template sets none), plus the padding
           and anything beside the columns (the featured card, the split list). */
        --ez-mega-fit: calc(var(--ez-mega-n) * var(--ez-mega-panel-column-min, 12rem) + (var(--ez-mega-n) - 1) * var(--ez-mega-gap)
            + 2 * var(--bs-menu-padding-x) + var(--ez-mega-fit-extra, 0rem));
        /* The Panel width, else the template's own. The width rules use it as the panel's width, capped at the
           app; only "Fit the content" (0rem) takes --ez-mega-fit instead: calc((1rem - W) * 100000) is huge for
           0 and negative for any real width, so min(fit, it) is the fit only then. */
        --ez-mega-w: var(--ez-mega-panel-width, var(--ez-mega-width-own, 100%));
    }
    .ez-mega-panel--tiles { --ez-mega-n-own: 4; --ez-mega-gap-own: var(--bs-spacer-2); }
    .ez-mega-panel--split {
        --ez-mega-width-own: 44rem;
        --ez-mega-n-own: 2;
        --ez-mega-colmin-own: 12rem;
        --ez-mega-gap-own: var(--bs-spacer-3);
        --ez-mega-fit-extra: calc(var(--ez-mega-split-list, 14rem) + 2 * var(--ez-mega-panel-padding, var(--bs-spacer-5)));
    }
    .ez-mega-panel--full { --ez-mega-n-own: 5; --ez-mega-colmin-own: 11rem; }
    .ez-mega-panel--featured { --ez-mega-width-own: 0rem; --ez-mega-n-own: 2; --ez-mega-fit-extra: calc(15rem + var(--bs-spacer-5)); }
    /* Each track at least the larger of the minimum width and an equal share of N, less a hair so N always fit
       (rounding); 1fr then shares out the rest. */
    .ez-mega-cols {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, calc(max(var(--ez-mega-colmin, 0rem),
            (100% - (var(--ez-mega-n, 3) - 1) * var(--ez-mega-gap, var(--bs-spacer-5))) / var(--ez-mega-n, 3)) - 0.05rem)), 1fr));
        column-gap: var(--ez-mega-gap, var(--bs-spacer-5));
    }

    /* ── The padlock ────────────────────────────────────────────────────────────────────────────── */
    .ez-nav-lock { flex-shrink: 0; }
    .ez-nav-lock--end { margin-inline-start: auto; }
    .ez-nav-dropdown:has(> .ez-nav-section-lock) { position: relative; }
    .ez-nav-section-lock {
        position: absolute;
        inset-block-start: var(--bs-spacer-1);
        inset-inline-end: var(--bs-spacer-1);
        font-size: 0.625rem;
        opacity: 0.6;
    }
    .ez-mega-tile-badge { display: flex; gap: var(--bs-spacer-1); align-items: center; }

    /* ── The Admin menu: the top bar's, nowhere else ──────────────────────────────────────────────── */
    .ez-nav-admin { display: none; }

    @media (width >= 1280px) {
        .ez-app[data-nav="top"] .ez-app-nav .ez-nav-section.ez-nav-locked { display: none; }
        .ez-app[data-nav="top"] .ez-app-nav .ez-nav-admin { display: flex; }
        /* Admin sits at the row's end, so its drop-down hangs from its end, like More's. */
        .ez-nav-admin .ez-nav-menu { inset-inline: auto 0; }

        /* ── Panel settings, top bar only ───────────────────────────────────────────────────────────
           :where() keeps these as weak as the base .ez-nav-mega rule, so a template's own padding (Mega split's
           panel has none, its pane does; full width uses the page's) still wins over the default here. */
        :where(.ez-app[data-nav="top"] > .ez-app-nav:is([data-variant="mega"], [data-variant="mega-tiles"], [data-variant="mega-split"], [data-variant="mega-full"], [data-variant="mega-featured"])) .ez-nav-mega {
            --bs-menu-padding-x: var(--ez-mega-panel-padding, var(--bs-spacer-5));
            --bs-menu-padding-y: var(--ez-mega-panel-padding, var(--bs-spacer-5));
            --bs-menu-max-height: var(--ez-mega-panel-max-height, 80dvh);
            --bs-menu-overflow-y: auto;
        }
        .ez-app[data-nav="top"] > .ez-app-nav[data-variant="mega-tiles"] .ez-mega-panel {
            width: max-content;
            min-width: min(100%, var(--ez-mega-panel-width, 0rem));
        }
        .ez-app[data-nav="top"] > .ez-app-nav:is([data-variant="mega-featured"], [data-variant="mega-full"]) .ez-mega-panel {
            width: min(100%, max(var(--ez-mega-w), min(var(--ez-mega-fit), calc((1rem - var(--ez-mega-w)) * 100000))));
            margin-inline: auto;
        }

        /* Alignment, with anchor positioning (the panel's containing block is the app). Mega joins the family
           here: the bar is --ez-mega-bar, the open toggle --ez-mega-open. The Alignment setting is the panel's
           inset-inline: under its toggle (start at it, end free), centered (both at the app's edges, auto
           margins share the room), or at the start of the menu row. Unset, each template keeps its own: Mega
           at the start of the row as wide as the bar, full width across the app, the rest under the toggle.
           A panel that would pass the app's end tries the row's end, then the app's start. A fallback is taken only
           when the panel fits its inset-modified containing block in both axes, so the block end reaches well
           below the app (align-self: start keeps the panel its own height): a panel taller than a short page is
           still moved back inside the app's width. */
        @supports (anchor-name: --ez-a) {
            .ez-app[data-nav="top"]:has(> .ez-app-nav[data-variant="mega"]) { position: relative; }
            .ez-app[data-nav="top"] > .ez-app-nav[data-variant="mega"] { anchor-name: --ez-mega-bar; }
            .ez-app[data-nav="top"] > .ez-app-nav[data-variant="mega"] > .nav { position: static; }
            .ez-app[data-nav="top"] > .ez-app-nav[data-variant="mega"] .ez-nav-dropdown[aria-expanded="true"] { anchor-name: --ez-mega-open; }
            .ez-app-nav[data-variant="mega"] {
                --ez-mega-inset-own: anchor(--ez-mega-bar start) auto;
                --ez-mega-width-own: anchor-size(--ez-mega-bar width);
            }
            .ez-app-nav[data-variant="mega-full"] { --ez-mega-inset-own: 0 0; }
            .ez-app[data-nav="top"] > .ez-app-nav:is([data-variant="mega"], [data-variant="mega-tiles"], [data-variant="mega-split"], [data-variant="mega-full"], [data-variant="mega-featured"]) .ez-nav-mega {
                position-anchor: --ez-mega-open;
                top: anchor(--ez-mega-bar bottom);
                inset-inline: var(--ez-mega-panel-inset, var(--ez-mega-inset-own, anchor(--ez-mega-open start) auto));
                inset-block-end: -100dvh;
                align-self: start;
                margin-block-start: var(--bs-spacer-1);
                margin-inline: auto;
                position-try-fallbacks: --ez-mega-row-end, --ez-mega-app-start;
            }
            .ez-app[data-nav="top"] > .ez-app-nav[data-variant="mega-full"] .ez-mega-panel { margin-block-start: 0; }
        }
    }
}

/* ══ Phones, the app's web views and Safari 17.5 ══════════════════════════════════════════════════════
   Carried over from the old sheets (ez-platform.css, ez-platform-nav.css, ez-platform-auth.css and the
   converted ez-shell.css), which the Bootstrap 6 path does not load. Virtual Change Room's iOS and Android
   apps ARE this site, in a WKWebView and Android's Chromium WebView, drawn edge to edge under
   viewport-fit=cover (App.razor): the status bar and the home indicator sit over the page unless it pads
   itself with env(safe-area-inset-*). env() is 0 in an ordinary desktop browser, so none of the insets
   change a desktop. The browser floor is iOS 17.5 (docs/theming.md, "Browser floor"); each rule below says
   which device or engine it is for, and why Bootstrap 6 cannot do it (env() and @supports have no
   utility). Keep a new phone fix here, in this block, so the next audit finds them together. */
@layer custom {

    /* ── Below the status bar, and the drawer clear of both system bars (< xl) ──────────────────────────
       The inset sits on the page itself, above the banners ChromeLayout stacks over the shell
       (impersonation, announcements, confirm-your-email), not on the header below them: on the iOS app a
       banner there rendered under the clock. The drawer menu is fixed top AND bottom (never 100vh tall,
       which in the iOS web view stops short of the bottom), so its first row clears the status bar and its
       last link the home indicator. overscroll-behavior keeps a scroll at the drawer's end from dragging
       the page under it (and, on Android, from reaching the shell's pull-to-refresh). */
    @media (width < 1280px) {
        body:has(> .ez-app) { padding-top: env(safe-area-inset-top); }
        /* That padding scrolls away with the page, so a scrolled page ran under the iPhone clock (owner,
           2026-11-25). A strip of the page's own ground stays behind it, as tall as the inset: nothing at all
           where there is none. Over the page and its fixed bars, under the drawer, dialogs and toasts. */
        body:has(> .ez-app)::before {
            content: "";
            position: fixed;
            inset: 0 0 auto;
            z-index: calc(var(--bs-z-fixed) + 1);
            height: env(safe-area-inset-top);
            background-color: var(--ez-c-bg, var(--ez-ground, var(--bs-bg-body)));
            pointer-events: none;
        }
        .ez-app-nav {
            padding-top: calc(var(--ez-m-sidebar-py, var(--bs-spacer-5)) + env(safe-area-inset-top));
            padding-bottom: calc(var(--ez-m-sidebar-py, var(--bs-spacer-5)) + var(--bs-spacer-3) + env(safe-area-inset-bottom));
            overscroll-behavior: contain;
        }
        /* The floating drawer is an inset card: the card moves clear of the bars, its padding stays its own. */
        .ez-app-nav[data-variant="floating"] {
            inset-block-start: calc(var(--ez-float-gap, 0.75rem) + env(safe-area-inset-top));
            inset-block-end: calc(var(--ez-float-gap, 0.75rem) + env(safe-area-inset-bottom));
            padding-block: var(--ez-m-sidebar-py, var(--bs-spacer-5));
        }
    }

    /* ── EzModal: the dialog clear of the status bar and home indicator ──────────────────────────────────
       The inset goes on the full-screen layer, so a tall or scrollable dialog stops below the clock and
       above the home bar; one rule for every dialog rather than a fix per dialog. The scrollable cap
       (EzModal section above) takes the insets back out of the viewport. */
    .ez-dialog-layer {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .ez-dialog-center > .dialog.dialog-scrollable {
        max-height: calc(100dvh - 2 * var(--bs-spacer-5) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    }

    /* ── Sign-in pages (AuthLayout): the form and the brand clear of the system bars ────────────────────
       The app opens on these pages, edge to edge. */
    .auth-main {
        padding-top: calc(var(--bs-spacer-8) + env(safe-area-inset-top));
        padding-bottom: calc(var(--bs-spacer-8) + env(safe-area-inset-bottom));
    }
    .auth-hero .auth-brand { top: calc(var(--bs-spacer-8) + env(safe-area-inset-top)); }

    /* ── No zoom on focus (iOS and iPadOS) ──────────────────────────────────────────────────────────────
       iOS zooms the whole page into any text field whose text is under 16px, and leaves it zoomed. A theme
       at 14px (Virtual Change Room's) scales the root, and v6 sizes every control from it, so every field
       would zoom. Only WebKit on iOS knows -webkit-touch-callout, so desktops, Android and macOS Safari keep
       the theme's exact size. 16px, not a rem: the threshold is iOS's, in CSS pixels, whatever the root.
       A small control grows a little to hold the larger text; that is the price of a page that stays put. */
    @supports (-webkit-touch-callout: none) {
        :where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"],
               [type="button"], [type="submit"], [type="reset"], [type="image"], [type="hidden"]), select, textarea) {
            font-size: max(16px, 1em);
        }
        .form-control { font-size: max(16px, var(--bs-control-font-size)); }
    }

    /* ── The account panels (NotificationBell, UserMenu) and the notification arrival banner ─────────────
       Both panels hang under their button, end-aligned, above the click-away backdrop (v6 places a .menu
       with its own JS positioner, which these Blazor-driven panels do not use).
       Phones (< sm): the bell sits inboard of the user card, so an end-aligned panel would run off the
       start edge. It becomes a screen-wide sheet instead, dropped just below the bell where CSS anchor
       positioning exists; Safari before 26 (the iOS 17.5 floor) has none, so there the sheet pins to the
       top of the screen, clear of the status bar. dvh, not vh: 100vh stops short of the bottom in the iOS
       web view. */
    .notif-wrap { anchor-name: --notif-bell; }
    :is(.notif-menu, .user-menu, .business-menu) {
        top: calc(100% + var(--bs-spacer-2));
        inset-inline: auto 0;
        max-width: 90vw;
    }
    /* They grow out of their button and shrink back into it. */
    :is(.notif-menu, .user-menu, .business-menu) { transform-origin: top right; }
    :is(.notif-menu, .user-menu, .business-menu):not(.show) { transform: translateY(-0.5rem) scale(0.94); }
    @starting-style {
        :is(.notif-menu, .user-menu, .business-menu).show { transform: translateY(-0.5rem) scale(0.94); }
    }
    .ez-nav-account--up :is(.user-menu, .notif-menu, .business-menu) { transform-origin: bottom left; }
    .notif-menu { width: 22.5rem; overflow: hidden; }
    .user-menu { width: 15rem; }
    /* On a phone or tablet the account links are two columns of thumb-sized rows, so they are easy to read and tap
       without the menu growing taller (owner, 2026-11-25). v6's menu is one column of 29px rows. */
    @media (width < 768px), (pointer: coarse) {
        .user-menu { width: min(24rem, 100vw - 1rem); max-width: none; --bs-menu-padding-x: var(--bs-spacer-2); }
        .user-menu-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .user-menu-links > .menu-item { white-space: normal; line-height: 1.2; }
        .user-menu-links .menu-item-content { min-width: 0; }
        /* A count or badge sits on the icon's corner, as on the tab bar: half a phone's width has no room beside the words. */
        .user-menu-links > .menu-item { position: relative; }
        .user-menu-links .ez-nav-badge { position: absolute; inset-block-start: 0.25rem; inset-inline-start: 1.375rem; line-height: 1; }
        .user-menu-links .badge { --bs-badge-font-size: 0.625rem; --bs-badge-padding-x: 0.4em; --bs-badge-padding-y: 0.2em; min-height: 0; }
        :is(.user-menu, .ez-tab-more) .menu-item { min-height: 3rem; }
        :is(.user-menu, .ez-tab-more .ez-action-menu__panel) { --bs-menu-item-padding-x: 0.625rem; }
    }
    .business-menu { width: 17rem; }
    /* ── Sheets: the account menu and the tab bar's More menu on a phone ──
       Why custom: a menu the colour of the page, with nothing dimmed behind it, read as part of the page, and a shadow
       does not show on black (owner, 2026-11-25). Both are the same thing: a raised surface over the dimmed page
       (lighter than behind a dialog: it is only a menu), and on a phone a sheet that slides up from the foot of the screen, dragged down or tapped
       beside to close (layout.js, which looks for --ez-sheet). v6 has no bottom sheet and no raised menu. */
    @media (width < 768px), (pointer: coarse) {
        :is(.user-menu, .ez-tab-more .ez-action-menu__panel) {
            --bs-menu-border-color: color-mix(in oklch, var(--bs-fg-body) 22%, var(--bs-bg-body));
            --bs-menu-divider-bg: color-mix(in oklch, var(--bs-fg-body) 18%, var(--bs-bg-body));
            --bs-menu-item-hover-bg: color-mix(in oklch, var(--bs-fg-body) 10%, transparent);
        }
        [data-bs-theme="dark"] :is(.user-menu, .ez-tab-more .ez-action-menu__panel) {
            --bs-menu-bg: color-mix(in oklch, var(--bs-fg-body) 25%, var(--bs-bg-body));
            --bs-menu-border-color: color-mix(in oklch, var(--bs-fg-body) 42%, var(--bs-bg-body));
            --bs-menu-divider-bg: color-mix(in oklch, var(--bs-fg-body) 36%, var(--bs-bg-body));
        }
        /* Log out's red, lighter so it reads on the raised surface. */
        [data-bs-theme="dark"] .user-menu > .theme-danger { color: var(--bs-theme-fg-emphasis); }
        /* The dimmed page, fading in and out with its menu (and with the finger that drags it: --ez-sheet-dim, layout.js).
           More's is drawn by its tab, not by its ::backdrop: Safari drops a ::backdrop the moment the popover closes. The
           bar therefore rises over the page's other bars while More is open, until it has faded. */
        .user-menu-backdrop, .ez-tab-more::before {
            background-color: rgb(0 0 0 / 60%);
            opacity: 0;
        }
        .ez-tab-more::before {
            content: "";
            position: fixed;
            inset: 0;
            z-index: 1;
            visibility: hidden;
        }
        .user-menu-backdrop.show, .ez-tab-more:has(> .ez-action-menu__panel:popover-open)::before {
            opacity: var(--ez-sheet-dim, 1);
            visibility: visible;
            touch-action: none;
        }
        .ez-tab-more:has(> .ez-action-menu__panel:popover-open) { touch-action: none; }
        .ez-app-tabs:has(.ez-tab-more > .ez-action-menu__panel:popover-open) { z-index: var(--bs-z-popover); transition: none; }
        @starting-style {
            .user-menu-backdrop.show { opacity: 0; }
        }
        @media (prefers-reduced-motion: no-preference) {
            .user-menu-backdrop, .ez-tab-more::before {
                transition: opacity var(--ez-sheet-dim-time, var(--ez-sheet-out)) ease-out,
                    visibility var(--ez-sheet-out), display var(--ez-sheet-out) allow-discrete;
            }
            .ez-app-tabs { transition: z-index 0s var(--ez-sheet-out); }
        }
    }
    .user-menu-backdrop:not(.show) { display: none; }
    :root {
        --ez-sheet-in: calc(var(--ez-motion-duration, 0.15s) * 3.4);
        --ez-sheet-out: calc(var(--ez-motion-duration, 0.15s) * 1.8);
        --ez-sheet-step: calc(var(--ez-motion-duration, 0.15s) / 5);
    }
    @media (width < 768px) {
        :is(.ez-app-header .user-menu, .ez-tab-more .ez-action-menu__panel) {
            --ez-sheet: 1;
            --bs-menu-border-radius: 1.25rem 1.25rem 0 0;
            --bs-menu-border-width: var(--bs-border-width) 0 0;
            --bs-menu-padding-x: var(--bs-spacer-4);
            position: fixed;
            /* 2rem of it is below the screen, for the spring to lift without showing what is under the sheet. */
            inset: auto 0 -2rem;
            width: 100%;
            max-width: none;
            max-height: calc(100dvh - 1rem - env(safe-area-inset-top));
            padding-bottom: calc(2rem + var(--bs-spacer-3) + env(safe-area-inset-bottom));
            overflow-y: auto;
        }
        /* Off the foot of the screen until it opens, and again once it closes. */
        :is(.ez-app-header .user-menu:not(.show), .ez-tab-more .ez-action-menu__panel:not(:popover-open)) { opacity: 1; transform: translateY(100%); }
        /* It springs up and settles, its rows rising one after another and their icons popping in; it leaves quickly. The
           times follow the theme's own motion speed. */
        @media (prefers-reduced-motion: no-preference) {
            :is(.ez-app-header .user-menu, .ez-tab-more .ez-action-menu__panel) {
                transition: transform var(--ez-sheet-out) cubic-bezier(0.4, 0, 1, 1), translate var(--ez-sheet-in) linear(0, 0.073, 0.234, 0.421, 0.598, 0.745, 0.857, 0.936, 0.986, 1.015, 1.028, 1.032, 1.029, 1.024, 1.018, 1.013, 1.008, 1.004, 1.002, 1),
                    display var(--ez-sheet-out) allow-discrete, overlay var(--ez-sheet-out) allow-discrete;
            }
            :is(.ez-app-header .user-menu.show, .ez-tab-more .ez-action-menu__panel:popover-open) {
                transition-duration: var(--ez-sheet-in);
                transition-timing-function: linear(0, 0.073, 0.234, 0.421, 0.598, 0.745, 0.857, 0.936, 0.986, 1.015, 1.028, 1.032, 1.029, 1.024, 1.018, 1.013, 1.008, 1.004, 1.002, 1);
            }
            :root:not([data-motion="reduce"]) :is(.ez-app-header .user-menu > :not(.menu-divider, .user-menu-links), .ez-app-header .user-menu-links > .menu-item, .ez-tab-more .ez-action-menu__panel > .menu-item) {
                animation: ez-sheet-row calc(var(--ez-sheet-step) * 14) cubic-bezier(0.22, 1, 0.36, 1) calc(var(--ez-sheet-step) * (2 + var(--ez-sheet-row, 0))) backwards;
            }
            :root:not([data-motion="reduce"]) :is(.ez-app-header .user-menu, .ez-tab-more .ez-action-menu__panel) .menu-item > i:first-child {
                animation: ez-sheet-icon calc(var(--ez-sheet-step) * 15) cubic-bezier(0.34, 1.8, 0.64, 1) calc(var(--ez-sheet-step) * (3 + var(--ez-sheet-row, 0))) backwards;
            }
            :is(.user-menu-links, .ez-tab-more .ez-action-menu__panel) > .menu-item {
                &:nth-child(n + 3) { --ez-sheet-row: 1; }
                &:nth-child(n + 5) { --ez-sheet-row: 2; }
                &:nth-child(n + 7) { --ez-sheet-row: 3; }
                &:nth-child(n + 9) { --ez-sheet-row: 4; }
                &:nth-child(n + 11) { --ez-sheet-row: 5; }
            }
            .user-menu > .menu-item { --ez-sheet-row: 6; }
            .user-menu > .menu-item ~ .menu-item { --ez-sheet-row: 7; }
            .user-menu > .menu-item:last-child { --ez-sheet-row: 8; }
        }
        :is(.ez-app-header .user-menu.show, .ez-tab-more .ez-action-menu__panel:popover-open) { transform: none; }
        .ez-tab-more .ez-action-menu__panel:popover-open { display: grid; }
        .ez-tab-more .ez-action-menu__panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .ez-tab-more .menu-item { white-space: normal; line-height: 1.2; }
        .ez-tab-more .menu-item-icon { align-self: center; margin-top: 0; width: auto; }
        @starting-style {
            :is(.ez-app-header .user-menu.show, .ez-tab-more .ez-action-menu__panel:popover-open) { opacity: 1; transform: translateY(100%); }
        }
        /* The grip. */
        :is(.ez-app-header .user-menu, .ez-tab-more .ez-action-menu__panel)::before {
            content: "";
            flex: none;
            grid-column: 1 / -1;
            width: 2.25rem;
            height: 0.25rem;
            margin: var(--bs-spacer-2) auto;
            border-radius: var(--bs-radius-pill);
            background: var(--bs-fg-4);
        }
    }
    @keyframes ez-sheet-row {
        from { opacity: 0; translate: 0 1.25rem; }
    }
    @keyframes ez-sheet-icon {
        from { scale: 0.3; rotate: -20deg; }
    }
    .notif-list { max-height: 22.5rem; }
    @media (width < 576px) {
        .notif-menu {
            position: fixed;
            top: calc(var(--bs-spacer-4) + env(safe-area-inset-top));
            inset-inline: var(--bs-spacer-4);
            width: auto;
            max-width: none;
            max-height: calc(100dvh - 2 * var(--bs-spacer-4) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
            overflow-y: auto;
        }
        @supports (anchor-name: --ez-a) {
            .notif-menu {
                position-anchor: --notif-bell;
                top: calc(anchor(bottom, var(--bs-spacer-2)) + var(--bs-spacer-2));
                max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 6.5rem);
            }
        }
        :is(.user-menu, .business-menu) { max-height: calc(100dvh - 6rem - env(safe-area-inset-top)); overflow-y: auto; }
    }

    /* The arrival banner: a v6 .toast pinned dark in the markup that flips in at the top of the screen,
       below the status bar. Notifications arrive at the TOP and toasts sit at the BOTTOM (.ez-toast-host),
       so the two never meet. On phones it drops just below the header rather than over the bell and the
       credit badge it is usually about; max() keeps it on screen once the header has scrolled away. */
    .notif-banner {
        position: fixed;
        top: calc(var(--bs-spacer-4) + env(safe-area-inset-top));
        inset-inline: 0;
        margin-inline: auto;
        max-width: calc(100vw - 2 * var(--bs-spacer-4));
        z-index: var(--bs-z-toast);
        transform-origin: top center;
        animation: notif-banner-in .45s cubic-bezier(0.34, 1.4, 0.64, 1);
    }
    .notif-banner.hiding {
        animation: notif-banner-out .22s ease-in forwards;
        pointer-events: none;
    }
    @media (width < 576px) {
        @supports (anchor-name: --ez-a) {
            .ez-app-header { anchor-name: --ez-page-header; }
            .notif-banner {
                top: max(calc(var(--bs-spacer-4) + env(safe-area-inset-top)), calc(anchor(--ez-page-header bottom, 0px) + var(--bs-spacer-3)));
            }
        }
    }
    @keyframes notif-banner-in {
        0%   { opacity: 0; transform: perspective(600px) rotateX(-50deg) translateY(-2rem); }
        55%  { opacity: 1; transform: perspective(600px) rotateX(7deg) translateY(0.25rem); }
        100% { opacity: 1; transform: none; }
    }
    @keyframes notif-banner-out {
        to { opacity: 0; transform: translateY(-110%); }
    }
    /* Two lines rather than one ellipsised line, so a short body stays readable on a narrow phone. Only the
       -webkit- spelling of line clamping exists in any engine today. */
    .notif-banner-body {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
    }

    /* ── EzTabs on a phone (< md): one row that scrolls sideways ───────────────────────────────────────
       Wrapped into rows, a strip stops reading as one strip and the underline (or pill ground) breaks up;
       scrolled, it stays one row and ezTabs.js scrolls the active tab into view when it changes. The
       scrollbar is hidden (the cut-off tab at the edge shows there is more), and a tab must not shrink or
       wrap its label, or the row squeezes instead of overflowing. v6's .nav-tabs wraps, and has no
       responsive overflow utility. scrollbar-width arrived in Safari 18.2, so the -webkit- pseudo-element
       hides it on the iOS 17.5 floor. */
    @media (width < 768px) {
        .nav-tabs {
            flex-wrap: nowrap;
            overflow-x: auto;
            overflow-y: hidden;
            scrollbar-width: none;
        }
        .nav-tabs::-webkit-scrollbar { display: none; }
        .nav-tabs > .nav-item { flex: none; }
        .nav-tabs .nav-link { white-space: nowrap; }
    }
    /* The public site's scrolling nav row (above) on Safari before 18.2, as for the tabs. */
    .ez-pub-nav::-webkit-scrollbar { display: none; }

    /* ── EzDateOfBirthInput: day, month, year that wrap rather than clip (Android web view) ────────────
       The Android app's web view follows the phone's SYSTEM font size, and at the largest sizes a fixed
       12-column split clipped the digits. Each part's basis is its content plus padding (and the month's
       select arrow) in em, so it grows with the text and the row wraps when it no longer fits; the grow
       factors keep the 3 : 5 : 4 split on one line. No v6 utility sets a basis in em. */
    .ez-dob-part--day   { flex: 3 1 3.25em; }
    .ez-dob-part--month { flex: 5 1 5.75em; }
    .ez-dob-part--year  { flex: 4 1 4.75em; }

    /* ── The browser floor notice (App.razor .ez-browser-notice) ────────────────────────────────────────
       Rendered with the hidden attribute; layout.js unhides it and adds .ez-browser-notice--shown when the
       engine lacks light-dark() or color-mix(), which every theme and this sheet rely on (Safari before
       17.5). The page stays usable underneath. Plain colours, the one place this sheet has any: the v6
       alert's own colours are light-dark() tokens, exactly what such a browser cannot resolve, and a
       declaration that reads an unresolvable token is dropped rather than falling back. */
    .ez-browser-notice--shown > .alert {
        color: #332701;
        background-color: #fff3cd;
        border: 0;
        border-bottom: 1px solid #997404;
    }
}

/* ── Wide tables: the edge with more columns past it fades ──────────────────────────────────────────────
   Why custom: v6's .table-responsive pans sideways with no sign that it can, and with overlay scrollbars (every
   phone, macOS) a wide admin table read as complete at its right edge. The right edge fades while columns lie
   past it, driven by the scroll position itself (a scroll-driven animation), so no script runs. Only the end
   edge: the start edge holds the sticky row-actions column, which must stay crisp. A table that fits, or a
   browser without animation-timeline (Firefox today), keeps the plain scroller: the custom property then sits
   at its 0px initial value and the mask is opaque. @property sits outside the layer, which it ignores. */
@property --ez-pan-end {
    syntax: "<length>";
    inherits: false;
    initial-value: 0px;
}
@layer custom {
    @supports (animation-timeline: scroll()) {
        .table-responsive {
            mask-image: linear-gradient(to right, #000 calc(100% - var(--ez-pan-end)), transparent);
            animation: ez-table-pan linear both;
            animation-timeline: scroll(self inline);
        }
    }
    @keyframes ez-table-pan {
        0%, 94% { --ez-pan-end: 3rem; }
        100% { --ez-pan-end: 0px; }
    }
}

/* ── The dashboard's greeting band (DashboardGreeting) ───────────────────────────────────────────────────
   Why custom: the greeting reads in the brand's own dark and mid browns on its soft band (owner, 2026-11-12), mixed
   from the brand colour so every theme gets its own; v6's emphasis tokens are what a theme sets for text, black in
   a theme whose brand colour fails as text. Lightened instead in dark mode, where the band is dark. */
@layer custom {
    .ez-greeting-title { color: light-dark(color-mix(in oklch, var(--bs-primary-base) 42%, black), color-mix(in oklch, var(--bs-primary-base) 45%, white)); }
    .ez-greeting-line { color: light-dark(color-mix(in oklch, var(--bs-primary-base) 68%, black), color-mix(in oklch, var(--bs-primary-base) 70%, white)); }
}

/* ── A button's count badge (EzButtonBadge) ──────────────────────────────────────────────────────────────
   Why custom: v6's translate-middle centres the badge on the corner, so half of it hung over the button beside it
   (owner, 2026-11-12). Pinned to the top-right corner (utilities) and nudged out by less than the gap between
   buttons, so it reads as on the button and never touches a neighbour; no utility moves it by a fraction. */
@layer custom {
    .ez-btn-badge { translate: 25% -40%; }
}

/* ── A person's avatar: grey in every theme ──────────────────────────────────────────────────────────────
   Why custom: v6's role colours are the brand's, so theme-secondary is lavender in one app and near-black in
   another. A person's initials disc is neutral everywhere (owner, 2026-11-12), in the soft grey of the side menu's
   Create button (bg-2) with dark initials and a hairline so it still reads on a white page; set directly because an
   avatar inside a themed button inherits that button's role colour. */
@layer custom {
    .ez-avatar-gray {
        background-color: var(--bs-bg-2);
        color: var(--bs-fg-1);
        box-shadow: inset 0 0 0 var(--bs-border-width) var(--bs-border-color);
    }
}

/* ── Outline-secondary hover and open: the border stays ──────────────────────────────────────────────────
   Why custom: v6 fills an outline button on hover with its role's solid colour and paints the border the same,
   which reads well only while that colour stands apart from the page. The secondary role is the theme's
   alternate surface, often within a shade of the page (VCR's dark theme), so the button seemed to lose its
   border and vanish. Secondary, the default variant, keeps its border and takes the role's stronger muted fill
   on hover and while its menu is open. */
@layer custom {
    .btn-outline.theme-secondary:hover {
        --bs-btn-hover-bg: var(--bs-theme-bg-muted);
        --bs-btn-hover-color: var(--bs-theme-fg-emphasis);
        --bs-btn-hover-border-color: var(--bs-theme-border);
    }
    .btn-outline.theme-secondary.active,
    .btn-outline.theme-secondary.show {
        --bs-btn-active-bg: var(--bs-theme-bg-muted);
        --bs-btn-active-color: var(--bs-theme-fg-emphasis);
        --bs-btn-active-border-color: var(--bs-theme-border);
    }
}

/* ── Buttons on a photo (.ez-on-media) ───────────────────────────────────────────────────────────────────
   Why custom: an outline button is transparent, so over a photo its icon and border take whatever colour the
   picture has under them, and a light photo swallows them. Every over-image button (AGENTS.md: an
   outline-secondary EzButton, the action-menu trigger included) sits on a see-through black chip with light
   text, darker on hover and while its menu is open, the same on every theme because the photo, not the theme,
   is what it sits on. v6 has bg opacity utilities but none that follow hover. The class goes on the button or
   on the cluster that holds it (EzUpload's remove, EzImageViewer's and EzCompareOverlay's close, VCR's photo
   menus, ratings and bottom bars). A role colour other than secondary keeps its own text and border. The
   hover fill sits with the hover colours, so the outline-secondary hover above does not win over a photo. */
@layer custom {
    .ez-on-media .btn-outline,
    .btn-outline.ez-on-media {
        --bs-btn-bg: color-mix(in oklch, var(--bs-black) 45%, transparent);
        -webkit-backdrop-filter: blur(4px);
        backdrop-filter: blur(4px);
    }
    .ez-on-media .btn-outline.theme-secondary,
    .btn-outline.theme-secondary.ez-on-media {
        --bs-btn-color: var(--bs-white);
        --bs-btn-border-color: color-mix(in oklch, var(--bs-white) 30%, transparent);
    }
    .ez-on-media .btn-outline.theme-secondary:is(:hover, .active, .show),
    .btn-outline.theme-secondary.ez-on-media:is(:hover, .active, .show) {
        --bs-btn-hover-bg: color-mix(in oklch, var(--bs-black) 70%, transparent);
        --bs-btn-active-bg: color-mix(in oklch, var(--bs-black) 70%, transparent);
        --bs-btn-hover-color: var(--bs-white);
        --bs-btn-hover-border-color: color-mix(in oklch, var(--bs-white) 60%, transparent);
        --bs-btn-active-color: var(--bs-white);
        --bs-btn-active-border-color: color-mix(in oklch, var(--bs-white) 60%, transparent);
    }
    .ez-on-media .btn-outline:not(.theme-secondary):is(:hover, .active, .show),
    .btn-outline.ez-on-media:not(.theme-secondary):is(:hover, .active, .show) {
        --bs-btn-hover-bg: color-mix(in oklch, var(--bs-black) 70%, transparent);
        --bs-btn-active-bg: color-mix(in oklch, var(--bs-black) 70%, transparent);
        --bs-btn-hover-color: var(--bs-theme-fg);
        --bs-btn-hover-border-color: var(--bs-theme-border);
        --bs-btn-active-color: var(--bs-theme-fg);
        --bs-btn-active-border-color: var(--bs-theme-border);
    }
}

/* ── Menu badges ("Beta", "New": NavBadge) ───────────────────────────────────────────────────────
   A soft chip, owner's pick 2026-11-13 (B6 / N6). Why custom: v6's badge-subtle paints the role's
   bg-subtle, which a theme mixes at about 12% into its surface, so on a black sidebar the brand-colour
   "New" chip all but disappears. The menu badge takes the role's bg-muted tint instead (v6's own token,
   the one its chips and list-group actions use), still soft but visible on any surface. */
@layer custom {
    .ez-nav-badge-chip.badge-subtle { --bs-badge-bg: var(--bs-theme-bg-muted, var(--bs-theme-bg-subtle)); }
}

/* ── Date and time fields: the calendar at the right edge ──────────────────────────────────────────
   Why custom: v6's .form-control is a flex box, and a browser's date and time fields keep their picker
   button right after the text inside it, so the calendar sat in the middle of a wide field (owner,
   2026-11-13). Drawn as a block, as the browser draws its own date fields, the button sits at the right edge.
   Seen in the app's Chromium pane. */
@layer custom {
    input.form-control:is([type="date"], [type="time"], [type="datetime-local"], [type="month"], [type="week"]) { display: block; }
}

/* ── The page's actions stay in reach: the action row sticks to the top from md up ───────────────────
   Why custom: scrolling down a long form left Save at the top of the page, out of sight (owner, 2026-11-13).
   From md up the row (EzActionBar, .page-actions) sticks to the top of the window while the page scrolls,
   as a full-width band on the page's own ground so the form does not show through; v6's sticky-top has no
   background and no full-bleed band. Below md a record editor keeps its own bar at the bottom of the screen
   (the total and the main action, .ef-editor-actions), where a thumb reaches it. */
@layer custom {
    @media (width >= 768px) {
        .ez-app-main > .page-actions:has(.page-actions-buttons > *) {
            position: sticky;
            top: env(safe-area-inset-top); /* below the status bar strip in the app on a tablet */
            z-index: var(--bs-z-sticky);
            /* The page's ground, slightly see-through and blurred, so what scrolls under it softens instead of vanishing
               (owner, 2026-11-13). A browser without backdrop blur still gets the mostly solid ground. */
            background-color: color-mix(in srgb, var(--ez-c-bg, var(--ez-ground, var(--bs-bg-body))) 80%, transparent);
            -webkit-backdrop-filter: blur(12px);
            backdrop-filter: blur(12px);
            margin-inline: calc(var(--ez-page-px) * -1);
            padding: var(--bs-spacer-3) var(--ez-page-px);
            /* The cards' own border under it, so the page scrolling underneath has an edge to go under (owner, 2026-11-13). */
            border-block-end: var(--bs-border-width) solid var(--bs-border-color);
        }
    }

    /* ============ Right to left (Arabic, Persian, Urdu) ============
       Our sheets say start and end rather than left and right (tools/css/logical.mjs), so a page with
       dir="rtl" flips by itself. These are the few things start/end cannot say: a drawer slides in from
       the start side, and an arrow points the way the page reads. A logo, a photo or a before/after
       comparison does not flip. */
    [dir="rtl"] .ez-app-nav:not(.open) { transform: translateX(100%); }
    [dir="rtl"] .ez-filter-drawer { animation-name: ez-filter-slide-in-rtl; }
    @keyframes ez-filter-slide-in-rtl { from { transform: translateX(-100%); } to { transform: translateX(0); } }
    [dir="rtl"] :is(.fa-arrow-left, .fa-arrow-right, .fa-arrow-left-long, .fa-arrow-right-long, .fa-chevron-left,
        .fa-chevron-right, .fa-angle-left, .fa-angle-right, .fa-arrow-right-from-bracket, .fa-arrow-right-to-bracket) {
        scale: -1 1;
    }
}
