/* Manual compatibility layer only. */
/* Authoritative theme tokens are generated into _content/AppPlatform.DesignTokens/css/tokens.generated.css. */

:root {
  /* Explicit allowlisted manual token (large data URI not yet moved into JSON source). */
  --ap-mask-warning-icon: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDg2IDY2LjAxODMgMjYzLjU4NiA2Ni4wMTgzIE0yNjMuNTc2IDg2LjA1NDdDMjYxLjA0OSA4Ni4wNTQ3IDI1OS43ODYgODcuMzAwNSAyNTkuNzg2IDg5Ljc5MjEgMjU5Ljc4NiA5Mi4yODM3IDI2MS4wNDkgOTMuNTI5NSAyNjMuNTc2IDkzLjUyOTUgMjY2LjExNiA5My41Mjk1IDI2Ny4zODcgOTIuMjgzNyAyNjcuMzg3IDg5Ljc5MjEgMjY3LjM4NyA4Ny4zMDA1IDI2Ni4xMTYgODYuMDU0NyAyNjMuNTc2IDg2LjA1NDdaIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L2c+PC9zdmc+");
}

/* === RadzenButton — spacing === */
/* Moved from app.css: .rz-* overrides belong in this file per CSS architecture */
.rz-button { margin-block: var(--ap-space-1); }
.ap-form-actions .rz-button { margin-block: 0; }

/* === RadzenButton — transitions, focus ring, disabled state (AC-03, AC-04) === */
.rz-button,
.rz-button:hover,
.rz-button:active {
    transition:
        background-color var(--ap-motion-duration-base) var(--ap-motion-ease-standard),
        opacity var(--ap-motion-duration-fast) var(--ap-motion-ease-standard);
    background-image: none !important;
}

.rz-button:focus-visible {
    outline: var(--ap-focus-ring-width) solid var(--ap-focus-ring-color);
    outline-offset: var(--ap-focus-ring-offset);
    background-image: none !important;
}

.rz-button:focus,
.rz-button.rz-state-focused {
    background-image: none !important;
}

.rz-button .rz-button-box,
.rz-button .rz-button-text,
.rz-button .rz-button-icon-left,
.rz-button .rz-button-icon-only,
.rz-button .rzi,
.rz-button i {
    background-image: none !important;
}

.rz-button.rz-variant-filled.rz-primary,
.rz-button.rz-variant-filled.rz-primary.rz-shade-default,
.rz-button.rz-variant-filled.rz-primary:hover,
.rz-button.rz-variant-filled.rz-primary:active,
.rz-button.rz-variant-filled.rz-primary:focus,
.rz-button.rz-variant-filled.rz-primary.rz-state-focused {
    color: var(--ap-text-on-accent) !important;
}

.rz-button.rz-variant-filled.rz-primary .rz-button-box,
.rz-button.rz-variant-filled.rz-primary .rz-button-text,
.rz-button.rz-variant-filled.rz-primary .rz-button-icon-left,
.rz-button.rz-variant-filled.rz-primary .rz-button-icon-only,
.rz-button.rz-variant-filled.rz-primary .rzi,
.rz-button.rz-variant-filled.rz-primary i {
    color: var(--ap-text-on-accent) !important;
}

.rz-button.rz-variant-filled.rz-danger,
.rz-button.rz-variant-filled.rz-danger.rz-shade-default,
.rz-button.rz-variant-filled.rz-danger:hover,
.rz-button.rz-variant-filled.rz-danger:active,
.rz-button.rz-variant-filled.rz-danger:focus,
.rz-button.rz-variant-filled.rz-danger.rz-state-focused {
    background-color: var(--ap-action-danger-filled-bg) !important;
    color: var(--ap-text-on-accent) !important;
    border-color: var(--ap-action-danger-filled-border) !important;
}

.rz-button.rz-variant-filled.rz-danger .rz-button-box,
.rz-button.rz-variant-filled.rz-danger .rz-button-text,
.rz-button.rz-variant-filled.rz-danger .rz-button-icon-left,
.rz-button.rz-variant-filled.rz-danger .rz-button-icon-only,
.rz-button.rz-variant-filled.rz-danger .rzi,
.rz-button.rz-variant-filled.rz-danger i {
    color: var(--ap-text-on-accent) !important;
}

/* Radzen uses --rz-danger for both fills and text. The bridge assigns its fill
   role to the existing solid-danger pair; these transparent/text roles retain the
   semantic error foreground. Do not redefine --rz-danger on these elements: that
   inherited variable would recolor a nested filled badge back to the text color. */
.rz-variant-outlined:is(.rz-button.rz-danger, .rz-badge-danger, .rz-chip-danger).rz-shade-default,
.rz-variant-text:is(.rz-button.rz-danger, .rz-badge-danger, .rz-chip-danger).rz-shade-default,
.rz-timeline-point-outlined:is(.rz-timeline-point-danger, .rz-timeline-point-error),
.rz-timeline-point-text:is(.rz-timeline-point-danger, .rz-timeline-point-error),
.rz-color-danger,
.rzi-danger,
.rzi-error,
.invalid ~ .rz-form-field-label,
.rz-spreadsheet-validation-error-message,
.rz-spreadsheet-cell-error {
    color: var(--ap-semantic-error) !important;
}

.rz-variant-outlined:is(.rz-button.rz-danger, .rz-badge-danger, .rz-chip-danger).rz-shade-default {
    border-color: var(--ap-semantic-error);
    box-shadow: inset 0 0 0 var(--rz-border-width) var(--ap-semantic-error);
}

/* Hover/active must keep the same pair, rather than a fixed Radzen red on a
   translucent primitive. The page surface is an existing theme-owned role. */
:is(.rz-variant-outlined, .rz-variant-text):is(.rz-button.rz-danger, .rz-chip-danger).rz-shade-default:not(.rz-state-disabled):is(:hover, :active) {
    background-color: var(--ap-bg-page);
}

.rz-timeline-point-outlined:is(.rz-timeline-point-danger, .rz-timeline-point-error),
.rz-timeline-point-text:is(.rz-timeline-point-danger, .rz-timeline-point-error) {
    background-color: var(--ap-bg-elevated);
    border-color: var(--ap-semantic-error);
}

.rz-button.rz-state-disabled {
    opacity: var(--ap-state-disabled-opacity);
    cursor: not-allowed;
}

/* === RadzenFormField — container layout (AC-01) === */
.rz-form-field {
    width: 100%;
    margin-bottom: var(--ap-space-4);
}

/* === RadzenFormField — field surface (D-4 semantic-first, AC-04/AC-29) ===
   Inside a form field Radzen makes the <input> transparent
   (`.rz-form-field-content input`, specificity 0,1,1, beats `.rz-textbox`), so the
   `.rz-textbox` background below paints nothing there. The visible surface is
   `.rz-form-field-content`, which reads --rz-input-background-color and its hover and
   focus siblings. Bind those three here, in the same var(<semantic>, <primitive>) form
   as `.rz-textbox`, so an overridden --ap-bg-page reaches the rendered field.
   The text variant sets the three to transparent on `.rz-form-field-content` itself
   (a nearer declaration than this inherited one), so it stays transparent. */
.rz-form-field {
    --rz-input-background-color: var(--ap-bg-page, var(--ap-surface));
    --rz-input-hover-background-color: var(--ap-bg-page, var(--ap-surface));
    --rz-input-focus-background-color: var(--ap-bg-page, var(--ap-surface));
}

/* === RadzenFormField — floating label (AC-01) === */
.rz-form-field-label,
.rz-form-field .rz-form-field-label,
.rz-form-field .rz-form-field-label.rz-text-truncate {
    font-size: var(--ap-text-sm);
    font-weight: 600;
    color: var(--ap-text-primary);
}

.rz-form-field.rz-variant-filled > .rz-form-field-content > :not(.rz-state-empty):not(.rz-form-field-start):not(.rz-form-field-end) ~ .rz-form-field-label,
.rz-form-field.rz-variant-flat > .rz-form-field-content > :not(.rz-state-empty):not(.rz-form-field-start):not(.rz-form-field-end) ~ .rz-form-field-label,
.rz-form-field.rz-state-focused .rz-form-field-label,
.rz-form-field:not(.rz-floating-label) .rz-form-field-label,
.rz-form-field .rz-form-field-content > :not(.rz-state-empty):not(.rz-form-field-start):not(.rz-form-field-end) ~ .rz-form-field-label {
    color: var(--ap-text-primary) !important;
}

/* === RadzenTextBox / RadzenPassword — input appearance (AC-01) === */
/* .rz-textbox is the <input> for both RadzenTextBox and RadzenPassword.
   It previously said the password input sat inside a .rz-password-icon-wrapper,
   "confirmed from Radzen 10.0.5 CSS patterns" — the rendered-DOM baseline shows
   11.1.4 renders no such element, so the claim and the rule that acted on it are
   both gone (spec section 7.2). */
/* D-4 (spec section 9 item 16, PO option (a) 2026-07-22): the four in-category
   raw-primitive bindings take .rz-alert's defensive fallback form
   var(<semantic>, <primitive>), so the OVERRIDABLE token wins when a theme sets one
   and the primitive remains the fallback. Binding the primitive alone let a
   selector match while carrying a value no theme could move — which AC-04 cannot
   catch, because it asserts matching and not overridability. AC-29 binds this. */
.rz-textbox {
    background-color: var(--ap-bg-page, var(--ap-surface));
    /* Control boundary — WCAG 1.4.11 requires >= 3:1, so this takes the STRONG
       tier. The recessive --ap-border-default is for decorative rules only. */
    border: 1px solid var(--ap-border-strong);
    border-radius: var(--ap-radius-md);
    padding: var(--ap-space-2) var(--ap-space-3);
    font-size: var(--ap-text-base);
    color: var(--ap-text-primary);
    width: 100%;
    box-sizing: border-box;
    transition: border-color var(--ap-motion-duration-base) var(--ap-motion-ease-standard);
}

/* Focus: override Radzen's inset box-shadow with design-system outline ring (AC-02) */
.rz-textbox:not(:disabled):not(.rz-state-disabled):focus {
    border-color: var(--ap-primary);
    outline: var(--ap-focus-ring-width) solid var(--ap-focus-ring-color);
    outline-offset: var(--ap-focus-ring-offset);
    box-shadow: none;
}

/* === RadzenDataGrid — table appearance (AC-05) === */
.rz-datatable {
    border: 1px solid var(--ap-border-default);
    border-radius: var(--ap-radius-md);
    overflow: hidden;
}

/* Radzen 10 renders the grid as `table.rz-grid-table` with an UNCLASSED <thead>;
   the legacy `.rz-datatable-thead` selector matches nothing, so these header rules
   silently never applied. Target the real DOM (`.rz-grid-table thead`). */
.rz-grid-table thead {
    background-color: var(--ap-bg-surface);
    border-bottom: 1px solid var(--ap-border-default);
}

.rz-datatable .rz-grid-table thead th {
    background-color: var(--ap-bg-surface);
    color: var(--ap-text-primary);
    border-color: var(--ap-border-default);
}

.rz-data-row {
    border-bottom: 1px solid var(--ap-surface-border);
    transition: background-color var(--ap-motion-duration-base) var(--ap-motion-ease-standard);
}

.rz-datatable .rz-grid-table tbody tr > td {
    background-color: var(--ap-bg-surface);
    color: var(--ap-text-primary);
    border-color: var(--ap-border-default);
}

.rz-datatable .rz-grid-table tbody tr:nth-child(even) > td {
    background-color: var(--ap-bg-page);
}

/* Row hover. This MUST stay after the even-row stripe above: both rules have the
   same specificity (0,3,3), so the later one wins, and a hover rule declared first
   left every hovered even row at the stripe colour. */
.rz-data-row:hover,
.rz-datatable .rz-grid-table tbody tr:hover > td {
    background-color: var(--ap-primary-subtle);
}

/* Vertical padding only. Radzen's own td already pads 16 px on the inline axis, and
   an extra inline padding here pushed every grid's cell text 12 px to the right of
   its column header text (#3736). */
.rz-cell-data {
    padding: var(--ap-space-2) 0;
    font-size: var(--ap-text-sm);
    color: var(--ap-text-primary);
}

/* Finding P-5 (re-fixed): data-grid column headers were near-illegible — the
   `.rz-column-title` span carries a hard-coded light-theme colour (#212121) while
   body cells correctly resolve --ap-text-primary. The original fix used the
   `.rz-datatable-thead` selector, which does NOT exist in Radzen 10's DOM
   (confirmed via live computed-style inspection: header colour stuck at #212121 on
   the dark surface). Re-target the actual `.rz-grid-table thead` structure and pin
   the title span to the primary token — theme-agnostic, since the token flips
   per light/dark. */
.rz-grid-table thead th,
.rz-grid-table thead .rz-column-title,
.rz-grid-table thead .rz-column-title-content,
.rz-datatable .rz-grid-table thead th .rz-column-title,
.rz-datatable .rz-grid-table thead th .rz-column-title-content {
    color: var(--ap-text-primary);
}

.rz-grid-table thead .rz-column-title {
    font-weight: 600;
}

.rz-datatable .rz-grid-table thead th .rz-grid-filter-icon,
.rz-datatable .rz-grid-table thead th button.rz-grid-filter-icon,
.rz-datatable .rz-grid-table thead th .rzi {
    color: var(--ap-text-secondary);
}

.rz-pager .rz-pager-page.rz-state-active,
.rz-pager .rz-pager-element.rz-state-active {
    background-color: var(--ap-primary-subtle);
    color: var(--ap-primary-on-subtle);
    border-color: var(--ap-primary-on-subtle);
}

/* rz-data-grid-loading and rz-grid-loading were removed rather than re-pointed
   (spec section 7.2): 11.1.4 emits neither, and both identifiers Radzen DOES emit
   for this state are already in this rule, so the two were redundant rather than
   wrong. Re-pointing would have produced a duplicate. */
.rz-datatable-loading,
.rz-datatable-loading-content {
    pointer-events: none;
}

/* Finding P-5b: Radzen's "Light" secondary button (ButtonStyle.Light — e.g. the
   admin grid's "Bearbeiten"/Edit button) styles itself with a fixed light fill
   (--rz-base-200 ≈ #eeeeee) plus --rz-text-color, which the token sheet maps to
   the dark-theme light text — light-grey text on a light-grey fill (~1.16:1,
   fails WCAG AA). --rz-base-200 is never remapped, so pin the Light button onto
   the design-system surface tokens so foreground/background always pair
   correctly (~10.9:1 dark / ~16:1 light). Mirrors the tour app's T-1 fix. */
.rz-button.rz-light {
    /* D-4 semantic-first — see the note above .rz-textbox. */
    background-color: var(--ap-bg-elevated, var(--ap-surface-elevated));
    color: var(--ap-text-primary);
    /* Control boundary — WCAG 1.4.11 requires >= 3:1, so this takes the STRONG
       tier. The recessive --ap-border-default is for decorative rules only. */
    border: 1px solid var(--ap-border-strong);
}

.rz-button.rz-light:hover {
    /* D-4 semantic-first — see the note above .rz-textbox. */
    background-color: var(--ap-bg-page, var(--ap-surface));
    color: var(--ap-text-primary);
}

/* Finding P-5c (SystemOK theme-selector sweep, SHA 892a67c1): the P-5b fix above
   covers the FILLED Light button (.rz-button.rz-light), but Radzen colours the
   TEXT variant with a separate, higher-specificity rule —
   `.rz-button.rz-variant-text.rz-light { color: var(--rz-base-200) }` (#eeeeee).
   The ThemeToggle icon button ships exactly this class set
   (`rz-button rz-button-md rz-variant-text rz-light`, see
   AppPlatform.Shared.UI/Components/Layout/ThemeToggle.razor), so its icon glyph
   rendered #eeeeee — 1.16:1 on the light `--ap-bg-surface` the ThemeToggle sits
   on (the header user-dropdown panel AND the Showroom theme-selector exhibit
   preview frame both paint --ap-bg-surface). --rz-base-200 is a fixed Radzen base
   primitive that never flips per theme, so the glyph was near-invisible in light
   theme. Pin the text-variant Light foreground to the theme-aware primary text
   token (keeping the variant's transparent fill) so the icon pairs correctly in
   BOTH bases (#212121 on #ffffff ≈ 16:1 light / #E0E0E0 on #2d2d2d ≈ 11.9:1 dark).
   Specificity 0,3,0 matches Radzen's own rule and this sheet loads after
   material-base.css, so the later, equal-specificity rule wins the cascade. */
.rz-button.rz-variant-text.rz-light {
    color: var(--ap-text-primary);
}

.rz-button.rz-variant-text.rz-light:not(.rz-state-disabled):hover,
.rz-button.rz-variant-text.rz-light:not(.rz-state-disabled):active {
    color: var(--ap-text-primary);
}

.rz-alert .rz-button.rz-variant-text,
.rz-alert .rz-button.rz-variant-text .rzi,
.rz-alert .rz-button.rz-variant-text i {
    color: var(--ap-text-primary);
}

/* === RadzenAlert — container and message (AC-06) === */
.rz-alert {
    border-radius: var(--ap-radius-md);
    padding: var(--ap-space-3) var(--ap-space-4);
    background-color: var(--ap-bg-elevated, var(--ap-surface-elevated));
    color: var(--ap-text-primary);
    border: 1px solid var(--ap-border-default);
    box-shadow: var(--ap-shadow-sm);
}

.rz-alert-message {
    font-size: var(--ap-text-base);
}

.rz-alert .rz-alert-message,
.rz-alert .rz-alert-content,
.rz-alert .rz-alert-title,
.rz-alert .rz-alert-icon {
    color: inherit;
}

/* Close control (AllowClose, Radzen's default). Radzen renders it as a direct child of
   `.rz-alert`, beside `.rz-alert-item`, as `rz-button rz-button-sm rz-variant-text rz-light
   rz-button-icon-only`. Three rules stacked on that one element made it taller than the
   24px icon/first-line row it sits beside: `.rz-button-sm` min-size 2rem plus 6px icon padding
   (Radzen), the `.rz-button` 4px margin-block above, and the 1px frame `.rz-button.rz-light`
   adds (WCAG 1.4.11, kept). The alert grew to 64px against 54px without it and the frame read as
   centred or lower than the top-aligned icon and message (staging /admin/ops/ci-runner and
   /admin/ops/mcp/approvals, both themes). Pin the control to exactly 1.5rem square, the WCAG 2.5.8
   minimum target, with no margin, so it fills the 24px first line instead of stretching the row.
   Colours, frame and focus ring are untouched, and alerts without a close button never match.

   #3711: at specificity 0,2,0 this lost to every first-party touch-floor rule on a product page
   (app.css `.ap-page .rz-button.rz-button-icon-only` 0,3,0, the ~20 page-scoped
   `.ap-page[b-x] .rz-button` rules 0,3,0, OpsDashboard's `:not(.ap-kpi-drill)` variant 0,4,0), so
   staging computed 44x44 and a 70px alert. The selector carries `.rz-alert` plus the classes
   Radzen really emits on this button for every alert size (`rz-button`, `rz-button-icon-only`,
   `rz-variant-text`, and `rz-button-sm` or, for `AlertSize.ExtraSmall`, `rz-button-xs`, matched
   with `:is()`, which counts as one class) = 0,5,0, strictly above all of them whatever the load
   order; the `::after` hit area is 0,5,1.
   The touch floor is kept as a POINTER hit area instead: a transparent `--ap-touch-target-min`
   square centred on the 24px control, absolutely positioned so it takes no layout space. It sits
   on `::after` because Radzen's material-base.css gives `.rz-button:before` to the click ripple
   (`inset: 0`, `opacity: 0`, `pointer-events: none`): a hit area on `::before` would inherit
   `pointer-events: none`, never receive a click, and stretch the ripple to 44px. With `::before`
   left alone, the ripple stays inside the 24px button (inset 0) despite `overflow: visible`.
   `pointer-events: auto` is set explicitly so a future Radzen `:after` rule cannot silently
   disable the hit area; a test fails if Radzen ever adds one. The button's own `overflow: hidden`
   would cut the pseudo-element off, hence `overflow: visible`. Trade-off: the square reaches 10px
   past the control on every side. Above and to the right it lies in the alert's own padding; to
   the left it can overlap the last few pixels of the message column, so a click or text selection
   that starts there hits the close button, not the text. Other icon-only buttons keep their real
   44px floor. */
.rz-alert > .rz-button.rz-button-icon-only:is(.rz-button-sm, .rz-button-xs).rz-variant-text {
    position: relative;
    overflow: visible;
    box-sizing: border-box;
    flex: none;
    width: 1.5rem;
    height: 1.5rem;
    min-width: 1.5rem;
    min-height: 1.5rem;
    margin: 0;
    padding: 0;
}

.rz-alert > .rz-button.rz-button-icon-only:is(.rz-button-sm, .rz-button-xs).rz-variant-text::after {
    content: "";
    pointer-events: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--ap-touch-target-min);
    height: var(--ap-touch-target-min);
    transform: translate(-50%, -50%);
}

.rz-alert.rz-danger {
    border-left: 4px solid var(--ap-semantic-error);
}

.rz-alert.rz-warning {
    border-left: 4px solid var(--ap-semantic-warning);
}

.rz-alert.rz-info {
    border-left: 4px solid var(--ap-semantic-info);
}

.rz-alert.rz-success {
    border-left: 4px solid var(--ap-semantic-success);
}

/* === RadzenNotification — the toast surface ===
   The toast is the only confirmation many actions produce at the moment they finish, and it was
   the one Radzen surface this sheet never bound. Measured on deployed staging, driving a real
   import dry run, the success toast rendered:

       light   surface rgb(37, 53, 38)   text rgb(46, 125, 50)    2.53:1
       dark    surface rgb(37, 53, 38)   text rgb(102, 187, 106)  5.50:1

   Identical surface in BOTH themes, theme-dependent text: half the pair followed the theme and
   the other half did not, so the light theme put a dark-green foreground on a dark slab, under
   the 4.5:1 floor for its 16px text and under 3:1 for the close control.

   The asymmetry is exactly a mapping gap, and this sheet is where it belongs. Radzen writes
   `.rz-notification-item-wrapper { background-color: var(--rz-notification-container-background-color) }`
   and that variable resolves to `var(--rz-white)`, which nothing here maps. The FOREGROUND half
   is bound already — `tokens.generated.css` maps `--rz-success` onto `--ap-action-success-bg` —
   so the text moved with the theme while the surface underneath it could not.

   Consumers that link Radzen's DARK base (app-wodvtt links `material-dark-base.css` +
   `material-dark.css` unconditionally, at every theme) get `--rz-white` as a fixed dark value,
   which is why the surface measured the same in light and dark. Binding it here fixes every
   consumer at once and does not require an app to change which Radzen base it links — that
   choice affects every control in the app and is not this defect's to make.

   Bound with real selectors rather than by remapping the `--rz-*` variables alone. `RadzenTheme`
   also emits variables at runtime, so a `:root` remap here can be outranked by markup this sheet
   does not control; a two-class selector matching Radzen's own cannot be, because this sheet
   loads after Radzen's.

   Severity reads as a rail and not as a text colour, which is `.rz-alert`'s shape above and is
   deliberate: tinting the foreground is the failure mode being fixed, and a border is a shape
   cue that survives a theme whose semantic hue is low-contrast. */
.rz-notification-item-wrapper {
    /* D-4 semantic-first — see the note above .rz-textbox. */
    background-color: var(--ap-bg-elevated, var(--ap-surface-elevated));
    border: 1px solid var(--ap-border-default);
    border-radius: var(--ap-radius-md);
    box-shadow: var(--ap-shadow-md);
}

/* Radzen's own severity rules are `.rz-notification-<severity> .rz-notification-item`, two
   classes. These match that weight exactly and win on load order, which is why the severity
   selector is repeated here rather than collapsed into `.rz-notification-item` alone. */
.rz-notification-success .rz-notification-item,
.rz-notification-warn .rz-notification-item,
.rz-notification-error .rz-notification-item,
.rz-notification-info .rz-notification-item {
    background-color: transparent;
    color: var(--ap-text-primary);
}

.rz-notification-item .rz-notification-message,
.rz-notification-item .rz-notification-title,
.rz-notification-item .rz-notification-content,
.rz-notification-item .rz-notification-icon,
.rz-notification-item .rz-notification-close {
    color: inherit;
}

.rz-notification-item-wrapper.rz-notification-success {
    border-inline-start: 4px solid var(--ap-semantic-success);
}

.rz-notification-item-wrapper.rz-notification-warn {
    border-inline-start: 4px solid var(--ap-semantic-warning);
}

.rz-notification-item-wrapper.rz-notification-error {
    border-inline-start: 4px solid var(--ap-semantic-error);
}

.rz-notification-item-wrapper.rz-notification-info {
    border-inline-start: 4px solid var(--ap-semantic-info);
}

/* === RadzenDialog — overlay, container, titlebar, and content (AC-07) === */
.rz-dialog {
    /* D-4 semantic-first — see the note above .rz-textbox. */
    background-color: var(--ap-bg-elevated, var(--ap-surface-elevated));
    border: 1px solid var(--ap-border-default);
    border-radius: var(--ap-radius-lg);
    box-shadow: var(--ap-shadow-lg);
}

.rz-dialog-titlebar {
    padding: var(--ap-space-4);
    border-bottom: 1px solid var(--ap-border-default);
}

.rz-dialog-title {
    font-size: var(--ap-text-base);
    font-weight: 600;
    color: var(--ap-text-primary);
}

.rz-dialog-content {
    padding: var(--ap-space-4);
}

/* === RadzenSkeleton — loading placeholder (AC-08) === */
.rz-skeleton {
    background-color: var(--ap-surface-border);
    border-radius: var(--ap-radius-md);
}

.rz-skeleton-text {
    border-radius: var(--ap-radius-md);
}

/* === RadzenBadge — secondary === */
/* This rule used to pin the filled secondary badge to --ap-secondary by hand,
   because "the Radzen bridge maps --rz-primary/danger/warning/success/info but
   never --rz-secondary" and BadgeStyle.Secondary therefore fell back to Radzen's
   default magenta (#e31c65 — off-palette, ~no relation to any --ap token).

   The bridge now maps --rz-secondary and --rz-on-secondary, so Radzen's own
   `.rz-badge-secondary { background-color: var(--rz-secondary); color:
   var(--rz-on-secondary) }` resolves to the accent with a readable label by
   itself, and this rule has nothing left to add.

   The label half is what makes this a fix rather than a move. The old rule paired
   the accent with a FIXED --ap-text-on-accent, and --ap-secondary is whatever
   palette the consuming app ships: "white-on-teal stays >= AA" was true of ours
   and of nothing else. Measured on app-wodvtt staging, white on a filled
   Secondary badge: blood-moon 2.58, wraiths-veil 2.92, kindred-codex 2.93, dark
   3.00, elysium 3.62 — five of seven themes under the 4.5:1 floor for normal
   text. --rz-on-secondary now resolves through --ap-action-secondary-text, which
   OnAccentDerivation picks per theme against that theme's own --ap-secondary
   (platform.theming.action-on-accent.v1), so the label is legible whatever the
   accent is. Our own teals do NOT both get white: the packaged light theme gets
   white on #00796B and the packaged dark theme states #1E1E1E on #26A69A. And
   since WI-09 (AC-30) the filled Secondary badge takes neither this label nor
   this fill: it is one of the neutral badges in the block below, bound to
   --ap-text-default on a muted tint of the elevated surface.

   Removing the rule also returns control to the consuming app, which pinning had
   taken away — at two classes to Radzen's one it outranked --rz-secondary no
   matter what the app mapped. */

/* === Filled Secondary buttons — the stated accessible fill ===
   platform.theming.action-on-accent.v1, amended 2026-10-16. --ap-secondary is a
   decorative accent and is often too bright to carry a label. A theme may
   therefore state --ap-action-secondary-filled-bg, the accessible fill its
   FILLED Secondary buttons are painted with; the emitter derives
   --ap-action-secondary-text against that same fill, because it is what the
   label sits on. This rule lives in the package so every consuming app gets the
   behaviour from one place instead of each keeping its own global Radzen
   override.

   BADGES ARE NOT IN THIS RULE. Amended 2026-11-02 (radzen-dom-fidelity WI-09,
   AC-30): a badge shows a state, never an action, so the filled Secondary badge
   no longer takes this fill. It joined the other badge styles in the rule
   block below. The 2026-10-16 clause still governs buttons.

   No `color` here: the label keeps Radzen's var(--rz-on-secondary), which already
   resolves through --ap-action-secondary-text. A theme that does not state the
   token gets the package default below, the bridged --rz-secondary, so the
   computed fill equals what Radzen painted before this rule and the theme renders
   unchanged.

   The default sits under :where(), which has zero specificity, so any theme
   block that states the token wins whatever the stylesheet order. It is declared
   on [data-theme] as well as :root, where the bridge itself is declared, so a
   scoped theme resolves its own --rz-secondary rather than inheriting the root's.

   Only the FILLED variants: outlined and text Secondary controls draw the accent
   as a stroke or a label on the page surface, a different job with a different
   contrast pair, and are left to Radzen. */
:where(:root, [data-theme]) {
    --ap-action-secondary-filled-bg: var(--rz-secondary);
}

.rz-button.rz-secondary.rz-shade-default:not(.rz-variant-outlined):not(.rz-variant-text) {
    background-color: var(--ap-action-secondary-filled-bg, var(--rz-secondary));
}

/* === RadzenBadge — a state, never an action; a pill, with the state said twice ===
   platform.theming.action-on-accent.v1, amended 2026-11-02 (radzen-dom-fidelity WI-09, AC-30),
   and the badge-icons follow-up. A badge shows a state. It therefore names no --ap-action-*
   token, for fill, label, border or glyph: those tokens say "this is the control you press", and
   a badge is not pressable. The filled Secondary badge used to take the Secondary action fill, so
   a badge was painted as a control and read as one.

   History this replaces. Measured on staging /admin/themes/global/default, the filled Secondary
   ("Packaged") badge — 12px, weight 500 — rendered

       light   rgb(33, 33, 33)     on rgb(0, 121, 107)   3.03:1
       dark    rgb(224, 224, 224)  on rgb(38, 166, 154)  2.27:1

   against the 4.5:1 floor: eleven blocking profui.color.computed-contrast cells, a label owned by
   one stylesheet on a fill owned by another, as the toast block documents. The pair is still set
   together here, by one rule per style, from --ap-* tokens that are not action tokens.

   A visual check of the first tint recipe on staging then found three more defects, and the
   operator is red-green colour-blind, so a state must not rest on colour alone:
     1. the light warning (#BF360C) is a red-orange; on a tint it looked like danger;
     2. the neutral badge (surface fill, grey 1px outline, UPPERCASE, 8px radius) looked like a
        small outlined button;
     3. the neutral badge disappeared on a striped grid row.

   SHAPE, all eight filled default-shade badges (state and neutral): a pill (999px), no
   text-transform and no letter-spacing (Radzen sets UPPERCASE and 0.02rem), an inline-flex row with
   a 4px gap, padding 0 8px and a 22px floor. Font size and weight stay Radzen's (12px, 500). The
   dark badge keeps Radzen's shape.

   STATE badges (success, warning, danger, info) are a tint of their accent on the elevated
   surface, with the accent as the border and the default text colour as the label. The tint is
   color-mix(accent N%, --ap-bg-elevated): 16% for success and info, 10% for warning, 45% for
   danger. Amber and red sit at near-equal luminance at the same tint, so at 16% each the two
   fills differed by 1.10:1 and, without hue (red-green colour blindness), a warning and a danger
   badge looked alike; the stronger danger tint and the paler warning tint keep them at least
   1.5:1 apart in luminance (1.89:1 light, 1.65:1 dark; 1.53:1 or more under protanopia and
   deuteranopia simulation). The border is the accent at full strength, read through the optional
   --ap-badge-edge hook (below): success reads --ap-semantic-success, danger --ap-semantic-error,
   info --ap-semantic-info; warning reads --ap-semantic-warning-accent for the tint (light #E69100,
   dark = --ap-warning), NOT --ap-semantic-warning, so alerts and notifications keep the
   red-orange, and --ap-semantic-warning-on-subtle for the border, because the amber accent alone
   cannot reach 3:1 on a light row (2.50:1 on white). Each state also carries a Material Symbols
   outline glyph as ::before, so every call site gets it with no markup change: success
   check_circle, warning warning, danger cancel (an X in a circle, not the exclamation of `error`,
   which reads as warning), info info. `content: "name" / ""` gives the glyph an empty
   accessible name; the badge text already says the state. The glyph is painted in the accent
   (warning: --ap-semantic-warning-on-subtle, light #8A5200, dark = --ap-warning); the danger glyph
   is the default text colour, because the red accent falls below 3:1 on the 45% tint, and the
   shape (X in a circle against the warning triangle) is the second non-colour cue. Neutral
   badges have no glyph: they say nothing.

   --ap-badge-edge. Optional, never declared here. A badge border reads it first and falls back
   to the outline of its style. A grid that paints a solid selected row (GlobalThemeManagement:
   --ap-action-primary-bg) sets it on that row to the row's own on-colour, because no outline
   colour reaches 3:1 against both a near-white row and a primary-blue row. A row painted with the
   Radzen default wash does not set it and keeps the normal outline.

   Measured from tokens.generated.css (WCAG 2.x; label --ap-text-default on the tint; glyph on
   the tint, the 1.4.11 floor is 3:1; border = the lower of the page row and the elevated or
   striped row, the 1.4.11 floor is 3:1; selected = the border with the hook set to the row's
   on-colour on --ap-action-primary-bg):

                   light label  dark label   light glyph  dark glyph   light border  dark border
       success      12.99:1       7.83:1       4.14:1       4.37:1        4.70:1        5.82:1
       warning      14.75:1       8.56:1       5.85:1       5.82:1        5.86:1        7.09:1
       danger        7.81:1       5.18:1       7.81:1       5.18:1        4.57:1        4.61:1
       info         12.44:1       8.07:1       5.72:1       4.02:1        6.79:1        5.20:1

   Selected row with the hook: 5.75:1 light (white on #1565C0), 4.55:1 dark (white on #1D78CD),
   for all five outlines. Warning fill against danger fill: 1.89:1 light, 1.65:1 dark.

   STATELESS badges (primary, secondary, light, base) carry no state, so they are one neutral
   recipe: a 14% mix of --ap-text-muted into --ap-bg-elevated (a grey that is distinct from the
   card, the page and a stripe), --ap-text-default as the label (13.25:1 light, 8.25:1 dark) and
   a 70% mix of --ap-text-default into --ap-bg-elevated as the outline (light #646464, dark
   #AAAAAA). The outline follows the theme's text colour, so a consumer theme keeps a legible
   outline; --ap-border-strong, shared with inputs and the theme editor, is no longer read here.
   The outline against the surface behind the badge measures 5.46:1 light and 7.20:1 dark on the
   page, 5.95:1 on an elevated card in both themes, so it clears the 3:1 non-text floor with
   margin and is what keeps the pill visible on a striped row. The width stays 1px (a display
   at 150 percent scaling draws it as one device pixel, 0.667 CSS px, which the margin absorbs).
   It uses no action token. The four stateless styles stay one look on purpose.

   Each colour rule sets BOTH halves. Filled only: the outlined/text variants draw the colour as a
   stroke or label on the page surface, a different pair, left to Radzen.

   SPECIFICITY IS A SCOPE DECISION. Every rule sits at two classes (0,2,0): `:where()` zeroes the
   shade class, so the selector weighs exactly what Radzen's own filled rule weighs and wins only
   on load order. That is deliberate. A component or consumer badge that states its own look at
   three classes keeps control, whether it loads before this sheet (app-platform-base.css
   `.ap-hosted-shell .rz-badge.ap-nav-count`, the nav counter) or after it (a scoped
   `::deep .wod-genealogy-badge.rz-badge`). Those are designs, not the defect, and a heavier rule
   here would repaint them. Secondary needed 0,4,0 only while its FILL was the shared
   filled-Secondary action rule above; with that fill gone there is nothing to match and it
   joins the neutral group. A page that wants another badge look owns BOTH halves at its own
   weight and must not set only the label. */
.rz-badge-success.rz-variant-filled:where(.rz-shade-default),
.rz-badge-warning.rz-variant-filled:where(.rz-shade-default),
.rz-badge-danger.rz-variant-filled:where(.rz-shade-default),
.rz-badge-info.rz-variant-filled:where(.rz-shade-default),
.rz-badge-primary.rz-variant-filled:where(.rz-shade-default),
.rz-badge-secondary.rz-variant-filled:where(.rz-shade-default),
.rz-badge-light.rz-variant-filled:where(.rz-shade-default),
.rz-badge-base.rz-variant-filled:where(.rz-shade-default) {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    text-transform: none;
    letter-spacing: normal;
}

.rz-badge-success.rz-variant-filled:where(.rz-shade-default) {
    background-color: color-mix(in srgb, var(--ap-semantic-success) 16%, var(--ap-bg-elevated));
    border: 1px solid var(--ap-badge-edge, var(--ap-semantic-success));
    color: var(--ap-text-default);
}

.rz-badge-warning.rz-variant-filled:where(.rz-shade-default) {
    background-color: color-mix(in srgb, var(--ap-semantic-warning-accent) 10%, var(--ap-bg-elevated));
    border: 1px solid var(--ap-badge-edge, var(--ap-semantic-warning-on-subtle));
    color: var(--ap-text-default);
}

.rz-badge-danger.rz-variant-filled:where(.rz-shade-default) {
    background-color: color-mix(in srgb, var(--ap-semantic-error) 45%, var(--ap-bg-elevated));
    border: 1px solid var(--ap-badge-edge, var(--ap-semantic-error));
    color: var(--ap-text-default);
}

.rz-badge-info.rz-variant-filled:where(.rz-shade-default) {
    background-color: color-mix(in srgb, var(--ap-semantic-info) 16%, var(--ap-bg-elevated));
    border: 1px solid var(--ap-badge-edge, var(--ap-semantic-info));
    color: var(--ap-text-default);
}

.rz-badge-success.rz-variant-filled:where(.rz-shade-default)::before,
.rz-badge-warning.rz-variant-filled:where(.rz-shade-default)::before,
.rz-badge-danger.rz-variant-filled:where(.rz-shade-default)::before,
.rz-badge-info.rz-variant-filled:where(.rz-shade-default)::before {
    font-family: "Material Symbols";
    font-size: 15px;
    line-height: 1;
    margin-left: -2px;
    font-style: normal;
    font-weight: normal;
    letter-spacing: normal;
    text-transform: none;
    font-variation-settings: "FILL" 0, "GRAD" 0, "opsz" 20, "wght" 500;
    font-feature-settings: "liga";
    -webkit-font-smoothing: antialiased;
}

.rz-badge-success.rz-variant-filled:where(.rz-shade-default)::before {
    content: "check_circle" / "";
    color: var(--ap-semantic-success);
}

.rz-badge-warning.rz-variant-filled:where(.rz-shade-default)::before {
    content: "warning" / "";
    color: var(--ap-semantic-warning-on-subtle);
}

.rz-badge-danger.rz-variant-filled:where(.rz-shade-default)::before {
    content: "cancel" / "";
    color: var(--ap-text-default);
}

.rz-badge-info.rz-variant-filled:where(.rz-shade-default)::before {
    content: "info" / "";
    color: var(--ap-semantic-info);
}

.rz-badge-primary.rz-variant-filled:where(.rz-shade-default),
.rz-badge-secondary.rz-variant-filled:where(.rz-shade-default),
.rz-badge-light.rz-variant-filled:where(.rz-shade-default),
.rz-badge-base.rz-variant-filled:where(.rz-shade-default) {
    background-color: color-mix(in srgb, var(--ap-text-muted) 14%, var(--ap-bg-elevated));
    border: 1px solid var(--ap-badge-edge, color-mix(in srgb, var(--ap-text-default) 70%, var(--ap-bg-elevated)));
    color: var(--ap-text-default);
}

.rz-badge-dark.rz-variant-filled:where(.rz-shade-default) {
    background-color: var(--ap-text-primary);
    color: var(--ap-bg-page, var(--ap-surface));
}

/* === RadzenProfileMenu — theme-blind surface primitives (finding R6) ===
   Adversarial visual sweep of wodvtt staging (build e36196a3) measured the
   account/profile-menu trigger as a solid rgb(37,37,37) (#252525) slab in BOTH
   themes, with a chevron that DOES follow the theme — #212121 in light, #E0E0E0
   in dark. Measured on the region tiles: 1.05:1 in light, 11.61:1 in dark for
   the identical element. In light theme that is a black rectangle in a white
   header with an invisible glyph: the control reads as a broken image, not a
   menu.

   ROOT CAUSE — the same fixed-Radzen-primitive family as P-5b/P-5c above, but
   inverted: here it is the SURFACE that is theme-blind and the FOREGROUND that
   flips. Consuming apps load ONE Radzen sheet for both themes (wodvtt pins
   `material-dark.css`) and let the --ap-* tokens do the light/dark work.
   material-dark.css declares

       --rz-profile-menu-top-item-background-color: var(--rz-base-700);  // #252525
       --rz-profile-menu-background-color:          var(--rz-base-700);  // #252525
       --rz-profile-menu-toggle-button-color:       var(--rz-text-color);

   `--rz-base-700` is a fixed base primitive the token bridge never remaps, so
   the trigger AND the open dropdown panel stay #252525 in every theme, while
   `--rz-text-color` IS bridged (tokens.generated.css maps it to
   --ap-text-primary) and therefore flips. One half of the pair moved and the
   other did not.

   FIX — remap the whole profile-menu surface family onto --ap-* tokens so the
   surface and its foreground always flip together. Because these are Radzen's
   own profile-menu-scoped custom properties, nothing outside the profile menu
   is touched (--rz-text-color / --rz-menu-item-color stay as they are), and a
   future Radzen theme bump cannot re-introduce the split by changing only one
   side. Resulting contrast: chevron/item text #212121 on #ffffff ~ 16.1:1
   (light) and #E0E0E0 on #2d2d2d ~ 11.9:1 (dark).

   The four surface/foreground remaps live in the GENERATED bridge
   (tokens/theme.tokens.json -> tokens.generated.css), next to the other --rz-*
   mappings, because that sheet is the authoritative bridge and it loads after
   the Radzen theme sheet in every host. Only the structural rules Radzen does
   not express as a custom property are declared here.

   Regression test of record: AppPlatform.Tests/DesignTokens/ProfileMenuContrastTests.cs */

/* The trigger was only legible before because it was a black block; on a theme
   surface it needs a real boundary. Control boundary — WCAG 1.4.11 requires
   >= 3:1, so this takes the STRONG tier (#868686 on #ffffff ~ 3.5:1 light,
   #7d7d7d on #2d2d2d ~ 3.4:1 dark). */
ul.rz-profile-menu {
    border: 1px solid var(--ap-border-strong);
    border-radius: var(--ap-radius-md);
}

ul.rz-profile-menu .rz-navigation-menu {
    border: 1px solid var(--ap-border-strong);
}

/* Radzen pairs the hover fill with `--rz-menu-item-hover-color: var(--rz-white)`,
   which is white-on-white once the fill is the light-theme --ap-primary-subtle
   tint. --rz-menu-item-hover-color is NOT profile-menu-scoped (it also colours
   the side-rail panel menu), so pin the hover foreground here instead, using the
   --ap-primary-subtle / --ap-primary-on-subtle pair this repo already treats as
   a unit (see `.rz-pager .rz-state-active` above). */
ul.rz-profile-menu .rz-navigation-menu .rz-navigation-item-wrapper:hover .rz-navigation-item-link,
ul.rz-profile-menu .rz-navigation-menu .rz-navigation-item-wrapper:hover .rz-navigation-item-text,
ul.rz-profile-menu .rz-navigation-menu .rz-navigation-item-wrapper:hover .rzi {
    color: var(--ap-primary-on-subtle);
}
