fluent-overflow::part(items) {
    flex-grow: 0;
}

fluent-button {
    --aspire-button-background: var(--colorNeutralBackground1);
    --aspire-button-foreground: var(--colorNeutralForeground1);
    --aspire-button-border-color: var(--colorNeutralStroke1);
}

fluent-button:where([appearance="primary"]) {
    --aspire-button-background: var(--accent-button-background);
    --aspire-button-foreground: var(--accent-button-foreground);
    --aspire-button-border-color: transparent;
}

fluent-button:where([appearance="outline"], [appearance="transparent"]) {
    --aspire-button-background: var(--colorTransparentBackground);
}

fluent-button:where([appearance="subtle"], [appearance="transparent"]) {
    --aspire-button-foreground: var(--colorNeutralForeground2);
    --aspire-button-border-color: transparent;
}

fluent-button:where([appearance="subtle"]) {
    --aspire-button-background: var(--colorSubtleBackground);
}

/* Fluent v5 Default replaces v4 Stealth for bordered toolbar and utility buttons. */

fluent-button:not([appearance]) {
    --colorNeutralBackground1Hover: var(--colorNeutralBackground3);
    --colorNeutralStroke1Hover: var(--aspire-button-hover-border);
}

/* Fluent v5 renamed v4's Accent appearance to Primary. Preserve the final-v4 color recipe for every primary action. */

fluent-button[appearance="primary"] {
    background-color: var(--aspire-button-background) !important;
    color: var(--aspire-button-foreground) !important;
}

fluent-button[appearance="primary"]:hover {
    background-color: var(--accent-button-hover-background) !important;
    color: var(--accent-button-hover-foreground) !important;
}

fluent-button[appearance="primary"]:active {
    background-color: var(--accent-button-pressed-background) !important;
    color: var(--accent-button-pressed-foreground) !important;
}

fluent-button[appearance="primary"] .copy-icon,
fluent-button[appearance="primary"] .checkmark-icon {
    fill: currentColor !important;
}

/* Fluent v5 renamed v4's Lightweight appearance to Transparent. */

fluent-button[appearance="transparent"] {
    --colorTransparentBackgroundHover: var(--colorNeutralBackground2);
}

/* Keep grid-button hover visible even when the grid doesn't highlight its rows. */

.fluent-data-grid tr:not([hover]) fluent-button[appearance="transparent"] {
    --colorTransparentBackgroundHover: var(--colorNeutralBackground3);
}

/* Keep disabled visuals independent of hover/pressed rules. Appearances and custom button
   styles supply their resting values; loading buttons also use disabled-focusable. */

fluent-button:is([disabled], [disabled-focusable]) {
    --aspire-button-icon-hover-color: var(--aspire-button-icon-color, currentColor);
    --colorNeutralForeground2BrandHover: currentColor;
    --colorNeutralForeground2BrandPressed: currentColor;
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    transition: none !important;
}

/* Leave Fluent's system colors in control for Windows Contrast Themes. */

@media (forced-colors: none) {
    fluent-button:is([disabled], [disabled-focusable]) {
        background: var(--aspire-button-background) !important;
        color: var(--aspire-button-foreground) !important;
        border-color: var(--aspire-button-border-color) !important;
    }
}

/* Preserve the final-v4 input and select recipes across their Fluent v5 replacements. */

fluent-text-input,
fluent-number-input,
fluent-dropdown {
    --colorNeutralStrokeAccessible: var(--colorNeutralStroke1);
    --colorNeutralStrokeAccessibleHover: var(--colorNeutralStroke1);
    --colorNeutralStrokeAccessiblePressed: var(--colorNeutralStroke1);
    --colorNeutralStroke1Hover: var(--colorNeutralStroke1);
    --colorNeutralStroke1Pressed: var(--colorNeutralStroke1);
    --colorCompoundBrandStroke: var(--colorBrandStroke1);
    --colorCompoundBrandStrokePressed: var(--colorBrandStroke1);
    --colorNeutralForeground3: var(--colorNeutralForeground2);
}

/* Restore native text selection colors instead of Fluent v5's inverted theme colors. */
fluent-text-input::part(control)::selection {
    color: HighlightText;
    background-color: Highlight;
}

fluent-text-input:is([disabled], :disabled),
fluent-text-input:is([disabled], :disabled)::part(control) {
    cursor: not-allowed;
}

fluent-text-input:is([disabled], :disabled)::part(root) {
    background-color: var(--colorNeutralBackgroundDisabled);
}

fluent-text-input:is([disabled], :disabled)::part(control) {
    color: var(--colorNeutralForegroundDisabled);
}

fluent-dropdown > [slot="control"] {
    align-self: center;
}

fluent-dropdown > button[slot="control"] {
    /* Prevent the selected text from expanding a FluentField grid track past the dropdown width. */
    width: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Fluent's placeholder state follows option selection, which can be empty even when a combobox has custom text. */
fluent-dropdown[type="combobox"]:not([disabled]) > input[slot="control"]:not(:placeholder-shown) {
    color: var(--colorNeutralForeground1);
}

.aspire-input {
    width: 100%;
    --borderRadiusMedium: 6px;
}

fluent-field.aspire-input,
.mobile-filter-toolbar fluent-field:has(> :is(fluent-text-input, fluent-dropdown)) {
    margin-block: 0;
    row-gap: 0;
}

.aspire-input:not(fluent-field),
fluent-field.aspire-input > [slot="input"],
.mobile-filter-toolbar fluent-field > :is(fluent-text-input, fluent-dropdown)[slot="input"] {
    width: 100%;
    min-width: 0;
    height: 28px;
    min-height: 28px;
    --borderRadiusMedium: 6px;
}

.aspire-input:not(fluent-field)::part(root),
fluent-field.aspire-input > [slot="input"]::part(root),
.mobile-filter-toolbar fluent-field > :is(fluent-text-input, fluent-dropdown)[slot="input"]::part(root) {
    height: 28px;
    min-height: 28px;
    padding: 0;
    border-radius: var(--aspire-control-radius);
}

fluent-text-input.aspire-input::part(control),
fluent-number-input.aspire-input::part(control),
fluent-field.aspire-input > fluent-text-input::part(control),
fluent-field.aspire-input > fluent-number-input::part(control),
.mobile-filter-toolbar fluent-text-input::part(control) {
    height: 22px;
    min-height: 22px;
    padding: 0 9px;
}

.aspire-field-row {
    display: flex;
    column-gap: var(--aspire-space-3);
    align-items: center;
}

.aspire-field-label,
.aspire-dialog-fields fluent-field > label[slot="label"] {
    font-size: var(--aspire-font-size-body);
    font-weight: var(--aspire-font-weight-semibold);
}

.aspire-button,
.aspire-button::part(control),
fluent-dialog-body > [slot="action"] fluent-button,
fluent-dialog-body > [slot="action"] fluent-button::part(control),
fluent-drawer fluent-drawer-body > [slot="footer"] fluent-button,
fluent-drawer fluent-drawer-body > [slot="footer"] fluent-button::part(control) {
    height: var(--aspire-control-height);
    min-height: var(--aspire-control-height);
    padding-inline: 14px;
    border-radius: var(--aspire-control-radius);
    font-weight: var(--aspire-font-weight-regular);
}

.aspire-compact-button,
.aspire-compact-button::part(control) {
    height: 24px;
    min-height: 24px;
    padding-inline: 14px;
    border-radius: var(--aspire-control-radius);
    font-size: var(--aspire-font-size-secondary);
    font-weight: var(--aspire-font-weight-regular);
    line-height: 20px;
}

.aspire-neutral-button,
.aspire-neutral-button::part(control) {
    --aspire-button-border-color: transparent;
    --aspire-button-background:
        padding-box linear-gradient(var(--aspire-neutral-button-background, var(--messagebar-action-background)), var(--aspire-neutral-button-background, var(--messagebar-action-background))),
        border-box var(--aspire-neutral-button-border, var(--messagebar-action-border));
    --aspire-button-foreground: var(--colorNeutralForeground1);
    border-color: var(--aspire-button-border-color);
    background: var(--aspire-button-background);
    color: var(--aspire-button-foreground);
}

.aspire-neutral-button:hover,
.aspire-neutral-button:hover::part(control) {
    background:
        padding-box linear-gradient(var(--messagebar-action-hover-background), var(--messagebar-action-hover-background)),
        border-box var(--messagebar-action-hover-border);
}

.aspire-neutral-button:active,
.aspire-neutral-button:active::part(control) {
    background:
        padding-box linear-gradient(var(--messagebar-action-pressed-background), var(--messagebar-action-pressed-background)),
        border-box var(--messagebar-action-pressed-border);
}

.aspire-neutral-button:focus-visible,
.aspire-neutral-button:focus-visible::part(control) {
    outline-offset: -2px;
}

.aspire-icon-button,
.aspire-icon-button::part(control),
.details-toolbar-button,
.details-toolbar-button::part(control),
fluent-dialog-body > [slot="title-action"] fluent-button[icon-only],
fluent-drawer fluent-drawer-body > [slot="close"] fluent-button,
fluent-drawer fluent-drawer-body > [slot="close"] fluent-button::part(control) {
    width: var(--aspire-control-height);
    min-width: var(--aspire-control-height);
    height: var(--aspire-control-height);
    min-height: var(--aspire-control-height);
    padding: 0;
}

.aspire-icon-button,
.aspire-icon-button::part(control) {
    --aspire-button-background: transparent;
    border-radius: var(--aspire-control-radius);
    background-color: var(--aspire-button-background);
}

/* The explicit background-color above overrides fluent-button's own hover/pressed shading,
   so icon-only buttons need their own state colors to still read as interactive. */
.aspire-icon-button:hover,
.aspire-icon-button:hover::part(control) {
    --aspire-button-background: var(--colorSubtleBackgroundHover);
}

.aspire-icon-button:active,
.aspire-icon-button:active::part(control) {
    --aspire-button-background: var(--colorSubtleBackgroundPressed);
}

.aspire-link-button,
.aspire-link-button::part(control),
.button-hyperlink,
.button-hyperlink-no-icon,
.button-hyperlink::part(control),
.button-hyperlink-no-icon::part(control) {
    --aspire-button-background: var(--aspire-link-button-background, transparent);
    --aspire-button-foreground: var(--aspire-link-button-color, var(--colorBrandForeground1));
    --aspire-button-border-color: transparent;
    width: auto;
    min-width: var(--aspire-control-height);
    height: var(--aspire-control-height);
    min-height: var(--aspire-control-height);
    padding: 0;
    border: 1px solid var(--aspire-button-border-color);
    border-radius: var(--aspire-control-radius);
    background-color: var(--aspire-button-background);
    color: var(--aspire-button-foreground);
    font-weight: var(--aspire-font-weight-regular);
}

.aspire-link-button,
.aspire-link-button::part(control) {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.button-hyperlink,
.button-hyperlink-no-icon {
    --aspire-link-button-background: var(--property-grid-background-color);
}

.button-hyperlink:hover,
.button-hyperlink-no-icon:hover,
.button-hyperlink:hover::part(control),
.button-hyperlink-no-icon:hover::part(control) {
    background-color: var(--property-grid-background-color);
    color: var(--colorNeutralForeground2BrandHover);
}

.button-hyperlink:active,
.button-hyperlink-no-icon:active,
.button-hyperlink:active::part(control),
.button-hyperlink-no-icon:active::part(control) {
    background-color: var(--property-grid-background-color);
    color: var(--colorBrandForeground1);
}

.button-hyperlink > [slot="start"] {
    margin-inline-end: var(--inline-icon-margin);
}

.aspire-link-button:hover,
.aspire-link-button:hover::part(control) {
    border-color: transparent;
    background-color: var(--colorNeutralBackground3);
    color: var(--aspire-link-button-hover-color, var(--colorBrandForegroundLinkHover));
    text-decoration: none;
}

.aspire-link-button:active,
.aspire-link-button:active::part(control) {
    border-color: transparent;
    background-color: var(--aspire-link-button-pressed-background);
    color: var(--aspire-link-button-pressed-color, var(--colorBrandForegroundLinkPressed));
    text-decoration: none;
}

.aspire-link-button:focus-visible,
.aspire-link-button:focus-visible::part(control) {
    outline-offset: -2px;
}

fluent-field.aspire-checkbox {
    margin: 0;
    column-gap: 0;
    row-gap: 0;
}

/* Keep the spacing inside the clickable label rather than in the checkbox's margin. */
fluent-field.aspire-checkbox > label {
    padding-inline-start: var(--aspire-space-2);
}

fluent-field.aspire-checkbox:has(> fluent-checkbox[disabled]) {
    color: var(--colorNeutralForegroundDisabled);
}

fluent-field.aspire-checkbox > fluent-checkbox[disabled] {
    --colorNeutralStrokeDisabled: var(--colorNeutralForegroundDisabled);
    cursor: not-allowed;
}

fluent-field.aspire-checkbox:has(> fluent-checkbox[disabled]) > label {
    cursor: not-allowed;
}

fluent-field.aspire-checkbox:not(:has(> fluent-checkbox[disabled])) > label {
    cursor: pointer;
}

.aspire-checkbox:not(fluent-field),
fluent-field.aspire-checkbox > fluent-checkbox {
    width: 18px;
    min-width: 18px;
    height: 18px;
    min-height: 18px;
    margin-inline-end: 0;
    --borderRadiusSmall: 6px;
}

.validation-message,
.fluent-validation-message {
    color: var(--error);
    font-size: var(--aspire-font-size-body);
    line-height: var(--lineHeightBase300);
    margin: 0;
}

/* The help dialog's height follows the selected tab. A dialog is centered vertically, so a taller tab would move the
   tab row up from under the pointer in the middle of the click that selected it. The click would then land on the
   dialog's backdrop and dismiss it. Anchoring the top edge lets the height change without moving the tabs. */
fluent-dialog#HelpDialog::part(dialog) {
    margin-top: min(80px, 8vh);
    margin-bottom: auto;
}

fluent-dialog-body fluent-radio {
    --size: 18px;
    flex-shrink: 0;
}

fluent-dialog-body fluent-radio::part(checked-indicator) {
    width: 8px;
    height: 8px;
}

/* Match v4 radio colors in normal light/dark themes, but leave Fluent's system-color styling
    in control when forced colors are active (for example, Windows Contrast Themes).
    See https://developer.mozilla.org/en-US/docs/Web/CSS/@media/forced-colors */

@media (forced-colors: none) {
    fluent-dialog-body fluent-radio:not(:state(disabled)) {
        background-color: transparent;
    }

    fluent-dialog-body fluent-radio:state(checked):not(:state(disabled)) {
        background-color: var(--colorBrandBackground);
        border-color: transparent;
    }

    fluent-dialog-body fluent-radio:state(checked):not(:state(disabled)):hover {
        background-color: var(--colorBrandBackgroundHover);
    }

    fluent-dialog-body fluent-radio:state(checked):not(:state(disabled))::part(checked-indicator) {
        background-color: var(--colorNeutralForegroundOnBrand);
    }
}

.fluent-validation-message > [message] > svg {
    display: none;
}

fluent-field.invalid > [slot="input"] {
    --colorNeutralStroke1: var(--error);
    --colorNeutralStroke1Hover: var(--error);
    --colorNeutralStroke1Pressed: var(--error);
    --colorNeutralStrokeDisabled: var(--error);
    --colorStrokeFocus1: var(--error);
    --colorStrokeFocus2: var(--error);
    --colorCompoundBrandStroke: var(--error);
    --colorCompoundBrandStrokePressed: var(--error);
}

input.invalid,
select.invalid,
textarea.invalid,
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
    border-color: var(--error);
}

:focus-visible {
    outline: 2px solid var(--colorBrandStroke1);
    outline-offset: 0;
    box-shadow: none;
}

fluent-dropdown > [slot="control"]:focus-visible {
    outline: none;
}

fluent-dropdown {
    --borderRadiusMedium: 6px;
}

fluent-dropdown > fluent-listbox {
    background-color: var(--aspire-popup-background);
    border-radius: var(--aspire-popup-radius);
    box-shadow: var(--aspire-popup-shadow);
    padding: 3px;
    row-gap: 0;
}

fluent-dropdown fluent-option {
    min-height: 28px;
    height: 28px;
    padding: 0 10px;
    color: var(--aspire-dropdown-option-foreground);
    background-color: var(--aspire-popup-background);
}

fluent-dropdown fluent-option[selected],
fluent-dropdown fluent-option:not(:state(disabled)):hover,
fluent-dropdown fluent-option:not(:state(disabled)):state(active),
fluent-dropdown fluent-option:not(:state(disabled)):focus-visible {
    color: var(--aspire-dropdown-option-foreground);
    background-color: var(--aspire-dropdown-option-selected-background);
}

fluent-dropdown fluent-option:state(disabled) {
    cursor: not-allowed;
    opacity: var(--disabled-opacity);
}

fluent-dropdown fluent-option:state(active) {
    border: none;
}

fluent-dropdown fluent-option[selected]:not(:state(disabled)):hover {
    background-color: var(--aspire-dropdown-option-selected-hover-background);
}

fluent-dropdown fluent-option::part(content) {
    transform: translateX(-20px);
}

/* Fluent's selected checkmark is inside shadow DOM and uses currentColor. Make the host
   transparent to hide it globally, then restore the option text through its exposed part. */
fluent-dropdown fluent-option[selected],
fluent-dropdown fluent-option[selected]:not(:state(disabled)):hover,
fluent-dropdown fluent-option[selected]:not(:state(disabled)):state(active),
fluent-dropdown fluent-option[selected]:not(:state(disabled)):focus-visible {
    position: relative;
    color: transparent;
}

fluent-dropdown fluent-option[selected]::part(content) {
    color: var(--aspire-dropdown-option-foreground);
}

fluent-dropdown fluent-option[selected]::before {
    position: absolute;
    top: 7px;
    left: 1px;
    width: 3px;
    height: 14px;
    border-radius: var(--aspire-control-radius);
    background-color: var(--colorBrandStroke1);
    content: "";
}

fluent-dropdown fluent-option:focus-visible {
    outline: none;
}

fluent-text-input[appearance="outline"]:focus-within::part(root) {
    border-color: var(--colorStrokeFocus1);
    outline: var(--strokeWidthThick) solid var(--colorStrokeFocus1);
    outline-offset: calc(-1 * var(--strokeWidthThick));
}

fluent-text-input[appearance="outline"]:focus-within::part(root)::after {
    transform: scaleX(0);
}

#components-reconnect-modal {
    color: var(--colorNeutralForeground1);
    background-color: var(--colorNeutralBackground1);
}

.components-rejoining-animation div {
    border-color: var(--colorBrandStroke1);
}

[data-theme="dark"] fluent-badge[color="danger"] {
    --colorNeutralForegroundOnBrand: #ffffff;
}

/* Firefox uses the standard properties, while Chromium, Edge, and WebKit use the pseudo-elements
   for exact sizing and hover styling. Fluent v5 supplies an inherited scrollbar-color, which takes
   precedence over the pseudo-elements in Chromium 121+, so reset it before applying the v4 recipe.
   See https://developer.mozilla.org/docs/Web/CSS/scrollbar-color#browser_compatibility */

@supports selector(::-webkit-scrollbar) {
    *,
    fluent-dialog-body::part(content),
    fluent-popover-b::part(dialog),
    ::part(listbox) {
        scrollbar-color: auto;
    }
}

@supports not selector(::-webkit-scrollbar) {
    *,
    fluent-dialog-body::part(content),
    fluent-popover-b::part(dialog),
    ::part(listbox) {
        scrollbar-width: thin;
        scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-track-color);
    }
}

::-webkit-scrollbar,
fluent-dialog-body::part(content)::-webkit-scrollbar,
fluent-popover-b::part(dialog)::-webkit-scrollbar {
    width: var(--scrollbar-size);
    height: var(--scrollbar-size);
}

::-webkit-scrollbar-track,
fluent-dialog-body::part(content)::-webkit-scrollbar-track,
fluent-popover-b::part(dialog)::-webkit-scrollbar-track {
    background: var(--scrollbar-track-color);
}

::-webkit-scrollbar-thumb,
fluent-dialog-body::part(content)::-webkit-scrollbar-thumb,
fluent-popover-b::part(dialog)::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb-color);
    border-radius: var(--aspire-radius-round);
}

::-webkit-scrollbar-thumb:hover,
fluent-dialog-body::part(content)::-webkit-scrollbar-thumb:hover,
fluent-popover-b::part(dialog)::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover-color);
}

::-webkit-scrollbar-corner,
fluent-dialog-body::part(content)::-webkit-scrollbar-corner,
fluent-popover-b::part(dialog)::-webkit-scrollbar-corner {
    background: transparent;
}

.block-warning {
    font-family: var(--fontFamilyBase);
    border: 1px solid var(--messagebar-warning-border-color);
    background-color: var(--messagebar-warning-background-color);
    color: var(--colorNeutralForeground1);
    display: grid;
    grid-template-columns: 24px auto;
    width: fit-content;
    align-items: center;
    min-height: 36px;
    border-radius: var(--aspire-radius-small);
    padding: 0 12px;
    column-gap: var(--aspire-space-2);
}

.block-warning-icon {
    grid-column: 1;
    display: flex;
    justify-content: center;
}

.block-warning-message {
    grid-column: 2;
    padding: 8px 0;
    align-self: center;
    font-size: var(--aspire-font-size-secondary);
    font-weight: var(--aspire-font-weight-regular);
    line-height: 16px;
}

.block-warning-message .title {
    font-weight: var(--aspire-font-weight-semibold);
    padding: 0 4px 0 0;
}

.pause-warning {
    display: inline-flex;
    align-items: center;
    gap: var(--aspire-space-1);
    min-width: 0;
    padding: 1px 9px;
    border-radius: var(--aspire-radius-medium);
    background: color-mix(in srgb, var(--warning) 14%, transparent);
    color: var(--colorNeutralForeground1);
    font-size: var(--aspire-font-size-secondary);
    font-weight: var(--aspire-font-weight-regular);
}

.pause-warning-icon {
    display: flex;
    flex: 0 0 auto;
    color: var(--warning);
}

.pause-warning-message {
    overflow: hidden;
    text-overflow: ellipsis;
}

.pause-warning-title {
    font-weight: var(--aspire-font-weight-semibold);
    padding-inline-end: 4px;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

:root {
    --inline-icon-margin: 5px;
}

body {
    overflow: hidden;
}

.aspire-menu-button {
    display: flex;
    align-items: center;
    position: relative;
}

.aspire-menu-button > fluent-button > svg[slot="end"] {
    flex: 0 0 16px;
    width: 16px !important;
    height: 16px !important;
    margin-inline-start: auto;
}

.aspire-menu-button > .aspire-menu-container {
    position: absolute;
}

:is(.aspire-menu-container, [cell-type="columnheader"] > fluent-menu) {
    --colorNeutralBackground1Hover: var(--aspire-menu-item-hover-background);
}

:is(.aspire-menu-container, [cell-type="columnheader"] > fluent-menu) fluent-menu-list {
    gap: 0;
    padding: 3px 0;
    border-radius: var(--aspire-popup-radius);
    background-color: var(--aspire-popup-background);
    box-shadow: var(--aspire-popup-shadow);
}

:is(.aspire-menu-container, [cell-type="columnheader"] > fluent-menu) fluent-menu-list:has(> fluent-menu-item:state(submenu)) {
    min-width: 180px;
}

:is(.aspire-menu-container, [cell-type="columnheader"] > fluent-menu) fluent-menu-item {
    gap: 0;
    grid-template-columns: minmax(32px, auto) 0 minmax(0, 1fr) minmax(32px, auto);
    height: 28px;
    min-height: 28px;
    box-sizing: border-box;
    inline-size: calc(100% - 8px);
    margin-inline: 4px;
    padding: 0;
    border-radius: var(--aspire-control-radius);
    background-color: var(--aspire-popup-background);
    color: var(--aspire-dropdown-option-foreground);
    font-family: var(--fontFamilyBase);
    font-size: var(--aspire-font-size-body);
    font-weight: var(--aspire-font-weight-regular);
    line-height: var(--lineHeightBase300);
}

:is(.aspire-menu-container, [cell-type="columnheader"] > fluent-menu) fluent-menu-item:state(submenu) {
    grid-template-columns: minmax(32px, auto) 0 minmax(0, 1fr) minmax(32px, auto) 24px;
    height: 32px;
    min-height: 32px;
    padding-inline-end: 8px;
}

:is(.aspire-menu-container, [cell-type="columnheader"] > fluent-menu) fluent-menu-item > [slot="start"],
:is(.aspire-menu-container, [cell-type="columnheader"] > fluent-menu) fluent-menu-item > [slot="indicator"] {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    inset-inline-start: 8px;
}

/* Selection indicators use one trailing axis across radio and checkbox menus. This leaves the
   leading edge for the option icon and keeps labels aligned whether or not an item is selected. */
:is(.aspire-menu-container, [cell-type="columnheader"] > fluent-menu) fluent-menu-item > .aspire-menu-item-indicator {
    grid-column: 4;
    grid-row: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    inset-inline-start: auto;
    justify-self: center;
    color: var(--colorNeutralForeground1);
}

[cell-type="columnheader"] > fluent-menu fluent-menu-item {
    text-align: left;
}

[cell-type="columnheader"] > fluent-menu fluent-menu-item > [slot="start"] {
    color: var(--colorBrandForeground1);
    width: 16px !important;
}

[cell-type="columnheader"] > [col-header-ui] {
    background: var(--aspire-popup-background);
}

/* :focus too: opening a menu focuses its checked item without :focus-visible, and Fluent's own focus background is
   a neutral grey that doesn't match the dashboard's tinted surfaces. */
:is(.aspire-menu-container, [cell-type="columnheader"] > fluent-menu) fluent-menu-item:not(:state(disabled)):hover,
:is(.aspire-menu-container, [cell-type="columnheader"] > fluent-menu) fluent-menu-item:not(:state(disabled)):state(active),
:is(.aspire-menu-container, [cell-type="columnheader"] > fluent-menu) fluent-menu-item:not(:state(disabled)):focus,
:is(.aspire-menu-container, [cell-type="columnheader"] > fluent-menu) fluent-menu-item:not(:state(disabled)):focus-visible {
    background-color: var(--aspire-menu-item-hover-background);
}

:is(.aspire-menu-container, [cell-type="columnheader"] > fluent-menu) fluent-divider {
    margin-block: 4px;
}

/* Fluent v5 separates the indicator and start slots. Collapse the unused indicator track so the
   icon and content align with v4's 32px start track while retaining the end slot for secondary actions. */

:is(.aspire-menu-container, [cell-type="columnheader"] > fluent-menu) fluent-menu-item:not(:state(submenu))::part(content) {
    grid-column: 2 / span 2;
    grid-row: 1;
    min-width: 0;
    overflow: hidden;
    padding-inline: 0;
    text-overflow: ellipsis;
}

:is(.aspire-menu-container, [cell-type="columnheader"] > fluent-menu) fluent-menu-item:state(submenu)::part(content) {
    grid-column: 3;
    grid-row: 1;
    padding-inline: 0;
}

fluent-menu-item:state(disabled) {
    background-color: transparent;
    color: var(--colorNeutralForeground1);
    cursor: not-allowed;
    opacity: var(--disabled-opacity);
}

/* The mobile menu is a sheet laid over the page, flush with the screen edges and directly under the header. It doesn't
   take a layout row, so the content below stays where it is. The scrim covers the page under it. */
.mobile-nav-scrim {
    position: fixed;
    inset: var(--mobile-header-height) 0 0;
    z-index: 99;
    background: rgba(0, 0, 0, .35);
}

.aspire-menu-container.mobile-nav-menu {
    position: fixed;
    top: var(--mobile-header-height);
    left: 0;
    right: 0;
    z-index: 100;
    width: auto;
    min-width: 0;
    max-width: none;
    gap: 0;
    padding-inline: 0;
    border: 0;
    border-bottom: 1px solid var(--colorNeutralStroke2);
    border-radius: 0;
    background-color: var(--aspire-popup-background);
    box-shadow: var(--aspire-popup-shadow);
}

.aspire-menu-container.mobile-nav-menu fluent-menu-item {
    position: relative;
    grid-template-columns: 44px minmax(0, 1fr) 32px;
    width: auto;
    min-width: 0;
    height: 48px;
    margin: 0;
    border: 0;
    border-radius: 0;
    background-color: transparent;
    color: var(--aspire-dropdown-option-foreground);
}

.aspire-menu-container.mobile-nav-menu fluent-menu-item > [slot="start"] {
    --colorNeutralForeground1: var(--aspire-dropdown-option-foreground);
    inset-inline-start: 12px;
    color: inherit;
}

.aspire-menu-container.mobile-nav-menu fluent-menu-item > [slot="start"] svg {
    fill: currentColor;
}

.aspire-menu-container.mobile-nav-menu fluent-menu-item:not(:state(submenu))::part(content) {
    grid-column: 2;
}

.aspire-menu-container.mobile-nav-menu fluent-menu-item:hover,
.aspire-menu-container.mobile-nav-menu fluent-menu-item:state(active) {
    background-color: var(--aspire-menu-item-hover-background);
}

.aspire-menu-container.mobile-nav-menu .mobile-nav-menu-item-active::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--colorBrandForegroundLinkPressed);
}

.aspire-menu-container.mobile-nav-menu fluent-menu-item > .mobile-nav-menu-icon-active {
    color: var(--colorBrandForegroundLinkPressed);
}

.aspire-menu-container.mobile-nav-menu fluent-divider {
    --colorNeutralStroke2: var(--mobile-nav-divider-color);
    height: 1px;
    margin: 0;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

/* Fluent renders each bar between two sibling panes. Match a collapsed pane immediately before
   the bar with the adjacent-sibling selector, or immediately after it via :has(). */

.fluent-multi-splitter > .fluent-multi-splitter-pane[status="collapsed"] + .fluent-multi-splitter-bar,
.fluent-multi-splitter > .fluent-multi-splitter-bar:has(+ .fluent-multi-splitter-pane[status="collapsed"]) {
    display: none;
}

body .fluent-multi-splitter > .fluent-multi-splitter-bar {
    background-color: transparent;
    z-index: 99;
}

.fluent-multi-splitter > .fluent-multi-splitter-bar:focus-visible {
    outline: none;
    background-color: var(--fluent-multi-splitter-background-color-active);
    opacity: var(--fluent-multi-splitter-hover-opacity);
}

.fluent-multi-splitter > .fluent-multi-splitter-bar > span[part="resize"] {
    display: none;
}

.fluent-multi-splitter > .fluent-multi-splitter-bar::before {
    content: "";
    position: absolute;
    pointer-events: none;
    background-color: var(--fluent-multi-splitter-background-color);
}

.fluent-multi-splitter[orientation="horizontal"] > .fluent-multi-splitter-bar::before {
    inset-block: 0;
    width: 1px;
}

.fluent-multi-splitter[orientation="horizontal"] > .fluent-multi-splitter-bar {
    /* Overlap the transparent hit target across both panes so only the 1px line consumes space. */
    margin-inline: calc((1px - var(--fluent-multi-splitter-bar-size)) / 2);
}

.fluent-multi-splitter[orientation="vertical"] > .fluent-multi-splitter-bar::before {
    inset-inline: 0;
    height: 1px;
}

.fluent-multi-splitter[orientation="vertical"] > .fluent-multi-splitter-bar {
    /* Overlap the transparent hit target across both panes so only the 1px line consumes space. */
    margin-block: calc((1px - var(--fluent-multi-splitter-bar-size)) / 2);
}

fluent-button {
    min-width: 32px;
    font-weight: var(--aspire-font-weight-regular);
}

fluent-text-input[type="search"] [slot="start"] svg {
    fill: var(--colorNeutralForeground1) !important;
}

.content-list-popover::part(dialog) {
    max-width: 400px;
    max-height: 300px;
    padding: 14px;
    overflow-x: hidden;
    overflow-y: auto;
    overflow-wrap: normal;
    cursor: default;
    word-break: normal;
}

.content-list-popover > strong {
    display: block;
    margin-bottom: 8px;
    font-family: var(--aspire-font-display);
    font-size: var(--aspire-font-size-heading);
    font-weight: var(--aspire-font-weight-semibold);
    line-height: normal;
}

.content-list-popover-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.content-list-popover-items > fluent-field {
    margin-block: 0;
}

/* Custom tab hosts share the Fluent tab appearance without taking over their selection lifecycle. */
.fluent-tabs,
.aspire-tab-list {
    max-width: 100%;
    min-width: 0;
}

.fluent-tabs:not(.aspire-content-tabs),
.aspire-tab-list {
    width: fit-content !important;
    display: flex;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
}

.fluent-tabs:not(.aspire-content-tabs),
.fluent-tabs.aspire-content-tabs > fluent-tablist,
.aspire-tab-list {
    min-height: 40px;
    gap: var(--aspire-space-1);
    padding: 3px;
    border: 1px solid var(--colorNeutralStroke1);
    border-radius: var(--aspire-control-radius);
}

.fluent-tabs.aspire-content-tabs {
    display: block;
    align-items: initial;
    min-height: 0;
    overflow: visible;
    gap: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
}

.fluent-tabs > fluent-tablist {
    width: fit-content;
}

.fluent-tab-panel:empty {
    display: none;
}

fluent-tab,
.aspire-tab {
    height: 32px;
    padding: 0 12px;
    gap: var(--aspire-space-1);
    border: 1px solid transparent;
    border-radius: var(--aspire-control-radius);
}

fluent-tab.tab-label svg {
    width: 18px !important;
    min-width: 18px;
    max-width: 18px;
    height: 18px !important;
    margin-right: var(--spacingHorizontalXS);
    color: var(--colorBrandForeground1);
}

fluent-tab.tab-label > span {
    align-items: center;
}

fluent-tab.tab-label fluent-badge {
    min-width: 20px;
    margin-inline-start: var(--spacingHorizontalXS);
    padding: 1px 3px;
    border: 1px solid transparent;
    border-radius: var(--aspire-radius-round);
    background: var(--colorNeutralBackground3);
    color: currentColor;
    font-weight: var(--aspire-font-weight-regular);
}

fluent-tab[aria-selected="true"],
.aspire-tab.active {
    color: var(--colorNeutralForeground1);
    background-color: var(--colorNeutralBackground3);
    border-color: var(--colorNeutralStroke1);
    font-weight: var(--aspire-font-weight-regular);
}

/* Fluent v5 renders hover/selection indicators on the tab and tablist. The v4 design represents
    these states with the tab's background, foreground, and border instead. */

fluent-tab::before,
fluent-tab::after,
fluent-tablist::after {
    display: none;
}

fluent-tab[aria-selected="false"],
.aspire-tab:not(.active) {
    color: var(--colorNeutralForeground3);
}

fluent-tab[aria-selected="false"]:hover,
.aspire-tab:not(.active):hover {
    color: var(--colorNeutralForeground1);
}

.fluent-data-grid:not(.trace-view-grid) th,
.fluent-data-grid:not(.trace-view-grid) td {
    border-bottom: var(--strokeWidthThin) solid var(--aspire-data-grid-cell-border-color, var(--colorNeutralStroke3)) !important;
}

table.aspire-scroll-border-grid:not(:has(tr[row-state="empty-content"], tr[row-state="loading-content"])) {
    /* Keep the bottom row border visible when scrolling a populated grid. */
    margin-bottom: 1px !important;
}

.fluent-data-grid.aspire-spaced-grid > thead > tr > th {
    padding: 4px 1px;
}

.fluent-data-grid.aspire-spaced-grid > thead > tr > th:first-child {
    padding-inline-start: 0;
}

.fluent-data-grid.aspire-spaced-grid > tbody > tr:not([row-state="empty-content"]) > td {
    padding: 4px 16px;
}

.aspire-empty-content {
    width: 100%;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: var(--aspire-font-weight-semibold);
}

.aspire-empty-message {
    display: flex;
    align-items: center;
    gap: var(--spacingHorizontalS);
}

.aspire-empty-message > svg {
    flex-shrink: 0;
}

.fluent-data-grid > thead > tr > th,
.fluent-data-grid > thead > tr > th > fluent-button,
.fluent-data-grid > thead > tr > th [col-title-text] {
    color: var(--colorNeutralForeground3);
    font-weight: var(--aspire-font-weight-regular) !important;
}

.fluent-data-grid > thead > tr > th [col-title-text] {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fluent-data-grid > thead > tr > th > fluent-button::part(content) {
    min-width: 0;
    overflow: hidden;
}

.property-grid-container > fluent-accordion,
.property-grid-container > fluent-accordion > fluent-accordion-item {
    width: 100%;
    max-width: none;
}

.property-grid-container .fluent-data-grid {
    --aspire-data-grid-cell-border-color: var(--datagrid-border-color);
}

.property-grid-container .fluent-data-grid > thead > tr > th > fluent-button {
    --colorSubtleBackground: var(--property-grid-background-color);
}

.property-grid-container th {
    padding: 4px 1px 4px 0 !important;
    text-align: left !important;
}

.property-grid-container td {
    padding: 4px 16px 4px 0 !important;
}

.property-grid-container tbody tr:last-child td {
    border-bottom: none !important;
}

.empty-data::before {
    content: "-";
}

fluent-accordion-item.property-details-accordion-item {
    margin-bottom: var(--spacingVerticalS);
    border: 1px solid var(--colorNeutralStroke3);
    border-radius: var(--aspire-radius-medium);
    background-color: var(--property-grid-background-color);
    overflow: hidden;
}

fluent-accordion-item.property-details-accordion-item::part(heading),
fluent-accordion-item.property-details-accordion-item::part(content) {
    background-color: var(--property-grid-background-color);
}

fluent-accordion-item.property-details-accordion-item::part(heading) {
    --accordion-marker-background: transparent;
    min-height: 40px;
    padding-inline: var(--spacingHorizontalM);
    direction: rtl;
}

fluent-accordion-item.property-details-accordion-item::part(heading):hover {
    --accordion-marker-background: color-mix(in srgb, var(--property-grid-background-color) 93.5%, var(--colorNeutralForeground1));
}

fluent-accordion-item.property-details-accordion-item::part(content) {
    padding-inline: 0;
}

fluent-accordion-item.property-details-accordion-item::part(button) {
    direction: ltr;
    text-align: left;
    font-family: var(--aspire-font-display);
    font-weight: var(--aspire-font-weight-semibold);
}

fluent-badge.property-details-accordion-badge {
    min-width: 20px;
    padding: 0;
    border: 0;
    border-radius: var(--aspire-radius-round);
    outline: none;
    box-shadow: none;
    background-color: var(--property-grid-badge-background-color);
    color: var(--colorNeutralForeground1);
    font-weight: var(--aspire-font-weight-regular);
}

.fluent-data-grid > thead > tr[row-type="sticky-header"] > th {
    background-color: var(--colorNeutralBackground2);
}

.fluent-data-grid > thead > tr > th {
    --fluent-data-grid-header-opacity: 0;
}

.fluent-data-grid > thead > tr > th:hover {
    --fluent-data-grid-header-opacity: 1;
}

.main-grid > thead > tr > th.expand-col:not(.select-all) {
    padding: 4px 1px 4px 16px;
}

.main-grid > thead > tr > th:not(.select-all):not(.expand-col) {
    padding: 4px 1px 4px 8px;
}

.fluent-data-grid > thead > tr > th > fluent-button {
    --aspire-button-foreground: var(--colorNeutralForeground3);
    --aspire-button-border-color: transparent;
    --colorSubtleBackground: var(--aspire-page-background);
    --colorSubtleBackgroundHover: var(--colorNeutralBackground3);
    --colorSubtleBackgroundPressed: var(--colorNeutralBackground3);
    height: 28px;
    min-height: 28px;
    padding-inline: 2px;
    border: 1px solid var(--aspire-button-border-color);
    border-radius: var(--aspire-control-radius);
}

/* Fluent anchors paint their own neutral surface. Match that surface to the row while
   ShowHover is active so embedded actions don't appear as opaque patches in the hovered row. */

.fluent-data-grid tr[hover]:not([row-type="header"], [row-type="sticky-header"]):hover fluent-anchor[appearance="lightweight"]:not(:hover),
.fluent-data-grid tr[hover]:not([row-type="header"], [row-type="sticky-header"]):hover fluent-anchor[appearance="stealth"]:not(:hover) {
    background-color: var(--datagrid-hover-color) !important;
    transition-property: border, color;
}

.fluent-data-grid tr.selected-row:not([row-type="header"], [row-type="sticky-header"]),
.fluent-data-grid tr.selected-row:not([row-type="header"], [row-type="sticky-header"]) > td {
    background-color: var(--datagrid-selected-color);
}

.fluent-data-grid tr.selected-row:not([row-type="header"], [row-type="sticky-header"]) fluent-anchor[appearance="lightweight"]:not(:hover),
.fluent-data-grid tr.selected-row:not([row-type="header"], [row-type="sticky-header"]) fluent-anchor[appearance="stealth"]:not(:hover) {
    background-color: var(--datagrid-selected-color) !important;
    transition-property: border, color;
}

.resource-icon,
.severity-icon {
    vertical-align: text-bottom;
    margin-inline-end: var(--inline-icon-margin);
    flex-shrink: 0;
}

.persistent-container-icon {
    vertical-align: text-bottom;
    margin-inline-start: var(--inline-icon-margin);
}
/* Text-only tooltips use the same Fluent component as rich tooltips. Preserve multiline
   descriptions and wrap long URLs rather than overflowing the tooltip's default max width. */
.dashboard-tooltip {
    width: max-content;
    /* Chromium caps tooltip text at 800px or half the display, not half the browser viewport.
       Fluent popups must also fit the viewport and the available anchor area. Floor the
       area cap at Fluent's usual 240px (less on small screens) so a cramped side triggers
       flipping rather than wrapping to just a few characters.
       https://source.chromium.org/chromium/chromium/src/+/main:ui/views/corewm/tooltip_aura.cc */
    max-width: min(800px, calc(100vw - 16px), max(min(240px, calc(50vw - 16px)), calc(100% - 16px)));
    overflow-wrap: anywhere;
    pointer-events: none;
}

/* Preserve description newlines only in content, not Fluent's shadow-template whitespace. */
.dashboard-tooltip > span {
    white-space: pre-wrap;
}

/* Log previews retain their compact layout instead of the viewport-sized text tooltip. */
.log-tooltip {
    width: auto;
    max-width: 350px;
    flex-direction: column;
    overflow-wrap: normal;
}

.log-tooltip .log-tooltip-title {
    font-weight: bold;
    font-size: 15px;
}

.log-tooltip .log-tooltip-subtitle {
    color: var(--colorNeutralForeground3);
    font-size: 12px;
    padding-left: 0.5rem;
}

.log-tooltip .log-tooltip-title-container {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    margin-bottom: 4px;
    margin-top: 4px;
}

.log-tooltip .log-tooltip-table {
    margin-bottom: 0;
    width: 100%;
    font-size: 12px;
}

.log-tooltip .log-tooltip-table td.label-column {
    white-space: nowrap;
    padding-right: var(--spacingHorizontalL);
    width: 20%;
}

.log-tooltip .log-tooltip-table td {
    padding: 3.5px 0;
    border-bottom: var(--strokeWidthThin) solid var(--colorNeutralStroke3);
    align-content: start;
    word-break: break-word;
}

.log-tooltip .log-tooltip-table tr:last-child td {
    border-bottom: none;
    padding-bottom: var(--spacingVerticalXXS);
}

.resource-hidden-icon {
    vertical-align: text-bottom;
    margin-inline-start: var(--inline-icon-margin);
}

/* A single line of tags. app-tag-overflow.js marks the tags that don't fit and fills the "+N" tag. */
aspire-tag-overflow {
    display: flex;
    align-items: center;
    gap: var(--aspire-space-1);
    min-width: 0;
    overflow: hidden;
    position: relative;
}

aspire-tag-overflow > * {
    flex: 0 0 auto;
}

/* Same as .visually-hidden: the tag leaves the line but screen readers still read it. */
aspire-tag-overflow > [data-tag-overflow-hidden] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

aspire-tag-overflow > [data-tag-overflow-more]:not([data-count]) {
    display: none;
}

/* The count is presentational: the hidden tags are still in the accessibility tree. */
aspire-tag-overflow > [data-tag-overflow-more]::before {
    content: attr(data-count);
}
