:root {
    --vf-bg-color: #ffffff;
    --vf-text-color: #000000;
    --vf-border-color: #ddd;
    --vf-input-bg: #ffffff;
    --vf-input-text: #000000;
}

html[data-theme="dark"],
html[data-theme="dark"] body {
    --vf-bg-color: #1e1e1e;
    --vf-text-color: #ffffff;
    --vf-border-color: #444444;
    --vf-input-bg: #2d2d2d;
    --vf-input-text: #ffffff;
}

/* Outline buttons (Play, Speed, Previous/Next) rendered #868e96 on #1e1e1e in dark mode, about
   5:1 contrast and hard to read. Lift their text to the dark body color, about 12:1. */
html[data-theme="dark"] .e-btn.e-outline,
html[data-theme="dark"] .e-btn.e-flat,
html[data-theme="dark"] .btn-outline-secondary {
    color: #dee2e6;
}

/* Helper text (.text-muted, .text-body-secondary) uses Bootstrap's secondary token, which is too faint on the dark body. Lift it to a light gray, about 8:1. */
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .text-body-secondary {
    color: #adb5bd;
}

/* Bit rate chart: SVG bars default to black, which disappears on the dark page. Bars take the secondary text
   token (about 7.6:1 on the dark body); the playhead takes the danger token so it stands out from the bars. */
.bitrate-series-chart .bitrate-bar {
    fill: var(--bs-secondary-color);
}

.bitrate-series-chart .bitrate-playhead {
    stroke: var(--bs-danger);
    stroke-width: 2;
}

/* One violet mark per bit rate dip run. Violet, not a text token, so it stays apart from the gray bars and the red playhead. */
.bitrate-series-chart .bitrate-dip-mark {
    stroke: #b388ff;
    stroke-width: 2;
    cursor: pointer;
}

.bitrate-series-chart .bitrate-bar {
    cursor: pointer;
}

/* Bootstrap's .card is hard-coded white, but the Syncfusion dark theme (bootstrap5-dark.css) sets
   checkbox labels to white. In dark mode the cards must go dark too, or those labels vanish. */
html[data-theme="dark"] .card {
    background-color: var(--vf-input-bg);
    color: var(--vf-text-color);
    border-color: var(--vf-border-color);
}

html, body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background-color: var(--vf-bg-color);
    color: var(--vf-text-color);
}

table {
    border-collapse: collapse;
    width: 100%;
}

th, td {
    border: 1px solid var(--vf-border-color);
    padding: 0.5rem;
    text-align: left;
}

nav a {
    display: block;
    color: inherit;
    padding: 0.5rem 0;
    text-decoration: none;
}

nav a:hover {
    text-decoration: underline;
}

/* Syncfusion Splitter theme adjustments (MainLayout's left-nav/content splitter) - must live here,
   not in a .razor.css file: Blazor CSS isolation has no ":global(...)" escape, so a rule meant to
   target Syncfusion's JS-rendered splitter markup (which never carries this component's scope
   attribute) has to be written in a genuinely unscoped stylesheet like this one. */
.e-splitter-layout {
    background-color: var(--vf-bg-color);
}

.e-splitter-layout .e-splitter-bar {
    background-color: var(--vf-border-color);
}

/* Every Syncfusion button (.e-btn) gets breathing room above/below by default, so a lone button or
   one that isn't inside a Bootstrap d-flex/gap container never sits flush against neighboring text
   or other controls. Buttons already grouped with Bootstrap's gap-* utility still look right - this
   only adds vertical margin, gap already handles the horizontal spacing between grouped buttons. */
.e-btn {
    margin-top: 4px;
    margin-bottom: 4px;
}

/* Small circular "?" toggle used to reveal/hide an inline help explanation (e.g. Network Access),
   instead of showing a long explanatory banner permanently on the page. */
.help-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--vf-border-color);
    background: transparent;
    color: inherit;
    font-size: 13px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.help-toggle-btn:hover {
    background: var(--vf-border-color);
}

/* Week-by-hour grid: a box is tinted by how far its mean sits from the camera's all-time mean, in sd. */
.calendar-box-green {
    background-color: color-mix(in srgb, var(--bs-success) 30%, transparent);
}

.calendar-box-yellow {
    background-color: color-mix(in srgb, var(--bs-warning) 40%, transparent);
}

.calendar-box-red {
    background-color: color-mix(in srgb, var(--bs-danger) 40%, transparent);
}

.calendar-box-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    vertical-align: middle;
}

/* The left-nav pane while hidden (see layout-prefs.js setLeftNavHidden). The pane leaves the flow but keeps its
   layout box: display:none made Syncfusion re-measure it at 0 and reset it to its 48px minimum. */
.splitter-left-nav.vf-left-nav-hidden {
    position: absolute !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* The separator after the hidden pane has no pane to split, so it can go. */
.e-splitter-separator.vf-left-nav-hidden {
    display: none !important;
}
