:root {
        --wv-space-1: .25rem;
        --wv-space-2: .5rem;
        --wv-space-3: .75rem;
        --wv-space-4: 1rem;
        --wv-space-5: 1.25rem;
        --wv-space-6: 1.5rem;
        --wv-space-8: 2rem;
        --wv-control-xs: 7rem;
        --wv-control-sm: 12rem;
        --wv-control-md: 22rem;
        --wv-control-lg: 34rem;
        --wv-control-height: 2.875rem;
        --wv-border: rgb(203 213 225);
        --wv-border-soft: rgb(226 232 240);
        --wv-muted: rgb(100 116 139);
        --wv-surface: rgb(255 255 255);
        --wv-surface-soft: rgb(248 250 252);
        --wv-surface-hover: rgb(241 245 249);
        --wv-danger-soft: rgb(254 242 242);
        --wv-radius-control: .6rem;
        --wv-radius-card: .9rem;
        --wv-shadow-card: 0 1px 2px rgba(15, 23, 42, .04);
        --wv-sidebar-safe-x: 1rem;
        --wv-table-row-y: .55rem;
        --wv-table-header-y: .65rem;
    }

    /* Shell invariants. Feature modules may never move or resize the application shell. */
    .fi-breadcrumbs { display: none !important; }
    .fi-main { width: 100%; max-width: none !important; }
    .fi-page { width: 100%; }
    .fi-page-header-main-ctn,
    .fi-page-content { max-width: none !important; }

    /* Page headers are deliberately compact. Large title whitespace is not a design default. */
    .fi-page-header-main-ctn {
        gap: var(--wv-space-5) !important;
        padding-block: var(--wv-space-5) !important;
    }
    .fi-page-content { gap-y: var(--wv-space-5) !important; }
    .fi-header { row-gap: var(--wv-space-2) !important; }
    .fi-header-heading { line-height: 1.15 !important; }
    .wv-content-readable { width: min(100%, 72rem); }
    .wv-content-form { width: min(100%, 58rem); }
    .wv-content-settings { width: min(100%, 68rem); }
    .wv-sr-only {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }

    /* Page rhythm is enforced with gap, not collapsing margins. */
    .wv-page-stack,
    .wv-stack,
    .wv-form-stack {
        display: flex;
        flex-direction: column;
    }
    .wv-page-stack { gap: var(--wv-space-5); }
    .wv-stack { gap: var(--wv-space-4); }
    .wv-form-stack { gap: var(--wv-space-5); }
    .wv-form-grid {
        display: grid;
        gap: var(--wv-space-5);
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
        align-items: start;
    }
    .wv-form-grid-compact { grid-template-columns: repeat(auto-fit, minmax(12rem, max-content)); }
    .wv-filter-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(10rem, 1fr));
        gap: var(--wv-space-4);
        align-items: end;
    }
    .wv-filter-grid-5 { grid-template-columns: 11rem 11rem minmax(12rem, 1fr) minmax(12rem, 1fr) minmax(14rem, 1.2fr); }
    .wv-filter-wide { grid-column: span 2; }

    /* Filament sections are treated as consistent cards. */
    .fi-section {
        border-radius: var(--wv-radius-card) !important;
        box-shadow: var(--wv-shadow-card) !important;
    }
    .fi-section-content-ctn { min-width: 0; }

    /* Actions are grouped and always separated from adjacent content. */
    .wv-actions {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--wv-space-3);
        margin-block: var(--wv-space-4);
    }
    .wv-actions:first-child { margin-top: 0; }
    .wv-actions:last-child { margin-bottom: 0; }
    .wv-actions > * { margin: 0 !important; }
    .fi-form-actions { margin-top: var(--wv-space-5) !important; gap: var(--wv-space-3) !important; }
    .wv-actions-end { justify-content: flex-end; }
    .wv-button-gap { margin-top: var(--wv-space-4); }

    /* Destructive actions are intentionally separated and de-emphasized until needed. */
    .wv-danger-zone {
        margin-top: var(--wv-space-8);
        border: 1px solid rgb(254 202 202);
        border-radius: var(--wv-radius-card);
        background: var(--wv-danger-soft);
        padding: var(--wv-space-5);
    }
    .wv-danger-zone-head { margin-bottom: var(--wv-space-4); }
    .wv-danger-zone-title { font-weight: 700; color: rgb(153 27 27); }
    .wv-danger-zone-copy { margin-top: var(--wv-space-1); color: rgb(185 28 28); font-size: .8125rem; }
    .wv-danger-zone-actions { display: flex; justify-content: flex-end; gap: var(--wv-space-3); }
    .wv-danger-action { margin-inline-start: auto !important; }
    .dark .wv-danger-zone { border-color: rgba(239,68,68,.22); background: rgba(239,68,68,.07); }
    .dark .wv-danger-zone-title { color: rgb(254 202 202); }
    .dark .wv-danger-zone-copy { color: rgb(252 165 165); }

    /* Field sizing follows information density. */
    .wv-field-xs { width: min(100%, var(--wv-control-xs)); max-width: var(--wv-control-xs); }
    .wv-field-sm { width: min(100%, var(--wv-control-sm)); max-width: var(--wv-control-sm); }
    .wv-field-md { width: min(100%, var(--wv-control-md)); max-width: var(--wv-control-md); }
    .wv-field-lg { width: min(100%, var(--wv-control-lg)); max-width: var(--wv-control-lg); }
    .wv-field-auto { width: fit-content; max-width: 100%; }
    .wv-field-short-select { width: min(100%, 14rem); max-width: 14rem; }
    .wv-field-email { width: min(100%, 28rem); max-width: 28rem; }
    .fi-fo-field.wv-field-email { width: min(100%, 28rem) !important; max-width: 28rem !important; }
    .wv-field-password { width: min(100%, 22rem); max-width: 22rem; }
    .fi-fo-field.wv-field-password { width: min(100%, 22rem) !important; max-width: 22rem !important; }
    .fi-fo-field:has(input[type="number"]) { width: min(100%, 10rem); max-width: 10rem; }
    .fi-fo-field.wv-compact-control { width: min(100%, var(--wv-control-sm)) !important; max-width: var(--wv-control-sm) !important; }
    .fi-fo-field.wv-number-control { width: min(100%, 10rem) !important; max-width: 10rem !important; }
    .fi-fo-field.wv-secret-control { width: min(100%, var(--wv-control-md)) !important; max-width: var(--wv-control-md) !important; }
    .fi-fo-field.wv-field-md { width: min(100%, var(--wv-control-md)) !important; max-width: var(--wv-control-md) !important; }
    .fi-fo-field.wv-field-sm { width: min(100%, var(--wv-control-sm)) !important; max-width: var(--wv-control-sm) !important; }
    .fi-fo-field.wv-field-lg { width: min(100%, var(--wv-control-lg)) !important; max-width: var(--wv-control-lg) !important; }
    .fi-sc-form .fi-fo-field { align-self: start; }

    /* Peer text/select controls use one shared height unless a component is intentionally multiline. */
    .fi-input:not(textarea),
    .fi-select-input,
    .fi-input-wrp:has(.fi-input:not(textarea)),
    .fi-input-wrp:has(.fi-select-input) {
        min-height: var(--wv-control-height) !important;
    }
    .fi-input:not(textarea),
    .fi-select-input {
        height: var(--wv-control-height) !important;
    }
    /* Peer single-line fields in one row must render at exactly the same control height. */
    .fi-fo-text-input .fi-input-wrp:not(:has(textarea)),
    .fi-fo-select .fi-input-wrp,
    .wv-form-grid .fi-input-wrp:not(:has(textarea)) {
        height: var(--wv-control-height) !important;
        min-height: var(--wv-control-height) !important;
    }

    /* Labels and supporting text have a fixed hierarchy. */
    .wv-label { display: block; margin-bottom: var(--wv-space-2); font-size: .875rem; font-weight: 600; color: rgb(30 41 59); }
    .wv-help,
    .wv-meta,
    .fi-fo-field-wrp-helper-text,
    .fi-fo-field-wrp-hint {
        margin-top: var(--wv-space-2);
        color: var(--wv-muted) !important;
        font-size: .8125rem !important;
        font-weight: 400 !important;
        line-height: 1.4;
    }
    .wv-error { margin-top: var(--wv-space-2); color: rgb(220 38 38); font-size: .8125rem; }
    .dark .wv-label { color: rgb(226 232 240); }
    .dark .wv-help,
    .dark .wv-meta { color: rgb(148 163 184) !important; }

    /* Checkboxes and toggles always have visible label spacing. */
    label:has(input[type="checkbox"]),
    .fi-fo-checkbox-list-option-label,
    .fi-toggle-label { column-gap: var(--wv-space-2) !important; }
    .wv-checkbox { display: inline-flex; align-items: center; gap: var(--wv-space-2); }

    /* Native controls used by Base-owned custom pages are unmistakably controls. */
    .wv-native-input,
    .wv-native-select,
    .wv-native-textarea {
        border: 1px solid var(--wv-border);
        border-radius: var(--wv-radius-control);
        background: var(--wv-surface-soft);
        padding: .625rem .75rem;
        color: rgb(15 23 42);
        width: 100%;
        min-height: var(--wv-control-height);
        box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
    }
    .wv-native-input:hover,
    .wv-native-select:hover,
    .wv-native-textarea:hover { border-color: rgb(148 163 184); background: var(--wv-surface); }
    .wv-native-input:focus,
    .wv-native-select:focus,
    .wv-native-textarea:focus {
        outline: 2px solid rgba(59,130,246,.18);
        outline-offset: 1px;
        border-color: rgb(100 116 139);
        background: var(--wv-surface);
    }
    .wv-native-select { padding-right: 2.25rem; }
    .wv-native-input[type="number"] { width: 6.5rem; max-width: 6.5rem; }
    .wv-field-auto .wv-native-select,
    .wv-field-auto .wv-native-input { width: auto; min-width: 8rem; max-width: 100%; }
    .wv-field-short-select .wv-native-select { width: 100%; }
    .dark .wv-native-input,
    .dark .wv-native-select,
    .dark .wv-native-textarea {
        border-color: rgba(255,255,255,.16);
        background: rgba(255,255,255,.055);
        color: #fff;
        box-shadow: none;
    }
    .dark .wv-native-input:hover,
    .dark .wv-native-select:hover,
    .dark .wv-native-textarea:hover { background: rgba(255,255,255,.08); }

    /* Compact value + unit controls. Text baselines align at the bottom of the row. */
    .wv-inline-setting {
        display: inline-grid;
        grid-template-columns: max-content max-content;
        align-items: end;
        column-gap: var(--wv-space-2);
        width: fit-content;
        min-height: var(--wv-control-height);
    }
    .wv-unit-control {
        display: inline-grid;
        grid-template-columns: max-content max-content;
        align-items: end;
        column-gap: var(--wv-space-2);
        width: fit-content;
    }
    .wv-unit-control .wv-native-input { width: 6.5rem; max-width: 6.5rem; }
    .wv-inline-setting > .wv-label,
    .wv-unit {
        display: flex;
        align-items: flex-end;
        min-height: var(--wv-control-height);
        margin: 0;
        padding-bottom: .67rem;
        line-height: 1.25rem;
        white-space: nowrap;
    }
    .wv-unit { color: var(--wv-muted); font-size: .8125rem; }

    /* Uploads: avatars/logos are compact visual tiles, not page-wide browser widgets. */
    input[type="file"].wv-sr-only { display: none !important; }
    .wv-upload-tile {
        width: 10rem;
        min-height: 10rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: var(--wv-space-2);
        border: 1px dashed rgb(148 163 184);
        border-radius: .8rem;
        background: var(--wv-surface-soft);
        padding: var(--wv-space-3);
        text-align: center;
        cursor: pointer;
        transition: background .15s ease, border-color .15s ease, transform .15s ease;
    }
    .wv-upload-tile:hover { background: var(--wv-surface-hover); border-color: rgb(100 116 139); }
    .wv-upload-tile-icon-wrap { display: inline-flex; width: 2.5rem; height: 2.5rem; align-items: center; justify-content: center; border-radius: .7rem; background: rgba(148,163,184,.12); }
    .wv-upload-tile-icon { width: 1.35rem; height: 1.35rem; color: var(--wv-muted); }
    .wv-upload-tile-title { font-size: .875rem; font-weight: 650; color: rgb(30 41 59); }
    .wv-upload-tile img { width: 5.5rem; height: 5.5rem; object-fit: contain; border-radius: .65rem; background: #fff; }
    .wv-logo-upload { width: 10rem; min-height: 10rem; }
    .wv-avatar-upload { width: 9rem; min-height: 9rem; border-radius: 999px; }
    .wv-avatar-upload img { border-radius: 999px; object-fit: cover; }
    .wv-favicon-upload { width: 7rem; min-height: 7rem; }
    .wv-favicon-upload img { width: 3.5rem; height: 3.5rem; object-fit: contain; }
    .wv-upload-secondary-action { margin-top: var(--wv-space-3); }
    .wv-branding-upload-grid { display: grid; grid-template-columns: repeat(2, max-content); gap: var(--wv-space-8); align-items: start; }
    .dark .wv-upload-tile { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.04); }
    .dark .wv-upload-tile:hover { background: rgba(255,255,255,.07); }
    .dark .wv-upload-tile-title { color: rgb(226 232 240); }

    /* Filament FileUpload used for logos follows the same compact tile contract. */
    .fi-fo-field.wv-logo-upload-control { width: 12rem !important; max-width: 12rem !important; }
    .wv-logo-upload-control .filepond--root { width: 11rem !important; min-height: 10rem !important; margin-bottom: 0 !important; }
    .wv-logo-upload-control .filepond--panel-root { background: var(--wv-surface-soft) !important; border: 1px dashed rgb(148 163 184) !important; border-radius: .8rem !important; }
    .wv-logo-upload-control .filepond--drop-label { min-height: 10rem !important; color: var(--wv-muted) !important; font-size: .8125rem !important; }
    .wv-logo-upload-control .filepond--item { width: 100% !important; }
    .wv-logo-upload-control .fi-fo-file-upload { width: 11rem !important; max-width: 11rem !important; }
    .wv-logo-upload-control .filepond--wrapper { width: 11rem !important; max-width: 11rem !important; }

    /* Reusable layout primitives. */
    .wv-row { display: flex; align-items: center; gap: var(--wv-space-3); }
    .wv-row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--wv-space-3); }
    .wv-row-end { display: flex; flex-wrap: wrap; align-items: end; gap: var(--wv-space-4); }
    .wv-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--wv-space-4); }
    .wv-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--wv-space-4); }
    .wv-muted { color: var(--wv-muted); }
    .wv-small { font-size: .8125rem; }
    .wv-code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .75rem; overflow-wrap: anywhere; }
    .wv-divider-list > * + * { border-top: 1px solid var(--wv-border-soft); }
    .dark .wv-divider-list > * + * { border-top-color: rgba(255,255,255,.1); }
    .wv-list-row { display: flex; align-items: center; justify-content: space-between; gap: var(--wv-space-4); padding-block: var(--wv-space-3); }

    /* Disclosure rows keep arrow + content on one line and only reveal detail on demand. */
    .wv-details { overflow: hidden; border: 1px solid var(--wv-border-soft); border-radius: .75rem; background: var(--wv-surface); }
    .dark .wv-details { border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.025); }
    .wv-details + .wv-details { margin-top: var(--wv-space-3); }
    .wv-details-summary {
        display: flex;
        align-items: center;
        gap: var(--wv-space-3);
        cursor: pointer;
        list-style: none;
        padding: .8rem 1rem;
    }
    .wv-details-summary::-webkit-details-marker { display: none; }
    .wv-details-summary::before {
        content: '›';
        flex: 0 0 auto;
        color: var(--wv-muted);
        font-size: 1.1rem;
        line-height: 1;
        transform: rotate(0deg);
        transition: transform .15s ease;
    }
    details[open] > .wv-details-summary::before { transform: rotate(90deg); }
    .wv-details-summary-content { min-width: 0; flex: 1 1 auto; }
    .wv-details-body { border-top: 1px solid var(--wv-border-soft); padding: 1rem; }
    .dark .wv-details-body { border-top-color: rgba(255,255,255,.1); }
    .wv-entry-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--wv-space-2); font-size: .875rem; }
    .wv-entry-time { margin-left: auto; color: var(--wv-muted); font-size: .75rem; white-space: nowrap; }

    .wv-badge { display: inline-flex; width: fit-content; align-items: center; border-radius: 999px; padding: .2rem .5rem; font-size: .72rem; font-weight: 700; line-height: 1.25; }
    .wv-badge-neutral { background: rgb(241 245 249); color: rgb(51 65 85); }
    .wv-badge-success { background: rgb(240 253 244); color: rgb(21 128 61); }
    .wv-badge-warning { background: rgb(255 251 235); color: rgb(180 83 9); }
    .wv-badge-danger { background: rgb(254 242 242); color: rgb(185 28 28); }
    .dark .wv-badge-neutral { background: rgba(255,255,255,.08); color: rgb(209 213 219); }
    .dark .wv-badge-success { background: rgba(34,197,94,.12); color: rgb(134 239 172); }
    .dark .wv-badge-warning { background: rgba(245,158,11,.12); color: rgb(253 230 138); }
    .dark .wv-badge-danger { background: rgba(239,68,68,.12); color: rgb(252 165 165); }
    .wv-code-block { max-height: 24rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: .6rem; background: rgb(15 23 42); padding: .85rem; color: rgb(241 245 249); font: .75rem/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
    .wv-status-card { border: 1px solid var(--wv-border-soft); border-radius: .75rem; padding: 1rem; background: var(--wv-surface-soft); }
    .dark .wv-status-card { border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.025); }
    .wv-status-label { color: var(--wv-muted); font-size: .8125rem; }
    .wv-status-value { margin-top: .25rem; font-weight: 700; }
    .wv-empty { padding: 1.5rem; text-align: center; color: var(--wv-muted); font-size: .875rem; }
    .wv-alert { border: 1px solid rgb(254 202 202); border-radius: .6rem; background: rgb(254 242 242); padding: .75rem; color: rgb(185 28 28); font-size: .875rem; }
    .dark .wv-alert { border-color: rgba(239,68,68,.22); background: rgba(239,68,68,.08); color: rgb(252 165 165); }

    /* Compact key/value information: label and value always share a row on normal screens. */
    .wv-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: var(--wv-space-2); row-gap: var(--wv-space-2); align-items: baseline; }
    .wv-kv dt { color: rgb(51 65 85); font-weight: 600; }
    .wv-kv dt::after { content: ':'; }
    .wv-kv dd { margin: 0; min-width: 0; }
    .dark .wv-kv dt { color: rgb(203 213 225); }

    /* Diagnostics get a dedicated row layout so values never drop under their labels by accident. */
    .wv-diagnostics { display: flex; flex-direction: column; }
    .wv-diagnostic-row {
        display: grid;
        grid-template-columns: minmax(12rem, .8fr) minmax(8rem, max-content) minmax(16rem, 1.3fr);
        align-items: center;
        gap: var(--wv-space-4);
        padding-block: var(--wv-space-3);
    }
    .wv-diagnostic-row + .wv-diagnostic-row { border-top: 1px solid var(--wv-border-soft); }
    .wv-diagnostic-label { font-weight: 650; color: rgb(30 41 59); }
    .wv-diagnostic-value { justify-self: start; }
    .wv-diagnostic-note { margin: 0 !important; color: var(--wv-muted); font-size: .8125rem; }
    .dark .wv-diagnostic-row + .wv-diagnostic-row { border-top-color: rgba(255,255,255,.1); }
    .dark .wv-diagnostic-label { color: rgb(226 232 240); }

    /* Sidebar workspace switcher belongs below the brand, never in the topbar. */
    .wv-workspace-switcher { padding: 0 var(--wv-sidebar-safe-x) var(--wv-space-4); }
    .wv-workspace-select-wrap { position: relative; }
    .wv-workspace-icon { position: absolute; left: .7rem; top: 50%; width: 1rem; height: 1rem; transform: translateY(-50%); color: var(--wv-muted); pointer-events: none; z-index: 1; }
    .wv-workspace-select {
        width: 100%;
        min-height: 2.65rem;
        appearance: none;
        border: 1px solid var(--wv-border);
        border-radius: .7rem;
        background: var(--wv-surface-soft);
        padding: .55rem 2.1rem .55rem 2.2rem;
        font-size: .875rem;
        font-weight: 650;
        color: rgb(30 41 59);
        cursor: pointer;
    }
    .wv-workspace-select-wrap::after { content: '⌄'; position: absolute; right: .7rem; top: 50%; transform: translateY(-55%); color: var(--wv-muted); pointer-events: none; }
    .dark .wv-workspace-select { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.05); color: #fff; }

    /* Update/system actions fit inside the existing topbar and never create a second bar. */
    .wv-topbar-tools { display: inline-flex; align-items: center; gap: var(--wv-space-2); flex: 0 0 auto; height: 2.5rem; white-space: nowrap; }
    .wv-topbar-form { display: inline-flex; height: 2.25rem; align-items: center; margin: 0; }
    .wv-topbar-tools form,
    .wv-topbar-tools a { margin-block: 0 !important; }
    .wv-topbar-tools .fi-btn { min-height: 2.25rem; }
    .wv-icon-sm { width: 1rem !important; height: 1rem !important; }
    .wv-icon-md { width: 1.25rem !important; height: 1.25rem !important; }
    .wv-update-button { white-space: nowrap; }
    .wv-update-count { display: inline-flex; min-width: 1.25rem; height: 1.25rem; margin-left: .35rem; align-items: center; justify-content: center; border-radius: 999px; background: rgba(255,255,255,.7); padding-inline: .3rem; font-size: .7rem; font-weight: 700; }
    .wv-health-button { display: inline-flex; width: 2.25rem; height: 2.25rem; align-items: center; justify-content: center; border-radius: .5rem; }
    .wv-health-button:hover { background: var(--wv-surface-hover); }
    .dark .wv-health-button:hover { background: rgba(255,255,255,.05); }
    .wv-health-dot { width: .65rem; height: .65rem; border-radius: 999px; }
    .wv-health-success { background: rgb(34 197 94); }
    .wv-health-warning { background: rgb(245 158 11); }
    .wv-health-danger { background: rgb(239 68 68); }
    .wv-maintenance-pill { display: inline-flex; align-items: center; gap: .35rem; min-height: 2rem; border-radius: .5rem; background: rgb(254 226 226); padding: .35rem .55rem; color: rgb(153 27 27); font-size: .75rem; font-weight: 700; }

    /* Tabs are used for closely related settings instead of expanding sidebar submenus. */
    .wv-tabs {
        display: inline-flex;
        width: fit-content;
        max-width: 100%;
        align-items: center;
        gap: var(--wv-space-1);
        border: 1px solid var(--wv-border-soft);
        border-radius: .75rem;
        background: var(--wv-surface-soft);
        padding: .25rem;
        overflow-x: auto;
    }
    .wv-tab {
        min-height: 2.25rem;
        border: 0;
        border-radius: .55rem;
        background: transparent;
        padding: .45rem .75rem;
        color: var(--wv-muted);
        font-size: .875rem;
        font-weight: 650;
        white-space: nowrap;
        cursor: pointer;
    }
    .wv-tab:hover { background: var(--wv-surface-hover); color: rgb(30 41 59); }
    .wv-tab.is-active { background: var(--wv-surface); color: rgb(30 41 59); box-shadow: 0 1px 2px rgba(15,23,42,.08); }
    .dark .wv-tabs { border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.03); }
    .dark .wv-tab.is-active { background: rgba(255,255,255,.09); color: #fff; }

    .wv-space-top { margin-top: var(--wv-space-5); }
    .wv-code-editor { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .8125rem; }
    .wv-status-heading { margin-bottom: var(--wv-space-2); font-weight: 650; }

    /* Compact Base tables used inside settings tabs. */
    .wv-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--wv-border-soft); border-radius: .75rem; }
    .wv-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
    .wv-table th { background: var(--wv-surface-soft); color: rgb(51 65 85); font-weight: 650; text-align: left; }
    .wv-table th, .wv-table td { border-bottom: 1px solid var(--wv-border-soft); vertical-align: top; }
    .wv-table-sort {
        display: inline-flex;
        align-items: center;
        gap: .35rem;
        padding: 0;
        border: 0;
        background: transparent;
        color: inherit;
        font: inherit;
        font-weight: inherit;
        cursor: pointer;
        text-align: left;
    }
    .wv-table-sort:hover { color: rgb(15 23 42); }
    .wv-table-sort:focus-visible { outline: 2px solid rgba(79,70,229,.35); outline-offset: 3px; border-radius: .2rem; }
    .dark .wv-table-sort:hover { color: #fff; }
    .wv-table tbody tr:last-child td { border-bottom: 0; }
    .dark .wv-table-wrap, .dark .wv-table th, .dark .wv-table td { border-color: rgba(255,255,255,.1); }
    .dark .wv-table th { background: rgba(255,255,255,.04); color: rgb(226 232 240); }

    .wv-filter-grid-compact { grid-template-columns: repeat(auto-fit, minmax(10rem, max-content)); }

    /* Table density is a Base invariant. Filament defaults are intentionally reduced on desktop
       so every information table uses the same compact rhythm as Base-owned custom tables. */
    .wv-table { font-size: .8125rem; }
    .wv-table th, .wv-table td { padding: var(--wv-table-row-y) .75rem; }
    .wv-table th { padding-block: var(--wv-table-header-y); }
    @media (min-width: 640px) {
        .fi-ta-header-cell { padding-top: var(--wv-table-header-y) !important; padding-bottom: var(--wv-table-header-y) !important; font-size: .8125rem !important; }
        .fi-ta-text:not(.fi-inline),
        .fi-ta-icon:not(.fi-inline),
        .fi-ta-cell:has(.fi-ta-actions),
        .fi-ta-cell:has(.fi-ta-record-checkbox),
        .fi-ta-selection-cell {
            padding-top: var(--wv-table-row-y) !important;
            padding-bottom: var(--wv-table-row-y) !important;
        }
        .fi-ta-text-item.fi-size-sm { font-size: .8125rem !important; line-height: 1.35rem !important; }
    }

    /* Theme controls are icon-sized. */
    .wv-theme-row { display: flex; flex-wrap: wrap; align-items: end; gap: var(--wv-space-5); }
    .wv-theme-icons { display: inline-flex; align-items: center; gap: var(--wv-space-1); width: fit-content; }
    .wv-theme-icons .fi-theme-switcher { width: fit-content !important; min-width: 0 !important; border: 0 !important; padding: 0 !important; background: transparent !important; }
    .wv-theme-icons .fi-theme-switcher button { width: 2.25rem !important; height: 2.25rem !important; min-width: 2.25rem !important; padding: 0 !important; }

    /* Organization identity. */
    .wv-organization-overview { display: flex; align-items: center; justify-content: space-between; gap: var(--wv-space-5); }
    .wv-organization-identity { display: flex; min-width: 0; align-items: center; gap: var(--wv-space-3); }
    .wv-organization-logo,
    .wv-organization-logo-placeholder { width: 2.75rem; height: 2.75rem; flex: 0 0 2.75rem; border-radius: .65rem; object-fit: contain; }
    .wv-organization-logo { border: 1px solid var(--wv-border); background: #fff; padding: .25rem; }
    .wv-organization-logo-placeholder { display: inline-flex; align-items: center; justify-content: center; background: rgb(241 245 249); color: rgb(71 85 105); }
    .dark .wv-organization-logo-placeholder { background: rgba(255,255,255,.08); color: rgb(203 213 225); }
    .wv-organization-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; font-weight: 700; }

    /* Compact, friendly settings patterns. Peer labels align on the same bottom baseline. */
    .wv-setting-row {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-end;
        column-gap: var(--wv-space-6);
        row-gap: var(--wv-space-3);
        min-height: var(--wv-control-height);
    }
    .wv-setting-row > .wv-label { margin: 0; padding-bottom: .67rem; }
    .wv-setting-row .wv-help { margin: 0; }
    .wv-setting-row > .wv-checkbox {
        display: inline-flex;
        min-height: var(--wv-control-height);
        align-items: flex-end;
        gap: var(--wv-space-2);
        padding-bottom: .67rem;
        line-height: 1.25rem;
    }
    .wv-setting-row > .wv-checkbox > input { margin-bottom: .08rem; }
    .wv-section-actions { display: flex; flex-wrap: wrap; gap: var(--wv-space-3); margin-top: var(--wv-space-4); }

    /* UI showcase helpers. */
    .wv-showcase-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--wv-space-5); }
    .wv-swatch { min-height: 6rem; border: 1px solid var(--wv-border-soft); border-radius: .75rem; background: var(--wv-surface-soft); padding: 1rem; }

    /* Sidebar safe area: Filament ships navigation groups with negative inline margins.
       Keep the Base padding and neutralize those margins so labels/icons can never touch the edge. */
    .fi-sidebar-nav { gap: .5rem !important; padding-inline: var(--wv-sidebar-safe-x) !important; }
    .fi-sidebar-nav-groups { margin-inline: 0 !important; gap: .65rem !important; }
    .fi-sidebar-group { gap: .15rem !important; }
    .fi-sidebar-group-items { gap: .125rem !important; }

    /* Collapsed sidebar is an icon rail: equal left/right padding and no exaggerated vertical gaps. */
    .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-nav {
        padding-inline: .875rem !important;
        gap: .25rem !important;
    }
    .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-nav-groups { margin-inline: 0 !important; gap: .25rem !important; }
    .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-group,
    .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-group-items { gap: .125rem !important; }
    .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item-btn {
        width: 2.75rem !important;
        min-width: 2.75rem !important;
        height: 2.75rem !important;
        min-height: 2.75rem !important;
        margin-inline: auto !important;
        padding: 0 !important;
        justify-content: center !important;
    }
    .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item { margin-block: 0 !important; }
    .fi-body.fi-body-has-sidebar-collapsible-on-desktop .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-nav-groups { width: 100% !important; }
    .fi-sidebar-open-collapse-sidebar-btn .fi-icon,
    .fi-sidebar-close-collapse-sidebar-btn .fi-icon { width: 1.35rem !important; height: 1.35rem !important; }

    @media (min-width: 1024px) {
        .fi-main { margin-inline: 0 !important; padding-inline: .85rem !important; }
        .fi-main-ctn { min-width: 0; }
    }

    @media (max-width: 1100px) {
        .wv-filter-grid,
        .wv-filter-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .wv-filter-wide { grid-column: auto; }
        .wv-diagnostic-row { grid-template-columns: minmax(10rem, 1fr) max-content; }
        .wv-diagnostic-note { grid-column: 1 / -1; }
    }

    @media (max-width: 760px) {
        .fi-page-header-main-ctn { gap: var(--wv-space-4) !important; padding-block: var(--wv-space-4) !important; }
        .fi-page-content { gap-y: var(--wv-space-4) !important; }
        .wv-kv { grid-template-columns: 1fr; gap: .15rem; }
        .wv-kv dt::after { content: ''; }
        .wv-form-grid-compact,
        .wv-grid-2,
        .wv-grid-3,
        .wv-filter-grid,
        .wv-filter-grid-5,
        .wv-showcase-grid,
        .wv-branding-upload-grid { grid-template-columns: 1fr; }
        .wv-update-button-label { display: none; }
        .wv-maintenance-pill span { display: none; }
        .wv-content-readable,
        .wv-content-form,
        .wv-content-settings { width: 100%; }
        .wv-organization-overview { align-items: flex-start; flex-direction: column; }
        .wv-diagnostic-row { grid-template-columns: 1fr; gap: var(--wv-space-1); }
        .wv-diagnostic-value { justify-self: start; }
        .wv-entry-time { margin-left: 0; width: 100%; }
        .wv-upload-tile { width: 9rem; min-height: 9rem; }
    }

/* Phase 2 invariant: workspace switching is one continuous compact surface, never a native select. */
    .wv-workspace-menu { position: relative; }
    .wv-workspace-menu > summary { list-style: none; }
    .wv-workspace-menu > summary::-webkit-details-marker { display: none; }
    .wv-workspace-trigger {
        display: grid; grid-template-columns: 1.1rem minmax(0,1fr) 1rem; align-items: center; gap: .55rem;
        min-height: 2.65rem; width: 100%; padding: .55rem .7rem; cursor: pointer;
        border: 1px solid var(--wv-border); border-radius: .7rem; background: var(--wv-surface-soft);
        color: rgb(30 41 59); font-size: .875rem; font-weight: 650;
    }
    .wv-workspace-trigger-icon, .wv-workspace-trigger-chevron { width: 1rem; height: 1rem; color: var(--wv-muted); }
    .wv-workspace-trigger-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .wv-workspace-options {
        position: absolute; z-index: 50; top: calc(100% + .35rem); left: 0; right: 0; overflow: hidden;
        border: 1px solid var(--wv-border); border-radius: .7rem; background: var(--wv-surface); box-shadow: 0 10px 30px rgba(15,23,42,.12);
    }
    .wv-workspace-options form { margin: 0; }
    .wv-workspace-option {
        display: flex; width: 100%; align-items: center; justify-content: space-between; gap: .5rem;
        padding: .65rem .75rem; border: 0; background: transparent; color: rgb(30 41 59); text-align: left; cursor: pointer; font-size: .85rem;
    }
    .wv-workspace-option:hover, .wv-workspace-option.is-active { background: var(--wv-surface-hover); }
    .wv-workspace-option.is-active { font-weight: 700; }
    .dark .wv-workspace-trigger { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.05); color: #fff; }
    .dark .wv-workspace-options { border-color: rgba(255,255,255,.14); background: rgb(24 24 27); }
    .dark .wv-workspace-option { color: rgb(244 244 245); }
    .dark .wv-workspace-option:hover, .dark .wv-workspace-option.is-active { background: rgba(255,255,255,.06); }


/* v0.16 shell design: original Filament/Inter typography is retained. */
body.fi-body,
.fi-main-ctn {
    background: rgb(248 250 252) !important;
}
.dark body.fi-body,
.dark .fi-main-ctn {
    background: rgb(9 9 11) !important;
}

/* Dark sidebar is the Base default in both light and dark content themes. */
.fi-sidebar {
    background: linear-gradient(180deg, rgb(17 24 39) 0%, rgb(15 23 42) 100%) !important;
    border-inline-end: 1px solid rgba(148, 163, 184, .13) !important;
    box-shadow: 10px 0 28px rgba(15, 23, 42, .06) !important;
}
.fi-sidebar-header {
    background: transparent !important;
    box-shadow: none !important;
    border-color: rgba(255,255,255,.08) !important;
}
.fi-sidebar .fi-logo,
.fi-sidebar .fi-sidebar-group-label,
.fi-sidebar .fi-sidebar-item-label,
.fi-sidebar .fi-sidebar-database-notifications-btn-label {
    color: rgb(203 213 225) !important;
}
.fi-sidebar .fi-sidebar-group-label {
    color: rgb(148 163 184) !important;
    font-weight: 600 !important;
}
.fi-sidebar .fi-icon,
.fi-sidebar .fi-sidebar-item-btn > .fi-icon,
.fi-sidebar .fi-sidebar-group-btn .fi-icon,
.fi-sidebar .fi-sidebar-database-notifications-btn > .fi-icon {
    color: rgb(148 163 184) !important;
}
.fi-sidebar .fi-sidebar-item-has-url > .fi-sidebar-item-btn:hover,
.fi-sidebar .fi-sidebar-item-btn:focus-visible,
.fi-sidebar .fi-sidebar-group-dropdown-trigger-btn:hover,
.fi-sidebar .fi-sidebar-database-notifications-btn:hover {
    background: rgba(255,255,255,.075) !important;
}
.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn,
.fi-sidebar .fi-sidebar-item.fi-sidebar-item-has-active-child-items > .fi-sidebar-item-btn {
    background: linear-gradient(135deg, rgba(79,70,229,.92), rgba(99,102,241,.72)) !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 5px 16px rgba(49,46,129,.18) !important;
}
.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-icon,
.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-label,
.fi-sidebar .fi-sidebar-item.fi-sidebar-item-has-active-child-items > .fi-sidebar-item-btn > .fi-icon,
.fi-sidebar .fi-sidebar-item.fi-sidebar-item-has-active-child-items > .fi-sidebar-item-btn > .fi-sidebar-item-label {
    color: #fff !important;
}
.fi-sidebar .wv-workspace-trigger {
    border-color: rgba(148,163,184,.22) !important;
    background: rgba(255,255,255,.055) !important;
    color: rgb(241 245 249) !important;
}
.fi-sidebar .wv-workspace-trigger:hover { background: rgba(255,255,255,.085) !important; }
.fi-sidebar .wv-workspace-trigger-icon,
.fi-sidebar .wv-workspace-trigger-chevron { color: rgb(148 163 184) !important; }
.fi-sidebar .wv-workspace-options {
    border-color: rgba(148,163,184,.2) !important;
    background: rgb(17 24 39) !important;
    box-shadow: 0 18px 38px rgba(0,0,0,.28) !important;
}
.fi-sidebar .wv-workspace-option { color: rgb(226 232 240) !important; }
.fi-sidebar .wv-workspace-option:hover,
.fi-sidebar .wv-workspace-option.is-active { background: rgba(255,255,255,.07) !important; }

/* Cards are clean, light surfaces with consistent borders and restrained shadows. */
.fi-section:not(.fi-section-not-contained),
.wv-status-card,
.wv-table-wrap {
    border-color: rgb(226 232 240) !important;
    box-shadow: 0 1px 2px rgba(15,23,42,.035), 0 8px 24px rgba(15,23,42,.025) !important;
}
.dark .fi-section:not(.fi-section-not-contained),
.dark .wv-status-card,
.dark .wv-table-wrap {
    border-color: rgba(255,255,255,.09) !important;
    box-shadow: none !important;
}

/* Field content is never bold. Labels/headings/buttons keep their own hierarchy. */
input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]),
textarea,
select,
[contenteditable="true"],
[contenteditable="true"] *,
.fi-input,
.fi-select-input,
.wv-native-input,
.wv-native-select,
.wv-native-textarea {
    font-weight: 400 !important;
}
