/* Full viewport: body and app fill height/width and autofit */
html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    overflow: hidden;
}

#app {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Dashboard layout: column with sticky footer */
.dashboard-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
}

.dashboard-layout fluent-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
}

/* Middle row: nav + body content, takes remaining space */
.dashboard-layout .stack-horizontal,
.dashboard-layout .tack-horizontal,
.dashboard-layout [class*="stack-horizontal"],
.dashboard-layout [class*="tack-horizontal"] {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    width: 100%;
}

/* Vertical stack: horizontal padding for content alignment */
div.stack-vertical {
    padding-left: 10px;
    padding-right: 10px;
}

/* Splitter: fill available height; do NOT override display (component uses grid for row layout) */
.dashboard-splitter,
.dashboard-layout .dashboard-splitter,
.dashboard-layout split-panels.dashboard-splitter {
    flex: 1;
    min-width: 0;
    min-height: 0;
    height: 100%;
}

/* Tree view splitter bar: 2px column (BarSize=2), slim line; faint by default so it's findable, full on hover */
split-panels.dashboard-splitter::part(median) {
    width: 100%;
    box-sizing: border-box;
    opacity: 0.25;
    transition: opacity 0.15s ease;
    background-color: var(--neutral-stroke-rest);
}
split-panels.dashboard-splitter::part(median):hover {
    opacity: 1;
    background-color: var(--neutral-stroke-hover);
}

/* Panel cells: fill height of the row, column layout for content inside */
.dashboard-layout split-panels > div {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.dashboard-layout split-panels > div:first-child {
    overflow: hidden;
}

.dashboard-layout .dashboard-tree-sidebar {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dashboard-sidebar-tab-bar {
    display: flex;
    flex-direction: row;
    gap: 4px;
    padding: 6px 8px;
    flex-shrink: 0;
    background-color: var(--neutral-fill-input-focus);
    border-bottom-width: 0;
    border-bottom-style: none;
    border-bottom-color: transparent;
    border-image: none;
}

.dashboard-sidebar-placeholder {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 1rem;
    text-align: center;
    background-color: var(--neutral-fill-input-focus);
    color: var(--neutral-foreground-hint);
}

.dashboard-sidebar-placeholder-hint {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Ensure tree view uses theme background (overrides Fluent default rgb(39,39,39)) */
fluent-tree-view {
    background-color: var(--neutral-fill-input-focus);
}

.dashboard-layout .dashboard-tree-sidebar fluent-tree-view {
    background-color: var(--neutral-fill-input-focus);
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Sidebar: scrollable when content is too big (when not in splitter) */
.dashboard-layout .fluent-nav-menu,
.dashboard-layout [class*="fluent-nav-menu"] {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 0 0 250px;
    min-height: 0;
    max-height: 100%;
    width: 250px;
}

/* Tree sidebar inside splitter: fill panel (width from splitter, height 100%) */
.dashboard-layout .dashboard-nav-menu.dashboard-tree-sidebar {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.dashboard-tree-sidebar fluent-tree-view {
    padding: 0.5rem 0;
}

.nav-tree-link {
    color: inherit;
    text-decoration: none;
    display: inline-block;
}

.nav-tree-link:hover {
    text-decoration: underline;
}

.nav-tree-link.active {
    font-weight: 600;
    background-color: var(--neutral-fill-secondary-rest);
    color: var(--neutral-foreground-rest);
    border-radius: 4px;
}

/* Body content: fills remaining space and scrolls */
.dashboard-layout .dashboard-body-content,
.dashboard-layout .body-content,
.dashboard-layout [class*="body-content"] {
    flex: 1;
    min-height: 0;
    overflow: auto;
    width: 100%;
}

/* Tabbed content container (VS Code-style tabs above body) */
.dashboard-tabs-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    min-width: 0;
    width: 100%;
}

/* When inside splitter pane (e.g. with terminal), fill height so placeholder can center; solid background */
.fluent-multi-splitter-pane > .dashboard-tabs-container {
    min-height: 100%;
    height: 100%;
    background-color: var(--neutral-fill-layer-alt);
}

.dashboard-tabs-container .dashboard-tabs {
    flex-shrink: 0;
}
.dashboard-tabs-container .dashboard-tabs-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.dashboard-tabs-container .dashboard-tabs-body .dashboard-body-content {
    flex: 1;
    min-height: 0;
    background: var(--neutral-fill-layer-alt);
}

/* Main content placeholder when no tabs are open (like TCB sidebar placeholder) */
.dashboard-content-placeholder {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 1rem;
    text-align: center;
    background-color: var(--neutral-fill-layer-alt);
    color: var(--neutral-foreground-hint);
}


/* IDE-style tabs (VS Code-like): compact height, thin full-width active indicator */
.dashboard-tabs-container .dashboard-tabs.dashboard-tabs-ide {
    min-height: 0;
}
.dashboard-tabs-container ::deep fluent-tabs.dashboard-tabs-ide {
    --tabs-height: 28px;
    min-height: var(--tabs-height);
    background-color: var(--neutral-fill-subtle);
}
.dashboard-tabs-container ::deep fluent-tabs.dashboard-tabs-ide .tablist {
    grid-template-rows: calc(var(--tabs-height, 28px) * 1px) auto;
    min-height: var(--tabs-height);
    border-bottom: 1px solid var(--neutral-stroke-subtle);
    background: var(--neutral-fill-subtle);
}
.dashboard-tabs-container ::deep fluent-tabs.dashboard-tabs-ide fluent-tab {
    padding: 2px 10px 0;
    font-size: 0.8125rem;
    min-height: 0;
    align-items: center;
}
.dashboard-tabs-container ::deep fluent-tabs.dashboard-tabs-ide::part(activeIndicator) {
    width: 100%;
    max-width: 100%;
    height: 1px;
    min-height: 1px;
    border-radius: 0;
    justify-self: stretch;
    background: var(--accent-fill-rest);
}

/* Tree nav link as button (component-based tabs) */
.nav-tree-link[role="button"] {
    cursor: pointer;
}

/* Nodes Summary page: fill tab body so grid uses all space and resizes with terminal show/hide */
.nodes-summary-page {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 1rem 1rem;
}
.nodes-summary-header {
    flex-shrink: 0;
    padding: 1rem 0 0.5rem;
    overflow: visible;
    position: relative;
    z-index: 10;
}
.nodes-summary-loading {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.nodes-summary-grid {
    flex: 1;
    min-height: 0;
    overflow: auto;
    background: var(--neutral-fill-layer-alt);
    position: relative;
    z-index: 1;
}
.nodes-summary-footer {
    flex-shrink: 0;
    padding: 0.5rem 0 0;
    font-size: 0.875rem;
}

/* TsStore Live Chart: chart container fills flex area so AutoSize chart resizes */
.tsstore-live-chart-container {
    min-height: 0;
    position: relative;
}

/* TsStore Browse/Live data grids: ensure grid container has height so table renders and fits available space */
.tsstore-data-grid-container {
    flex: 1;
    min-height: 400px;
    min-width: 0;
    overflow: auto;
    background: var(--neutral-fill-layer-alt);
    position: relative;
    z-index: 1;
}

/* FluentSelect / listbox dropdowns: ensure they paint above the grid and are not clipped */
.nodes-summary-header fluent-listbox,
.nodes-summary-header fluent-anchored-region,
.nodes-summary-header [role="listbox"] {
    z-index: 1000 !important;
}

/* Native select used where FluentSelect dropdown would be clipped (e.g. Import page folder) */
select.fluent-select-native {
    min-width: 200px;
    padding: 4px 8px;
    font-size: 0.875rem;
    font-family: inherit;
    border: 1px solid var(--neutral-stroke-rest, #616161);
    border-radius: 4px;
    background: var(--neutral-fill-input-rest, #fff);
    color: var(--neutral-foreground-rest, #242424);
    cursor: pointer;
}
select.fluent-select-native:hover {
    border-color: var(--neutral-stroke-hover, #505050);
}
select.fluent-select-native:focus {
    outline: none;
    border-color: var(--accent-fill-rest, #0078d4);
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.2);
}

/* Open Trade page: sidebar + main (quote panel + logs) */
.open-trade-page .open-trade-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: row;
    gap: 1rem;
}
.open-trade-sidebar {
    flex-shrink: 0;
    width: 280px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--neutral-fill-layer-alt);
    padding: 0.5rem;
    border-radius: 4px;
}
.open-trade-sidebar-hint {
    font-size: 0.875rem;
    color: var(--neutral-foreground-hint);
    margin: 0.5rem 0 0;
}
.open-trade-listbox-option {
    font-size: 0.8125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.open-trade-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.open-trade-top {
    flex-shrink: 0;
}
.open-trade-quote-card {
    padding: 1rem;
}
.open-trade-bottom {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--neutral-fill-layer-alt);
    border-radius: 4px;
    padding: 0.5rem;
}
.open-trade-logs {
    flex: 1;
    min-height: 0;
    overflow: auto;
    font-family: var(--font-family-mono, ui-monospace, monospace);
    font-size: 0.75rem;
}
.open-trade-logs-hint {
    color: var(--neutral-foreground-hint);
}
.open-trade-log-line {
    white-space: pre-wrap;
    word-break: break-word;
    padding: 0.125rem 0;
    border-bottom: 1px solid var(--neutral-stroke-subtle);
}

/* OHLCV Data page: same layout as Open Trade — sidebar (symbol list) + main (date/load + grid) */
.ohlcv-page .ohlcv-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: row;
    gap: 1rem;
}
.ohlcv-sidebar {
    flex-shrink: 0;
    width: 280px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--neutral-fill-layer-alt);
    padding: 0.5rem;
    border-radius: 4px;
}
.ohlcv-sidebar .fluent-text-field {
    width: 100%;
}
.ohlcv-sidebar-hint {
    font-size: 0.875rem;
    color: var(--neutral-foreground-hint);
    margin: 0.5rem 0 0;
}
.ohlcv-listbox-wrap {
    flex: 1;
    min-height: 0;
    margin-top: 0.25rem;
    display: flex;
    flex-direction: column;
}
.ohlcv-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.ohlcv-top {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}
.ohlcv-grid-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--neutral-fill-layer-alt);
    border-radius: 4px;
    overflow: hidden;
}
.ohlcv-grid-wrap .fluent-data-grid {
    flex: 1;
    min-height: 0;
}
.ohlcv-selection-hint {
    font-size: 0.875rem;
    color: var(--neutral-foreground-hint);
}

/* Footer: stick to bottom always; top border only */
.dashboard-layout .dashboard-footer,
.dashboard-layout footer,
.dashboard-layout .footer,
.dashboard-layout fluent-footer {
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    background-color: var(--neutral-fill-stealth-rest);
    border: none;
    border-top: 1px solid var(--neutral-fill-hover);
}

.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: var(--neutral-foreground-on-accent);
}

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

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

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

code {
    color: #c02d76;
}

/* App initializer */
.app-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    font-size: 1.1rem;
}

/* AuthorizeRouteView */
.authorizing {
    padding: 2rem;
    text-align: center;
}

.access-denied {
    padding: 2rem;
    color: var(--error-fill-rest);
}

/* Login page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-title {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
}

.login-subtitle {
    margin: 0 0 1.5rem 0;
    color: var(--neutral-foreground-hint);
    font-size: 0.9rem;
}

.login-error {
    margin-bottom: 1rem;
}

.login-card FluentTextField {
    display: block;
    margin-bottom: 1rem;
}

.login-card FluentButton {
    margin-top: 1rem;
    width: 100%;
}

/* Dashboard layout */
.dashboard-header {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--neutral-stroke-subtle);
    background: var(--neutral-fill-layer-alt);
}

.dashboard-main {
    flex: 1;
    padding: 1.5rem;
}

/* When footer has the sidebar toggle, align content so toggle stays left and rest is centered */
.dashboard-footer-with-sidebar-toggle {
    justify-content: flex-start;
}

/* Sidebar collapse toggle: stuck to the left side of the footer */
/* .dashboard-footer-sidebar-toggle {
    flex-shrink: 0;
    margin-right: 0.5rem;
    display: flex;
    align-items: center;
    gap: 2px;
} */

/* Terminal splitter (FluentMultiSplitter): 2px bar, no extra gap; faint by default so findable, full on hover */
.dashboard-terminal-splitter.fluent-multi-splitter {
    --fluent-multi-splitter-bar-size: 2px;
}
.dashboard-terminal-splitter.fluent-multi-splitter > .fluent-multi-splitter-bar {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    opacity: 0.25;
    transition: opacity 0.15s ease;
    background-color: var(--neutral-stroke-rest);
}
.dashboard-terminal-splitter.fluent-multi-splitter > .fluent-multi-splitter-bar:hover {
    opacity: 1;
    background-color: var(--neutral-stroke-hover);
}

/* Terminal panel at bottom (VS Code style) */
.dashboard-terminal {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    background-color: var(--neutral-fill-input-focus);
    border-top: 1px solid var(--neutral-fill-hover);
}

.dashboard-terminal-header {
    flex-shrink: 0;
    padding: 4px 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--neutral-foreground-hint);
    background-color: var(--neutral-fill-stealth-rest);
    border-bottom: 1px solid var(--neutral-fill-hover);
}

.dashboard-terminal-placeholder {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 8px 12px;
    font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--neutral-foreground-rest);
}

.dashboard-terminal-line {
    white-space: pre-wrap;
    word-break: break-word;
}

.user-email {
    font-size: 0.9rem;
    color: var(--neutral-foreground-hint);
}

/* C003 info popover */
.c003-popover-section {
    margin-bottom: 1rem;
}
.c003-popover-section:last-child {
    margin-bottom: 0;
}
.c003-popover-dl {
    margin: 0.25rem 0 0 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 1rem;
    font-size: 0.875rem;
}
.c003-popover-dl dt {
    margin: 0;
    color: var(--neutral-foreground-hint);
}
.c003-popover-dl dd {
    margin: 0;
}

.c003-live-badge {
    font-size: 0.7rem;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: var(--accent-fill-rest);
    color: var(--neutral-foreground-on-accent);
    font-weight: 500;
    margin-left: 0.35rem;
}

.c004-sub {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}
.c004-list {
    margin: 0.25rem 0 0 0;
    padding-left: 1.25rem;
    font-size: 0.875rem;
}

.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;
}

/* App Information page */
.app-info-value {
    margin-top: 0.25rem;
    color: var(--neutral-foreground-rest);
}
.app-info-features {
    margin: 0.25rem 0 0 0;
    padding-left: 1.5rem;
    color: var(--neutral-foreground-rest);
}

/* App Monitoring page */
.app-monitoring-live-badge {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: var(--accent-fill-rest);
    color: var(--neutral-foreground-on-accent);
    font-weight: 600;
}
.app-monitoring-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}
.app-monitoring-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.app-monitoring-value {
    color: var(--neutral-foreground-rest);
    font-variant-numeric: tabular-nums;
}

/* Node detail page */
.node-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

/* MemStore Get Item page: key-value rows */
.memstore-getitem-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.memstore-getitem-row {
    display: grid;
    grid-template-columns: minmax(140px, auto) 1fr;
    gap: 0.75rem;
    align-items: baseline;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--neutral-stroke-subtle);
}
.memstore-getitem-row:last-child {
    border-bottom: none;
}
.memstore-getitem-key {
    font-weight: 600;
    color: var(--neutral-foreground-hint);
    font-size: 0.875rem;
}
.memstore-getitem-value {
    word-break: break-word;
    font-variant-numeric: tabular-nums;
}

.handler-toolbox-list {
    margin: 0;
    padding-left: 1.25rem;
}

/* TCB tree view sidebar */
.tcb-new-folder-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background-color: var(--neutral-fill-input-focus);
    border-bottom: 1px solid var(--neutral-fill-hover);
}
.tcb-new-folder-input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.8125rem;
    background: var(--neutral-fill-input-rest);
    color: var(--neutral-foreground-rest);
    outline: none;
}
.tcb-new-folder-input:focus {
    border-color: var(--accent-fill-rest);
}
.tcb-account-icon-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.tcb-account-icon-wrap svg {
    width: 16px;
    height: 16px;
    display: block;
    flex-shrink: 0;
}
.tcb-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    vertical-align: middle;
}
.tcb-status-running {
    background-color: #26b050;
    box-shadow: 0 0 4px rgba(38, 176, 80, 0.5);
}
.tcb-status-stopped {
    background-color: var(--neutral-stroke-rest);
}
.tcb-transient-badge {
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0 3px;
    border-radius: 3px;
    background: var(--accent-fill-rest);
    color: var(--neutral-foreground-on-accent);
    margin-left: 4px;
    vertical-align: middle;
    line-height: 1.3;
    display: inline-block;
}
.tcb-folder-badge {
    font-size: 0.6875rem;
    color: var(--neutral-foreground-hint);
    margin-left: 4px;
    flex-shrink: 0;
}
.tcb-empty-hint {
    font-size: 0.8125rem;
    color: var(--neutral-foreground-hint);
    font-style: italic;
}
.tcb-adapter-type-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tree row: label + hover-only action buttons (right-aligned) */
.tcb-tree-item-with-actions .tcb-tree-row-wrap {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    flex: 1;
}
.tcb-tree-item-with-actions .tcb-tree-row-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.tcb-tree-item-with-actions .tcb-tree-row-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.15s ease;
}
/* Show actions only when hovering the row line itself (not when hovering child items like Information, Logs) */
.tcb-tree-row-wrap:hover .tcb-tree-row-actions,
.tcb-tree-item-with-actions .tcb-tree-row-actions:focus-within {
    opacity: 1;
}
.tcb-tree-item-with-actions .tcb-tree-row-actions fluent-button {
    min-width: 24px;
    width: 24px;
    height: 24px;
    padding: 0;
}

/* TCS adapter type documentation (markdown content) */
.tcs-docs-article {
    max-width: 72ch;
    line-height: 1.6;
}
.tcs-docs-article h1 { font-size: 1.5rem; margin: 1.25rem 0 0.75rem; font-weight: 600; }
.tcs-docs-article h2 { font-size: 1.25rem; margin: 1.25rem 0 0.5rem; font-weight: 600; border-bottom: 1px solid var(--neutral-stroke-subtle-rest, #e0e0e0); padding-bottom: 0.25rem; }
.tcs-docs-article h3 { font-size: 1.1rem; margin: 1rem 0 0.5rem; font-weight: 600; }
.tcs-docs-article h4 { font-size: 1rem; margin: 0.75rem 0 0.375rem; font-weight: 600; }
.tcs-docs-article p { margin: 0.5rem 0; }
.tcs-docs-article ul, .tcs-docs-article ol { margin: 0.5rem 0; padding-left: 1.5rem; }
.tcs-docs-article li { margin: 0.25rem 0; }
.tcs-docs-article code { font-family: ui-monospace, monospace; font-size: 0.9em; background: var(--neutral-fill-secondary-rest, #f5f5f5); padding: 0.15em 0.4em; border-radius: 4px; }
.tcs-docs-article pre { margin: 0.75rem 0; padding: 1rem; overflow-x: auto; background: var(--neutral-fill-secondary-rest, #f5f5f5); border-radius: 6px; }
.tcs-docs-article pre code { padding: 0; background: none; }
.tcs-docs-article a { color: var(--accent-fill-rest, #0078d4); text-decoration: none; }
.tcs-docs-article a:hover { text-decoration: underline; }
.tcs-docs-article blockquote { margin: 0.75rem 0; padding-left: 1rem; border-left: 4px solid var(--neutral-stroke-rest, #ccc); color: var(--neutral-foreground-hint, #666); }

.tcs-schema-grid {
    min-height: 0;
    overflow: auto;
    background: var(--neutral-fill-layer-alt);
}
.tcs-schema-footer {
    flex-shrink: 0;
    padding: 0.5rem 0 0;
    font-size: 0.875rem;
}

.tcs-validate-logs {
    flex: 1;
    min-height: 0;
    overflow: auto;
    font-family: ui-monospace, monospace;
    font-size: 0.8125rem;
    background: var(--neutral-fill-layer-alt);
    border: 1px solid var(--neutral-stroke-subtle-rest);
    border-radius: 6px;
    padding: 0.5rem;
}
.tcs-validate-log-line {
    display: flex;
    gap: 0.5rem;
    padding: 0.15rem 0;
    border-bottom: 1px solid var(--neutral-stroke-subtle-rest);
}
.tcs-validate-log-line:last-child { border-bottom: none; }
.tcs-validate-log-ts { color: var(--neutral-foreground-hint); flex-shrink: 0; }
.tcs-validate-log-level { font-weight: 600; min-width: 4rem; }
.tcs-validate-log-msg { word-break: break-word; }
.tcs-validate-log-line[data-level="Error"] .tcs-validate-log-level { color: var(--error-fill-rest); }
.tcs-validate-log-line[data-level="Warn"] .tcs-validate-log-level { color: var(--presence-busy); }

/* Validate page: left form, right tabs (Logs | Symbols) */
.tcs-validate-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}
.tcs-validate-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 0.375rem 1rem;
    flex-shrink: 0;
    min-height: 2rem;
}
.tcs-validate-header fluent-label {
    font-size: 0.9375rem;
    font-weight: 600;
}
.tcs-validate-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    gap: 1.5rem;
    padding: 1rem;
    overflow: hidden;
}
.tcs-validate-form-panel {
    flex-shrink: 0;
    width: 22rem;
    min-width: 22rem;
    overflow-y: auto;
}
.tcs-validate-result-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.tcs-validate-result-message {
    flex-shrink: 0;
    margin-bottom: 0.5rem;
}
.tcs-validate-tabs-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.tcs-validate-tabs-wrap .tcs-validate-tabs,
.tcs-validate-tabs-wrap ::deep fluent-tabs {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.tcs-validate-tabs-wrap ::deep fluent-tab-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.tcs-validate-tab-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0.5rem 0;
}
.tcs-validate-symbols-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.tcs-validate-symbols-grid {
    flex: 1;
    min-height: 0;
    overflow: auto;
    background: var(--neutral-fill-layer-alt);
}
.tcs-validate-symbols-footer {
    flex-shrink: 0;
    padding: 0.5rem 0 0;
    font-size: 0.875rem;
}

/* Add Account wizard page */
.tcs-add-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}
.tcs-add-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 0.375rem 1rem;
    flex-shrink: 0;
    min-height: 2rem;
}
.tcs-add-header fluent-label {
    font-size: 0.9375rem;
    font-weight: 600;
}
.tcs-add-step-content {
    padding: 0.5rem 0;
    overflow-y: auto;
    max-height: 100%;
}
.tcs-add-validate-result {
    flex-shrink: 0;
}
.tcs-add-logs {
    font-family: ui-monospace, monospace;
    font-size: 0.8125rem;
    background: var(--neutral-fill-layer-alt);
    border: 1px solid var(--neutral-stroke-subtle-rest);
    border-radius: 6px;
    padding: 0.5rem;
    max-height: 200px;
    overflow: auto;
}
.tcs-add-log-line {
    display: flex;
    gap: 0.5rem;
    padding: 0.15rem 0;
    border-bottom: 1px solid var(--neutral-stroke-subtle-rest);
}
.tcs-add-log-line:last-child { border-bottom: none; }
.tcs-add-log-ts { color: var(--neutral-foreground-hint); flex-shrink: 0; }
.tcs-add-log-level { font-weight: 600; min-width: 4rem; }
.tcs-add-log-msg { word-break: break-word; }
.tcs-add-log-line[data-level="Error"] .tcs-add-log-level { color: var(--error-fill-rest); }
.tcs-add-log-line[data-level="Warn"] .tcs-add-log-level { color: var(--presence-busy); }
.tcs-add-symbols-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.tcs-add-symbols-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
}
.tcs-add-symbols-count {
    font-size: 0.875rem;
    color: var(--neutral-foreground-hint);
}
.tcs-add-symbols-grid {
    min-height: 120px;
    max-height: 220px;
    overflow: auto;
    background: var(--neutral-fill-layer-alt);
    border: 1px solid var(--neutral-stroke-subtle-rest);
    border-radius: 6px;
}
.tcs-add-summary {
    padding: 0.5rem 0;
}

/* Machine Hardware / Network pages */
.machine-network-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

/* Monaco editor Features page: VS-style layout, no padding, header compact, editor fills space. */
.monaco-features-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    width: 100%;
    padding: 0;
}
.monaco-features-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    min-height: 28px;
    border-bottom: 1px solid var(--neutral-stroke-subtle-rest, #e0e0e0);
    background: var(--neutral-fill-secondary-rest, #f5f5f5);
}
.monaco-features-header .monaco-features-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.monaco-features-header-spinner {
    margin-left: auto;
}
.monaco-features-header .monaco-features-error {
    font-size: 12px;
    color: var(--error-fill-rest, #c42b1c);
    margin-left: 8px;
}
.monaco-features-loading {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--neutral-foreground-hint, #605e5c);
}
.monaco-editor-features-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
}
/* BlazorMonaco root must have height; fill container. */
.monaco-editor-features-container [id^="monaco-features-editor-"],
[id^="monaco-features-editor-"] {
    flex: 1 !important;
    min-height: 200px !important;
    height: 100% !important;
    width: 100% !important;
    display: block !important;
}