html {
    font-size: 13px;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* GPU-composited indeterminate progress bar.
   Animates `transform` only and is promoted to its own compositor layer via
   `will-change: transform`, so the browser keeps animating it on the GPU
   thread even while the WASM main thread is busy (IndexedDB reads, JSON
   deserialization, tree builds). MudProgressLinear's animation lives inside
   Mud component wrappers that re-render and don't reliably stay composited. */
.gpu-progress {
    position: relative;
    height: 4px;
    width: 100%;
    overflow: hidden;
    border-radius: 2px;
    background: var(--mud-palette-action-disabled-background, rgba(255, 255, 255, 0.12));
    contain: strict;
}

.gpu-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 40%;
    border-radius: 2px;
    background: var(--mud-palette-primary, #594ae2);
    will-change: transform;
    transform: translate3d(-100%, 0, 0);
    animation: gpu-progress-slide 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes gpu-progress-slide {
    0%   { transform: translate3d(-100%, 0, 0); }
    100% { transform: translate3d(250%, 0, 0); }
}

.gpu-progress-caption {
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary, #999);
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

/* ── Global page body wrapper ── */
.page-body {
    background-color: var(--mud-palette-background);
    min-height: 100vh;
    padding: 6px 12px;
}

/* ── Compact shared app bar ───────────────────────────────────
   Shrink the top header on every page to reclaim vertical real
   estate (matters most on viewport-filling pages like the schema
   designer tree). MudMainContent pads its top by --mud-appbar-height,
   so overriding the variable keeps content correctly aligned. */
:root {
    --mud-appbar-height: 52px;
}

.app-bar.mud-appbar {
    height: 52px;
    min-height: 52px;
}

/* Org/account status lives in the far-right profile menu now;
   keep the signed-in identifier readable but unobtrusive. */
.appbar-profile-id {
    font-size: 0.8rem;
    opacity: 0.75;
}

/* When the schema designer is active:
   - MudMainContent: fix its height to the viewport minus the appbar (~64px) so
     the designer has a real resolved ancestor height and overflow:hidden works.
   - .page-body: remove padding and fill the container.
   - .schema-designer-page: flex-fill what .page-body gives it.
   This scoped :has() rule only applies on the designer page so other pages keep
   their normal scroll behaviour.
   NOTE: MudMainContent sits at top:0 (behind the fixed appbar) and uses
   padding-top:var(--mud-appbar-height) internally to push content below it,
   so height must be 100vh (full viewport). Using calc(100vh - 64px) subtracts
   the appbar height twice and leaves a matching gap at the bottom. */
.mud-main-content:has(.schema-designer-page) {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.mud-main-content:has(.schema-designer-page) .page-body {
    padding: 0;
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-splash {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #1a1a2e;
    color: #e0e0e0;
    font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.loading-spinner-wrapper {
    position: relative;
    width: 160px;
    height: 160px;
}

.loading-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 160px;
    height: 160px;
    animation: loading-rotate 1.4s linear infinite;
}

.loading-progress .spinner-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.12);
    stroke-width: 5;
}

.loading-progress .spinner-fill {
    fill: none;
    stroke: #0CA1FF;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 90, 340;
    stroke-dashoffset: 0;
    transform-origin: center;
    animation: loading-dash 1.4s ease-in-out infinite;
}

@keyframes loading-rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes loading-dash {
    0% {
        stroke-dasharray: 1, 340;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 120, 340;
        stroke-dashoffset: -50;
    }
    100% {
        stroke-dasharray: 120, 340;
        stroke-dashoffset: -280;
    }
}

.loading-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 74px;
    height: 74px;
    object-fit: contain;
}

.loading-app-name {
    margin-top: 1.25rem;
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: #b0b0cc;
}

.brand-accent {
    color: #067AE2;
}

.brand-tm {
    font-size: 0.45em;
    font-weight: 400;
    vertical-align: super;
    line-height: 0;
    margin-left: 1px;
    opacity: 0.85;
}

.loading-progress-text {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-weight: 400;
    color: #0CA1FF;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

.loading-attribution {
    margin-top: 2rem;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.3px;
    color: #b0b0cc;
    opacity: 0.7;
}

.drawer-attribution {
    padding: 8px 16px 12px;
    font-size: 0.7rem;
    line-height: 1.3;
    color: var(--mud-palette-text-secondary);
    opacity: 0.75;
}

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ── Tree view node styling ── */
.tree-node-label {
    cursor: pointer;
    flex-grow: 1;
    padding: 0 2px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.85rem;
    line-height: 1.3;
}

.tree-node-label:hover {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.1);
}

.tree-node-label.selected {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.2);
    font-weight: 500;
}

.tree-node-label.selected:hover {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.25);
}

.tree-node-label.node-folder {
    font-style: italic;
}

.tree-node-edit-input {
    font-size: inherit;
    padding: 2px 4px;
    border: 1px solid var(--mud-palette-primary);
    border-radius: 4px;
    background: var(--mud-palette-surface);
    color: inherit;
    min-width: 100px;
    outline: none;
}

.tree-node-edit-input:focus {
    box-shadow: 0 0 0 2px rgba(var(--mud-palette-primary-rgb), 0.3);
}

.tree-node-actions {
    display: none;
    margin-left: 4px;
}

.tree-node-row:hover .tree-node-actions {
    display: inline-flex;
    gap: 2px;
}

.tree-node-action-btn {
    padding: 0 !important;
    min-width: 18px !important;
    height: 18px !important;
    opacity: 0.6;
    border: none;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tree-btn-icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.tree-btn-success { color: var(--mud-palette-success); }
.tree-btn-info { color: var(--mud-palette-info); }
.tree-btn-error { color: var(--mud-palette-error); }

.tree-node-action-btn:hover {
    opacity: 1;
}

.tree-panel {
    overflow-x: auto;
    overflow-y: auto;
}

/* ── Header tab indicator (underline like MudTabs) ── */
.header-tab {
    display: inline-flex;
    align-items: center;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}

.header-tab-active {
    border-bottom-color: var(--mud-palette-primary);
}

/* ── Schema Designer page container ── */
.schema-designer-page {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

/* ── Pinned header bar (scoped to the right properties panel) ── */
.schema-designer-header {
    flex: 0 0 auto;
}

/* When used inside a right panel, add a bottom border for separation */
.schema-panel-header {
    border-bottom: 1px solid var(--mud-palette-divider);
}

/* ── CSS flex sidebar layout for editor/changes panels ── */
.schema-split {
    display: flex;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

.schema-sidebar {
    width: 280px;
    min-width: 180px;
    flex-shrink: 0;
    overflow: hidden;
    transition: width 0.2s ease, min-width 0.2s ease, max-width 0.2s ease;
}

.schema-sidebar.schema-sidebar-mini {
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
}

.schema-main-panel {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
}

.schema-main-panel > .mud-paper {
    height: 100%;
}

/* ── Splitter drag handle ── */
.schema-splitter {
    width: 6px;
    flex-shrink: 0;
    cursor: col-resize;
    background: transparent;
    position: relative;
    z-index: 1;
    transition: background 0.15s;
}

.schema-splitter::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 2px;
    width: 2px;
    background: var(--mud-palette-lines-default);
    border-radius: 1px;
    transition: background 0.15s, width 0.15s, left 0.15s;
}

.schema-splitter:hover::after,
.schema-splitter.active::after {
    background: var(--mud-palette-primary);
    width: 4px;
    left: 1px;
}

.schema-drawer-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.schema-drawer-header {
    display: flex;
    align-items: center;
    padding: 3px 8px;
    cursor: pointer;
    border-bottom: 1px solid var(--mud-palette-divider);
    flex: 0 0 auto;
}

.schema-drawer-header:hover {
    background: var(--mud-palette-action-default-hover);
}

/* ── Tree scroll container ── */
.schema-tree-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow-x: auto;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--mud-palette-lines-default) transparent;
}

.schema-tree-scroll::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.schema-tree-scroll::-webkit-scrollbar-thumb {
    background: var(--mud-palette-lines-default);
    border-radius: 3px;
}

.schema-tree-scroll::-webkit-scrollbar-track {
    background: transparent;
}

/* ── Lightweight HTML tree ── */
.schema-tree {
    min-width: max-content;
}

.tree-node {
    display: flex;
    align-items: center;
    height: 24px;
    padding: 0 4px 0 0;
    padding-left: calc(var(--depth, 0) * 16px);
    gap: 2px;
    white-space: nowrap;
    cursor: default;
    border-radius: 3px;
}

.tree-node:hover {
    background: rgba(var(--mud-palette-primary-rgb), 0.06);
}

.tree-node-selected {
    background: rgba(var(--mud-palette-primary-rgb), 0.12);
}

.tree-node-selected:hover {
    background: rgba(var(--mud-palette-primary-rgb), 0.16);
}

.tree-node-drag-over {
    box-shadow: inset 0 2px 0 0 var(--mud-palette-primary);
    background: rgba(var(--mud-palette-primary-rgb), 0.08);
}

.tree-node[draggable="true"] {
    cursor: grab;
}

.tree-node[draggable="true"]:active {
    cursor: grabbing;
}

.col-row-drag-over > td {
    box-shadow: inset 0 2px 0 0 var(--mud-palette-primary);
    background: rgba(var(--mud-palette-primary-rgb), 0.08);
}

.html-table tr[draggable="true"] {
    cursor: default;
}

.html-table tr[draggable="true"]:active {
    cursor: grabbing;
}

.tree-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px;
    width: 16px;
    height: 16px;
    min-width: 0;
    flex-shrink: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--mud-palette-primary);
}

.tree-expand-icon {
    width: 12px;
    height: 12px;
    fill: currentColor;
    transition: transform 0.15s ease;
}

.tree-expand-icon.expanded {
    transform: rotate(90deg);
}

.tree-expand-spacer {
    display: inline-block;
    width: 16px;
    flex-shrink: 0;
}

.tree-type-icon {
    width: 16px;
    height: 16px;
    min-width: 16px;
    flex-shrink: 0;
    fill: currentColor;
    margin-inline-end: 4px;
}

.tree-node-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 4px;
    border: 2px solid var(--mud-palette-lines-default);
    border-top-color: var(--mud-palette-primary);
    border-radius: 50%;
    animation: tree-spin 0.6s linear infinite;
    flex-shrink: 0;
}

@keyframes tree-spin {
    to { transform: rotate(360deg); }
}

/* ── Compact header selects ── */
.compact-select .mud-input-root {
    font-size: 0.7rem;
}

.compact-select .mud-input {
    padding: 2px 4px !important;
    min-height: 24px !important;
}

.compact-select .mud-input-label {
    font-size: 0.7rem;
}

.compact-select .mud-input-adornment-start .mud-icon-root {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.compact-select .mud-select-input {
    padding: 0 !important;
}

.schema-explorer-panel .mud-input-root {
    font-size: 0.8125rem;
}

.schema-explorer-panel .mud-input-label {
    font-size: 0.75rem;
}

.schema-explorer-panel .mud-select .mud-input {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}

/* ── Schema Explorer panel chrome ── */
.schema-explorer-panel {
    overflow: hidden;
}

/* Virtual/pending items */
.tree-node-label.node-virtual {
    font-style: italic;
    opacity: 0.8;
}

.tree-node-label.node-virtual::after {
    content: " (pending)";
    font-size: 0.75em;
    opacity: 0.7;
}

/* Deleted items — greyed out with strikethrough */
.tree-node-label.node-deleted {
    opacity: 0.45;
    text-decoration: line-through;
    pointer-events: none;
}

/* ── Change status icons ── */
.node-status-icon {
    width: 12px;
    height: 12px;
    min-width: 12px;
    flex-shrink: 0;
    margin-right: 3px;
}

.node-status-modified { fill: #f44336; }
.node-status-added { fill: #4caf50; }
.node-status-deleted { fill: #f44336; opacity: 0.6; }
.node-status-unchanged { fill: #2196f3; opacity: 0.35; }

/* ── Schema detail tabs fill height ── */
.schema-detail-tabs {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.schema-detail-tabs > .mud-tabs-panels {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.schema-detail-tabs > .mud-tabs-panels > .mud-tab-panel,
.schema-detail-tabs > .mud-tabs-panels > .mud-tabpanel {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Deployment wizard stepper ──
   Keep the Previous/Next action bar below the step content, right-aligned. */
.deploy-wizard-stepper {
    display: flex;
    flex-direction: column;
}

.deploy-wizard-stepper > .mud-stepper-nav {
    order: 0;
}

.deploy-wizard-stepper > .mud-stepper-content {
    order: 1;
}

.deploy-wizard-stepper > .mud-stepper-actions {
    order: 2;
    justify-content: flex-end;
    padding-top: 8px;
}

/* ── SQL Editor (Monaco) ── */
.sql-editor-wrapper {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sql-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px 8px;
    background: var(--mud-palette-surface);
    border-bottom: 1px solid var(--mud-palette-divider);
    min-height: 30px;
}

.sql-editor-dark .sql-editor-toolbar {
    background: #1e1e1e;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.sql-editor-light .sql-editor-toolbar {
    background: #f3f3f3;
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

.sql-editor-toolbar-spacer {
    flex: 1;
}

.sql-editor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 3px;
    color: var(--mud-palette-action-default);
    cursor: pointer;
    padding: 3px 5px;
    transition: background 0.15s, color 0.15s;
}

.sql-editor-btn:hover {
    background: rgba(128, 128, 128, 0.15);
    color: var(--mud-palette-text-primary);
}

.sql-editor-body {
    overflow: hidden;
}

.sql-monaco-editor.monaco-editor-container {
    height: 100% !important;
    overflow: hidden;
}

.commit-diff-editor.monaco-editor-container {
    height: 100% !important;
    overflow: hidden;
}

.sql-editor-label {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    font-weight: 500;
}

/* ── SQL Editor fullscreen mode ── */
.sql-editor-fullscreen {
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 10000;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
}

.sql-editor-fullscreen .sql-editor-body {
    flex: 1 1 0;
    min-height: 0;
    height: 100% !important;
}

.sql-editor-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
}

.sql-editor-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 12px;
    background: #007acc;
    font-size: 0.7rem;
    color: #fff;
    min-height: 22px;
    border-radius: 0 0 8px 8px;
}

.sql-editor-status-bar kbd {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.65rem;
    font-family: inherit;
}

/* ── Lightweight form controls ── */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 12px;
}

.form-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.form-grid .span-full {
    grid-column: 1 / -1;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.form-field label {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    font-weight: 500;
    user-select: none;
}

.form-field input[type="text"],
.form-field input[type="number"],
.form-field select {
    font-size: 0.85rem;
    padding: 5px 8px;
    border: 1px solid var(--mud-palette-lines-inputs);
    border-radius: 4px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    outline: none;
    min-height: 32px;
    width: 100%;
    box-sizing: border-box;
}

.form-field input:focus,
.form-field select:focus {
    border-color: var(--mud-palette-primary);
    box-shadow: 0 0 0 1px var(--mud-palette-primary);
}

.form-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
}

.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--mud-palette-primary);
    cursor: pointer;
    margin: 0;
}

.form-checks-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    grid-column: 1 / -1;
}

/* ── Validation errors ── */
.field-validation-error {
    font-size: 0.75rem;
    color: var(--mud-palette-error);
    margin-top: 2px;
}

.form-field.has-error input,
.form-field.has-error select {
    border-color: var(--mud-palette-error);
}

.form-field.has-error input:focus,
.form-field.has-error select:focus {
    border-color: var(--mud-palette-error);
    box-shadow: 0 0 0 1px var(--mud-palette-error);
}

/* ── Lightweight action bar ── */
.action-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--mud-palette-lines-default);
    background: transparent;
    color: var(--mud-palette-text-primary);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.action-btn:hover {
    background: var(--mud-palette-action-default-hover);
}

.action-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    flex-shrink: 0;
}

.action-btn-primary {
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    border-color: var(--mud-palette-primary);
}

.action-btn-primary:hover {
    opacity: 0.9;
}

.action-btn-error {
    color: var(--mud-palette-error);
    border-color: var(--mud-palette-error);
}

.action-btn-error:hover {
    background: rgba(var(--mud-palette-error-rgb, 244, 67, 54), 0.08);
}

.action-btn-group {
    display: inline-flex;
}

.action-btn-group .action-btn {
    border-radius: 0;
}

.action-btn-group .action-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.action-btn-group .action-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.action-btn-group .action-btn + .action-btn {
    border-left: none;
}

.action-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid;
    white-space: nowrap;
}

.action-chip svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

.action-chip-warning {
    color: var(--mud-palette-warning);
    border-color: var(--mud-palette-warning);
}

.action-chip-success {
    color: var(--mud-palette-success);
    border-color: var(--mud-palette-success);
}

.action-chip-readonly {
    color: var(--mud-palette-warning);
    border-color: var(--mud-palette-warning);
}

/* ── Lightweight HTML tabs ── */
.html-tabs {
    display: flex;
    flex-direction: column;
}

.html-tab-header {
    display: flex;
    border-bottom: 1px solid var(--mud-palette-divider);
    gap: 0;
    flex-shrink: 0;
    overflow-x: auto;
}

.html-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    font-size: 0.8rem;
    border: none;
    background: transparent;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.html-tab-btn:hover {
    color: var(--mud-palette-text-primary);
    background: var(--mud-palette-action-default-hover);
}

.html-tab-btn.active {
    color: var(--mud-palette-primary);
    border-bottom-color: var(--mud-palette-primary);
}

.html-tab-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.html-tab-content {
    padding: 8px;
}

/* ── Lightweight HTML data table ── */
.html-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.html-table th,
.html-table td {
    padding: 4px 8px;
    text-align: left;
    border: 1px solid var(--mud-palette-table-lines);
}

.html-table th {
    background: var(--mud-palette-surface);
    background-color: var(--mud-palette-surface);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--mud-palette-text-secondary);
    position: sticky;
    top: 0;
    z-index: 5;
    /* Draw top + bottom borders via box-shadow so they remain visible
       while the header is stuck (border-collapse otherwise hides them). */
    box-shadow: inset 0 1px 0 var(--mud-palette-table-lines),
                inset 0 -1px 0 var(--mud-palette-table-lines);
    background-clip: padding-box;
}

.html-table tr:nth-child(even) {
    background: rgba(var(--mud-palette-primary-rgb), 0.02);
}

.html-table tr:hover {
    background: var(--mud-palette-action-default-hover);
}

.html-table tr.clickable {
    cursor: pointer;
}

.html-table input[type="text"] {
    font-size: 0.85rem;
    padding: 2px 4px;
    border: 1px solid transparent;
    border-radius: 3px;
    background: transparent;
    color: inherit;
    width: 100%;
    outline: none;
    min-height: 24px;
}

.html-table input[type="text"]:focus {
    border-color: var(--mud-palette-primary);
    background: var(--mud-palette-surface);
}

.html-table input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--mud-palette-primary);
    cursor: pointer;
}

.html-table .table-action-btn {
    padding: 2px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    color: var(--mud-palette-error);
    opacity: 0.7;
}

.html-table .table-action-btn:hover {
    opacity: 1;
}

.html-table .table-action-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ── Column reorder controls (non-drag alternative) ── */
.col-reorder-cell {
    white-space: nowrap;
    text-align: center;
    user-select: none;
    padding: 0 4px !important;
}

.col-drag-handle {
    cursor: grab;
    opacity: 0.6;
    margin-right: 2px;
}

.col-reorder-btns {
    display: inline-flex;
    gap: 1px;
    opacity: 0;
    transition: opacity 0.12s ease-in-out;
    vertical-align: middle;
}

tr:hover .col-reorder-btns,
tr:focus-within .col-reorder-btns {
    opacity: 1;
}

.col-reorder-btn {
    border: none;
    background: transparent;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
    padding: 0 2px;
    font-size: 0.7rem;
    line-height: 1;
    border-radius: 2px;
}

.col-reorder-btn:hover {
    background: var(--mud-palette-action-default-hover);
    color: var(--mud-palette-primary);
}

.col-ordinal-input {
    width: 3em;
    text-align: center;
    font-size: 0.8em;
    color: var(--mud-palette-text-secondary);
    border: 1px solid transparent;
    background: transparent;
    border-radius: 3px;
    padding: 1px 2px;
    -moz-appearance: textfield;
}

.col-ordinal-input::-webkit-outer-spin-button,
.col-ordinal-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.col-ordinal-input:hover,
.col-ordinal-input:focus {
    border-color: var(--mud-palette-primary);
    background: var(--mud-palette-surface);
    color: inherit;
    outline: none;
}

.col-size-cell {
    white-space: nowrap;
}

.col-size-input {
    width: 3.5em;
    text-align: center;
    font-size: 0.8em;
    color: var(--mud-palette-text-primary);
    border: 1px solid transparent;
    background: transparent;
    border-radius: 3px;
    padding: 1px 2px;
    -moz-appearance: textfield;
}

.col-size-input::-webkit-outer-spin-button,
.col-size-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.col-size-input::placeholder {
    color: var(--mud-palette-text-secondary);
}

.col-size-input:hover,
.col-size-input:focus {
    border-color: var(--mud-palette-primary);
    background: var(--mud-palette-surface);
    outline: none;
}

.col-size-sep {
    color: var(--mud-palette-text-secondary);
    margin: 0 1px;
}

/* ── Prop editor add row ── */
.prop-add-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-top: 8px;
}

.prop-add-row select,
.prop-add-row input[type="text"] {
    font-size: 0.85rem;
    padding: 5px 8px;
    border: 1px solid var(--mud-palette-lines-inputs);
    border-radius: 4px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    outline: none;
    min-height: 32px;
    min-width: 160px;
}

.prop-add-row select:focus,
.prop-add-row input:focus {
    border-color: var(--mud-palette-primary);
}

/* ── Detail panel header ── */
.detail-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.detail-header-info {
    display: flex;
    flex-direction: column;
}

.detail-header-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}

.detail-header-subtitle {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

.detail-header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: var(--mud-palette-text-primary);
    transition: background 0.15s;
}

.detail-nav-btn:hover:not(:disabled) {
    background: var(--mud-palette-action-default-hover);
}

.detail-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.detail-nav-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.detail-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.detail-divider {
    height: 1px;
    background: var(--mud-palette-divider);
    margin-bottom: 12px;
}

/* ── Detail placeholder ── */
.detail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    gap: 8px;
    color: var(--mud-palette-text-secondary);
}

.detail-placeholder svg {
    width: 40px;
    height: 40px;
    fill: currentColor;
    opacity: 0.5;
}

.detail-placeholder-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.detail-placeholder-msg {
    font-size: 0.85rem;
    text-align: center;
}

/* ── Loading spinner (small) ── */
.detail-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
    color: var(--mud-palette-text-secondary);
    font-size: 0.85rem;
}

.detail-loading .spinner-sm {
    width: 18px;
    height: 18px;
    border: 2px solid var(--mud-palette-lines-default);
    border-top-color: var(--mud-palette-primary);
    border-radius: 50%;
    /* Promote to its own compositor layer so the GPU keeps the spin animation
       running even while the WASM main thread is busy loading details.
       NOTE: do NOT also set `transform: translateZ(0)` here — the tree-spin
       keyframes only declare `to { transform: rotate(360deg); }`, and mixing
       a translate base with a rotate target forces the browser into matrix
       interpolation between two identity matrices, which produces no visible
       rotation. `will-change: transform` alone is enough to layer-promote. */
    will-change: transform;
    backface-visibility: hidden;
    animation: tree-spin 0.6s linear infinite;
}

/* ── Progress bar (linear) ── */
.progress-bar-sm {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--mud-palette-lines-default);
    overflow: hidden;
    /* Strict containment isolates layout/paint so sibling renders don't
       invalidate the bar's compositor layer. */
    contain: strict;
}

.progress-bar-sm::after {
    content: '';
    display: block;
    height: 100%;
    width: 40%;
    background: var(--mud-palette-primary);
    border-radius: 2px;
    /* GPU-composited: translate3d + will-change keeps the animation running
       on the compositor thread while the WASM main thread is busy. */
    will-change: transform;
    transform: translate3d(-100%, 0, 0);
    animation: progress-indeterminate 1.2s ease-in-out infinite;
}

@keyframes progress-indeterminate {
    0%   { transform: translate3d(-100%, 0, 0); }
    100% { transform: translate3d(350%, 0, 0); }
}

/* ── Changes tree (HTML version) ── */
.changes-tree-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.changes-tree-header svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.changes-tree-header .count-badge {
    font-size: 0.7rem;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--mud-palette-warning);
    color: var(--mud-palette-warning-text);
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.changes-tree-title {
    font-size: 0.85rem;
    font-weight: 600;
}

.change-node {
    display: flex;
    align-items: center;
    height: 28px;
    padding: 0 4px 0 0;
    padding-left: calc(var(--depth, 0) * 16px);
    gap: 4px;
    white-space: nowrap;
    cursor: pointer;
    border-radius: 3px;
    font-size: 0.85rem;
}

.change-node:hover {
    background: rgba(var(--mud-palette-primary-rgb), 0.06);
}

.change-node.selected {
    background: var(--mud-palette-action-default-hover);
}

.change-node-icon {
    width: 16px;
    height: 16px;
    min-width: 16px;
    flex-shrink: 0;
    fill: currentColor;
}

.change-node-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.change-node-op {
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
    flex-shrink: 0;
}

.change-node-undo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--mud-palette-warning);
    border-radius: 3px;
    opacity: 0;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.change-node:hover .change-node-undo {
    opacity: 0.7;
}

.change-node-undo:hover {
    opacity: 1 !important;
    background: var(--mud-palette-action-default-hover);
}

.change-node-undo svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* ── Commit button ── */
.commit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 4px;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s;
}

.commit-btn:hover {
    opacity: 0.9;
}

.commit-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ── Undo All button ── */
.undo-all-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 4px;
    background: var(--mud-palette-warning);
    color: var(--mud-palette-warning-text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s;
}

.undo-all-btn:hover {
    opacity: 0.9;
}

.undo-all-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ── Changes sidebar empty / no-project states ── */
.changes-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    flex: 1;
    color: var(--mud-palette-text-secondary);
}

.changes-empty svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
    opacity: 0.5;
}

.changes-empty-msg {
    font-size: 0.85rem;
    text-align: center;
}

.no-changes-msg {
    font-size: 0.8rem;
    color: var(--mud-palette-text-secondary);
    text-align: center;
    padding: 16px 0;
}

/* ── Info alert ── */
.info-alert {
    font-size: 0.8rem;
    padding: 6px 10px;
    border-radius: 4px;
    background: rgba(var(--mud-palette-info-rgb, 33, 150, 243), 0.08);
    color: var(--mud-palette-info);
    margin-bottom: 12px;
}

/* ── Caption text helper ── */
.caption-text {
    font-size: 0.8rem;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 8px;
}

/* ── Section title ── */
.section-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
}

/* ── Change Diff View ── */
.diff-line {
    display: flex;
    gap: 6px;
    padding: 2px 8px;
    white-space: nowrap;
}

.diff-added {
    background: rgba(46, 160, 67, 0.15);
    color: #3fb950;
}

.diff-removed {
    background: rgba(248, 81, 73, 0.15);
    color: #f85149;
}

.diff-unchanged {
    opacity: 0.5;
}

.diff-sign {
    display: inline-block;
    width: 12px;
    flex-shrink: 0;
    font-weight: bold;
    user-select: none;
}

.diff-prop {
    font-weight: 600;
    margin-right: 4px;
    flex-shrink: 0;
}

/* ── Responsive app bar (logo + wordmark + breadcrumb) ──
   The app bar packs the logo, the "Schema-Ops" wordmark, the project
   breadcrumb, an org chip and two icon buttons onto a single row. Without
   these rules the fixed-size logo and h4 wordmark overflow narrow (mobile)
   viewports: the wordmark wraps to two lines and overlaps the breadcrumb,
   forcing a horizontal scrollbar. */
.appbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.appbar-logo {
    height: 34px;
    width: auto;
    flex-shrink: 0;
}

.appbar-title {
    white-space: nowrap;
    line-height: 1.1;
    font-size: 1.5rem;
}

.appbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 16px;
    min-width: 0;
    overflow: hidden;
    font-size: 0.9rem;
}

.appbar-breadcrumb .mud-button-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tablets and small laptops: scale the logo and wordmark down a notch. */
@media (max-width: 960px) {
    .appbar-logo {
        height: 30px;
    }

    .appbar-title {
        font-size: 1.35rem;
    }

    .appbar-breadcrumb {
        margin-left: 8px;
    }
}

/* Phones: drop the wordmark so the scaled logo and breadcrumb fit on one row
   without overlapping. */
@media (max-width: 600px) {
    .appbar-logo {
        height: 28px;
    }

    .appbar-title {
        display: none;
    }

    .appbar-breadcrumb {
        margin-left: 6px;
        font-size: 0.8rem;
    }

    /* Without the wordmark the leading "/" separator dangles after the logo. */
    .appbar-breadcrumb .bc-sep:first-child {
        display: none;
    }
}

/* ───────────────────────────────────────────────────────────
   Responsive: Schema Designer
   The designer uses a custom horizontal flex split
   (sidebar + drag splitter + main panel). The sidebar is a fixed
   280px and the JS splitter writes an inline pixel width onto it,
   so on narrow screens it overflows instead of adapting. Only on
   genuinely small (phone) viewports do we stack the panels
   vertically and hide the drag handle. The breakpoint is 600px
   (not 768px) so scaled laptops — whose effective CSS width can
   dip just under 768px at 150% display scaling — keep the desktop
   side-by-side layout where the tree fills the full viewport
   height. The splitter stays fully functional on wider screens.
   ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    /* Stacked layout: the split becomes the vertical scroll container so the
       tree (top) and the properties/detail panel (bottom) each get a
       comfortable height and the user can scroll down to reach the
       properties instead of them being clipped off the bottom. */
    .schema-split {
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* Open sidebar: full width with a fixed, comfortable tree height.
       flex:0 0 auto keeps it from shrinking so the properties panel below
       pushes the column past the viewport and the split scrolls. Overrides
       the fixed 280px, the JS-applied inline width, AND the
       higher-specificity mini rule via !important. */
    .schema-split > .schema-sidebar {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 60vh;
        flex: 0 0 auto;
    }

    /* Properties / detail panel: give it a definite height beneath the tree
       (definite so the inner MudPaper's height:100% + its own scroll resolve
       reliably) and keep it from being squeezed, so scrolling the split
       brings it fully into view. */
    .schema-split > .schema-main-panel {
        flex: 0 0 auto;
        height: 60vh;
    }

    /* Collapsed (mini) state: inner content is hidden, so let the
       sidebar shrink to just its toggle header instead of a fixed
       56px-wide rail. */
    .schema-split > .schema-sidebar.schema-sidebar-mini {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: auto !important;
    }

    /* The horizontal drag handle is meaningless when stacked. */
    .schema-splitter {
        display: none !important;
    }

    /* Let the pinned header (branch select / tabs / repo info) wrap
       onto multiple rows instead of overflowing horizontally. */
    .schema-designer-header > .mud-stack {
        flex-wrap: wrap;
        row-gap: 4px;
    }
}
/* -- In-app assistant: floating, draggable chat bubble -- */
.assistant-anchor {
    position: fixed;
    z-index: 1399; /* above app bar (1100) / drawers (1200-1300), below MudBlazor popovers & dialogs (1400+) */
    right: 24px; bottom: 24px; /* default corner until JS positions it via left/top */
}
.assistant-anchor.assistant-dragging { opacity: 0.9; }
.assistant-anchor.assistant-dragging * { pointer-events: none; }

/* The launcher and the card are both mounted; CSS decides which one shows so MudTabs keeps its state.
   The anchor always has the launcher's footprint; the card hangs off its bottom-right corner so the
   bubble position never has to move to make room for the card (JS nudges just the card into view). */
.assistant-anchor.assistant-open  .assistant-collapsed { visibility: hidden; pointer-events: none; }
.assistant-anchor.assistant-closed .assistant-card     { display: none; }
.assistant-anchor.assistant-hidden                     { display: none; }
.assistant-collapsed { position: relative; }

.assistant-launcher { cursor: grab; touch-action: none; }
.assistant-launcher:active { cursor: grabbing; }
.assistant-launcher .mud-button-root { box-shadow: 0 6px 20px rgba(0,0,0,.35); }

.assistant-drag-tip {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 4px 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
    font-size: 0.8rem;
    background: var(--mud-palette-surface);
    animation: assistant-tip-bob 1.6s ease-in-out infinite;
}
@keyframes assistant-tip-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
}

.assistant-card {
    position: absolute;
    right: 0;
    bottom: 0;
    width: min(400px, calc(100vw - 16px));
    height: min(620px, 75vh);
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    overflow: hidden;
}
.assistant-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px 8px 6px;
    cursor: grab;
    touch-action: none;
    user-select: none;
    border-bottom: 1px solid var(--mud-palette-divider);
    background: var(--mud-palette-surface);
}
.assistant-card-header:active { cursor: grabbing; }
.assistant-grip { color: var(--mud-palette-text-disabled); }
.assistant-card-title { display: flex; flex-direction: column; line-height: 1.1; }

.assistant-tabbar {
    display: flex;
    width: 100%;
    border-bottom: 1px solid var(--mud-palette-divider);
    background: var(--mud-palette-surface);
}
.assistant-tab {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 8px;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--mud-palette-text-secondary);
    font: inherit;
    font-weight: 500;
    letter-spacing: .02em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color .15s, color .15s, border-color .15s;
}
.assistant-tab:hover { background: var(--mud-palette-action-default-hover); }
.assistant-tab.active { color: var(--mud-palette-primary); border-bottom-color: var(--mud-palette-primary); }
.assistant-panels { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
.assistant-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.assistant-chat-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.assistant-composer { flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; }
.assistant-msg { border-radius: 8px; }
.assistant-msg-user { background: var(--mud-palette-primary); color: var(--mud-palette-primary-text); margin-left: 24px; }
.assistant-msg-assistant { background: var(--mud-palette-background-grey); margin-right: 24px; }
.assistant-tour .mud-timeline-item { padding-bottom: 8px; }

/* Sticky horizontal scrollbar proxy (StickyHorizontalScroll.razor). The real table scroll
   container may extend below the fold; this bar is pinned to the viewport bottom and synced
   with it via js/sticky-hscroll.js so wide rows can be scrolled without reaching the table end. */
.sticky-hscroll-wrapper { position: relative; }
.sticky-hscroll {
    position: sticky;
    bottom: 0;
    overflow-x: scroll;
    overflow-y: hidden;
    height: 14px;
    max-width: 100%;
    z-index: 2;
    background: var(--mud-palette-surface);
    border-top: 1px solid var(--mud-palette-lines-default);
    scrollbar-gutter: stable;
}
.sticky-hscroll--hidden { display: none; }
.sticky-hscroll__inner { height: 1px; }
.sticky-hscroll::-webkit-scrollbar { height: 12px; }
.sticky-hscroll::-webkit-scrollbar-thumb { background: var(--mud-palette-action-default); border-radius: 6px; }
.sticky-hscroll::-webkit-scrollbar-track { background: var(--mud-palette-background-grey); }
/* The JS switches the container to overflow-x: hidden while the proxy is shown, so only one
   horizontal bar is visible; the native bar returns as a fallback if the script is unavailable. */
.deployments-table .mud-table-container { overflow-x: auto; }
