html, body {
    height: 100%;
    min-height: 100vh;
    margin: 0;
}

body {
    font-family: Roboto, Helvetica, Arial, sans-serif;
}

.app-shell {
    min-height: 100vh;
}

.app-main-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-page-content {
    flex: 1 0 auto;
}

.app-footer {
    flex: 0 0 auto;
    margin-top: auto;
}

.app-connection-status {
    margin-top: 20px !important;
}

@media (max-width: 600px) {
    .app-user-email {
        display: none !important;
    }

    .app-credit-chip {
        margin-right: 4px !important;
    }
}

/* Data grids stay uniformly dark in every app theme. */
.mud-table-container,
.mud-table-root {
    background: #30313a !important;
}

.mud-table-root .mud-table-head .mud-table-cell {
    background: #26272f !important;
    color: #f3f3f6 !important;
    border-color: #4a4b55 !important;
}

.mud-table-root .mud-table-body .mud-table-row,
.mud-table-root .mud-table-body .mud-table-row:nth-child(odd),
.mud-table-root .mud-table-body .mud-table-row:nth-child(even) {
    background: #34353e !important;
    color: #f3f3f6 !important;
}

.mud-table-root .mud-table-body .mud-table-row:hover {
    background: #3d3e48 !important;
}

.mud-table-root .mud-table-cell {
    color: #f3f3f6 !important;
    border-color: #4a4b55 !important;
}

.last-variables-scroll {
    max-height: 340px;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.execution-logs-scroll {
    max-height: 420px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

/* Canonical UI Block CSS shared with Studio's native HTML renderer. */
.bz-player-surface {
    --gap: 12px;
    --field-min-width: 140px;
    --radius: 10px;
    --accent: #2f6fed;
    --accent-dark: #1f4fc4;
    --bg: #fafbfd;
    --card: #ffffff;
    --border: #e1e6ee;
    --text: #1f2937;
    --text-dim: #667085;
    --disabled-opacity: .55;
    box-sizing: border-box;
    margin: 0;
    padding: 12px;
    background: var(--bg);
    color: var(--text);
    font: 13px/1.4 'Segoe UI', system-ui, sans-serif;
}

.bz-player-surface *, .bz-player-surface *::before, .bz-player-surface *::after { box-sizing: border-box; }
.bz-player-surface .bz-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--gap); }
.bz-player-surface .bz-field { display: flex; flex-direction: column; gap: 5px; min-width: var(--field-min-width); }
.bz-player-surface .bz-field.bz-checkbox { flex-direction: row; align-items: center; min-width: 0; }
.bz-player-surface label.bz-caption { font-size: 11px; font-weight: 600; color: var(--text-dim); }
.bz-player-surface input[type=text], .bz-player-surface input[type=number], .bz-player-surface select, .bz-player-surface textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--card); color: var(--text); }
.bz-player-surface textarea { min-height: 56px; resize: vertical; }
.bz-player-surface input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.bz-player-surface input[type=range] { -webkit-appearance: none; width: 160px; height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--pct, 0%), #d9dfe9 var(--pct, 0%)); outline: none; }
.bz-player-surface input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--accent); cursor: pointer; }
.bz-player-surface .bz-slider-row { display: flex; align-items: center; gap: 10px; }
.bz-player-surface .bz-slider-row input[type=number] { width: 64px; }
.bz-player-surface .bz-radio-group { display: flex; flex-direction: column; gap: 4px; }
.bz-player-surface .bz-radio-group .bz-caption { margin-bottom: 2px; }
.bz-player-surface .bz-radio-option { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.bz-player-surface .bz-radio-option input { accent-color: var(--accent); }
.bz-player-surface .bz-label { padding: 6px 0; font-size: 13px; }
.bz-player-surface .bz-ui-button { font: inherit; font-weight: 600; padding: 7px 14px; border: 1px solid var(--border); border-radius: 6px; background: #e8ebf0; color: var(--text-dim); cursor: not-allowed; opacity: var(--disabled-opacity); }
.bz-player-surface .bz-group { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; background: var(--card); }
.bz-player-surface .bz-group > .bz-group-title { font-size: 11px; font-weight: 700; color: var(--text-dim); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .03em; }
.bz-player-surface .bz-group[hidden] { display: none; }
.bz-player-surface .bz-disabled { opacity: var(--disabled-opacity); pointer-events: none; }

.job-parameter-preview {
    padding: 10px;
    border: 1px solid var(--mud-palette-divider);
    width: 100%;
}

.job-parameter-preview .bz-disabled {
    opacity: 1;
}

.job-parameter-preview .mud-disabled {
    opacity: 1;
}

.job-inline-editor,
.job-parameter-editor {
    width: 100%;
}

#background-canvas-login {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background: #121318;
}

#blazor-error-ui {
    color-scheme: light only;
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: .6rem 1.25rem .7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 10000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: .75rem;
    top: .5rem;
}
