h1:focus {
    outline: none;
}

:root,
:root[data-bs-theme='light'] {
    color-scheme: light;
    --bs-body-bg: var(--ec-page-bg);
    --bs-body-bg-rgb: 238, 242, 246;
    --bs-body-color: var(--ec-text);
    --bs-body-color-rgb: 17, 24, 39;
    --bs-border-color: rgba(15, 23, 42, 0.16);
    --bs-secondary-color: #526070;
    --bs-secondary-color-rgb: 82, 96, 112;
    --bs-secondary-bg: #f7fafc;
    --bs-secondary-bg-rgb: 247, 250, 252;
    --bs-tertiary-bg: #e7edf4;
    --bs-tertiary-bg-rgb: 231, 237, 244;
    --bs-emphasis-color: #111827;
    --bs-emphasis-color-rgb: 17, 24, 39;
    --bs-primary: #2563eb;
    --bs-primary-rgb: 37, 99, 235;
    --ec-page-bg: #eef2f6;
    --ec-surface: #ffffff;
    --ec-surface-alt: #f7fafc;
    --ec-surface-card: #ffffff;
    --ec-surface-elevated: #ffffff;
    --ec-surface-data: #f8fafc;
    --ec-surface-muted: rgba(255, 255, 255, 0.96);
    --ec-border: rgba(15, 23, 42, 0.16);
    --ec-border-strong: rgba(37, 99, 235, 0.30);
    --ec-text: #111827;
    --ec-text-muted: #526070;
    --ec-text-subtle: #334155;
    --ec-shadow: 0 12px 28px rgba(15, 23, 42, 0.10);
    --ec-shadow-soft: 0 6px 16px rgba(15, 23, 42, 0.08);
    --ec-accent: #2563eb;
    --ec-accent-strong: #1d4ed8;
    --ec-accent-soft: rgba(37, 99, 235, 0.10);
    --ec-live: #059669;
    --ec-live-soft: rgba(5, 150, 105, 0.14);
    --ec-warning: #d97706;
    --ec-warning-soft: rgba(217, 119, 6, 0.14);
    --ec-danger: #dc2626;
    --ec-danger-soft: rgba(220, 38, 38, 0.12);
    --ec-offline: #64748b;
    --ec-offline-soft: rgba(100, 116, 139, 0.14);
    --ec-data-canvas-bg: #f8fafc;
    --ec-data-canvas-border: rgba(15, 23, 42, 0.14);
    --ec-data-canvas-text: #172033;
    --ec-tooltip-bg: rgba(15, 23, 42, 0.92);
    --ec-tooltip-text: #f8fafc;
    --ec-sticky-connected: #ffffff;
    --ec-sticky-disconnected: #f3f6fa;
    --ec-error-ui-bg: #fef3c7;
    --ec-error-ui-text: #78350f;
    --ec-error-ui-border: rgba(217, 119, 6, 0.35);
    --ec-card-radius: 12px;
    --ec-card-padding: 14px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-bs-theme]) {
        color-scheme: dark;
        --bs-body-bg: var(--ec-page-bg);
        --bs-body-bg-rgb: 17, 19, 21;
        --bs-body-color: var(--ec-text);
        --bs-body-color-rgb: 229, 231, 235;
        --bs-border-color: rgba(203, 213, 225, 0.14);
        --bs-secondary-color: #a6b0bb;
        --bs-secondary-color-rgb: 166, 176, 187;
        --bs-secondary-bg: #20262e;
        --bs-secondary-bg-rgb: 32, 38, 46;
        --bs-tertiary-bg: #20262e;
        --bs-tertiary-bg-rgb: 32, 38, 46;
        --bs-emphasis-color: #e5e7eb;
        --bs-emphasis-color-rgb: 229, 231, 235;
        --bs-primary: #3b82f6;
        --bs-primary-rgb: 59, 130, 246;
        --ec-page-bg: #111315;
        --ec-surface: #1a1f25;
        --ec-surface-alt: #20262e;
        --ec-surface-card: #1c222a;
        --ec-surface-elevated: #242a33;
        --ec-surface-data: #181d23;
        --ec-surface-muted: rgba(26, 31, 37, 0.97);
        --ec-border: rgba(203, 213, 225, 0.14);
        --ec-border-strong: rgba(59, 130, 246, 0.34);
        --ec-text: #e5e7eb;
        --ec-text-muted: #a6b0bb;
        --ec-text-subtle: #cfd8e3;
        --ec-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
        --ec-shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.24);
        --ec-accent: #3b82f6;
        --ec-accent-strong: #60a5fa;
        --ec-accent-soft: rgba(59, 130, 246, 0.16);
        --ec-live: #10b981;
        --ec-live-soft: rgba(16, 185, 129, 0.16);
        --ec-warning: #f59e0b;
        --ec-warning-soft: rgba(245, 158, 11, 0.16);
        --ec-danger: #f87171;
        --ec-danger-soft: rgba(248, 113, 113, 0.16);
        --ec-offline: #94a3b8;
        --ec-offline-soft: rgba(148, 163, 184, 0.16);
        --ec-data-canvas-bg: #f8fafc;
        --ec-data-canvas-border: rgba(203, 213, 225, 0.30);
        --ec-data-canvas-text: #172033;
        --ec-tooltip-bg: rgba(17, 19, 21, 0.98);
        --ec-tooltip-text: #e5e7eb;
        --ec-sticky-connected: #20272f;
        --ec-sticky-disconnected: #1b2027;
        --ec-error-ui-bg: #3f2a06;
        --ec-error-ui-text: #fde68a;
        --ec-error-ui-border: rgba(251, 191, 36, 0.28);
    }
}

:root[data-bs-theme='dark'] {
    color-scheme: dark;
    --bs-body-bg: var(--ec-page-bg);
    --bs-body-bg-rgb: 17, 19, 21;
    --bs-body-color: var(--ec-text);
    --bs-body-color-rgb: 229, 231, 235;
    --bs-border-color: rgba(203, 213, 225, 0.14);
    --bs-secondary-color: #a6b0bb;
    --bs-secondary-color-rgb: 166, 176, 187;
    --bs-secondary-bg: #20262e;
    --bs-secondary-bg-rgb: 32, 38, 46;
    --bs-tertiary-bg: #20262e;
    --bs-tertiary-bg-rgb: 32, 38, 46;
    --bs-emphasis-color: #e5e7eb;
    --bs-emphasis-color-rgb: 229, 231, 235;
    --bs-primary: #3b82f6;
    --bs-primary-rgb: 59, 130, 246;
    --ec-page-bg: #111315;
    --ec-surface: #1a1f25;
    --ec-surface-alt: #20262e;
    --ec-surface-card: #1c222a;
    --ec-surface-elevated: #242a33;
    --ec-surface-data: #181d23;
    --ec-surface-muted: rgba(26, 31, 37, 0.97);
    --ec-border: rgba(203, 213, 225, 0.14);
    --ec-border-strong: rgba(59, 130, 246, 0.34);
    --ec-text: #e5e7eb;
    --ec-text-muted: #a6b0bb;
    --ec-text-subtle: #cfd8e3;
    --ec-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
    --ec-shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.24);
    --ec-accent: #3b82f6;
    --ec-accent-strong: #60a5fa;
    --ec-accent-soft: rgba(59, 130, 246, 0.16);
    --ec-live: #10b981;
    --ec-live-soft: rgba(16, 185, 129, 0.16);
    --ec-warning: #f59e0b;
    --ec-warning-soft: rgba(245, 158, 11, 0.16);
    --ec-danger: #f87171;
    --ec-danger-soft: rgba(248, 113, 113, 0.16);
    --ec-offline: #94a3b8;
    --ec-offline-soft: rgba(148, 163, 184, 0.16);
    --ec-data-canvas-bg: #f8fafc;
    --ec-data-canvas-border: rgba(203, 213, 225, 0.30);
    --ec-data-canvas-text: #172033;
    --ec-tooltip-bg: rgba(17, 19, 21, 0.98);
    --ec-tooltip-text: #e5e7eb;
    --ec-sticky-connected: #20272f;
    --ec-sticky-disconnected: #1b2027;
    --ec-error-ui-bg: #3f2a06;
    --ec-error-ui-text: #fde68a;
    --ec-error-ui-border: rgba(251, 191, 36, 0.28);
}

html,
body {
    background: var(--ec-page-bg);
    color: var(--ec-text);
}

body {
    min-height: 100vh;
    transition: background-color 0.2s ease, color 0.2s ease;
}

a {
    color: var(--ec-accent-strong);
}

a:hover {
    color: var(--ec-accent);
}

.navbar.bg-body-tertiary {
    background-color: rgba(var(--bs-tertiary-bg-rgb), var(--bs-bg-opacity, 1)) !important;
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-card-radius);
    box-shadow: var(--ec-shadow-soft);
    min-height: 4.25rem;
    padding: 0.45rem 0.75rem;
}

.navbar-brand {
    align-items: center;
    display: inline-flex;
    min-width: 0;
    padding-bottom: 0;
    padding-top: 0;
}

.navbar-brand img {
    height: auto;
    max-height: 3.4rem;
    object-fit: contain;
    width: clamp(8.5rem, 12vw, 9.875rem);
}

.card,
.modal-content,
.offcanvas,
.dropdown-menu,
.list-group-item {
    background-color: var(--ec-surface-elevated);
    border-color: var(--ec-border);
    color: var(--ec-text);
}

.card {
    border-radius: var(--ec-card-radius);
    box-shadow: var(--ec-shadow-soft);
}

.card-header,
.card-footer,
.modal-header,
.modal-footer,
.offcanvas-header {
    background-color: var(--ec-surface-alt);
    border-color: var(--ec-border);
}

.form-control,
.form-select,
.form-control:focus,
.form-select:focus,
.input-group-text {
    background-color: var(--ec-surface);
    border-color: var(--ec-border);
    color: var(--ec-text);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ec-border-strong);
    box-shadow: 0 0 0 0.2rem var(--ec-accent-soft);
}

.form-control::file-selector-button {
    background: var(--ec-surface-alt);
    border-color: var(--ec-border);
    color: var(--ec-text);
}

.legal-markdown {
    line-height: 1.55;
}

.legal-markdown > :last-child {
    margin-bottom: 0 !important;
}

.legal-markdown h5,
.legal-markdown h6 {
    color: var(--ec-text);
}

.legal-markdown p,
.legal-markdown li {
    color: var(--ec-text);
}

.legal-markdown code {
    background: var(--ec-surface);
    border: 1px solid var(--ec-border);
    border-radius: 0.25rem;
    color: var(--ec-text);
    padding: 0.08rem 0.25rem;
}

.legal-markdown pre code {
    background: transparent;
    border: 0;
    padding: 0;
}

.form-control[type='file'] {
    background: var(--ec-surface);
    cursor: pointer;
}

.form-control[type='file']::file-selector-button {
    border: 0;
    border-right: 1px solid var(--ec-border);
    margin: -0.375rem 0.75rem -0.375rem -0.75rem;
    padding: 0.45rem 0.75rem;
}

.btn-primary {
    background-color: var(--ec-accent);
    border-color: var(--ec-accent);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background-color: var(--ec-accent-strong);
    border-color: var(--ec-accent-strong);
}

.btn-outline-primary {
    border-color: var(--ec-border-strong);
    color: var(--ec-accent-strong);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus-visible,
.btn-check:checked + .btn-outline-primary {
    background-color: var(--ec-accent);
    border-color: var(--ec-accent);
    color: #fff;
}

.btn-outline-secondary {
    border-color: var(--ec-border);
    color: var(--ec-text-muted);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
    background-color: var(--ec-surface-alt);
    border-color: var(--ec-border-strong);
    color: var(--ec-text);
}

.table {
    --bs-table-bg: var(--ec-surface-data);
    --bs-table-color: var(--ec-text);
    --bs-table-border-color: var(--ec-border);
    --bs-table-striped-bg: var(--ec-surface-alt);
    --bs-table-hover-bg: var(--ec-accent-soft);
}

.text-muted {
    color: var(--ec-text-muted) !important;
}

.settings-page .card {
    border-color: var(--ec-border);
    box-shadow: var(--ec-shadow-soft);
}

.settings-page .border.rounded {
    background: var(--ec-surface-alt);
    border-color: var(--ec-border) !important;
}

.settings-page .card-header {
    background: var(--ec-surface-muted);
    border-color: var(--ec-border);
    color: var(--ec-text);
}

.settings-page input[type='file'] {
    max-width: min(100%, 32rem);
}

.demo-mode-banner {
    border-color: var(--ec-border-strong);
    box-shadow: var(--ec-shadow-soft);
}

.visualization-shell {
    background: var(--ec-surface-data);
    border: 1px solid var(--ec-border);
    border-radius: calc(var(--ec-card-radius) - 2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    color: var(--ec-text);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-height: 0;
    overflow: hidden;
    padding: 0.65rem;
    width: 100%;
}

.visualization-shell--light-canvas {
    background: var(--ec-surface-card);
}

.visualization-shell__header {
    align-items: flex-start;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    min-width: 0;
}

.visualization-shell__title-group {
    min-width: 0;
}

.visualization-shell__title {
    color: var(--ec-text);
    font-size: 0.9rem;
    font-weight: 750;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.visualization-shell__description,
.visualization-shell__metadata {
    color: var(--ec-text-muted);
    font-size: 0.76rem;
    line-height: 1.25;
}

.visualization-shell__toolbar {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-end;
}

.visualization-shell__palette {
    align-items: center;
    background: var(--ec-surface-alt);
    border: 1px solid var(--ec-border);
    border-radius: 999px;
    color: var(--ec-text-muted);
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 650;
    gap: 0.35rem;
    padding: 0.22rem 0.5rem;
    white-space: nowrap;
}

.visualization-shell__palette--custom {
    background: var(--ec-warning-soft);
    border-color: rgba(245, 158, 11, 0.28);
    color: var(--ec-warning);
}

.visualization-shell__canvas {
    border-radius: 0.55rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.visualization-shell__canvas .live-visualization-host {
    width: 100%;
}

.visualization-shell__canvas--native {
    background: var(--ec-surface-data);
}

.visualization-shell__canvas--light {
    background: var(--ec-data-canvas-bg);
    border: 1px solid var(--ec-data-canvas-border);
    color: var(--ec-data-canvas-text);
}

.data-card[data-card-type='ProgramMap'] .visualization-shell,
.data-card[data-card-type='TimelineHeatmap'] .visualization-shell {
    height: 100%;
}

.visualization-shell__legend {
    color: var(--ec-text-muted);
    font-size: 0.74rem;
    line-height: 1.2;
}

.visualization-shell__swatch-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.55rem;
}

.visualization-shell__swatch {
    align-items: center;
    display: inline-flex;
    gap: 0.25rem;
    max-width: 10rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.visualization-shell__swatch span {
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-radius: 999px;
    display: inline-block;
    flex: 0 0 auto;
    height: 0.7rem;
    width: 0.7rem;
}

.visualization-shell__state {
    align-items: center;
    color: var(--ec-text-muted);
    display: flex;
    gap: 0.75rem;
    inset: 0;
    justify-content: center;
    min-height: 12rem;
    padding: 1rem;
    text-align: left;
}

.visualization-shell__state > i {
    color: var(--ec-text-muted);
    font-size: 1.35rem;
}

.visualization-shell__state p {
    margin: 0.15rem 0 0;
}

.visualization-shell__state--overlay {
    background: color-mix(in srgb, var(--ec-surface-card) 78%, transparent);
    position: absolute;
}

.visualization-shell__state--error > i {
    color: var(--ec-warning);
}

.visualization-palette-summary {
    align-items: center;
    background: var(--ec-surface-alt);
    border: 1px solid var(--ec-border);
    border-radius: 0.75rem;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0.7rem 0.8rem;
}

.visualization-palette-summary__body {
    min-width: 0;
}

.visualization-palette-summary__title {
    align-items: center;
    color: var(--ec-text);
    display: flex;
    font-weight: 750;
    gap: 0.45rem;
}

.visualization-palette-summary__description {
    color: var(--ec-text-muted);
    font-size: 0.82rem;
    margin-top: 0.15rem;
}

.visualization-palette-summary__swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
    margin-top: 0.45rem;
}

.visualization-palette-summary__swatches span {
    border: 1px solid var(--ec-border);
    border-radius: 999px;
    height: 0.85rem;
    width: 0.85rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: var(--ec-danger);
}

.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.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: minmax(220px, auto);
    gap: 15px;
}

.reorderable-data-card {
    min-width: 0;
}

@media (max-width: 560px) {
    .data-grid .reorderable-data-card {
        grid-column: 1 / -1 !important;
    }
}

.carousel-container {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.carousel-track {
    display: flex;
    animation: scroll 20s linear infinite;
}

.carousel-item {
    display: inline-block;
    width: 300px;
    text-align: center;
    padding: 10px;
    background: var(--ec-surface-alt);
    color: var(--ec-text);
    border: 1px solid var(--ec-border);
    border-radius: 8px;
    box-shadow: var(--ec-shadow-soft);
}

@keyframes scroll {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(-100%);
    }
}

.tooltip-box {
    position: absolute;
    display: none;
    background: var(--ec-tooltip-bg);
    color: var(--ec-tooltip-text);
    padding: 8px 12px;
    border: 1px solid var(--ec-border-strong);
    border-radius: 10px;
    box-shadow: var(--ec-shadow-soft);
    font-size: 0.85rem;
    max-width: 300px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
    word-wrap: break-word;
}

.tooltip-box.show {
    display: block;
    opacity: unset;
}

.i-chatgpt {
    display: inline-block;
    vertical-align: -0.125rem;
    fill: currentColor;
}

.i-chatgpt::before {
    content: '';
    background: url('img/OpenAI-black-monoblossom.png');
    background-position: center;
    background-size: contain;
    display: inline-block;
    line-height: 1;
    width: 1.25em;
    height: 1.25em;
    vertical-align: -0.125rem;
    filter: var(--ec-chatgpt-icon-filter, none);
}

@media (prefers-color-scheme: dark) {
    .i-chatgpt::before {
        filter: invert(1) brightness(1.25);
    }
}

div.sticky-top {
    background: var(--ec-surface-muted);
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-card-radius);
    box-shadow: var(--ec-shadow-soft);
    padding: 0.65rem 0.9rem;
    margin-left: 0;
    margin-right: 0;
}

.sticky-top.fafo-sticky {
    top: -100%;
    transition: top ease-in-out 0.6s;
}

.dropdown-menu.show {
    z-index: 1080;
}


.agent-meta-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.75rem;
}

.agent-actions-toggle {
    border-radius: 999px;
    padding-inline: 0.75rem;
}

.ec-status-pill {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 999px;
    display: inline-flex;
    gap: 0.35rem;
    font-weight: 700;
    padding: 0.35rem 0.7rem;
}

.ec-status-pill-live {
    background: var(--ec-live-soft);
    border-color: rgba(16, 185, 129, 0.32);
    color: var(--ec-live);
}

.ec-status-pill-live .spinner-grow {
    color: currentColor;
}

.ec-status-pill-offline {
    background: var(--ec-offline-soft);
    border-color: rgba(148, 163, 184, 0.28);
    color: var(--ec-offline);
}

.save-status-banner {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1200;
    border-radius: 999px;
    padding: 0.7rem 1rem;
    box-shadow: var(--ec-shadow-soft);
    border: 1px solid var(--ec-border);
    max-width: min(90vw, 480px);
    font-weight: 600;
}

.save-status-banner-success {
    background: rgba(34, 197, 94, 0.18);
    color: #14532d;
    border-color: rgba(34, 197, 94, 0.35);
}

.save-status-banner-error {
    background: rgba(248, 113, 113, 0.2);
    color: #7f1d1d;
    border-color: rgba(248, 113, 113, 0.38);
}

.configuration-change-banner {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    z-index: 1205;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: min(92vw, 720px);
    padding: 0.85rem 1rem;
    border: 1px solid var(--ec-border-strong);
    border-radius: 12px;
    background: var(--ec-surface-elevated);
    color: var(--ec-text);
    box-shadow: var(--ec-shadow);
}

.configuration-change-banner span {
    display: block;
    font-size: 0.9rem;
    color: var(--ec-text-muted);
}

@media (prefers-color-scheme: dark) {
    .save-status-banner-success {
        color: #bbf7d0;
    }

    .save-status-banner-error {
        color: #fecaca;
    }
}

.ec-live-line-graph {
    width: 100%;
    min-height: 320px;
    display: grid;
    grid-template-rows: auto minmax(220px, 1fr) auto;
    gap: 0.5rem;
}

.ec-live-line-graph__status,
.ec-live-line-graph__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--ec-text-muted);
    font-size: 0.85rem;
}

.ec-live-line-graph__current {
    color: var(--ec-text);
    font-weight: 600;
}

.ec-live-line-graph__quality,
.ec-live-line-graph__interval {
    white-space: nowrap;
}

.ec-live-line-graph__canvas-wrap {
    position: relative;
    min-height: 220px;
    width: 100%;
}

.ec-live-line-graph canvas {
    width: 100% !important;
    height: 100% !important;
}

.ec-live-chart-js {
    width: 100%;
    min-height: 320px;
    display: grid;
    grid-template-rows: auto minmax(220px, 1fr);
    gap: 0.5rem;
}

.ec-live-chart-js__status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--ec-text-muted);
    font-size: 0.85rem;
    min-width: 0;
}

.ec-live-chart-js__title {
    color: var(--ec-text);
    font-weight: 600;
    white-space: nowrap;
}

.ec-live-chart-js__summary {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}

.ec-live-chart-js__canvas-wrap {
    position: relative;
    min-height: 220px;
    width: 100%;
}

.ec-live-chart-js canvas {
    width: 100% !important;
    height: 100% !important;
}

.program-map-visualization-host,
.ec-program-map {
    width: 100%;
    min-height: 17rem;
    max-height: min(72vh, 720px);
}

.ec-program-map {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.data-card[data-card-type='ProgramMap'] {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.data-card[data-card-type='ProgramMap'] .data-content {
    align-items: stretch;
    justify-content: stretch;
    min-height: 0;
    width: 100%;
    overflow: hidden;
}

.ec-program-map__status {
    padding: 0.5rem 0.75rem;
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.875rem;
}

.ec-program-map__root {
    flex: 0 0 auto;
    min-height: 0;
    max-height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.ec-program-map__root.program-map {
    background: var(--pm-surface, #fff);
    box-sizing: border-box;
    color: var(--pm-text, #172033);
    display: flex;
    font-family: var(--bs-font-sans-serif, "Segoe UI", system-ui, sans-serif);
    font-size: 0.78rem;
    line-height: 1.2;
    position: relative;
    width: 100%;
}

.ec-program-map__root .pm-scroll-canvas {
    align-self: stretch;
    background: var(--pm-scroll-surface, #edf2f7);
    border-right: 1px solid var(--pm-border, #d7dde6);
    display: block;
    flex: 0 0 4.5rem;
    width: 4.5rem;
}

.ec-program-map__root .pm-data-container {
    align-items: flex-start;
    display: flex;
    flex: 1 0 auto;
    min-width: max-content;
}

.ec-program-map__root .pm-table {
    background: var(--pm-surface, #fff);
    border-collapse: collapse;
    color: var(--pm-text, #172033);
    flex: 0 0 24rem;
    table-layout: fixed;
    width: 24rem;
}

.ec-program-map__root .pm-table th,
.ec-program-map__root .pm-table td {
    border-bottom: 1px solid var(--pm-border-soft, #edf1f5);
    box-sizing: border-box;
    height: var(--pm-row-height, 28px);
    max-height: var(--pm-row-height, 28px);
    overflow: hidden;
    padding: 0 0.6rem;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
}

.ec-program-map__root .pm-table th {
    background: var(--pm-header-bg, #eef3f8);
    border-bottom-color: var(--pm-border, #d7dde6);
    color: var(--pm-header-text, #253043);
    font-weight: 700;
}

.ec-program-map__root .pm-add-data-item-header,
.ec-program-map__root .pm-table th:nth-child(1),
.ec-program-map__root .pm-action-cell {
    padding: 0;
    text-align: center;
    width: 2rem;
}

.ec-program-map__root .pm-table th:nth-child(2),
.ec-program-map__root .pm-time-cell {
    color: var(--pm-muted, #667085);
    width: 7.5rem;
}

.ec-program-map__root .pm-block-cell,
.ec-program-map__root .pm-table th:nth-child(3),
.ec-program-map__root .pm-aggregation-header {
    width: 12rem;
}

.ec-program-map__root .pm-canvas-container {
    background: var(--pm-canvas-surface, #f4f7fa);
    flex: 0 0 auto;
    overflow: hidden;
    position: relative;
}

.ec-program-map__root .pm-header-container {
    align-items: stretch;
    background: var(--pm-header-bg, #eef3f8);
    border-bottom: 1px solid var(--pm-border, #d7dde6);
    display: flex;
    height: var(--pm-row-height, 28px);
}

.ec-program-map__root .pm-column-header {
    align-items: center;
    border-right: 1px solid var(--pm-border, #d7dde6);
    box-sizing: border-box;
    color: var(--pm-header-text, #253043);
    display: inline-flex;
    flex: 0 0 var(--ec-program-map-field-width, 200px);
    font-weight: 700;
    gap: 0.35rem;
    justify-content: center;
    min-width: 0;
    padding: 0 0.45rem;
    position: relative;
    width: var(--ec-program-map-field-width, 200px);
}

.ec-program-map__root .pm-column-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ec-program-map__root .pm-map-canvas {
    background: var(--pm-canvas-surface, #f4f7fa);
    display: block;
}

.ec-program-map__root .pm-icon-button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: var(--pm-action, #9aa5b5);
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    gap: 0.12rem;
    height: 1.5rem;
    justify-content: center;
    padding: 0;
    width: 1.5rem;
}

.ec-program-map__root .pm-icon-button:hover,
.ec-program-map__root .pm-icon-button:focus-visible {
    background: var(--pm-action-hover-bg, #eef3f8);
    color: var(--pm-action-hover, #667085);
    outline: none;
}

.ec-program-map__root .pm-icon-button span {
    background: currentColor;
    border-radius: 999px;
    display: block;
    height: 0.18rem;
    width: 0.18rem;
}

.ec-program-map__root .pm-column-action-button {
    position: absolute;
    right: 0.2rem;
}

.ec-program-map__root .pm-header-menu {
    background: var(--pm-surface, #fff);
    border: 1px solid var(--pm-border, #d7dde6);
    border-radius: 0.4rem;
    box-shadow: var(--pm-tooltip-shadow, 0 10px 28px rgba(23, 32, 51, 0.16));
    min-width: 9rem;
    padding: 0.25rem;
    position: absolute;
    right: 0.25rem;
    top: calc(100% + 0.25rem);
    z-index: 20;
}

.ec-program-map__root .pm-header-menu button {
    background: transparent;
    border: 0;
    border-radius: 0.3rem;
    color: var(--pm-text, #172033);
    display: block;
    padding: 0.35rem 0.5rem;
    text-align: left;
    width: 100%;
}

.ec-program-map__root .pm-header-menu button:hover,
.ec-program-map__root .pm-header-menu button:focus-visible {
    background: var(--pm-row-hover, #f4f8ff);
}

.ec-program-map__root .pm-hover-tooltip,
.ec-program-map__root .pm-processing-toast {
    background: var(--pm-surface, #fff);
    border: 1px solid var(--pm-tooltip-border, #b8cedd);
    border-radius: 0.4rem;
    box-shadow: var(--pm-tooltip-shadow, 0 10px 28px rgba(23, 32, 51, 0.16));
    color: var(--pm-text, #172033);
    font-size: 0.75rem;
    max-width: 20rem;
    padding: 0.45rem 0.55rem;
    position: absolute;
    z-index: 30;
}

.ec-program-map__root .pm-hover-tooltip[hidden],
.ec-program-map__root .pm-processing-toast[hidden] {
    display: none;
}

.ec-program-map__root .pm-tooltip-title {
    display: block;
    margin-bottom: 0.25rem;
}

.ec-program-map__root .pm-tooltip-row {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: minmax(5rem, auto) 1fr;
}

.ec-program-map__root .pm-tooltip-label {
    color: var(--pm-muted, #667085);
}

.data-card[data-card-type='TimelineHeatmap'] .data-content {
    align-items: stretch;
    justify-content: stretch;
    min-height: 300px;
    width: 100%;
    overflow: hidden;
}

.ec-live-heatmap {
    width: 100%;
    min-height: 240px;
    height: 100%;
    flex: 1 1 auto;
    box-sizing: border-box;
    padding: 0.25rem 0.35rem 0.65rem;
    overflow: hidden;
}

.ec-live-heatmap--axis-readable {
    min-height: 260px;
}

.ec-live-heatmap canvas {
    display: block;
    width: 100% !important;
    min-height: 232px;
    max-width: 100%;
}

.ec-live-heatmap__fallback {
    min-height: 220px;
    display: grid;
    place-content: center;
    gap: 0.35rem;
    color: var(--ec-text-muted);
    border: 1px solid var(--ec-border);
    background: var(--ec-surface);
}

.ec-live-heatmap__fallback-current {
    color: var(--ec-text);
    font-weight: 600;
}

.ec-live-heatmap__fallback-meta {
    font-size: 0.85rem;
}

.ec-live-indicator,
.ec-live-gauge,
.ec-live-value-card {
    width: 100%;
}

.ec-live-indicator {
    display: grid;
    place-items: center;
    min-height: 104px;
}

.ec-live-indicator .indicator {
    display: block;
    max-width: 148px;
    max-height: 100px;
    margin-left: auto;
    margin-right: auto;
}

.ec-live-indicator .indicator-glow {
    opacity: 0.22;
    transition: opacity 0.3s ease-in-out;
}

.ec-live-indicator .indicator-light {
    transition: fill 0.3s ease-in-out, stroke 0.3s ease-in-out;
}

.ec-live-indicator .indicator-highlight {
    opacity: 0.34;
    transition: opacity 0.3s ease-in-out;
}

.ec-live-indicator .indicator-text {
    font-size: 14px;
    text-anchor: middle;
    fill: var(--indicator-text-fill, var(--ec-text));
    stroke: var(--indicator-text-stroke, var(--ec-page-bg));
    stroke-width: 2.25;
    paint-order: stroke fill;
    stroke-linejoin: round;
}

.ec-live-indicator .blinking {
    animation: blink-animation 1s infinite alternate;
}

@keyframes blink-animation {
    0% {
        filter: contrast(1.08) saturate(1.08);
        transform: scale(1.012);
    }

    100% {
        filter: unset;
    }
}

.ec-live-indicator__icon-wrap {
    display: grid;
    place-items: center;
    min-height: 88px;
    color: var(--ec-text);
}

.ec-live-indicator__unicode,
.ec-live-indicator__icon {
    font-size: 2.6rem;
    line-height: 1;
}

.ec-live-gauge .gauge-container {
    position: relative;
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 0.5rem;
    max-width: 100%;
    overflow: visible;
}

.ec-live-gauge .gauge {
    width: 100%;
    height: auto;
    overflow: visible;
}

.ec-live-gauge .gauge-background {
    stroke: var(--ec-border);
    stroke-width: 4;
    fill: none;
    stroke-linecap: round;
    transition: stroke-dasharray 0.8s ease-in-out;
}

.ec-live-gauge .gauge-foreground {
    stroke: var(--ec-live);
    stroke-width: 4;
    fill: none;
    stroke-linecap: round;
    transition: stroke 0.2s ease-in-out;
}

.ec-live-gauge .ec-live-gauge__target {
    stroke: var(--ec-warning);
    stroke-width: 2.25;
}

.ec-live-gauge .gauge-text {
    text-anchor: middle;
    fill: var(--ec-text-subtle);
    stroke: transparent;
    stroke-width: 0;
    dominant-baseline: middle;
    letter-spacing: 0;
}

.ec-live-gauge__value {
    font-weight: 700;
    line-height: 1;
}

.ec-live-gauge__unit {
    font-weight: 600;
    line-height: 1;
}

.ec-live-value-card {
    display: grid;
    place-items: center;
}

.ec-live-value-card .text-content {
    font-size: clamp(1rem, 5vw, 2rem);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    line-height: 1.1;
}

.program-replay-page {
    --program-replay-surface: var(--ec-surface-elevated);
}

.program-replay-page > .navbar {
    margin-bottom: 0.75rem;
}

.program-replay-setup {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(480px, auto);
    gap: 0.75rem;
    align-items: end;
    padding: 0.85rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--ec-border);
    border-radius: 0.75rem;
    background: var(--program-replay-surface);
    box-shadow: var(--ec-shadow-soft);
}

.program-replay-summary {
    min-width: 0;
}

.program-replay-range-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: flex-end;
    gap: 0.75rem;
}

.program-replay-range,
.program-replay-speed {
    min-width: 0;
}

.program-replay-range {
    flex: 1 1 180px;
}

.program-replay-import {
    flex: 1 1 220px;
}

.program-replay-import-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--ec-border-strong);
    border-radius: 0.75rem;
    background: var(--ec-surface-card);
}

.program-replay-import-summary > div:first-child {
    min-width: 0;
}

.program-replay-setup .form-label {
    margin-bottom: 0.2rem;
    font-size: 0.72rem;
    color: var(--ec-text-muted);
    text-transform: uppercase;
}

.program-replay-media {
    position: sticky;
    top: 0;
    z-index: 1090;
    display: grid;
    gap: 0.65rem;
    padding: 0.7rem 0.8rem 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--ec-border);
    border-radius: 0.75rem;
    background: var(--ec-surface-muted);
    box-shadow: var(--ec-shadow);
}

.program-replay-media-track {
    min-width: 0;
}

.program-replay-media-track .form-range {
    display: block;
    margin: 0;
    height: 0.7rem;
}

.program-replay-media-track .form-range::-webkit-slider-thumb {
    background: var(--ec-accent);
}

.program-replay-media-track .form-range::-moz-range-thumb {
    background: var(--ec-accent);
    border-color: var(--ec-accent);
}

.program-replay-media-track .form-range::-webkit-slider-runnable-track {
    background-color: var(--ec-border);
}

.program-replay-media-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.program-replay-play-button {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

.program-replay-time-label {
    display: flex;
    align-items: baseline;
    flex: 1 1 auto;
    gap: 0.38rem;
    min-width: 0;
    color: var(--ec-text-subtle);
    font-size: 0.86rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.program-replay-time-part {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.program-replay-time-current {
    color: var(--ec-text);
    font-size: 1rem;
    font-weight: 800;
}

.program-replay-time-separator {
    flex: 0 0 auto;
    color: var(--ec-text-muted);
    font-weight: 600;
}

.program-replay-media-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    gap: 0.5rem;
}

.program-replay-speed-select {
    width: 6.2rem;
    height: 2.4rem;
    background-color: var(--ec-surface);
    border-color: var(--ec-border);
    color: var(--ec-text);
}

.program-replay-capture-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 6.8rem;
    height: 2.4rem;
    padding: 0 0.85rem;
    white-space: nowrap;
    background-color: var(--ec-surface);
    border-color: var(--ec-border);
    color: var(--ec-text);
}

.program-replay-capture-button .bi {
    line-height: 1;
}

.program-replay-actions-dropdown {
    flex: 0 0 auto;
}

.program-replay-action-menu {
    z-index: 1095;
    min-width: min(22rem, 86vw);
    padding: 0.35rem;
}

.program-replay-action-item {
    border-radius: 0.45rem;
    display: grid;
    gap: 0.15rem;
    padding: 0.5rem 0.65rem;
    white-space: normal;
}

.program-replay-action-label {
    align-items: center;
    display: inline-flex;
    font-weight: 700;
}

.program-replay-action-description {
    color: var(--ec-text-muted);
    font-size: 0.78rem;
    line-height: 1.25;
    padding-left: 1.55rem;
}

.program-replay-action-item:disabled .program-replay-action-description,
.program-replay-action-item.disabled .program-replay-action-description {
    opacity: 0.6;
}

.program-replay-frame {
    border: 1px solid var(--ec-border);
    border-radius: 0.85rem;
    padding: 0.75rem;
    overflow: visible;
}

.program-replay-frame div.sticky-top {
    margin-left: 0;
    margin-right: 0;
}

.program-replay-screenshots {
    margin-top: 1rem;
    padding: 0.85rem;
    border: 1px solid var(--ec-border);
    border-radius: 0.75rem;
    background: var(--ec-surface-card);
}

@media (max-width: 1200px) {
    .program-replay-setup {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .program-replay-range-controls {
        justify-content: stretch;
    }

    .program-replay-media-row {
        flex-wrap: wrap;
    }

    .program-replay-time-label {
        flex-basis: calc(100% - 3.1rem);
    }

    .program-replay-media-actions {
        flex-basis: 100%;
        justify-content: flex-start;
    }

    .program-replay-import-summary {
        align-items: stretch;
        flex-direction: column;
    }
}
