/* VisionPb: the shared MudBlazor layer (Vision.Web/design.md, Variants).

   VisionPb gives the back office the customer portal's feel: warm paper, records on cotton stock lit
   from the top left, one Poolblu blue, General Sans. tokens.css sets the colours and type under the
   VisionPb scope; this file restyles the MudBlazor controls every page shares, after the portal's
   own layer (Vision.Consumer/Client/wwwroot/css/consumer.css). The area sheets in css/visionpb/
   add the shell and page surfaces on top.

   Every selector starts with the VisionPb scope, so Light and Dark never match a rule here. The
   scope's attribute and class also outrank MudBlazor's and site.css's single-purpose selectors,
   which load later. No colour literals: every value is a token from tokens.css. */

/* ---------- Ground ---------- */

/* The scope element is display: contents, but it still passes inherited properties on, so text
   outside MudBlazor's typography classes takes General Sans instead of the body's Plex. General
   Sans ships 400, 500 and 600; no synthesis, so a bold request uses the real 600 face. */
.vision-theme-scope[data-vision-theme="visionpb"] {
    font-family: var(--font-body);
    font-synthesis: none;
    color: var(--color-ink);
}

.vision-theme-scope[data-vision-theme="visionpb"] strong,
.vision-theme-scope[data-vision-theme="visionpb"] b {
    font-weight: var(--weight-strong);
}

.vision-theme-scope[data-vision-theme="visionpb"] ::selection {
    background: color-mix(in oklab, var(--color-accent) 22%, transparent);
    color: var(--color-ink);
}

/* Figures in a column: General Sans has no tabular figures, so they set in Geist Mono. */
.vision-theme-scope[data-vision-theme="visionpb"] .pb-num {
    font-family: var(--vpb-font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

/* ---------- Focus: the blue ring on every control, at once ---------- */

.vision-theme-scope[data-vision-theme="visionpb"] .mud-input-control:focus-within .mud-input-outlined-border {
    border-color: var(--color-focus);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-input-control:focus-within .mud-input.mud-input-outlined {
    outline: 2px solid color-mix(in oklab, var(--color-focus) 45%, transparent);
    outline-offset: 0;
    border-radius: var(--vpb-radius-input);
}

/* ---------- Buttons: letterpress stock, one blue primary ---------- */

.vision-theme-scope[data-vision-theme="visionpb"] .mud-ripple-effect {
    display: none;
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-button-root.mud-button {
    border-radius: var(--vpb-radius-card);
    font-family: var(--font-body);
    font-weight: var(--weight-medium);
    letter-spacing: 0;
    text-transform: none;
    transition:
        transform var(--dur-micro) var(--ease-out),
        background-color var(--dur-micro) var(--ease-out),
        box-shadow var(--dur-micro) var(--ease-out),
        color var(--dur-micro) var(--ease-out);
}

/* A press sinks the stock by a pixel. */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-button-root.mud-button:active:not(:disabled) {
    transform: translateY(1px);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-button-root:disabled {
    box-shadow: none;
    transform: none;
}

/* Filled: the blue (or the board for quiet fills) with a soft cast that grows on hover. */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-button-filled {
    box-shadow: var(--vpb-cast-stock);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-button-filled:hover:not(:disabled) {
    box-shadow: var(--vpb-cast-stock-lift);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-button-filled.mud-button-filled-primary,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-button-filled.mud-button-filled-info {
    background-color: var(--color-accent);
    color: var(--color-accent-ink);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-button-filled.mud-button-filled-primary:hover:not(:disabled),
.vision-theme-scope[data-vision-theme="visionpb"] .mud-button-filled.mud-button-filled-info:hover:not(:disabled) {
    background-color: var(--vpb-accent-2);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-button-filled.mud-button-filled-secondary,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-button-filled.mud-button-filled-dark,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-button-filled.mud-button-filled-tertiary {
    background-color: var(--vpb-board);
    color: var(--vpb-board-type);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-button-filled.mud-button-filled-default {
    background-color: var(--vpb-cotton);
    color: var(--color-ink);
    box-shadow: var(--vpb-edge-stock), var(--vpb-cast-stock);
}

/* Outlined is the secondary: a cotton card with a lit edge, the label in its colour. The border
   turns transparent rather than going, so every button keeps the size its page was laid out for. */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-button-outlined {
    background-color: var(--vpb-cotton);
    border-color: transparent;
    box-shadow: var(--vpb-edge-stock), var(--vpb-cast-stock);
    color: var(--color-ink);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-button-outlined:hover:not(:disabled) {
    background-color: var(--vpb-cotton);
    box-shadow: var(--vpb-edge-stock), var(--vpb-cast-stock-lift);
    transform: translateY(-1px);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-button-outlined.mud-button-outlined-primary,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-button-outlined.mud-button-outlined-info {
    color: var(--color-accent);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-button-outlined.mud-button-outlined-error {
    color: var(--vpb-state-bad);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-button-outlined.mud-button-outlined-success {
    color: var(--vpb-state-ok);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-button-outlined.mud-button-outlined-warning {
    color: var(--vpb-state-warn);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-button-text:hover:not(:disabled),
.vision-theme-scope[data-vision-theme="visionpb"] .mud-icon-button:hover:not(:disabled) {
    background-color: var(--color-hover);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-button-text.mud-button-text-primary,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-button-text.mud-button-text-info {
    color: var(--color-accent);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-icon-button {
    border-radius: var(--vpb-radius-card);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-toggle-group {
    border-radius: var(--vpb-radius-card);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-toggle-item {
    text-transform: none;
    letter-spacing: 0;
}

/* ---------- Surfaces: cotton stock on warm paper ---------- */

.vision-theme-scope[data-vision-theme="visionpb"] .mud-paper {
    background-color: var(--vpb-cotton);
}

/* Raised papers and cards, and the outlined surface the Light theme draws with a rule, become
   stock: a lit edge and a cast. The outline turns transparent, so no surface changes size. */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-paper.mud-elevation-1,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-paper.mud-elevation-2,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-paper.mud-paper-outlined {
    border-color: transparent;
    border-radius: var(--vpb-radius-card);
    box-shadow: var(--vpb-edge-stock), var(--vpb-cast-stock);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-paper.mud-elevation-3,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-paper.mud-elevation-4 {
    border-color: transparent;
    border-radius: var(--vpb-radius-card);
    box-shadow: var(--vpb-edge-stock), var(--vpb-cast-stock-lift);
}

/* site.css flattens elevation to a rule inside .pb-flat-surfaces; in VisionPb those are stock too. */
.vision-theme-scope[data-vision-theme="visionpb"] .pb-flat-surfaces .mud-paper.mud-elevation-1,
.vision-theme-scope[data-vision-theme="visionpb"] .pb-flat-surfaces .mud-paper.mud-elevation-2,
.vision-theme-scope[data-vision-theme="visionpb"] .pb-flat-surfaces .mud-paper.mud-elevation-3,
.vision-theme-scope[data-vision-theme="visionpb"] .pb-flat-surfaces .mud-paper.mud-elevation-4,
.vision-theme-scope[data-vision-theme="visionpb"] .pb-flat-surfaces .mud-table.mud-elevation-1,
.vision-theme-scope[data-vision-theme="visionpb"] .pb-flat-surfaces .mud-table.mud-elevation-2 {
    border-color: transparent;
    box-shadow: var(--vpb-edge-stock), var(--vpb-cast-stock);
}

/* Never a card inside a card: a table or grid inside a sheet, and a nested paper inside a flat
   page's surface, are part of that sheet. */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-paper .mud-table.mud-paper,
.vision-theme-scope[data-vision-theme="visionpb"] .pb-flat-surfaces .mud-paper .mud-paper:not(.mud-popover) {
    border-color: transparent;
    box-shadow: none;
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-paper.mud-elevation-0:not(.mud-paper-outlined) {
    box-shadow: none;
}

/* A quiet panel (filters, side notes) is a groove pressed into paper; opt in with this class. */
.vision-theme-scope[data-vision-theme="visionpb"] .pb-surface-muted {
    background-color: var(--color-surface-2);
    border-color: transparent;
    border-radius: var(--vpb-radius-card);
    box-shadow: var(--vpb-press-groove);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-divider {
    border-color: var(--color-rule);
}

/* ---------- Floating layers: menus, dialogs, tooltips, snackbars ---------- */

.vision-theme-scope[data-vision-theme="visionpb"] .mud-popover.mud-paper {
    border-radius: var(--vpb-radius-card);
    box-shadow: var(--vpb-edge-stock), var(--vpb-cast-stock-lift);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-dialog {
    background-color: var(--vpb-cotton);
    border-radius: 10px;
    box-shadow: var(--vpb-edge-stock), var(--vpb-cast-dialog);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-dialog .mud-dialog-title {
    font-weight: var(--weight-strong);
    letter-spacing: -0.015em;
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-overlay .mud-overlay-scrim.mud-overlay-dark {
    background-color: color-mix(in oklab, var(--color-ink) 42%, transparent);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-tooltip.mud-tooltip-default {
    background-color: var(--vpb-board);
    color: var(--vpb-board-type);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-snackbar {
    border-radius: var(--vpb-radius-card);
    font-family: var(--font-body);
}

/* ---------- Chips: a tint and an ink, never a loud fill ---------- */

.vision-theme-scope[data-vision-theme="visionpb"] .mud-chip.mud-chip-size-small,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-chip.mud-chip-size-medium {
    border-radius: 6px;
    font-weight: var(--weight-medium);
    letter-spacing: 0;
}

/* StatusChip (.status-chip) keeps its solid --status-* fill: staff read order states by those
   hues, so only MudBlazor's colour chips take the tint. */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-chip:is(.mud-chip-filled, .mud-chip-outlined, .mud-chip-text):not(.status-chip) {
    --vpb-chip-ink: var(--vpb-state-quiet);
    background-color: color-mix(in oklab, var(--vpb-chip-ink) 9%, var(--vpb-cotton));
    border-color: transparent;
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--vpb-chip-ink) 30%, transparent);
    color: var(--vpb-chip-ink);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-chip:is(.mud-chip-color-primary, .mud-chip-color-info, .mud-chip-color-tertiary):not(.status-chip) {
    --vpb-chip-ink: var(--vpb-state-info);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-chip.mud-chip-color-success:not(.status-chip) {
    --vpb-chip-ink: var(--vpb-state-ok);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-chip.mud-chip-color-warning:not(.status-chip) {
    --vpb-chip-ink: var(--vpb-state-warn);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-chip.mud-chip-color-error:not(.status-chip) {
    --vpb-chip-ink: var(--vpb-state-bad);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-chip:not(.status-chip) .mud-icon-root {
    color: inherit;
}

/* ---------- Tables: horizontal rules only, quiet heads ---------- */

.vision-theme-scope[data-vision-theme="visionpb"] .mud-table-root .mud-table-head .mud-table-cell {
    background-color: var(--vpb-cotton);
    border-bottom: var(--rule-width) solid var(--color-rule);
    color: var(--color-ink-2);
    font-family: var(--font-body);
    font-weight: var(--weight-medium);
    letter-spacing: 0;
    text-transform: none;
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-table-root .mud-table-body .mud-table-cell {
    border-bottom-color: var(--vpb-paper-3);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-table-pagination {
    border-top: var(--rule-width) solid var(--color-rule);
    color: var(--color-ink-2);
}

/* ---------- Inputs ---------- */

.vision-theme-scope[data-vision-theme="visionpb"] .mud-input.mud-input-outlined {
    background-color: var(--vpb-cotton);
    border-radius: var(--vpb-radius-input);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-input.mud-input-outlined .mud-input-outlined-border {
    border-color: var(--color-rule-strong);
    border-radius: var(--vpb-radius-input);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-input.mud-input-outlined:not(.mud-disabled):not(:focus-within):hover .mud-input-outlined-border {
    border-color: var(--color-ink-2);
}

/* ---------- Alerts ---------- */

.vision-theme-scope[data-vision-theme="visionpb"] .mud-alert {
    border-radius: var(--vpb-radius-card);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-alert[class*="mud-alert-outlined-"] {
    background-color: var(--vpb-cotton);
    border-color: var(--color-rule);
    box-shadow: var(--vpb-edge-stock);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-alert[class*="mud-alert-text-"] {
    background-color: var(--color-surface-2);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-alert.mud-alert-text-error {
    background-color: color-mix(in oklab, var(--vpb-state-bad) 7%, var(--vpb-cotton));
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-alert.mud-alert-text-warning {
    background-color: color-mix(in oklab, var(--vpb-state-warn) 8%, var(--vpb-cotton));
}

/* ---------- Tabs and progress ---------- */

/* The tab voice keeps its accent bar, now in the blue (the MudTheme primary). Labels stay in
   sentence case, untracked. */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-tab {
    letter-spacing: 0;
    text-transform: none;
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-tab-slider {
    background: var(--color-accent);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-skeleton {
    background-color: var(--vpb-paper-3);
}

/* ---------- Shared controls, round 2 ---------- */

/* Filter panel: a recessed well in paper, like the portal's filter strip. The fields inside stay cotton. */
.vision-theme-scope[data-vision-theme="visionpb"] .filter-panel.mud-paper {
    background-color: var(--color-surface-2);
    border-color: transparent;
    box-shadow: var(--vpb-press-groove);
}

/* Filter panels that are not a MudPaper take the same well. */
.vision-theme-scope[data-vision-theme="visionpb"] .filter-panel {
    background-color: var(--color-surface-2);
    border-color: transparent;
    border-radius: var(--vpb-radius-card);
    box-shadow: var(--vpb-press-groove);
}

/* Grid heads: the column-header span and sort label carry their own weight; keep them quiet. */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-table-head .mud-table-cell .column-header,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-table-head .mud-table-cell .mud-table-sort-label {
    color: var(--color-ink-2);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

/* "Advanced" and the column picker: quiet text-weight controls, in the accent only on hover or focus. */
.vision-theme-scope[data-vision-theme="visionpb"] .filter-advanced-toggle {
    color: var(--color-ink-2);
    font-weight: var(--weight-medium);
}

.vision-theme-scope[data-vision-theme="visionpb"] .filter-advanced-toggle:hover {
    color: var(--color-accent);
}

.vision-theme-scope[data-vision-theme="visionpb"] .filter-panel-advanced {
    border-top-color: var(--color-rule);
}

/* Breadcrumbs: links in the accent, the current page in quiet ink. */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-breadcrumbs .mud-breadcrumb-item a {
    color: var(--color-accent);
    font-weight: var(--weight-medium);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-breadcrumbs .mud-breadcrumb-item a:hover {
    color: var(--vpb-accent-2);
    text-decoration: underline;
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-breadcrumbs .mud-breadcrumb-item.mud-disabled,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-breadcrumbs .mud-breadcrumb-item.mud-disabled a {
    color: var(--color-ink-2);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-breadcrumbs .mud-breadcrumb-separator {
    color: var(--color-ink-3);
}

/* Dialogs: a head and a foot set off by hairlines, the foot a quiet strip like the portal's action bar. */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-dialog .mud-dialog-title {
    border-bottom: var(--rule-width) solid var(--color-rule);
    color: var(--color-ink);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-dialog .mud-dialog-content {
    color: var(--color-ink);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-dialog .mud-dialog-actions {
    background-color: var(--color-surface-2);
    border-bottom-left-radius: inherit;
    border-bottom-right-radius: inherit;
    border-top: var(--rule-width) solid var(--color-rule);
}

/* Tabs: a hairline under the bar, quiet labels, ink for the active tab, a soft tint on hover. */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-tabs-tabbar {
    background-color: transparent;
    border-bottom: var(--rule-width) solid var(--color-rule);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-tab {
    color: var(--color-ink-2);
    font-family: var(--font-body);
    font-weight: var(--weight-medium);
    transition:
        background-color var(--dur-micro) var(--ease-out),
        color var(--dur-micro) var(--ease-out);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-tab:hover {
    background-color: var(--color-hover);
    color: var(--color-ink);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-tab.mud-tab-active {
    color: var(--color-accent);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-tab:focus-visible,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-expand-panel-header:focus-visible,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-list-item:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
}

/* Expansion panels: stock cards with a lit edge; a header in medium weight and a hairline under it. */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-expand-panel.mud-elevation-1,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-expand-panel.mud-elevation-2 {
    background-color: var(--vpb-cotton);
    box-shadow: var(--vpb-edge-stock), var(--vpb-cast-stock);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-expand-panels .mud-expand-panel.mud-expand-panel-border {
    border-bottom-color: var(--color-rule);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-expand-panel-header {
    font-weight: var(--weight-medium);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-expand-panel-header:hover {
    background-color: var(--color-hover);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-expand-panel.mud-panel-expanded > .mud-expand-panel-header {
    border-bottom: var(--rule-width) solid var(--color-rule);
}

/* Grid toolbar and pager: transparent bars on the card, quiet ink, figures that line up. */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-table .mud-toolbar,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-data-grid .mud-toolbar {
    background-color: transparent;
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-table-pagination .mud-table-pagination-caption,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-table-pagination .mud-table-pagination-information {
    color: var(--color-ink-2);
    font-variant-numeric: tabular-nums;
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-table-pagination .mud-select-input {
    color: var(--color-ink);
    font-weight: var(--weight-medium);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-table-pagination .mud-icon-button:not(:disabled) {
    color: var(--color-ink);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-table-pagination .mud-icon-button:disabled {
    color: var(--color-ink-3);
}

/* Rows: a warm hover tint instead of MudBlazor's cool grey. */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-table-hover .mud-table-body .mud-table-row:hover > .mud-table-cell,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-table-hover .mud-table-body .mud-table-row:hover {
    background-color: var(--color-hover);
}

/* Pickers: a cotton popover, tabular day numbers, the header in the accent. */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-picker-content,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-picker-container {
    background-color: var(--vpb-cotton);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-day,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-picker-calendar-header-day {
    font-family: var(--font-body);
    font-variant-numeric: tabular-nums;
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-day:hover:not(.mud-selected):not(:disabled) {
    background-color: var(--color-hover);
}

/* Menus, selects and autocomplete lists: warm hover, a soft accent wash for the selected row. */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-list-item.mud-list-item-clickable:hover:not(.mud-disabled) {
    background-color: var(--color-hover);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-list-item.mud-selected-item,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-list-item.mud-selected-item:hover {
    background-color: var(--vpb-accent-soft);
    color: var(--vpb-state-info);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-list-subheader {
    color: var(--color-ink-2);
    font-weight: var(--weight-medium);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-popover .mud-divider {
    border-color: var(--color-rule);
}

/* Tooltips: the board's dark stock, a small corner and a cast, set in General Sans. */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-tooltip.mud-tooltip-default {
    border-radius: var(--vpb-radius-input);
    box-shadow: var(--vpb-cast-stock);
    font-family: var(--font-body);
}

/* Snackbars and filled alerts: a soft tint and a darker ink of one hue, like a chip, not a solid block.
   The neutral fill keeps the board's dark stock. */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-snackbar[class*="mud-alert-filled-"],
.vision-theme-scope[data-vision-theme="visionpb"] .mud-alert[class*="mud-alert-filled-"] {
    --vpb-alert-ink: var(--vpb-state-quiet);
    background-color: color-mix(in oklab, var(--vpb-alert-ink) 10%, var(--vpb-cotton));
    box-shadow: var(--vpb-edge-stock), var(--vpb-cast-stock-lift);
    color: var(--vpb-alert-ink);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-snackbar.mud-alert-filled-success,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-alert.mud-alert-filled-success {
    --vpb-alert-ink: var(--vpb-state-ok);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-snackbar.mud-alert-filled-error,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-alert.mud-alert-filled-error {
    --vpb-alert-ink: var(--vpb-state-bad);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-snackbar.mud-alert-filled-warning,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-alert.mud-alert-filled-warning {
    --vpb-alert-ink: var(--vpb-state-warn);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-snackbar.mud-alert-filled-info,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-snackbar.mud-alert-filled-primary,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-alert.mud-alert-filled-info,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-alert.mud-alert-filled-primary {
    --vpb-alert-ink: var(--vpb-state-info);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-snackbar.mud-alert-filled-normal,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-alert.mud-alert-filled-normal {
    background-color: var(--vpb-board);
    color: var(--vpb-board-type);
}

/* Inline alerts: every hue gets the same tint and ink; outlined ones take a hairline of their hue. */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-alert.mud-alert-text-success {
    background-color: color-mix(in oklab, var(--vpb-state-ok) 8%, var(--vpb-cotton));
    color: var(--vpb-state-ok);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-alert.mud-alert-text-info {
    background-color: color-mix(in oklab, var(--vpb-state-info) 7%, var(--vpb-cotton));
    color: var(--vpb-state-info);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-alert.mud-alert-text-error {
    color: var(--vpb-state-bad);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-alert.mud-alert-text-warning {
    color: var(--vpb-state-warn);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-alert.mud-alert-outlined-success { border-color: color-mix(in oklab, var(--vpb-state-ok) 35%, transparent); }
.vision-theme-scope[data-vision-theme="visionpb"] .mud-alert.mud-alert-outlined-error { border-color: color-mix(in oklab, var(--vpb-state-bad) 35%, transparent); }
.vision-theme-scope[data-vision-theme="visionpb"] .mud-alert.mud-alert-outlined-warning { border-color: color-mix(in oklab, var(--vpb-state-warn) 35%, transparent); }
.vision-theme-scope[data-vision-theme="visionpb"] .mud-alert.mud-alert-outlined-info { border-color: color-mix(in oklab, var(--vpb-state-info) 35%, transparent); }

/* Progress: a rounded bar and track, like the portal's meters. */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-progress-linear {
    border-radius: 999px;
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-progress-linear .mud-progress-linear-bar {
    border-radius: 999px;
}

/* Form labels and helper text: quiet ink for labels and hints, the state ink for errors. */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-input-label {
    color: var(--color-ink-2);
    font-family: var(--font-body);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-input-control:focus-within > .mud-input-control-input-container > .mud-input-label {
    color: var(--color-accent);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-input-helper-text {
    color: var(--color-ink-2);
    font-family: var(--font-body);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-input-helper-text.mud-input-error,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-input-control.mud-input-error .mud-input-helper-text {
    color: var(--vpb-state-bad);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-input-control.mud-input-error .mud-input.mud-input-outlined .mud-input-outlined-border {
    border-color: var(--vpb-state-bad);
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-input-control .mud-input-slot,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-input-control input,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-input-control textarea {
    font-family: var(--font-body);
}

/* Switch, checkbox and radio: a visible ring for keyboard focus (the ripple is off in this theme). */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-checkbox:has(input:focus-visible) .mud-icon-root,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-radio:has(input:focus-visible) .mud-icon-root,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-switch:has(input:focus-visible) .mud-switch-track {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
    border-radius: 4px;
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-checkbox .mud-typography,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-switch .mud-typography,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-radio .mud-typography {
    color: var(--color-ink);
}

/* Sticky save bar: a cotton strip with a lit top edge and a soft upward cast. */
.vision-theme-scope[data-vision-theme="visionpb"] .pb-sticky-actions {
    background-color: var(--vpb-cotton);
    border-top: var(--rule-width) solid var(--color-rule);
    box-shadow: 0 -8px 14px -10px oklch(var(--vpb-shade) / 0.28);
}

/* Empty states: quiet ink; the icon recedes. */
.vision-theme-scope[data-vision-theme="visionpb"] .empty-state .mud-icon-root {
    color: var(--color-ink-3);
}

/* Chips on the filter bar and elsewhere: the close button follows the chip's ink. */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-chip:not(.status-chip) .mud-chip-close-button {
    color: inherit;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .vision-theme-scope[data-vision-theme="visionpb"] .mud-button-root.mud-button,
    .vision-theme-scope[data-vision-theme="visionpb"] .mud-button-root.mud-button:active:not(:disabled),
    .vision-theme-scope[data-vision-theme="visionpb"] .mud-button-outlined:hover:not(:disabled) {
        transform: none;
        transition: none;
    }
}
