:root {
    --sf-bg: #15191f;
    --sf-sidebar: #0e1217;
    --sf-surface: #1b2128;
    --sf-surface-elevated: #242b34;
    --sf-surface-hover: #29313a;
    --sf-input: #101318;
    --sf-border: #2d3641;
    --sf-border-strong: #3d4957;
    --sf-text: #e1e5e8;
    --sf-text-secondary: #adb6c0;
    --sf-muted: #7c8792;
    /* Canonical SynqFlow orange, taken from the official logo mark. */
    --synqflow-orange: #F47C48;
    --synqflow-orange-hover: #FF9A6D;
    --synqflow-orange-active: #D6653B;
    --sf-accent: var(--synqflow-orange);
    --sf-accent-hover: var(--synqflow-orange-hover);
    --sf-accent-soft: #ffc078;
    --sf-success: #4ecb8d;
    --sf-warning: #e7b15f;
    --sf-danger: #ef6b73;
    --sf-info: #78b6e8;
    --sf-focus: color-mix(in srgb, var(--synqflow-orange) 30%, transparent);
    --auth-edge-x: clamp(24px, 4vw, 64px);
    --auth-edge-y: clamp(18px, 3vh, 36px);
    --auth-footer-bottom: clamp(18px, 2vh, 28px);
    --sf-radius-sm: .4rem;
    --sf-radius-md: .65rem;
    --sf-radius-lg: .85rem;
    --sf-shadow-sm: 0 .25rem .8rem rgba(0, 0, 0, .14);
    --sf-shadow-lg: 0 1.5rem 4rem rgba(0, 0, 0, .26);
}

html, body {
    min-width: 320px;
    min-height: 100%;
    background: var(--sf-bg);
    color: var(--sf-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

body { margin: 0; }

/* Shared application shell for the interactive app and authenticated Razor pages. */
.page { min-height: 100vh; display: flex; background: var(--sf-bg); }
.page > .sidebar { width: 248px; min-height: 100vh; flex: 0 0 248px; position: sticky; top: 0; z-index: 30; background: var(--sf-sidebar); border-right: 1px solid var(--sf-border); }
.page > main { min-width: 0; flex: 1; }
.page > main > .top-row { min-height: 4.25rem; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 20; background: rgba(21, 25, 31, .92); border-bottom: 1px solid var(--sf-border); backdrop-filter: blur(14px); }
.page > main > article.content { width: min(100%, 1500px); margin: 0 auto; }
.page > main > .top-row .btn { min-height: 2.05rem; }

a, .btn-link { color: var(--sf-accent-hover); text-decoration: none; }
a:hover, .btn-link:hover { color: var(--sf-accent-soft); }
h1, h2, h3, h4, h5, h6 { color: var(--sf-text); letter-spacing: -.02em; }
h1:focus { outline: none; }
.content { padding-top: 2rem; padding-bottom: 3rem; }

.btn {
    min-height: 2.35rem;
    border-radius: var(--sf-radius-sm);
    font-size: .85rem;
    font-weight: 650;
    letter-spacing: .005em;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn.disabled { cursor: not-allowed; opacity: .52; transform: none; }
.btn-primary { color: #16181d; background: var(--sf-accent); border-color: var(--sf-accent); }
.btn-primary:hover { color: #16181d; background: var(--sf-accent-hover); border-color: var(--sf-accent-hover); }
.btn-outline-light { color: var(--sf-text-secondary); border-color: var(--sf-border-strong); }
.btn-outline-light:hover { color: var(--sf-text); background: var(--sf-surface-hover); border-color: var(--sf-accent); }
.btn-outline-danger { color: #ff9aa0; border-color: rgba(239, 107, 115, .45); }
.btn-outline-danger:hover, .btn-danger:hover { color: #fff; background: rgba(239, 107, 115, .18); border-color: var(--sf-danger); }
.btn-danger { color: #fff; background: var(--sf-danger); border-color: var(--sf-danger); }
.btn-link { min-height: auto; padding: 0; font-weight: 600; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible {
    outline: 2px solid var(--sf-accent);
    outline-offset: 2px;
}

.form-label, .config-field label { color: var(--sf-text-secondary); font-size: .8rem; font-weight: 650; }
.form-control, .form-select {
    min-height: 2.45rem;
    color: var(--sf-text);
    background: var(--sf-input);
    border: 1px solid var(--sf-border);
    border-radius: var(--sf-radius-sm);
}
.form-control::placeholder { color: #68727e; }
.form-control:focus, .form-select:focus {
    color: var(--sf-text);
    background: var(--sf-input);
    border-color: var(--sf-accent);
    box-shadow: 0 0 0 .2rem var(--sf-focus);
}
.form-control:disabled, .form-select:disabled { color: var(--sf-muted); background: #15181d; }
.form-select option { color: var(--sf-text); background: var(--sf-surface); }
.form-check-input { background-color: var(--sf-input); border-color: var(--sf-border-strong); }
.form-check-input:checked { background-color: var(--sf-accent); border-color: var(--sf-accent); }
.form-check-label { color: var(--sf-text-secondary); }
.validation-message { margin-top: .3rem; color: #ff9aa0; font-size: .78rem; }
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--sf-success); }
.invalid { outline: 1px solid var(--sf-danger); }
.field-help, .muted-text { color: var(--sf-muted); }
.field-help { font-size: .76rem; }
.required { color: var(--sf-accent); }

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.7rem;
}
.page-header h1 { margin: 0; font-size: clamp(1.6rem, 2vw, 2.05rem); font-weight: 720; }
.page-header-copy { min-width: 0; }
.page-subtitle { max-width: 56rem; margin: .4rem 0 0; color: var(--sf-muted); font-size: .92rem; }
.page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .55rem; }
.eyebrow { margin-bottom: .35rem; color: var(--sf-accent); font-size: .68rem; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; }

.panel, .stat-card {
    background: var(--sf-surface);
    border: 1px solid var(--sf-border);
    border-radius: var(--sf-radius-md);
    box-shadow: var(--sf-shadow-sm);
}
.panel { padding: 1.15rem; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel h2 { font-size: 1rem; font-weight: 700; }
.panel h3 { font-size: .92rem; font-weight: 700; }
.panel > h2, .panel > h3 { margin-bottom: .85rem; }
.panel .panel { background: var(--sf-surface-elevated); box-shadow: none; }
.stat-card { min-height: 112px; padding: 1.05rem 1.15rem; }
.stat-card .stat-label { color: var(--sf-muted); font-size: .69rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.stat-card .stat-value { display: block; margin-top: .5rem; font-size: 1.9rem; font-weight: 740; letter-spacing: -.035em; }
.stat-card .stat-detail { color: var(--sf-muted); font-size: .78rem; }

.table-responsive { border-radius: var(--sf-radius-sm); }
.table { --bs-table-bg: transparent; --bs-table-color: var(--sf-text); --bs-table-border-color: var(--sf-border); margin-bottom: 0; }
.table thead th { padding-top: .7rem; padding-bottom: .7rem; color: var(--sf-muted); border-bottom-color: var(--sf-border-strong); font-size: .67rem; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; white-space: nowrap; }
.table tbody td { padding-top: .82rem; padding-bottom: .82rem; color: var(--sf-text-secondary); vertical-align: middle; }
.table tbody tr { border-color: var(--sf-border); }
.table tbody tr:hover { background: rgba(255, 255, 255, .025); }
.table td:first-child, .table th:first-child { padding-left: .25rem; }

.status-badge { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid transparent; border-radius: 999px; padding: .22rem .58rem; color: var(--sf-text-secondary); background: rgba(127, 137, 149, .13); font-size: .7rem; font-weight: 750; line-height: 1.2; white-space: nowrap; }
.status-badge.active, .status-badge.succeeded, .status-badge.completed { color: #83e2ae; background: rgba(78, 203, 141, .13); border-color: rgba(78, 203, 141, .25); }
.status-badge.published, .status-badge.success { color: #83e2ae; background: rgba(78, 203, 141, .13); border-color: rgba(78, 203, 141, .25); }
.status-badge.failed, .status-badge.cancelled, .status-badge.disabled { color: #ff9aa0; background: rgba(239, 107, 115, .13); border-color: rgba(239, 107, 115, .25); }
.status-badge.error, .status-badge.dead-lettered, .status-badge.retired, .status-badge.expired, .status-badge.revoked { color: #ff9aa0; background: rgba(239, 107, 115, .13); border-color: rgba(239, 107, 115, .25); }
.status-badge.running, .status-badge.queued, .status-badge.pending { color: #ffc078; background: rgba(242, 140, 40, .13); border-color: rgba(242, 140, 40, .25); }
.status-badge.draft, .status-badge.inactive, .status-badge.superseded { color: var(--sf-text-secondary); background: rgba(127, 137, 149, .13); border-color: rgba(127, 137, 149, .25); }
.status-badge.completedwitherrors, .status-badge.warning { color: #f2c879; background: rgba(231, 177, 95, .13); border-color: rgba(231, 177, 95, .25); }
.status-badge.completed-with-errors { color: #f2c879; background: rgba(231, 177, 95, .13); border-color: rgba(231, 177, 95, .25); }
.status-badge.healthy { color: #83e2ae; background: rgba(78, 203, 141, .13); border-color: rgba(78, 203, 141, .25); }
.status-badge.critical, .status-badge.offline { color: #ff9aa0; background: rgba(239, 107, 115, .13); border-color: rgba(239, 107, 115, .25); }
.health-metric { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid rgba(127, 137, 149, .12); }
.health-metric:last-child { border-bottom: 0; }

.empty-state { padding: 2.75rem 1.2rem; color: var(--sf-muted); text-align: center; }
.empty-state h2, .empty-state h3 { margin: 0 0 .45rem; color: var(--sf-text); font-size: 1.1rem; }
.empty-state p { max-width: 34rem; margin: 0 auto 1.1rem; font-size: .88rem; }
.alert-sf { padding: .78rem 1rem; border: 1px solid rgba(239, 107, 115, .35); border-radius: var(--sf-radius-sm); color: #ffb4b9; background: rgba(239, 107, 115, .11); }
.alert-sf.success { color: #9ae8ba; border-color: rgba(78, 203, 141, .3); background: rgba(78, 203, 141, .1); }
.alert-sf.warning { color: #f2d19a; border-color: rgba(231, 177, 95, .34); background: rgba(231, 177, 95, .1); }

.auth-page { min-height: 100vh; color: var(--sf-text); background: var(--sf-bg); }
.auth-shell { --auth-split: 44%; position: relative; min-height: 100dvh; height: 100dvh; display: grid; grid-template-columns: minmax(31rem, 44%) minmax(0, 56%); overflow: hidden; }
.auth-panel { min-width: 0; min-height: 0; position: relative; z-index: 1; display: grid; grid-template-rows: minmax(0, 1fr) auto; overflow-y: auto; padding: clamp(2.75rem, 7vh, 4.75rem) var(--auth-edge-x) var(--auth-footer-bottom); background: #101215; }
.auth-panel-main { min-height: 0; display: flex; align-items: center; justify-content: center; }
.auth-content { width: min(100%, 25rem); margin: 0 auto; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 2.1rem; }
.auth-brand__logo { display: block; width: min(100%, 290px); height: auto; }
.auth-brand:hover { text-decoration: none; }
.auth-visual { position: relative; min-width: 0; min-height: 0; overflow: hidden; z-index: 1; background: #0d1014; }
.auth-visual img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; opacity: .98; }
.auth-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(13, 16, 20, .08), transparent 38%), linear-gradient(0deg, rgba(13, 16, 20, .2), transparent 45%); pointer-events: none; }
.auth-visual__copy { position: absolute; inset: 0; z-index: 1; pointer-events: none; color: #d8dde1; font-size: clamp(10px, .75vw, 12px); font-weight: 500; line-height: 1.65; letter-spacing: .16em; }
.auth-visual__copy-top, .auth-visual__copy-bottom { position: absolute; z-index: 0; right: var(--auth-edge-x); display: flex; flex-direction: column; align-items: flex-start; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, .68); }
.auth-visual__copy-top { top: var(--auth-edge-y); }
.auth-visual__copy-top::before, .auth-visual__copy-bottom::before { content: ""; position: absolute; z-index: -1; background: rgba(7, 9, 12, .58); }
.auth-visual__copy-top::before { inset: -10px -14px -12px; }
.auth-visual__copy-top i { display: block; width: 3.5rem; height: 1px; margin-top: .75rem; background: var(--synqflow-orange); }
.auth-visual__copy-bottom { bottom: var(--auth-footer-bottom); gap: .15rem; font-size: clamp(8px, .58vw, 10px); letter-spacing: .13em; }
.auth-visual__copy-bottom::before { inset: -8px -12px -8px; }
.auth-visual__copy-bottom strong { color: #eef0f2; font-size: 1em; font-weight: 500; }
.auth-footer { width: min(100%, 25rem); margin: 0 auto; color: var(--sf-muted); font-size: clamp(8px, .62vw, 10px); font-weight: 700; line-height: 1.2; letter-spacing: .16em; }
.auth-structure { position: absolute; inset: 0; z-index: 3; pointer-events: none; border-top: 1px solid rgba(173, 183, 192, .18); border-bottom: 1px solid rgba(173, 183, 192, .18); }
.auth-structure::before { content: ""; position: absolute; inset: 0 auto 0 var(--auth-split); width: 1px; background: rgba(173, 183, 192, .22); }
.auth-structure::after { content: ""; position: absolute; inset: 9% 0 11%; border-top: 1px solid rgba(173, 183, 192, .13); border-bottom: 1px solid rgba(173, 183, 192, .13); }
.auth-footer__separator { color: var(--synqflow-orange); }
.auth-panel h1 { margin: .7rem 0 .55rem; font-size: clamp(2.55rem, 3.7vw, 3.15rem); line-height: 1.04; font-weight: 540; letter-spacing: -.045em; }
.auth-panel h1 + .muted-text { max-width: 28rem; margin-bottom: 1.65rem; font-size: clamp(1rem, 1.25vw, 1.15rem); }
.auth-content > h1, .auth-content > h1 + .muted-text { text-align: center; }
.auth-page a, .auth-page .btn-link { color: var(--synqflow-orange); }
.auth-page a:hover, .auth-page a:focus-visible, .auth-page .btn-link:hover, .auth-page .btn-link:focus-visible { color: var(--synqflow-orange-hover); }
.auth-panel .form-label { margin-bottom: .4rem; font-size: .9rem; }
.auth-panel .form-control { min-height: 3.1rem; padding: .65rem .9rem; font-size: .96rem; background: #20252a; }
.auth-panel .form-check-label { font-size: .9rem; }
.auth-panel .auth-submit { min-height: 3.1rem; font-size: .96rem; }
.auth-panel .btn-primary { color: var(--sf-text); background: var(--synqflow-orange); border-color: var(--synqflow-orange); }
.auth-panel .btn-primary:hover { color: var(--sf-text); background: var(--synqflow-orange-hover); border-color: var(--synqflow-orange-hover); }
.auth-options { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.auth-options a { color: var(--synqflow-orange); font-size: .9rem; }
.auth-divider { height: 1px; margin: 1.55rem 0 1rem; background: var(--sf-border); }
.auth-divider ~ p { text-align: center; }
.auth-password { position: relative; }
.auth-password .form-control { padding-right: 3.1rem; }
.auth-password-toggle { position: absolute; top: 50%; right: .65rem; display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: var(--sf-radius-sm); color: var(--sf-muted); background: transparent; transform: translateY(-50%); }
.auth-password-toggle:hover, .auth-password-toggle:focus-visible { color: var(--synqflow-orange); background: color-mix(in srgb, var(--synqflow-orange) 10%, transparent); }
.auth-password-toggle:focus-visible { outline: 2px solid var(--synqflow-orange); outline-offset: 2px; }
.auth-panel .btn-primary { width: 100%; }
.brand-mark { color: var(--sf-accent); font-size: 1.2rem; font-weight: 760; letter-spacing: -.015em; }
.auth-brand .brand-mark { font-size: clamp(2.35rem, 4vw, 3.15rem); letter-spacing: -.045em; }

.step-tabs { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1rem; padding-bottom: .85rem; border-bottom: 1px solid var(--sf-border); }
.step-tabs .readiness-panel { flex-basis: 100%; }
.step-tab { padding: .45rem .7rem; border: 1px solid var(--sf-border); border-radius: var(--sf-radius-sm); color: var(--sf-muted); background: transparent; font-size: .78rem; font-weight: 650; }
.step-tab:hover { color: var(--sf-text); border-color: var(--sf-border-strong); background: var(--sf-surface-hover); }
.step-tab.active { color: #ffc078; border-color: var(--sf-accent); background: rgba(242, 140, 40, .13); }
.synqflow-form { width: min(100%, 760px); }
.synqflow-form--wide { width: min(100%, 820px); }
.compact-form-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.config-grid { display: flex; flex-direction: column; gap: 1rem; }
.config-field { display: flex; flex-direction: column; gap: .35rem; }
.synqflow-form .config-grid { gap: 1.1rem; }
.synqflow-form .config-field { width: 100%; }
.synqflow-form > section > h3 { margin: 0 0 .35rem; font-size: .95rem; font-weight: 700; }
.credentials-section { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--sf-border); }
.configured-secret { color: var(--sf-success); font-size: .76rem; font-weight: 650; }
.config-boolean-control { min-height: 2.45rem; display: flex; align-items: center; }
.config-boolean-control .form-check-input { width: 1.15rem; height: 1.15rem; margin: 0; cursor: pointer; }
.mapping-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: .55rem; margin-bottom: .55rem; }
.mapping-row--compact { grid-template-columns: minmax(0, 1fr) minmax(12rem, 1fr) auto; padding: .45rem .55rem; border: 1px solid var(--sf-border); border-radius: var(--sf-radius-sm); background: rgba(255, 255, 255, .018); }
.version-history__row { padding: .65rem 0; border-bottom: 1px solid var(--sf-border); }
.version-history__row:last-child { border-bottom: 0; }
.sf-icon-button { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 2.25rem; border-radius: var(--sf-radius-sm); }
.sf-icon-button--icon-only { width: 2.25rem; padding: .35rem; }
.sf-icon-button:focus-visible { outline: 2px solid var(--sf-accent); outline-offset: 2px; }
.sf-icon { display: inline-flex; align-items: center; justify-content: center; width: 1.05rem; height: 1.05rem; font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", sans-serif; font-size: 1rem; line-height: 1; }
.sf-icon--edit::before { content: "✎"; }
.sf-icon--view::before { content: "◉"; }
.sf-icon--restore::before { content: "↶"; }
.sf-icon--close::before { content: "×"; }
.sf-icon--arrow-up::before { content: "↑"; }
.sf-icon--arrow-down::before { content: "↓"; }
.sf-icon--arrow-left::before { content: "←"; }
.sf-icon--arrow-right::before { content: "→"; }
.sf-icon--left::before { content: "‹"; }
.sf-icon--right::before { content: "›"; }
.sf-icon--save::before { content: "▣"; }
.sf-icon--publish::before { content: "↑"; }
.sf-icon--activate::before { content: "✓"; }
.sf-icon--play::before { content: "▶"; }
.sf-icon--test::before { content: "⌁"; }
.sf-icon--refresh::before { content: "↻"; }
.sf-icon--pause::before { content: "Ⅱ"; }
.sf-icon--trash::before { content: "⌫"; }
.sf-icon--plus::before { content: "+"; }
/* Navigation uses the same restrained icon vocabulary as action buttons. */
.sf-icon--home::before { content: "⌂"; }
.sf-icon--connections::before { content: "◇"; }
.sf-icon--flows::before { content: "⇄"; }
.sf-icon--runs::before { content: "◷"; }
.sf-icon--warning::before { content: "!"; }
.sf-icon--users::before { content: "•"; }
.sf-icon--audit::before { content: "≋"; }
.sf-icon--logs::before { content: "▤"; }
.sf-icon--settings::before { content: "⚙"; }
.sf-icon--organizations::before { content: "▦"; }
.sf-icon--profile::before { content: "●"; }
.sf-icon--tenants::before { content: "⌘"; }
.sf-icon--security::before { content: "⚿"; }
.sf-icon--signout::before { content: "↗"; }
.mapping-endpoint { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: .45rem; min-width: 0; }
.mapping-arrow { color: var(--sf-muted); font-size: 1rem; }
.mapping-transformations { min-width: 0; }
.transformation-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.transformation-chip { padding: .25rem .5rem; border: 1px solid var(--sf-border-strong); border-radius: 999px; color: var(--sf-text-secondary); background: var(--sf-surface); font-size: .75rem; line-height: 1.2; }
.transformation-chip:hover, .transformation-chip:focus-visible { color: var(--sf-accent); border-color: var(--sf-accent); background: var(--sf-surface-hover); }
.transformation-chip--add { color: var(--sf-muted); border-style: dashed; }
.transformation-add { white-space: nowrap; }
.mapping-remove { width: 1.8rem; height: 1.8rem; padding: 0; line-height: 1; }
.transformation-picker { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .35rem; }
.transformation-picker .form-select { width: min(100%, 14rem); }
.transformation-editor { width: min(100%, 32rem); margin-top: .45rem; padding: .65rem; border: 1px solid var(--sf-border); border-radius: var(--sf-radius-sm); background: var(--sf-surface); }
.transformation-editor .config-field + .config-field { margin-top: .6rem; }
.transformation-editor-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .65rem; }
.dry-run-panel { background: var(--sf-surface-elevated); }
.dry-run-result { border-top: 1px solid var(--sf-border); padding-top: 1rem; }
.dry-run-record { border: 1px solid var(--sf-border); border-radius: var(--sf-radius-sm); padding: .55rem .7rem; background: rgba(255, 255, 255, .018); }
.dry-run-record + .dry-run-record { margin-top: .45rem; }
.dry-run-record summary { cursor: pointer; color: var(--sf-text-secondary); font-size: .82rem; font-weight: 650; }
.dry-run-record .mono span:last-child { max-width: 65%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.readiness-issue--error { color: #ffb4b9; }
.readiness-issue--warning { color: #ffd27a; }
.technical-details { display: inline-block; margin-left: .45rem; color: var(--sf-muted); font-size: .72rem; }
.technical-details summary { cursor: pointer; display: inline; }
.technical-details .mono { margin-left: .25rem; }
.transform-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .5rem; margin-top: .5rem; }
.query-editor, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.query-editor { min-height: 230px; font-size: .84rem; }
.mono { font-size: .84em; }
.tenant-selector { display: flex; align-items: center; gap: .6rem; margin-right: auto; }
.tenant-selector label { color: var(--sf-muted); font-size: .67rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.tenant-selector .form-select { width: 220px; }
.user-chip { color: var(--sf-text-secondary); font-size: .8rem; }
.account-menu { position: relative; margin-left: auto; }
.account-menu__summary { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.25rem; padding: .35rem .55rem; border: 1px solid transparent; border-radius: var(--sf-radius-sm); color: var(--sf-text-secondary); cursor: pointer; list-style: none; }
.account-menu__summary::-webkit-details-marker { display: none; }
.account-menu__summary:hover, .account-menu[open] .account-menu__summary { color: var(--sf-text); background: var(--sf-surface-hover); border-color: var(--sf-border); }
.account-menu__summary:focus-visible { outline: 2px solid var(--sf-accent); outline-offset: 2px; }
.account-menu__summary .sf-icon--profile { color: var(--sf-accent); }
.account-menu__caret { color: var(--sf-muted); font-size: .8rem; }
.account-menu__panel { position: absolute; z-index: 40; top: calc(100% + .45rem); right: 0; width: min(17rem, calc(100vw - 2rem)); padding: .45rem; border: 1px solid var(--sf-border-strong); border-radius: var(--sf-radius-sm); background: var(--sf-surface-elevated); box-shadow: var(--sf-shadow-lg); }
.account-menu__identity { display: flex; flex-direction: column; gap: .15rem; padding: .55rem .65rem .7rem; border-bottom: 1px solid var(--sf-border); overflow: hidden; }
.account-menu__identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sf-text); font-size: .8rem; }
.account-menu__panel > a { display: flex; align-items: center; gap: .55rem; padding: .55rem .65rem; border-radius: var(--sf-radius-sm); color: var(--sf-text-secondary); font-size: .82rem; text-decoration: none; }
.account-menu__panel > a:hover, .account-menu__panel > a:focus-visible { color: var(--sf-text); background: var(--sf-surface-hover); outline: none; }
.account-menu__panel > a .sf-icon { color: var(--sf-muted); }
.account-menu__panel > a.account-menu__signout { color: var(--synqflow-orange); }
.account-menu__panel > a.account-menu__signout .sf-icon { color: var(--sf-accent); }
.account-menu__divider { height: 1px; margin: .35rem .55rem; background: var(--sf-border); }
.audit-details { color: var(--sf-muted); font-size: .78rem; }
.security-content { width: min(100%, 760px); }

.blazor-error-boundary { position: fixed; right: 1rem; bottom: 1rem; z-index: 1000; max-width: min(32rem, calc(100vw - 2rem)); padding: .8rem 1rem .8rem 3rem; border: 1px solid rgba(239, 107, 115, .4); border-radius: var(--sf-radius-sm); color: #fff; background: #6c2227; box-shadow: var(--sf-shadow-lg); }
.blazor-error-boundary::after { content: "An error has occurred."; }
#blazor-error-ui { display: none; }
.darker-border-checkbox.form-check-input { border-color: var(--sf-border-strong); }

@media (min-width: 768px) and (max-width: 1099px) {
    .auth-shell { --auth-split: 52%; grid-template-columns: minmax(25rem, 52%) minmax(0, 48%); }
    .auth-panel { padding: 2.5rem clamp(1.75rem, 4vw, 3.5rem) var(--auth-footer-bottom); }
    .auth-content { width: min(100%, 25rem); }
    .auth-brand__logo { width: min(100%, 270px); }
    .auth-panel h1 { font-size: clamp(2.45rem, 4.1vw, 3rem); }
}

@media (max-width: 767px) {
    .page { display: block; }
    .page > .sidebar { width: 100%; min-height: auto; position: relative; border-right: 0; border-bottom: 1px solid var(--sf-border); }
    .page > main > .top-row { min-height: 4.1rem; align-items: flex-start; flex-wrap: wrap; padding-top: .85rem !important; padding-bottom: .85rem !important; }
    .page > main > article.content { padding-left: 1rem !important; padding-right: 1rem !important; }
    .content { padding-top: 1.35rem; }
    .page-header { align-items: flex-start; flex-direction: column; gap: 1rem; }
    .page-actions { justify-content: flex-start; }
    .compact-form-pair { grid-template-columns: 1fr; }
    .mapping-row { grid-template-columns: 1fr; }
    .mapping-endpoint { grid-template-columns: 1fr; }
    .mapping-arrow { display: none; }
    .tenant-selector { width: 100%; margin-right: 0; }
    .tenant-selector .form-select { width: min(100%, 260px); }
    .auth-shell { height: auto; overflow-x: hidden; overflow-y: auto; }
    .auth-panel { min-height: 100vh; padding: 1.5rem var(--auth-edge-x) var(--auth-footer-bottom); }
    .auth-panel-main { align-items: flex-start; }
    .auth-visual { display: none; }
    .auth-structure { display: none; }
    .auth-content { width: min(100%, 30rem); }
    .auth-panel h1 { font-size: clamp(2.5rem, 12vw, 3.2rem); }
    .auth-panel h1 + .muted-text { font-size: 1.05rem; }
}

@media (min-width: 768px) and (max-height: 760px) {
    /* Keep short laptop viewports usable; the panel remains scrollable rather
       than allowing a centered block to clip above or below the viewport. */
    .auth-panel-main { align-items: flex-start; padding-top: .5rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
