/* Shared design tokens: change these once for every Xa component. */
:root {
    --xa-text: var(--mud-palette-text-primary);
    --xa-muted: var(--mud-palette-text-secondary);
    --xa-surface: var(--mud-palette-surface);
    --xa-background: var(--mud-palette-background);
    --xa-subtle: #f7f7f7;
    --xa-selected-background: #eff6ff;
    --xa-border: #E1E6E2;
    --xa-control-border: #b5b5b5;
    --xa-primary: var(--mud-palette-primary);
    --xa-focus: #458fff;
    --xa-link: #005bd3;
    --xa-radius: 8px;
    --xa-card-radius: 14px;
    --xa-card-padding: 24px;
    --xa-card-title-size: 18px;
    --xa-field-gap: 8px;
    --xa-control-height: 56px;
    --xa-button-height: 43px;
    --xa-space: 16px;
    color-scheme: light;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--xa-text);
    background: var(--xa-background);
    font-size: 16px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-size: 14px;
}

[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 3px solid var(--xa-focus);
    outline-offset: 2px;
}

h1 {
    font-size: 30px;
    line-height: 1.3;
    margin: 0;
    letter-spacing: -.6px;
}

h2 {
    font-size: 19px;
    margin: 0;
}

.xa-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.xa-helper {
    font-weight: 400;
    color: var(--xa-muted);
    font-size: 12px;
    line-height: 1.5;
    margin: 6px 0;
}

.xa-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.xa-chip {
    padding: 5px 10px;
    border-radius: 18px;
    background: var(--xa-subtle);
    font-size: 11px;
    color: var(--xa-text);
}

@media (max-width: 700px) {
    h1 {
        font-size: 23px;
    }

}

/* Shared Mud component roots: never override these from feature pages. */
.xa-card {
    padding: var(--xa-card-padding);
    border-radius: var(--xa-card-radius);
    display: grid;
    gap: var(--xa-space);
    min-width: 0;
}
.xa-card h2 {
    font-size: var(--xa-card-title-size);
    font-weight: 600;
}
.xa-button {
    min-height: var(--xa-button-height);
}
.xa-table a {
    color: var(--xa-primary);
}
.xa-affected-items {
    padding-left: 24px;
    max-height: 240px;
    overflow: auto;
}
/* MudBlazor supplies the rounded focus border; avoid a second square outline. */
.xa-field input:focus-visible {
    outline: none;
}

.xa-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.xa-icon-button {
    width: 46px;
    min-width: 46px;
    height: var(--xa-button-height);
    padding: 0;
}

/* ML reference geometry, shared by pages and provider-rendered dialogs. */
.xa-button.mud-button {
    font-size: 14px;
    text-transform: none;
    border-radius: var(--xa-radius);
    box-shadow: none;
}

.xa-button .mud-button-label {
    gap: 10px;
}

.xa-button.xa-button-compact {
    min-height: 32px;
    padding: 4px 8px;
}

.xa-button.xa-button-compact.xa-icon-button {
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 5px;
}

.mud-dialog.xa-dialog {
    width: 540px;
    max-width: 90vw;
    max-height: 85dvh;
    border: 1px solid var(--xa-border);
    border-radius: var(--xa-card-radius);
    overflow: hidden;
}

.mud-dialog.xa-dialog-wide {
    width: 1000px;
    max-width: 94vw;
}

.xa-dialog .mud-focus-trap,
.xa-dialog .xa-dialog-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 85dvh;
}

.xa-dialog .xa-dialog-content {
    padding: 0 !important;
    /* Only the body scrolls; focus must not scroll the fixed header/footer container. */
    overflow: clip;
}

.xa-choice-icon .mud-typography {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
