/* ============================================================================
   modern-ui.css — the single application stylesheet.

   This used to be four files: a four-line aggregator whose only content was
   three `@import url(...)` rules, plus the three parts. CSS `@import` is
   serial — the browser fetches and parses this file before it even learns the
   three real stylesheets exist, so the split cost three extra round trips on
   the critical path and bought nothing a section comment does not.

   Order is the original import order and is load-bearing: base defines the
   design tokens, components consume them, responsive overrides both. The token
   block (until 2026-11-18 a separate css/po-tokens.css) aliases the estate's
   --po-* tokens; po-tokens.css is now the shared estate file, loaded first.
   ============================================================================ */

/* ── BASE: design tokens, resets, typography ─────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════════════════════
   DESIGN TOKENS — the single source of truth.

   Every colour, radius, shadow, spacing step, and motion curve in the app resolves
   from this block. Nothing downstream (global or scoped) may hardcode a hex, an
   rgba(), or a px radius; accent washes are derived with color-mix() from the base
   accent so they track the light/dark flip automatically instead of drifting.
   ═══════════════════════════════════════════════════════════════════════════════ */
:root {
    /* ── Surfaces & text ──────────────────────────────────────────────────────
       Po web standard (2026-11-18): every colour is an alias of a --po-* token in
       po-tokens.css (the estate file, same in every Po app), which flips with the
       device's light/dark setting on its own. So this block needs no light copy. */
    --app-bg: var(--po-bg);
    --app-bg-deep: color-mix(in srgb, var(--po-bg) 92%, #000);
    --app-bg-alt: var(--po-surface-2);
    /* Cards no longer sit behind a backdrop-filter, so the surface carries its own
       opacity rather than relying on a blur to separate it from the page. */
    --app-surface: color-mix(in srgb, var(--po-surface) 94%, transparent);
    --app-surface-strong: color-mix(in srgb, var(--po-surface) 98%, transparent);
    --app-surface-soft: color-mix(in srgb, var(--po-text) 4%, transparent);
    --app-border: var(--po-border);
    --app-border-strong: color-mix(in srgb, var(--po-text-muted) 40%, var(--po-border));
    --app-text: var(--po-text);
    --app-text-muted: var(--po-text-muted);
    /* The smallest type in the app reads this, so it is the estate's muted text (AA on
       --po-surface in both schemes) rather than a softer third grey. */
    --app-text-soft: var(--po-text-muted);
    --app-on-accent: var(--po-on-accent);

    /* ── Accents ────────────────────────────────────────────────────────────── */
    --app-accent: var(--po-accent);
    --app-accent-strong: var(--po-accent-hover);
    --app-accent-warm: var(--po-warning);
    --app-danger-soft: var(--po-danger);
    --app-danger-strong: color-mix(in srgb, var(--po-danger) 80%, #000);

    /* Derived washes — replace the hand-typed rgba() literals that had already
       drifted out of sync with their source token (the warm wash was authored as
       rgb(248,195,107) while --app-accent-warm is rgb(241,182,99)). */
    --app-accent-wash: color-mix(in srgb, var(--app-accent-strong) 14%, transparent);
    --app-accent-wash-strong: color-mix(in srgb, var(--app-accent-strong) 24%, transparent);
    --app-accent-edge: color-mix(in srgb, var(--app-accent) 35%, transparent);
    --app-warm-wash: color-mix(in srgb, var(--app-accent-warm) 13%, transparent);
    --app-warm-edge: color-mix(in srgb, var(--app-accent-warm) 35%, transparent);
    --app-hover-wash: color-mix(in srgb, var(--app-text) 7%, transparent);
    --app-sunken: color-mix(in srgb, var(--app-bg-deep) 55%, transparent);

    /* ── Elevation ──────────────────────────────────────────────────────────── */
    --app-shadow-sm: 0 2px 8px rgba(2, 6, 16, 0.22);
    --app-shadow-md: 0 8px 20px rgba(2, 6, 16, 0.32);
    --app-shadow-lg: 0 12px 32px rgba(2, 6, 16, 0.45);
    --app-shadow-chrome: 0 12px 40px rgba(0, 0, 0, 0.3);
    --app-shadow-chrome-raised: 0 16px 48px rgba(0, 0, 0, 0.45);
    --app-shadow-accent: 0 8px 20px color-mix(in srgb, var(--app-accent-strong) 22%, transparent);

    /* ── Radii ──────────────────────────────────────────────────────────────── */
    --app-radius-sm: var(--po-radius-sm);
    --app-radius-md: var(--po-radius);
    --app-radius-lg: calc(var(--po-radius) + 2px);
    --app-radius-xl: calc(var(--po-radius) + 6px);
    --app-radius-pill: var(--po-radius-pill);

    /* ── Spacing scale ──────────────────────────────────────────────────────────
       Every step is derived from --app-density, so compacting the UI for a small
       viewport is ONE declaration rather than a per-component override in each of the
       five breakpoints this file and AzureDashboard.razor.css used to carry. Change the
       dial, not the steps. */
    /* Compact for everyone (owner's call, 2026-11-17): the /settings Density toggle that
       switched between 1 and this value was removed, so the compact step is the base. */
    --app-density: 0.82;
}

:root {
    --app-space-3xs: calc(0.25rem * var(--app-density));
    --app-space-2xs: calc(0.35rem * var(--app-density));
    --app-space-xs: calc(0.5rem * var(--app-density));
    --app-space-sm: calc(0.75rem * var(--app-density));
    --app-space-md: calc(1rem * var(--app-density));
    --app-space-lg: calc(1.25rem * var(--app-density));
    --app-space-xl: calc(2rem * var(--app-density));

    /* ── Type scale ─────────────────────────────────────────────────────────────
       One fluid ladder, 390px → 1280px. Before this, headings carried hand-written
       clamp()s that disagreed with each other across pages — the catalog h1 grew at
       5vw while the dashboard h1 grew at 3vw, so the two pages' headings crossed over
       somewhere in the middle of the range and neither was ever deliberate. Every
       font-size above 0.9rem should resolve from a step.

       The bottom step is also the app's most-repeated size — `.app-kicker`, the card
       subtitles and `.app-note` all resolve from it — and it used to bottom out at
       0.68rem (10.88px), which is below the size at which a tracked all-caps kicker
       stays comfortably readable on a phone. The floor is now 0.76rem (12.16px) at
       390px and 0.82rem (13.12px) at 1280px. If a pane stops fitting its viewport,
       fix the pane — do not put the floor back, and do not scale this step with
       --app-density (see the note on the density dial below). */
    --app-step--2: clamp(0.76rem, 0.735rem + 0.10vw, 0.82rem);
    --app-step--1: clamp(0.76rem, 0.725rem + 0.15vw, 0.86rem);
    --app-step-0: clamp(0.92rem, 0.89rem + 0.13vw, 1rem);
    --app-step-1: clamp(1rem, 0.95rem + 0.22vw, 1.15rem);
    --app-step-2: clamp(1.15rem, 1.05rem + 0.42vw, 1.42rem);
    --app-step-3: clamp(1.35rem, 1.16rem + 0.79vw, 1.85rem);
    --app-step-4: clamp(1.6rem, 1.28rem + 1.34vw, 2.45rem);
    --app-step-5: clamp(1.85rem, 1.4rem + 1.9vw, 3.05rem);

    /* ── Motion ─────────────────────────────────────────────────────────────── */
    --app-dur-fast: 120ms;
    --app-dur-base: 200ms;
    --app-dur-slow: 380ms;
    --app-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --app-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    /* A real damped spring (zeta 0.38), sampled into linear(): it overshoots, swings back
       under, and settles — a cubic-bezier can only overshoot once. Unsupported browsers
       drop the declaration that uses it and get no animation, never a broken one. */
    --app-ease-bounce: linear(0, 0.083, 0.287, 0.546, 0.804, 1.021, 1.173, 1.255, 1.274, 1.245, 1.185, 1.113, 1.043, 0.986, 0.947, 0.928, 0.925, 0.935, 0.952, 0.972, 0.991, 1.006, 1.016, 1.02, 1.02, 1.017, 1.012, 1.007, 1.002, 0.998, 1);
    --app-ease-smooth: cubic-bezier(0.25, 0.8, 0.25, 1);

    /* ── Layering ───────────────────────────────────────────────────────────── */
    --app-z-header: 1000;
    --app-z-skip: 10000;

    /* Glassmorphism is reserved for chrome (the header). Applying it per-card created
       one backdrop root per card and was the dominant mobile GPU cost. The chrome fill
       stays translucent so the blur has something to do; it derives from --app-bg-deep
       and therefore tracks the light/dark flip. */
    --app-glass-blur: 18px;
    --app-chrome: color-mix(in srgb, var(--app-bg-deep) 72%, transparent);

    /* ── Layout ─────────────────────────────────────────────────────────────── */
    --app-content-width: 1280px;
    /* The estate header (.po-header): a full-width bar at the top, not a floating pill. */
    --app-header-height: var(--po-header-h);
    --app-header-offset: 0px;
    /* The phone bottom nav's height (BottomNav.razor.css, same 768px breakpoint):
       po-tokens.css lifts the .po-version stamp above it by this much. */
    --po-stamp-lift: calc(3.5rem + env(safe-area-inset-bottom, 0px));
    /* Header is position:fixed, so the body must reserve its footprint. */
    --app-header-reserve: calc(var(--app-header-height) + var(--app-header-offset) + 4px);
    /* Space Grotesk for titles, Inter for text: self-hosted by po-tokens.css. */
    --app-headline-font: var(--po-font-display);
    --app-body-font: var(--po-font);

    /* ── Radzen token bridge ──────────────────────────────────────────────────
       Every name below is a variable Radzen's theme actually reads. The previous
       bridge set `--rz-primary-color` and `--rz-primary-hover-color`, neither of
       which exists in the theme — so every Radzen button, badge, and selected tab
       silently kept the theme's stock teal (#598087) instead of the app accent. */
    --rz-primary: var(--app-accent-strong);
    --rz-primary-light: var(--app-accent);
    --rz-primary-lighter: var(--app-accent-wash);
    --rz-primary-dark: var(--app-accent-strong);
    --rz-primary-darker: var(--app-accent-strong);
    --rz-on-primary: var(--app-on-accent);
    /* Radzen's software themes set their own text face (Source Sans Pro) on body and every
       component through this variable; the estate face is Inter. */
    --rz-text-font-family: var(--app-body-font);
    --rz-border-radius: var(--app-radius-lg);
    --rz-grid-cell-color: var(--app-text-muted);
    --rz-body-background-color: var(--app-bg);
    --rz-card-background-color: var(--app-surface);
    --rz-card-border: 1px solid var(--app-border);
    --rz-text-color: var(--app-text);
    --rz-text-secondary-color: var(--app-text-muted);

    /* ── Radzen status palette ────────────────────────────────────────────────
       The bridge above covers `--rz-primary*`, which the theme reads for buttons,
       selected tabs and focused fields. It does NOT cover the four status colours,
       and `.rz-badge-<style>` is written against `--rz-<style>` / `--rz-on-<style>`
       — so every filled badge kept the theme's pastel fill with WHITE text baked on
       top of it, in both schemes (Radzen's badge palette does not follow
       prefers-color-scheme). Measured on the running app before this: "3 actionable"
       and "1 cleanup" at 1.64:1, "AI" / "Current" / "On track" at 2.29:1, "1 security"
       at 2.63:1 — every one of them a WCAG AA failure at 12px, and the worst of them
       the single least legible text in the app.

       A pastel fill is unusable under white text at any size, so the fills are dark
       and the single on-colour stays white. Ratios below are white-on-fill, all above
       the 4.5:1 the 12px badge needs and two of them above AAA's 7:1.

       These are deliberately NOT redefined per scheme. A saturated fill with white
       text is legible on either ground — the badge carries its own contrast — and
       Radzen's light/dark sheets define `--rz-warning` to the same pastel anyway, so
       a per-scheme block would only be a second place to keep in sync. */
    --rz-success: #146c43;          /* white 6.45:1 */
    --rz-on-success: #ffffff;
    --rz-warning: #8a5a00;          /* white 5.93:1 */
    --rz-on-warning: #ffffff;
    --rz-danger: #b0393f;           /* white 5.99:1 */
    --rz-on-danger: #ffffff;
    --rz-info: #2f5aa8;             /* white 6.67:1 */
    --rz-on-info: #ffffff;

    /* Radzen's theme sheet colours bare `h1`..`h6` from its own display tokens, which
       are baked for its dark theme. Left unbridged, every heading that does not set an
       explicit colour renders near-white — invisible against the light-mode surface. */
    --rz-text-title-color: var(--app-text);
    --rz-text-display-h1-color: var(--app-text);
    --rz-text-display-h2-color: var(--app-text);
    --rz-text-display-h3-color: var(--app-text);
    --rz-text-display-h4-color: var(--app-text);
    --rz-text-display-h5-color: var(--app-text);
    --rz-text-display-h6-color: var(--app-text);
    --rz-text-h1-color: var(--app-text);
    --rz-text-h2-color: var(--app-text);
    --rz-text-h3-color: var(--app-text);
    --rz-text-h4-color: var(--app-text);
    --rz-text-h5-color: var(--app-text);
    --rz-text-h6-color: var(--app-text);
}


/* ── Light scheme ────────────────────────────────────────────────────────────
   The theme follows the device only (owner's call, 2026-11-17). The palette itself flips in
   po-tokens.css; only the shadows and the backdrop grid need a light value here. */
@media (prefers-color-scheme: light) {
    :root {
        --app-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
        --app-shadow-md: 0 8px 20px rgba(15, 23, 42, 0.07);
        --app-shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.10);
        --app-shadow-chrome: 0 12px 40px rgba(15, 23, 42, 0.12);
        --app-shadow-chrome-raised: 0 16px 48px rgba(15, 23, 42, 0.18);
    }

    /* On <html>, not <body> — see the note above about negative-z backdrop layers painting
       under an opaque body background. */
    html {
        background: var(--app-bg);
    }


    html body::before {
        background-image:
            linear-gradient(rgba(0, 0, 0, 0.018) 1px, transparent 1px),
            linear-gradient(90deg, rgba(0, 0, 0, 0.018) 1px, transparent 1px);
    }

    html a {
        color: var(--app-accent-strong);
    }
}



html,
body {
    min-height: 100%;
    color: var(--app-text);
}

/* The page colour lives on <html>, and <body> stays transparent. This is load-bearing,
   not tidiness: #app-gpu-backdrop and the body::before grid are both position:fixed with
   NEGATIVE z-index, and in the root stacking context negative-z descendants paint before
   the in-flow block backgrounds of their ancestors. An opaque background on <body>
   therefore paints straight over both backdrop layers — BOTH of them, so neither the GPU
   canvas nor the static grid fallback it degrades to was ever visible. Proven, not
   inferred: with the composite shader forced to solid opaque red, the page still rendered
   plain navy.

   The `!important` is not laziness. Something in the Radzen theme sheets sets an opaque
   background on <body> that a plain `body` rule and even `html body` both lose to; setting
   it from JS required `important` to take effect, which is how this was finally isolated.
   The alternative — lifting the canvas out of negative z-index and giving every piece of
   app chrome an explicit positive one — trades a single scoped declaration for a stacking
   order that silently hides CONTENT the first time an element is missed. This is the
   smaller and more reversible risk of the two. */
html {
    background: var(--app-bg-deep);
}

html body {
    background: transparent !important;
    font-family: var(--app-body-font);
    letter-spacing: 0.01em;
}

/* Static grid backdrop. Acts as the fallback layer when the GPU canvas
   (see #app-gpu-backdrop / gpu-backdrop.js) is unavailable or suppressed by
   prefers-reduced-motion; the canvas sets `data-gpu-backdrop` on <html> to hide it. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
    background-size: 28px 28px;
    -webkit-mask-image: radial-gradient(circle at 50% 30%, black 50%, rgba(0, 0, 0, 0.1) 100%);
    mask-image: radial-gradient(circle at 50% 30%, black 50%, rgba(0, 0, 0, 0.1) 100%);
    opacity: 0.32;
}

html[data-gpu-backdrop] body::before {
    display: none;
}

/* Single full-viewport GPU compositing layer. One surface for the whole app —
   cheaper than the 23 per-card backdrop roots it replaces. */
#app-gpu-backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--app-dur-slow) var(--app-ease-out);
}

#app-gpu-backdrop.is-ready {
    opacity: 1;
}

/* ── Glass surfaces ──────────────────────────────────────────────────────────────
   `data-glass` is an opt-in marker read by js/gpu-backdrop.js, which collects the
   on-screen rect of every tagged element and hands it to the renderer. The shader
   blurs and refracts the backdrop *underneath* those rects — the same effect
   `backdrop-filter` produces, except computed once for the whole page in a pass that
   was already running rather than once per element in its own compositing root. That
   difference is the entire reason the 23 per-card backdrop-filter roots were removed.

   CSS's only job here is to be translucent enough for the result to show. The default
   --app-surface is 92% opaque, which would hide it completely.

   Gated on html[data-gpu-backdrop] so the translucency only applies when a renderer
   actually initialised. Without that gate, a visitor on a machine with no WebGL (or
   with reduced-motion on) would get see-through cards over a flat background — thinner
   contrast bought for no visual effect at all. */
html[data-gpu-backdrop] [data-glass] {
    /* 82% was the effect's ceiling, not its floor: --app-surface is itself ~92% opaque,
       so a tagged card sat at ~75% over a SHADER whose luminance moves every frame —
       small muted text on it had no fixed contrast ratio at all. 88% keeps the refraction
       visible while pinning the worst frame above the AA floor the tokens now guarantee. */
    background: color-mix(in srgb, var(--app-surface) 88%, transparent);
    border-color: var(--app-border-strong);
}

/* Hover lifts the surface back toward opaque. A card being read wants contrast more
   than it wants to be pretty. */
html[data-gpu-backdrop] [data-glass]:hover {
    background: color-mix(in srgb, var(--app-surface) 97%, transparent);
}

/* Belt and braces: the token bridge above covers Radzen's variables, and this rule
   (same specificity, later in the cascade) covers any theme sheet that hardcodes a
   literal colour on bare headings. */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--app-headline-font);
    letter-spacing: -0.025em;
    color: var(--app-text);
}

/* Default sizes from the ladder. Pages override with another step, never with a
   hand-written clamp() — that is what let the two pages' scales cross over. */
h1 { font-size: var(--app-step-5); line-height: 1.05; }
h2 { font-size: var(--app-step-3); line-height: 1.15; }
h3 { font-size: var(--app-step-2); line-height: 1.2; }
h4 { font-size: var(--app-step-1); line-height: 1.25; }

body {
    font-size: var(--app-step-0);
}

a {
    color: var(--app-accent);
}

/* ── Icon font ───────────────────────────────────────────────────────────────────
   Radzen.Blazor already SHIPS the Material Symbols variable font and self-hosts it at
   _content/Radzen.Blazor/fonts/, under the family name "Material Symbols" — that is what
   every <RadzenIcon> in the app has always rendered with. The Google Fonts <link> in
   App.razor was therefore buying nothing but the four bare
   <span class="material-symbols-outlined"> glyphs in MainLayout, and charging the whole
   app for it: a render-blocking third-party stylesheet on the critical path, two extra
   preconnects, and a font request with no `display=swap` — so every icon in the header
   was invisible until a cross-origin round trip finished.

   The family is re-declared here rather than relied on from Radzen's theme sheets because
   those are media-scoped (`prefers-color-scheme`), and an @font-face inside a
   non-matching media context does not apply. This declaration always does — and because it
   comes after the Radzen sheets in App.razor, it also OVERRIDES their declaration of the same
   family, which is what stops the full file being fetched at all.

   The file it points at is a SUBSET, not Radzen's copy. Radzen's ships ~3,600 glyphs in
   1,068,920 bytes; this app draws about thirty of them, so a megabyte sat on the critical
   path of every cold load to deliver roughly 16 KB of glyphs. SCRIPTS/Build-IconFontSubset.py
   rebuilds this file (16,000 bytes) and verifies every ligature the app asks for survived —
   run it after adding an icon, because a name missing from the subset does not degrade to a
   blank box, it renders as the literal WORD in the middle of a button.

   `font-display: block` is right for an icon font and, at 16 KB same-origin, is not the FOIT
   the swap-less Google request was: the block period will not be reached in practice, and a
   swap would flash the ligature TEXT ("monitor_heart") before the glyph arrives. */
@font-face {
    font-family: "Material Symbols";
    src: url("/fonts/material-symbols-subset.woff2") format("woff2-variations"),
         url("/fonts/material-symbols-subset.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 700;
    font-display: block;
}

.material-symbols-outlined {
    font-family: "Material Symbols";
    font-weight: normal;
    font-style: normal;
    font-size: 1.25rem;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: "liga";
    font-feature-settings: "liga";
    -webkit-font-smoothing: antialiased;
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.app-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.app-page {
    width: min(100%, var(--app-content-width));
    margin: 0 auto;
    padding: 0 0 var(--app-space-xl);
    animation: app-fade-in var(--app-dur-slow) var(--app-ease-spring) both;
}

.app-shell-body {
    width: min(100%, calc(var(--app-content-width) + var(--app-space-xl)));
    margin: 0 auto;
    padding: var(--app-space-lg) var(--app-space-md) var(--app-space-xl);
}

/* ── Top bar: the brand upper-left, the settings gear upper-right ────────────
   The estate header (.po-header in po-tokens.css draws the title and the gear). The page
   links were hidden from 2026-10-20 and removed on 2026-10-30. */
.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--app-space-md);
    width: 100%;
    margin: 0;
    padding: 0;
    height: 100%;
}

.app-topbar-brand {
    min-width: 0;
    text-decoration: none;
    /* WCAG 2.2 2.5.8: 24x24 CSS px minimum for a pointer target. The wordmark is one line
       of text, so it measured 169x23 on a phone and 501x23 on a desktop — a 23px-tall band,
       one pixel under the floor, and the only target in the app that failed it. The padding
       is vertical only: horizontal padding would move the wordmark off the shell's left edge. */
    padding-block: 2px;
    align-self: center;
}

.app-topbar-brand:hover {
    color: var(--po-accent);
    text-decoration: none;
}

/* ── Letter fall (js/letter-fall.js) ─────────────────────────────────────────
   The × in the top bar, the overlay the letters fall in, and the page's own text
   going see-through underneath while they are down. */
/* Radzen button (ppk-plain): the four-class selectors outrank the .rz-button.rz-base.ppk-plain reset below. */
.rz-button.rz-base.ppk-plain.app-topbar-drop {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--app-radius-pill);
    background: none;
    color: var(--app-text-soft);
    cursor: pointer;
}
.rz-button.rz-base.ppk-plain.app-topbar-drop:hover { color: var(--app-text); border-color: var(--app-border); }
.rz-button.rz-base.ppk-plain.app-topbar-drop:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 2px; }
.app-topbar-drop .material-symbols-outlined { font-size: 20px; }
@media (prefers-reduced-motion: reduce) { .rz-button.rz-base.ppk-plain.app-topbar-drop { display: none; } }

html.lf-fallen body * {
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
    text-shadow: none !important;
}

.lf-layer {
    position: fixed;
    inset: 0;
    z-index: 10000;
    overflow: hidden;
    cursor: pointer;
    contain: strict;
}

.lf-glyph {
    position: absolute;
    left: 0;
    top: 0;
    text-align: center;
    white-space: pre;
    will-change: transform;
    pointer-events: none;
    user-select: none;
}

/* ── Surfaces ────────────────────────────────────────────────────────────────
   No backdrop-filter here by design — see --app-glass-blur.
*/
.app-card {
    padding: var(--app-space-lg);
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow-md);
}

.app-kicker {
    color: var(--app-text-soft);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: var(--app-step--2);
    font-weight: 700;
}

.app-grid {
    display: grid;
    gap: var(--app-space-md);
}

.app-grid.cards {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.app-grid.cards > * {
    height: 100%;
}

/* Renders directly inside .app-page on Index.razor with no opaque wrapper (.app-card etc.) —
   i.e. straight over the backdrop layer (gpu-backdrop.js). --app-surface-soft is a ~3.5-4% wash meant for nesting inside an
   already-opaque card; used bare, the moving glow could lighten the background enough
   to drop the muted text below AA's 4.5:1 floor at their brightest point. --app-surface (92%+
   opaque in both themes) is the same token every standalone panel in the app already uses. */
.app-empty-state {
    padding: var(--app-space-lg);
    border: 1px dashed var(--app-border-strong);
    border-radius: var(--app-radius-md);
    color: var(--app-text-muted);
    background: var(--app-surface);
}

.app-note {
    color: var(--app-text-soft);
    font-size: var(--app-step--1);
}

/* ── Hint triggers (AppHint.razor) ───────────────────────────────────────────
   The wrapper is deliberately inline and otherwise unstyled: it replaces a bare <span>
   that carried a `title`, so wrapping one of those in a hint must not change the layout it
   sits in — several of them live in flex rows and inside table cells.

   `cursor: help` is the only affordance at rest. A focusable trigger (the ones carrying
   information available nowhere else) additionally gets a dotted underline, so the promise
   that Tab reaches it is visible rather than something a visitor has to discover. The
   `[tabindex]` attribute selector is the switch: the component only emits `tabindex` when
   `Focusable` is set, so this needs no second class to keep in sync. */
.app-hint {
    cursor: help;
}

.app-hint[tabindex] {
    text-decoration: underline dotted;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* Icon-only hint (AppHint with no child content): the glyph is the affordance, so no underline. */
.app-hint--icon {
    display: inline-flex;
    vertical-align: middle;
    color: var(--app-text-soft);
}

.app-hint--icon[tabindex] { text-decoration: none; }
.app-hint--icon .material-symbols-outlined { font-size: 1.1em; }

/* A hint is a sentence or two; without a cap Radzen's tooltip ran the width of the page. */
html .rz-tooltip .rz-tooltip-content { max-width: min(24rem, calc(100vw - 2rem)); white-space: normal; }

.app-hint[tabindex]:focus-visible {
    outline: 2px solid var(--app-accent);
    outline-offset: 2px;
    border-radius: var(--app-radius-sm);
}

/* ── 404 (NotFoundPage.razor) ────────────────────────────────────────────────
   Lives here rather than in a scoped stylesheet because it is the only page whose
   component sits in the API project (it needs a cascaded HttpContext to set the response
   status), and a scoped sheet there would be a second stylesheet for one screen. */
.not-found-card {
    max-width: 46rem;
    margin: var(--app-space-lg) auto;
    padding: var(--app-space-lg);
}

.not-found-card h1 {
    font-size: var(--app-step-3);
    margin: var(--app-space-2xs) 0 var(--app-space-sm);
}

.not-found-card p {
    color: var(--app-text-muted);
    margin: 0 0 var(--app-space-sm);
}

.not-found-path {
    color: var(--app-text);
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    padding: 0 .35rem;
    overflow-wrap: anywhere;
}

.not-found-links {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--app-text-muted);
    line-height: 1.8;
}

.app-progress-icon {
    font-size: 1rem;
    animation: app-spin 1.4s linear infinite;
}

.app-card-title {
    margin: 0;
    font-size: var(--app-step-1);
}

.app-card-copy {
    color: var(--app-text-muted);
    line-height: 1.65;
}


/* ── COMPONENTS: cards, topbar, badges, Radzen token bridge ─────────────── */
/* ═══════════════════════════════════════════════════════════════════════════════
   Radzen component skinning. Every value resolves from a token in modern-ui.base.css.

   Removed in the 2026 hygiene pass:
     • .rz-tabview / .rz-tabs skin — no page uses a Radzen tab component.
     • 26 unused .app-* utility classes (app-glow, app-stat*, app-surface, app-panel,
       app-table-frame, app-chip-row, app-badge-*, app-section*, app-break, app-nowrap,
       app-overflow-top, app-grid-span-all, app-meta-line, app-link-break,
       app-inline-link, app-muted, app-portfolio-github-card, app-display, app-title).
     • .rz-chart's own border/background — it nested inside bordered containers and
       produced concentric double borders. Containers own the frame now.
   ═══════════════════════════════════════════════════════════════════════════════ */

.app-page .rz-button {
    border-radius: var(--app-radius-pill);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.app-page .rz-button.rz-primary {
    box-shadow: var(--app-shadow-accent);
}

.app-page .rz-badge {
    letter-spacing: 0.02em;
}

/* A `.rz-badge-danger.rz-variant-fill` rule used to sit here, darkening the danger
   fill so white text cleared 4.5:1. It never applied: Radzen emits `rz-variant-filled`
   and `.rz-shade-default`, never `rz-variant-fill`, so the selector matched nothing and
   the badge it was written for measured 2.63:1 on the live page. Its comment ("looks
   unreferenced to a static grep — it is not") made it look verified.
   The fix now lives in the token block as `--rz-<status>` / `--rz-on-<status>`, which is
   where Radzen's own rule reads its colours from — one place, all four statuses, no
   selector to get wrong. Do not re-add a per-style badge override. */

/* ── Charts ──────────────────────────────────────────────────────────────────
   Frameless: the surrounding .app-card / <article> supplies border + radius.
*/
.app-page .rz-chart {
    padding: var(--app-space-xs);
    background: transparent;
    border: 0;
}

/* A legend item is a real control — Radzen renders it as
   `<span role="button" tabindex="0">`, and clicking one hides that series — but with no
   padding it measured 116x20px, under the 24x24 WCAG 2.2 2.5.8 floor and the smallest
   interactive thing in the app. Padding rather than margin: it grows the hit area without
   moving the legend, and the row the legend occupies is already counted in the chart's
   height. */
.app-page .rz-chart .rz-legend-item {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: var(--app-space-3xs) var(--app-space-2xs);
}

/* ── Data grid ───────────────────────────────────────────────────────────── */
.app-page .rz-datatable,
.app-page .rz-data-grid {
    border-radius: var(--app-radius-xl);
    overflow: hidden;
    border: 1px solid var(--app-border);
    background: var(--app-surface-soft);
}

.app-page .rz-datatable table,
.app-page .rz-data-grid table {
    background: transparent;
}

.app-page .rz-column-title,
.app-page .rz-sortable-column {
    color: var(--app-text);
    font-weight: 700;
}

.app-page .rz-cell-data,
.app-page .rz-datatable-data td,
.app-page .rz-data-grid-data td {
    color: var(--app-text-muted);
}

.app-page .rz-datatable-thead th,
.app-page .rz-data-grid-header th {
    background: var(--app-hover-wash);
    border-color: var(--app-border);
}

.app-page .rz-datatable-even,
.app-page .rz-data-grid-data tr:nth-child(even) {
    background: var(--app-surface-soft);
}

.app-page .rz-paginator {
    background: var(--app-surface-soft);
    border-top: 1px solid var(--app-border);
}

.app-page .rz-progressbar {
    border-radius: var(--app-radius-pill);
    overflow: hidden;
}

/* ── KPI tiles, disclosures, tables ──────────────────────────────────────────
   Shared by /azure and /users. Each used to be written twice, once per page stylesheet
   (`.azure-command-kpis` / `.signins-kpis`, `.azure-disclosure` / `.signin-disclosure`,
   and `.signin-table` with the resource explorer as cards beside it), and the copies had
   already drifted: different number sizes, different corner radii, different heading
   padding for the same <details> shape. A page stylesheet now carries only what is
   genuinely page-specific — and because those are scoped rules at (0,3,0), they still win
   over these (0,1,x) ones wherever a page needs to differ. */
.app-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--app-space-xs);
}

.app-kpis > div {
    display: grid;
    gap: .15rem;
    align-content: start;
    min-width: 0;
    padding: var(--app-space-sm);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: var(--app-surface-soft);
}

.app-kpis strong {
    font-size: var(--app-step-2);
    color: var(--app-text);
    overflow-wrap: anywhere;
}

.app-kpis span {
    font-size: var(--app-step--2);
    color: var(--app-text-soft);
}

.app-disclosure {
    /* Lets the body's overflow-x contain a chart or table instead of it widening the page. */
    min-width: 0;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
}

.app-disclosure__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--app-space-xs);
    padding: var(--app-space-xs) var(--app-space-sm);
    cursor: pointer;
    list-style: none;
}

.app-disclosure__heading::-webkit-details-marker { display: none; }

.app-disclosure__heading > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}

/* Pinned: the title is a real heading, and Radzen's theme sheet sizes bare h1..h6 from its
   own display tokens, so without this a disclosure title jumps to the theme's h2 size. */
.app-disclosure__title {
    margin: 0;
    font-family: var(--app-headline-font);
    font-size: var(--app-step-0);
    font-weight: 600;
    letter-spacing: -.01em;
}

/* minmax(0, 1fr): an `auto` track is floored at its widest child's min-content width, so a
   chart legend or a wide table would size the track past the body instead of scrolling
   inside it. */
.app-disclosure__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--app-space-xs);
    padding: 0 var(--app-space-sm) var(--app-space-sm);
    overflow-x: auto;
}

/* A table's ONE permitted sideways scroll. The rule the app holds to is that the page BODY
   never scrolls horizontally; a per-table container is the escape hatch it allows. The
   element carries tabindex="0" + role="group" so a keyboard can reach what is off-screen. */
/* Segmented choice: a row of pill buttons, one `is-active`, each with aria-pressed. The /users
   window picker and every /settings row. */
.app-segmented {
    display: flex;
    gap: var(--app-space-3xs);
    flex-wrap: wrap;
}

/* ── Outlined RadzenAlert (ErrorRetryBanner): words in the text colour ──
   Radzen colours an outlined alert's text with --rz-<style>, and those are the dark fills tuned for white
   badge text above. On the dark-mode page the warning banner ("The app list could not be loaded") read
   3.21:1. The words take --app-text in both schemes; the border and icon keep the status colour. */
.rz-alert.rz-variant-outlined .rz-alert-content,
.rz-alert.rz-variant-outlined .rz-alert-message,
.rz-alert.rz-variant-outlined .rz-alert-title {
    color: var(--app-text);
}

/* ── Radzen buttons with a bespoke look (owner decision 2026-11-21: every control is a Radzen one) ──
   ButtonStyle.Base + Variant.Flat + class "ppk-plain" strips the theme back to a bare button (no fill,
   padding, size floor or type scale; the hover/focus gradients are switched off through Radzen's own
   variables). The bespoke class then styles it as before: in a scoped stylesheet as
   `.<page> ::deep .<class>` (or `.rz-button.<class>`), which outranks this reset by load order. */
.rz-button.rz-base.ppk-plain {
    --rz-button-hover-gradient: none;
    --rz-button-active-gradient: none;
    --rz-button-focus-gradient: none;
    --rz-button-hover-shadow: none;
    --rz-button-active-shadow: none;
    --rz-button-focus-shadow: none;
    min-width: 0;
    min-height: 0;
    height: auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    text-align: inherit;
    vertical-align: middle;
}

.rz-button.ppk-plain > .rz-button-box {
    display: contents;
}

.rz-button.ppk-plain.app-segmented__btn {
    border: 1px solid var(--app-border);
    background: var(--app-surface-soft);
    color: var(--app-text-muted);
    border-radius: var(--app-radius-pill);
    padding: .3rem .8rem;
    font: inherit;
    font-size: var(--app-step--1);
    cursor: pointer;
    transition: background var(--app-dur-fast) var(--app-ease-out),
                color var(--app-dur-fast) var(--app-ease-out);
}

.rz-button.ppk-plain.app-segmented__btn:hover:not(:disabled) {
    background: var(--app-hover-wash);
    color: var(--app-text);
}

.rz-button.ppk-plain.app-segmented__btn.is-active {
    background: var(--app-accent-wash-strong);
    border-color: var(--app-accent-edge);
    color: var(--app-text);
}

.rz-button.ppk-plain.app-segmented__btn:disabled {
    opacity: .55;
    cursor: default;
}

.app-table-scroll {
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.app-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--app-step--1);
}

.app-table th,
.app-table td {
    text-align: left;
    padding: var(--app-space-2xs) var(--app-space-xs);
    border-bottom: 1px solid var(--app-border);
    vertical-align: top;
    white-space: nowrap;
}

.app-table thead th {
    color: var(--app-text-soft);
    font-size: var(--app-step--2);
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.app-table tbody tr:last-child th,
.app-table tbody tr:last-child td {
    border-bottom: 0;
}

.app-table tbody tr:hover {
    background: var(--app-hover-wash);
}

.app-table .is-numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* AppDrawer: Radzen's side dialog (CssClass app-drawer) pinned to the right edge — full screen on a
   phone, where min() resolves to 100vw. Fully opaque — the surface tone laid over the page colour — so
   the page never ghosts through the panel. */
.rz-dialog-side.app-drawer {
    max-width: 100vw;
    border-left: 1px solid var(--app-border-strong);
    background: linear-gradient(var(--app-surface-strong), var(--app-surface-strong)) var(--app-bg);
    color: var(--app-text);
    box-shadow: var(--app-shadow-lg);
}

.rz-dialog-side.app-drawer .rz-dialog-side-titlebar {
    border-bottom: 1px solid var(--app-border);
    background: transparent;
}

.rz-dialog-side.app-drawer .rz-dialog-side-title {
    margin: 0;
    color: var(--app-text);
    font-family: var(--app-headline-font);
    font-size: var(--app-step-2);
    letter-spacing: -.02em;
}

.rz-dialog-side.app-drawer .rz-dialog-side-content {
    padding: 0;
    overscroll-behavior: contain;
}

/* The page-side wrapper (see AppDrawer.razor): it carries .app-page for the page's shared rules, minus
   the page's own width, centring, bottom padding and entrance animation. */
.app-drawer__body.app-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--app-space-md);
    width: auto;
    margin: 0;
    padding: var(--app-space-md);
    animation: none;
}


.app-page code {
    font-family: Consolas, "Cascadia Code", monospace;
    background: var(--app-hover-wash);
    padding: 0.12rem var(--app-space-2xs);
    border-radius: var(--app-radius-sm);
}

/* ── Floating navbar ─────────────────────────────────────────────────────────
   The one place glassmorphism is affordable: a single backdrop root for the whole
   app chrome. Only `transform` is transitioned — animating background-color on a
   backdrop-filter element repaints the blur every frame.
*/
.rz-header {
    /* Full-width estate header (Po web standard, 2026-11-18): it was a floating pill
       centred at the content width. Fixed rather than the kit's sticky, because Radzen's
       layout grid would otherwise lay it out; .rz-body reserves its height. */
    position: fixed !important;
    top: 0;
    left: 0;
    transform: none;
    width: 100% !important;
    height: var(--app-header-height) !important;
    border-radius: 0;
    border: 0 !important;
    border-bottom: 1px solid var(--po-border) !important;
    background: var(--po-surface) !important;
    box-shadow: none !important;
    z-index: var(--app-z-header);
    will-change: transform;
    transition: transform var(--app-dur-slow) var(--app-ease-out),
                box-shadow var(--app-dur-base) var(--app-ease-smooth) !important;
}

.rz-header.nav-hidden {
    transform: translateY(-110%);
}

.rz-header.nav-scrolled {
    box-shadow: var(--po-shadow) !important;
}

/* ── Radzen layout overrides ─────────────────────────────────────────────────
   Covers: sidebar-column removal, the transparent chrome that lets the GPU backdrop
   show through, and the scroll-trap fix that lets the page scroll naturally instead
   of .rz-body.

   Radzen's default .rz-layout is a two-column grid:
       grid-template-columns: auto 1fr;
       grid-template-areas: "rz-header rz-header" "rz-sidebar rz-body" "rz-footer rz-footer";
   This app has no sidebar. Collapsing the columns to one WITHOUT also redefining the
   areas leaves a 2-column area map against a 1-column track list — the map is dropped
   and .rz-body's `grid-area: rz-body` resolves against implicit lines, pushing the
   whole page into a phantom right-hand column. Both must be overridden together.
   (This used to be an inline `Style` on <RadzenLayout>.)
*/
.rz-layout {
    min-height: 100dvh;
    height: auto;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto 1fr !important;
    grid-template-areas: "rz-header" "rz-body" !important;
    /* Transparent so the fixed GPU backdrop behind the layout stays visible. */
    background: transparent !important;
}

.rz-body {
    width: 100%;
    min-width: 0;
    padding-top: var(--app-header-reserve) !important;
    background: transparent !important;
    overflow-y: visible !important;
    height: auto !important;
    min-height: 0 !important;
}

@media (max-width: 640px) {
    .rz-body {
        margin-left: 0 !important;
        padding-left: 0 !important;
        grid-column: 1 !important;
    }

    /* Charts stay readable on narrow viewports without forcing a page-level scroll. */
    .app-card:has(.rz-chart) {
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .app-card .rz-chart svg text {
        font-size: var(--app-step--2);   /* was 10px, below the 0.76rem floor */
    }
}


/* ── RESPONSIVE: breakpoint overrides for both of the above ─────────────── */
/* ═══════════════════════════════════════════════════════════════════════════════
   Theme flip, viewport adaptation, and the app's two keyframes.
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Density ─────────────────────────────────────────────────────────────────────
   The single dial. One declaration compacts every gap, pad and inset in the app,
   because the whole spacing scale is derived from it (see --app-density in the token
   block). Type is NOT scaled here — the fluid ladder already shrinks with the viewport,
   and multiplying the two would compound into unreadable text.

   One step: 640px covers phones (0.78). Every wider screen keeps the compact base 0.82
   (po-tokens.css) — an 820px step to 0.9 went 2026-11-17, because with Density fixed at
   Compact it would have made tablets LESS compact than the setting promises. These replace
   the per-component `padding: .5rem` / `gap: .35rem` overrides that used to be repeated in
   every breakpoint of every stylesheet. */

@media (max-width: 640px) {
    :root {
        --app-density: 0.78;
    }

    .app-shell-body,
    .app-page {
        padding-left: var(--app-space-2xs);
        padding-right: var(--app-space-2xs);
    }

    /* The catalog page's own bottom padding is dead space above the fold on a phone;
       the last card already has the grid gap under it. */
    .app-shell-body {
        padding-bottom: var(--app-space-md);
    }
}

/* ── Panes ───────────────────────────────────────────────────────────────────────
   One question per section of /azure, stacked and scrolled ordinarily at every width. A
   phone used to PAGE them — a scroll-snap container one viewport tall, a pane per screen,
   injected dots — until 2026-10-19: each pane had to fill a whole screen, so "Needs
   attention" was ~150px of content in a 756px box, the hero sat centred under 230px of
   nothing, and four screens of paging held what fits in two of scrolling. */
.app-pane {
    display: grid;
    align-content: start;
    gap: var(--app-space-md);
    /* A grid item defaults to `min-width: auto`, i.e. it refuses to shrink below the
       min-content width of its subtree. One wide descendant then forces the pane wider than
       the page and everything overflows sideways together. This is the same footgun
       `minmax(0, 1fr)` exists to defuse in the track list, and it has to be defused on the
       ITEM as well. */
    min-width: 0;
}

/* Same defusal one level down. A pane's children are grid items too, so a single wide
   descendant - the 30-column uptime grid is the one that actually did this - would set the
   card's min-content width and drag the whole pane past the viewport with it. */
.app-pane > * {
    min-width: 0;
}


/* ── Command Palette (Cmd+K) ─────────────────────────────────────────────── */
.app-palette-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}

.app-palette-backdrop.is-open {
    display: flex;
}

/* Over a live GPU backdrop the dim is lighter and barely blurred, so the lens that
   gpu-backdrop.js draws toward the open palette reads through it. */
html[data-gpu-backdrop] .app-palette-backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* The header brand morphs into the new page's h1 when the palette navigates. */
::view-transition-group(app-jump) {
    animation-duration: 560ms;
    animation-timing-function: var(--app-ease-bounce, ease-out);
}

.app-palette-modal {
    width: min(600px, 92vw);
    background: var(--app-surface-strong);
    border: 1px solid var(--app-border-strong);
    border-radius: var(--app-radius-xl);
    box-shadow: var(--app-shadow-lg);
    overflow: hidden;
    animation: app-palette-drop 160ms var(--app-ease-out) both;
}

@keyframes app-palette-drop {
    from { opacity: 0; transform: translateY(-16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.app-palette-header {
    display: flex;
    align-items: center;
    gap: var(--app-space-xs);
    padding: var(--app-space-sm) var(--app-space-md);
    border-bottom: 1px solid var(--app-border);
}

.app-palette-search-icon {
    color: var(--app-text-muted);
}

.app-palette-input {
    flex: 1 1 auto;
    background: transparent;
    border: 0;
    outline: none;
    font-size: 1rem;   /* literal on purpose: iOS zooms into any input under 16px */
    color: var(--app-text);
}

.app-palette-kbd {
    font-size: var(--app-step--2);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--app-border);
    background: var(--app-surface-soft);
    color: var(--app-text-muted);
}

.app-palette-list {
    max-height: 340px;
    overflow-y: auto;
    padding: var(--app-space-2xs);
}

.app-palette-item {
    display: flex;
    align-items: center;
    gap: var(--app-space-sm);
    padding: var(--app-space-sm);
    border-radius: var(--app-radius-md);
    cursor: pointer;
    transition: background-color var(--app-dur-fast) var(--app-ease-smooth);
}

.app-palette-item.is-active,
.app-palette-item:hover {
    background: var(--app-accent-wash);
}

.app-palette-item-icon {
    font-size: 1.2rem;
    color: var(--app-accent);
}

.app-palette-item-title {
    flex: 1 1 auto;
    font-size: var(--app-step-0);
    color: var(--app-text);
}

.app-palette-item-category {
    font-size: var(--app-step--2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--app-text-soft);
}

.app-palette-empty {
    padding: var(--app-space-lg);
    text-align: center;
    color: var(--app-text-muted);
    font-size: var(--app-step--1);
}

/* ── Mobile safe area & touch compliance (Audit #22) ───────────────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
    .app-page {
        /* The Po rule: main keeps a stamp-high gap so the fixed .po-version badge never covers content. */
        padding-bottom: calc(var(--po-space-6) + env(safe-area-inset-bottom));
        padding-left: max(var(--app-space-md), env(safe-area-inset-left));
        padding-right: max(var(--app-space-md), env(safe-area-inset-right));
    }
}

.rz-button.ppk-plain.app-segmented__btn,
.rz-button {
    min-height: 38px;
    touch-action: manipulation;
}

@media (max-width: 640px) {
    .rz-button.ppk-plain.app-segmented__btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* The .po-version stamp never sits on content (2026-11-21: it covered /diag cards and app rows
   as they scrolled past it).
   - Wider than a phone it stays fixed lower-right, and the content column leaves it an 88px
     gutter on each side (11rem in all), so nothing can scroll under it.
   - On a phone it is no longer fixed: it is the last thing in the page flow, lower-right, lifted
     above the fixed bottom nav by --po-stamp-lift, so it is seen at the end of every page and
     never floats over a card. The shell keeps only its ordinary bottom padding. */
@media (min-width: 769px) {
    .app-shell-body {
        width: min(100%, calc(var(--app-content-width) + var(--app-space-xl)), calc(100vw - 11rem));
    }
}

@media (max-width: 768px) {
    .app-shell-body {
        padding-bottom: var(--app-space-md);
    }

    .po-version {
        position: static;
        display: block;
        width: fit-content;
        margin: 0 max(var(--po-space-3), env(safe-area-inset-right, 0px)) calc(var(--po-space-3) + var(--po-stamp-lift, 0px)) auto;
        opacity: 1;
    }
}



