/* NUI-7.3 Accessibility and motion pass (WCAG 2.1 AA), technical requirements 3.3 and D-1.

   One global stylesheet for both apps, linked last in each index.html (after nj-bottom-sheet.css), so its rules sit
   after MudBlazor, app.css and the scoped component styles. It adds the keyboard focus ring (BR-5 to BR-7), the 44x44
   hit areas MudBlazor's small controls lack (BR-8, BR-9), 150 to 250ms motion for MudBlazor's transitions (BR-10) and
   no motion at all under prefers-reduced-motion (BR-11, BR-12).

   Colours come only from --mud-palette-* variables, so both themes follow NjordTheme. Component-specific fixes live in
   each component's own .razor.css; this file holds only rules for MudBlazor classes used on many screens and the
   helpers below.

   Helpers a component may add to a control's Class:
   - nj-focus-inset  the ring sits 2px inside the control, for controls flush against a clipping edge (cards,
                     scrollers, rounded frames; BR-7).
   - nj-focus-halo   the ring gets a Surface-coloured halo outside it, for controls over images (BR-5).
   - nj-target       a transparent border grows the hit area without changing the look: set --nj-target-block and
                     --nj-target-inline to (44px - visible size) / 2. Meant for controls sized by their padding and
                     content; a control with a fixed box-sizing: border-box height must add the border to it. */

/* ---------------------------------------------------------------------------------------------------------------
   BR-5 to BR-7: focus ring (3.3.1, D-3)
   MudBlazor removes the outline on buttons, links, chips, list items and inputs and shows focus as a background wash,
   which stays. The ring is an outline, so it follows border-radius and takes no space. !important because MudBlazor's
   resets reach specificity 0,3,1. Only :focus-visible is styled, so a mouse click or a tap shows no ring.
   --nj-focus-offset and --nj-focus-color let the helpers below move or recolour the ring without another !important.
   --------------------------------------------------------------------------------------------------------------- */

:focus-visible:not(:where(
    h1, h2, h3, h4, h5, h6, main,
    [role="dialog"], .mud-dialog, .mud-popover, .mud-drawer,
    .mud-input-control input, .mud-input-control textarea, .mud-input-control select, .mud-input-control .mud-input-slot)) {
    outline: 2px solid var(--nj-focus-color, var(--mud-palette-primary)) !important;
    outline-offset: var(--nj-focus-offset, 2px) !important;
}

/* BR-6: fields, selects, autocompletes and pickers keep MudBlazor's focused 2px Primary border or underline as their
   ring (Primary meets 3:1 on every ground, NjordThemeContrastTests.ControlPairs). Headings that FocusOnNavigate
   focuses and the containers MudBlazor focuses in code (dialogs, popovers, drawers, main) show no ring (BR-7, OQ9). */

/* FC-2: a checkbox's or radio's focus lands on a visually hidden <input>, so the ring goes on the visible button. */
:is(.mud-checkbox, .mud-radio) .mud-button-root:has(input:focus-visible) {
    outline: 2px solid var(--mud-palette-primary) !important;
    outline-offset: 2px !important;
}

/* A switch clips its thumb (.mud-switch-span has overflow: hidden), so its ring is drawn round the track, 2px outside
   it, inside the span's padding where nothing clips it. */
.mud-switch-span:has(input:focus-visible)::after {
    content: "";
    position: absolute;
    inset: 8px;
    border: 2px solid var(--mud-palette-primary);
    border-radius: 11px;
    pointer-events: none;
}

/* BR-7: rows that run edge to edge in a list, a menu, a drawer or a card (list items, menu items, nav links) are
   always flush with a clipping frame, so their ring sits 2px inside them (live check F-6: the You rows, the avatar and
   Create menus, the organizer sidebar). Zero specificity, so a component can still move it. */
:where(.mud-list-item, .mud-menu-item, .mud-nav-link) {
    --nj-focus-offset: -2px;
}

/* BR-7: an inset ring for controls flush against a clipping edge. On a filled control the inset ring would vanish into
   the fill, so it takes the fill's text colour. */
.nj-focus-inset {
    --nj-focus-offset: -2px;
}

.nj-focus-inset:is(.mud-button-filled, .mud-chip-filled) {
    --nj-focus-color: var(--mud-palette-primary-text);
}

/* BR-5: over an image, a 2px Surface halo outside the ring keeps it readable on any photo. The shadow spreads 4px past
   the ring's offset: with the default 2px offset the ring covers 2 to 4px, so Surface shows from 0 to 2px and from 4
   to 6px. With nj-target the offset already subtracts the transparent border, so the halo follows the ring. */
.nj-focus-halo:focus-visible {
    box-shadow: 0 0 0 calc(var(--nj-focus-offset, 2px) + 4px) var(--mud-palette-surface) !important;
}

/* ---------------------------------------------------------------------------------------------------------------
   BR-8, BR-9: 44x44 touch targets (3.3.2, D-6)
   MudBlazor's ripple sets overflow: hidden on buttons, chips and list items (FC-3), so a pseudo-element cannot reach
   past them. Instead a transparent border grows the hit area, background-clip: padding-box keeps the fill and hover
   wash to the visible size, and an equal negative margin keeps the layout. Controls 44px or larger are untouched.
   outline-offset is one value for all four sides, measured from the border box, so it subtracts the smaller of the
   two borders: the ring then sits 2px outside the visible control on that axis and further out on the other, never
   inside it. Text buttons, clickable chips and range days have a block border only, so their offset stays 2px (the
   ring is 2px outside their left and right edges and 2px outside the hit area above and below). The inset ring
   subtracts the larger border instead, so it stays inside the control on every side.
   --------------------------------------------------------------------------------------------------------------- */

/* Text buttons ("See all", "Clear", "Show more", feed card actions, a snackbar's action): no fill or border at rest,
   36.5px tall at the medium size, 30.75px small and 42.25px large, at least 64px wide. A transparent border above and
   below makes them at least 44px tall without moving them (View 2). Filled and outlined buttons are not changed here:
   their fill and border are part of their look, and several screens already size them to 44px. A component whose text
   button is already 44px tall, or that draws its own border on one, sets --nj-target-block: 0px to opt out. The rule
   has the specificity of one class, so nj-target (below) and component styles override it. The border has no inline
   part, so the ring offset stays 2px (F-1). */
:where(.mud-button-root.mud-button-text):not(.mud-icon-button) {
    --nj-target-block: 4px;
    border-style: solid;
    border-color: transparent;
    border-width: var(--nj-target-block) 0;
    background-clip: padding-box;
    margin-block: calc(-1 * var(--nj-target-block));
    --nj-focus-offset: 2px;
}

:where(.mud-button-root.mud-button-text-size-small):not(.mud-icon-button) {
    --nj-target-block: 7px;
}

:where(.mud-button-root.mud-button-text-size-large):not(.mud-icon-button) {
    --nj-target-block: 1px;
}

/* Filled and outlined buttons (live check F-6: "Join", "Details", "Donate", "Apply", "View events", sheet actions and
   more were 36.5px, or 30.75px small): the same block border as text buttons, so they keep their look and reach 44px.
   MudToggleItem renders with these classes too, but forbids itself a border, so toggle items grow instead (below);
   buttons inside a MudButtonGroup keep MudBlazor's joined borders. A component that sizes its button to 44px or more
   sets --nj-target-block: 0px. app.css removes the filled buttons' shadow, so nothing is drawn outside the fill. */
:where(.mud-button-root.mud-button-filled, .mud-button-root.mud-button-outlined):not(.mud-icon-button, .mud-toggle-item, .mud-button-group-root *) {
    --nj-target-block: 4px;
    border-style: solid;
    border-color: transparent;
    border-width: var(--nj-target-block) 0;
    background-clip: padding-box;
    margin-block: calc(-1 * var(--nj-target-block));
    --nj-focus-offset: 2px;
}

:where(.mud-button-root.mud-button-filled-size-small, .mud-button-root.mud-button-outlined-size-small):not(.mud-icon-button, .mud-toggle-item, .mud-button-group-root *) {
    --nj-target-block: 7px;
}

:where(.mud-button-root.mud-button-filled-size-large, .mud-button-root.mud-button-outlined-size-large):not(.mud-icon-button, .mud-toggle-item, .mud-button-group-root *) {
    --nj-target-block: 1px;
}

/* An outlined button's 1px boundary becomes an inset shadow of the same colour (MudBlazor's border colours, kept in
   --nj-button-line), and its padding takes back the 1px border, so it looks as before. MudBlazor sets the outlined
   border with the colour, on hover and on focus at up to three classes, so this rule needs three to replace it. A
   component that colours its outlined button's border sets --nj-button-line instead. */
.mud-button-root.mud-button-outlined:not(.mud-icon-button, .mud-toggle-item, .mud-button-group-root *) {
    border-style: solid;
    border-color: transparent;
    border-width: var(--nj-target-block, 0px) var(--nj-target-inline, 0px);
    box-shadow: inset 0 0 0 1px var(--nj-button-line, rgba(var(--mud-palette-text-primary-rgb), var(--mud-palette-border-opacity)));
}

:where(.mud-button-root.mud-button-outlined):not(.mud-icon-button, .mud-toggle-item, .mud-button-group-root *) {
    padding: 6px 16px;
}

:where(.mud-button-root.mud-button-outlined-size-small):not(.mud-icon-button, .mud-toggle-item, .mud-button-group-root *) {
    padding: 4px 10px;
}

:where(.mud-button-root.mud-button-outlined-size-large):not(.mud-icon-button, .mud-toggle-item, .mud-button-group-root *) {
    padding: 8px 22px;
}

.mud-button-outlined.mud-button-outlined-primary { --nj-button-line: rgba(var(--mud-palette-primary-rgb), var(--mud-palette-border-opacity)); }
.mud-button-outlined.mud-button-outlined-secondary { --nj-button-line: rgba(var(--mud-palette-secondary-rgb), var(--mud-palette-border-opacity)); }
.mud-button-outlined.mud-button-outlined-tertiary { --nj-button-line: rgba(var(--mud-palette-tertiary-rgb), var(--mud-palette-border-opacity)); }
.mud-button-outlined.mud-button-outlined-info { --nj-button-line: rgba(var(--mud-palette-info-rgb), var(--mud-palette-border-opacity)); }
.mud-button-outlined.mud-button-outlined-success { --nj-button-line: rgba(var(--mud-palette-success-rgb), var(--mud-palette-border-opacity)); }
.mud-button-outlined.mud-button-outlined-warning { --nj-button-line: rgba(var(--mud-palette-warning-rgb), var(--mud-palette-border-opacity)); }
.mud-button-outlined.mud-button-outlined-error { --nj-button-line: rgba(var(--mud-palette-error-rgb), var(--mud-palette-border-opacity)); }
.mud-button-outlined.mud-button-outlined-dark { --nj-button-line: rgba(var(--mud-palette-dark-rgb), var(--mud-palette-border-opacity)); }
.mud-button-outlined.mud-button-outlined-inherit { --nj-button-line: currentColor; }
.mud-button-outlined.mud-button-outlined:disabled { --nj-button-line: var(--mud-palette-action-disabled-background); }

/* Spin buttons inside a numeric field are not tab stops and sit in the field's own box (MudBlazor sizes them), so they
   take no hit-area border. */
.mud-input-numeric-spin .mud-button-root {
    --nj-target-block: 0px;
}

/* Declared before nj-target, so a text button that also carries nj-target and nj-focus-inset takes nj-target's. */
:where(.mud-button-root.mud-button-text):not(.mud-icon-button).nj-focus-inset {
    --nj-focus-offset: calc(-2px - var(--nj-target-block));
}

:where(.mud-button-root.mud-button-filled, .mud-button-root.mud-button-outlined):not(.mud-icon-button, .mud-toggle-item, .mud-button-group-root *).nj-focus-inset {
    --nj-focus-offset: calc(-2px - var(--nj-target-block));
}

.nj-target {
    border-style: solid;
    border-color: transparent;
    border-width: var(--nj-target-block, 0px) var(--nj-target-inline, 0px);
    background-clip: padding-box;
    margin: calc(-1 * var(--nj-target-block, 0px)) calc(-1 * var(--nj-target-inline, 0px));
    --nj-focus-offset: calc(2px - min(var(--nj-target-block, 0px), var(--nj-target-inline, 0px)));
}

.nj-target.nj-focus-inset {
    --nj-focus-offset: calc(-2px - max(var(--nj-target-block, 0px), var(--nj-target-inline, 0px)));
}

/* Small icon buttons (Size.Small): 24px (3px padding round an 18px icon), so 10px each way. Text variant only: an
   outlined or filled icon button draws its own border, and a component that uses one adds nj-target itself. */
.mud-icon-button.mud-icon-button-size-small:not(.mud-button-outlined, .mud-button-filled) {
    --nj-target-block: 10px;
    --nj-target-inline: 10px;
    border: 10px solid transparent;
    background-clip: padding-box;
    margin: -10px;
    --nj-focus-offset: -8px;
}

.mud-icon-button.mud-icon-button-size-small.mud-icon-button-edge-start:not(.mud-button-outlined, .mud-button-filled) {
    margin-inline-start: -13px;
}

.mud-icon-button.mud-icon-button-size-small.mud-icon-button-edge-end:not(.mud-button-outlined, .mud-button-filled) {
    margin-inline-end: -13px;
}

/* Two small icon buttons side by side (the footer's Facebook and Instagram, an event's copy and open links): with the
   -10px margins their 44px areas overlapped by the 20px the margins took back (F-6). The second one's start margin
   becomes +10px, so the areas are as far apart as the visible gap the row already sets (BR-9: the spacing grows). */
.mud-icon-button.mud-icon-button-size-small:not(.mud-button-outlined, .mud-button-filled) + .mud-icon-button.mud-icon-button-size-small:not(.mud-button-outlined, .mud-button-filled) {
    margin-inline-start: 10px;
}

/* MudDataGrid column headers (/activity/all, /manage/money): Sort and Column options are small icon buttons a few px
   apart, in dense cells whose 6px padding left their hit areas under the table's edge and the filter row. The header
   cells take 10px above and below, so each area stays in its own cell, and Column options moves 14px further from
   Sort; in the filter row Clear filter moves 8px from the filter menu. */
.mud-data-grid .mud-table-head .mud-table-cell {
    padding-block: 10px;
}

.mud-data-grid .mud-table-cell .column-header .column-options .mud-menu {
    margin-inline-start: 14px;
}

.mud-data-grid .filter-header-cell .column-filter-menu + .mud-icon-button.mud-icon-button-size-small {
    margin-inline-start: -2px;
}

/* Text fields (search boxes, the date range, the filter row, a select's box): the standard variant's box is 32px,
   29px dense, so it takes a transparent border above and below, and an outlined dense field (40px) 2px. The underline
   and the outline are drawn inside the padding box, so they stay where they were; the label, above the box, passes
   clicks through (MudBlazor sets pointer-events: none on it). Filled and default outlined fields are 56px. */
.mud-input-control .mud-input.mud-input-text {
    border-block: 6px solid transparent;
    margin-block: -6px;
}

.mud-input-control .mud-input.mud-input-text.mud-input-margin-dense {
    border-block-width: 8px;
    margin-block: -8px;
}

.mud-input-control > .mud-input-control-input-container > div.mud-input.mud-input-text.mud-input-text-with-label {
    margin-top: 10px;
}

.mud-input-control > .mud-input-control-input-container > div.mud-input.mud-input-text.mud-input-text-with-label.mud-input-margin-dense {
    margin-top: 8px;
}

.mud-input-control .mud-input.mud-input-outlined.mud-input-margin-dense {
    border-block: 2px solid transparent;
    margin-block: -2px;
}

/* The data grid pager's "Rows per page" select is a 20px box in a 52px bar: 12px above and below. MudBlazor pins its
   top margin to 0 (!important), so instead of a negative top margin it moves up 6px, back to the bar's centre. */
.mud-table-pagination-select .mud-input.mud-input-text {
    border-block-width: 12px;
    margin-bottom: -12px;
    top: -6px;
}

/* Switches: the 38px track and its label are one <label>, which takes a 3px transparent border above and below. A
   column of switches keeps 6px between them (the avatar menu sets it). Positioned, so a later sibling never paints
   over the border and takes its taps (the track's own positioned parts keep their containing block). */
label.mud-switch {
    position: relative;
    border-block: 3px solid transparent;
    margin-block: -3px;
}

/* MudToggleGroup items are 30 to 36px and MudBlazor forbids them a border (border-style: none !important) and clips
   them to the group, so they grow to 44px and their ring sits inside them (BR-7). A selected item is filled with the
   group's colour, so its inset ring takes the fill's text colour; a component that restyles the selected item sets
   --nj-focus-color itself. */
.mud-toggle-group > .mud-toggle-item {
    min-height: 44px;
    --nj-focus-offset: -2px;
}

.mud-toggle-group > .mud-toggle-item.mud-toggle-item-selected.mud-button-filled-primary {
    --nj-focus-color: var(--mud-palette-primary-text);
}

/* Breadcrumb links (Money, Reported comments): one 20px line of text. A transparent border makes each at least 44px
   tall and 12px wider ("Home" is 35px), inside the 12px around each separator, without moving them. Positioned, so
   the separator after it (a later flex item) does not paint over, and take the taps on, its right edge. */
.mud-breadcrumbs .mud-breadcrumb-item > a {
    position: relative;
    border: 13px solid transparent;
    border-inline-width: 6px;
    margin: -13px -6px;
    --nj-focus-offset: -4px;
}

/* Clickable chips (filter chips, chip sets): 32px medium, 24px small, 40px large, all border-box with a fixed height,
   so the height takes the border too. Their width is set by their label, which keeps them at least 44px wide, so only
   the block axis grows. The elliptical radius keeps the visible pill: inner radius = outer radius - border. Display-
   only status chips are not interactive and keep MudBlazor's size. A row that sets its chips' margin itself must
   subtract --nj-target-block and keep 12px between wrapped rows, so hit areas never overlap (BR-9). The border has no
   inline part, so the ring offset stays 2px (F-1). */
.mud-chip.mud-clickable {
    --nj-target-block: 6px;
    --nj-chip-radius: 16px;
    border-style: solid;
    border-color: transparent;
    border-width: var(--nj-target-block) 0;
    background-clip: padding-box;
    height: 44px;
    margin-block: calc(4px - var(--nj-target-block));
    border-radius: var(--nj-chip-radius) / calc(var(--nj-chip-radius) + var(--nj-target-block));
    --nj-focus-offset: 2px;
}

.mud-chip.mud-clickable.mud-chip-size-small {
    --nj-target-block: 10px;
    --nj-chip-radius: 12px;
}

.mud-chip.mud-clickable.mud-chip-size-large {
    --nj-target-block: 2px;
    --nj-chip-radius: 20px;
}

.mud-chip.mud-clickable.nj-focus-inset {
    --nj-focus-offset: calc(-2px - var(--nj-target-block));
}

.mud-chip.mud-clickable.mud-chip-label {
    --nj-chip-radius: var(--mud-default-borderradius);
}

/* An outlined chip's 1px border becomes an inset shadow of the same colour, and its side padding takes back the 1px
   the border used to add, so it looks exactly as before. */
.mud-chip.mud-clickable.mud-chip-outlined {
    box-shadow: inset 0 0 0 1px var(--nj-chip-line, var(--mud-palette-lines-inputs));
    padding-inline: 13px;
}

.mud-chip.mud-clickable.mud-chip-outlined.mud-chip-size-small {
    padding-inline: 9px;
}

.mud-chip.mud-clickable.mud-chip-outlined.mud-chip-size-large {
    padding-inline: 17px;
}

.mud-chip.mud-clickable.mud-chip-outlined.mud-chip-color-primary { --nj-chip-line: rgba(var(--mud-palette-primary-rgb), var(--mud-palette-border-opacity)); }
.mud-chip.mud-clickable.mud-chip-outlined.mud-chip-color-secondary { --nj-chip-line: rgba(var(--mud-palette-secondary-rgb), var(--mud-palette-border-opacity)); }
.mud-chip.mud-clickable.mud-chip-outlined.mud-chip-color-tertiary { --nj-chip-line: rgba(var(--mud-palette-tertiary-rgb), var(--mud-palette-border-opacity)); }
.mud-chip.mud-clickable.mud-chip-outlined.mud-chip-color-info { --nj-chip-line: rgba(var(--mud-palette-info-rgb), var(--mud-palette-border-opacity)); }
.mud-chip.mud-clickable.mud-chip-outlined.mud-chip-color-success { --nj-chip-line: rgba(var(--mud-palette-success-rgb), var(--mud-palette-border-opacity)); }
.mud-chip.mud-clickable.mud-chip-outlined.mud-chip-color-warning { --nj-chip-line: rgba(var(--mud-palette-warning-rgb), var(--mud-palette-border-opacity)); }
.mud-chip.mud-clickable.mud-chip-outlined.mud-chip-color-error { --nj-chip-line: rgba(var(--mud-palette-error-rgb), var(--mud-palette-border-opacity)); }
.mud-chip.mud-clickable.mud-chip-outlined.mud-chip-color-dark { --nj-chip-line: rgba(var(--mud-palette-dark-rgb), var(--mud-palette-border-opacity)); }

/* MudPagination items: 32px pills 6px apart. A 6px border each way makes them 44x44; the 3px side margins go, so the
   visible pills are 12px apart and the hit areas touch without overlapping (BR-9: the spacing grows). */
.mud-pagination .mud-pagination-item > .mud-button-root {
    border: 6px solid transparent;
    background-clip: padding-box;
    height: 44px;
    min-width: 44px;
    margin: -6px 0;
    border-radius: 22px;
    --nj-focus-offset: -4px;
}

.mud-pagination .mud-pagination-item-rectangular > .mud-button-root {
    border-radius: calc(var(--mud-default-borderradius) + 6px);
}

/* Date picker days: 36px circles 40px apart, in a 310px calendar. A 4px border makes each 44x44, and the week rows and
   day labels lose their side margins so seven 44px days fit (308px) and line up with their labels; rows are 44px
   apart. Range days are a continuous strip, so they grow on the block axis only and their ring offset stays 2px. */
.mud-picker-calendar .mud-picker-calendar-week {
    margin-inline: 0;
}

.mud-picker-calendar-header-day .mud-day-label {
    width: 44px;
    margin: 0;
}

.mud-picker-calendar .mud-day:not(.mud-range) {
    border: 4px solid transparent;
    background-clip: padding-box;
    width: 44px;
    height: 44px;
    margin: 0;
    --nj-focus-offset: -2px;
}

.mud-picker-calendar .mud-day.mud-range {
    border-style: solid;
    border-color: transparent;
    border-width: 4px 0;
    background-clip: padding-box;
    width: 44px;
    height: 44px;
    --nj-focus-offset: 2px;
}

/* ---------------------------------------------------------------------------------------------------------------
   BR-10: every state-change transition and animation lasts 150 to 250ms (3.3.3, D-5)
   MudBlazor 9.14.0 runs these at 300ms to 500ms, its dialog at 100ms (FC-5). Each takes 200ms and keeps its easing and
   delay. Snackbar and popover timings are set in C# (NjordMudServicesRegistration). Looping loading indicators are not
   state changes and keep their pace. NUI-3.3's 220ms bottom sheet is more specific than .mud-dialog and stays.
   --------------------------------------------------------------------------------------------------------------- */

.mud-alert,
.mud-badge,
.mud-paper,
.mud-table,
.mud-drop-zone,
.mud-expansion-panels,
.mud-expand-panel,
.mud-expand-panel .mud-expand-panel-header,
.mud-tabs-tabbar-content .mud-tabs-tabbar-wrapper,
.mud-tabs-panels,
.mud-tab-slider,
.mud-progress-circular.mud-progress-static,
.mud-progress-circular-circle.mud-progress-static,
.mud-progress-linear .mud-progress-linear-bar,
.mud-time-picker-dial,
.mud-data-grid .drag-icon-options,
.mud-data-grid .mud-table-cell .column-header .sort-direction-icon,
.mud-data-grid .mud-table-cell .column-header .column-options .mud-menu .mud-icon-button-label,
.mud-data-grid-columns-panel .sort-direction-icon,
.mud-data-grid-columns-panel .drag-icon-options,
.mud-scroll-to-top {
    transition-duration: 200ms;
}

/* Chips: background and box shadow 200ms (the outlined chip's boundary is a box shadow above). */
.mud-chip {
    transition-duration: 200ms, 200ms;
}

/* The second transition (visibility, or the overlay's z-index) stays as MudBlazor set it. */
.mud-chip .mud-chip-close-button,
.mud-expand-panel .mud-expand-panel-header .mud-expand-panel-icon,
.mud-nav-link .mud-nav-link-expand-icon,
.mud-treeview-item-arrow .mud-treeview-item-arrow-expand {
    transition-duration: 200ms, 0s;
}

.mud-overlay {
    transition-duration: 200ms, 1ms;
}

/* MudCollapse can write its duration inline, so this one needs !important. An important class rule would outrank the
   reduced-motion rule on `*` (both important, the class more specific), so it applies only with motion on (F-2). */
@media (prefers-reduced-motion: no-preference) {
    .mud-collapse-container {
        transition-duration: 200ms !important;
    }
}

.mud-dialog {
    animation-duration: 200ms;
}

.mud-picker-year-container .mud-picker-year {
    animation-duration: 200ms;
}

/* Ripple: expands and fades in 200ms each (was 500ms and 400ms; OQ6). */
.mud-ripple-effect-expanding,
.mud-ripple-effect-fading {
    transition-duration: 200ms;
}

/* BR-2 (F-6): MudBreadcrumbs draws its "/" separators in TextPrimary at 38% opacity, 2.31:1 in light and 2.98:1 in
   dark on Money and Reported comments. They take TextSecondary, which passes on every ground (3.2). */
.mud-breadcrumbs .mud-breadcrumb-separator > span {
    color: var(--mud-palette-text-secondary);
    opacity: 1;
}

/* D-7: hovered, focused and pressed text and outlined primary buttons sit on Primary's 6% wash, where Primary text is
   4.26:1 in light. 85% Primary mixed with 15% TextPrimary passes in both themes (light 5.19 on Surface, 4.76 on
   BackgroundGray; dark 6.03 on Surface, 5.30 on level 2). Primary itself does not change (BR-4 item 7). */
@media (hover: hover) and (pointer: fine) {
    .mud-button-text.mud-button-text-primary:hover,
    .mud-button-outlined.mud-button-outlined-primary:hover {
        color: color-mix(in srgb, var(--mud-palette-primary) 85%, var(--mud-palette-text-primary));
    }
}

.mud-button-text.mud-button-text-primary:is(:focus-visible, :active),
.mud-button-outlined.mud-button-outlined-primary:is(:focus-visible, :active) {
    color: color-mix(in srgb, var(--mud-palette-primary) 85%, var(--mud-palette-text-primary));
}

/* ---------------------------------------------------------------------------------------------------------------
   BR-11, BR-12: reduced motion (3.3.4, D-4, TQ-4)
   With the system or browser set to reduce motion, nothing animates in either app, the loading screens and the
   authorizing interstitial included. Durations become 0.01ms rather than animation: none, so anything that fades,
   slides or grows in lands on its final frame at once (the loading screen's fade-up text shows) and transitionend and
   animationend still fire. Spinners and skeletons stop on their last frame and keep their role or aria-busy (OQ5).
   The media query re-evaluates live, so turning the setting off restores motion without a reload.
   --------------------------------------------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
    }

    html {
        scroll-behavior: auto !important;
    }

    .mud-ripple-effect {
        display: none !important;
    }
}
