/* =====================================================================
 * setup-brand.css — nanocosmos Product Theme (dark), applied to the
 * chroma-key workbench UI.
 *
 * Tier:   Product page (web.pages.gitlab.nanocosmos.cloud)
 * Fonts:  Lexend Deca (heading/buttons) + Source Sans 3 (body) — both
 *         self-hosted from https://www.nanocosmos.net/fonts/ via
 *         fonts.css, loaded before this file. No Google Fonts.
 *         Monospace stays a system stack (ui-monospace/SFMono/Menlo/
 *         Consolas) — Roboto Mono is not currently self-hosted anywhere
 *         in this repo, and this redesign does not reintroduce Google
 *         Fonts just to get it. Flagging, not silently deciding: see
 *         nanocosmos-brand-guidelines' own "Font-hosting note" for the
 *         open item on self-hosting Lexend Deca/Source Sans Pro/Roboto
 *         Mono centrally — Roboto Mono should move to the same
 *         self-hosted path once that's resolved.
 *
 * Tokens: canonical nanocosmos Product Theme tokens (--accent-orange
 *         #e5883c / --accent-blue #408bc3 / --bg #0d171e / --panel
 *         #252a2f / --panel-inset #1c2228 / --border #2e343d) — see
 *         nanocosmos-brand-guidelines/product-theme.css. This is a
 *         DIFFERENT accent pair from the marketing site (#F48220 /
 *         #0F8DC8) — do not mix them back in.
 *
 * No green/red/yellow anywhere (status colors are bucketed into the two
 * brand accents only — orange = attention: error/warning/live, blue =
 * positive: success/done — icons and labels carry the specific
 * meaning). The one deliberate exception: the chroma-key color swatches
 * (#00FF00 green-screen / #0057FF blue-screen presets) and the RGB
 * channel slider thumbs — those literal colors ARE the data (what pixel
 * color is being keyed / previewed), not a status indicator, so they
 * stay real red/green/blue.
 *
 * Flat surfaces, no drop-shadow, no gradients (except the mandatory
 * header gradient bar) — panels are a plain fill + 1px border. Buttons,
 * pills, chips, badges, and toggles are all full-pill (999px). Panels
 * are a modest 4px. Ordinary inputs/selects are 8px with a uniform
 * border on every side — no colored accent stripe on any edge, ever
 * (the previous `border-left: 3px solid var(--orange)` on every input
 * was exactly that anti-pattern; removed throughout).
 *
 * Built from scratch — no rules borrowed from styles.css. Only the
 * layout primitives (workbench grid, upload grid, sections, sticky
 * preview, sliders + value-input shape, combo boxes, stream cards) are
 * preserved by intent — this is a re-skin, not a re-architecture.
 * ===================================================================== */


/* ---------- Product Theme tokens ---------- */
:root {
    /* Canonical product-theme tokens (source of truth) */
    --accent-orange:       #e5883c;
    --accent-orange-hover: #f0954a;
    --accent-blue:         #408bc3;
    --accent-blue-hover:   #5398cf;
    --bg:                  #0d171e;
    --panel:               #252a2f;
    --panel-inset:         #1c2228;
    --border:              #2e343d;
    --text-primary:        #eef1f3;
    --text-secondary:      #97a1ad;
    --text-muted:          #6b7480;
    --text-on-accent:      #ffffff;

    /* Legacy token names used throughout this file / the tuner's inline
       styles — kept so existing selectors don't all need renaming, but
       every one of them now resolves to a canonical value above. */
    --orange:          var(--accent-orange);
    --orange-dark:     var(--accent-orange-hover); /* name says "dark", value is the brighter hover swap — matches every existing :hover rule */
    --blue:            var(--accent-blue);
    --blue-dark:       var(--accent-blue-hover);
    --navy:            var(--text-primary);   /* standalone headings/labels read as near-white, not literal navy */
    --hero-navy:       var(--text-primary);
    --platform-navy:   var(--panel);
    --bg-soft:         var(--panel-inset);
    --bg-sunken:       var(--panel-inset);
    --bg-card:         var(--panel);
    --bg-dark:         var(--panel);
    --surface-2:       var(--panel);
    --surface-3:       var(--panel-inset);    /* was previously undefined — every var(--surface-3, #fallback) in the inline styles silently used mismatched literal fallbacks; now resolves consistently */
    --ink:             var(--text-primary);
    --muted:           var(--text-secondary);
    --grey:            var(--text-secondary);
    --text:            var(--text-secondary); /* used almost entirely for content inside chip/box-shaped elements (mono IDs, table cells) */
    --text-on-dark:    #ffffff;
    --text-on-dark-soft: var(--text-secondary);

    --line:            var(--border);
    --line-strong:     var(--border);
    --line-faint:      rgba(255, 255, 255, 0.06);

    /* Status — no green/red/yellow. Attention bucket (error/warning) and
       "live" all read as orange; positive/success/done reads as blue. */
    --ok:              var(--accent-blue);
    --ok-soft:         rgba(64, 139, 195, 0.16);
    --err:             var(--accent-orange);
    --err-soft:        rgba(229, 136, 60, 0.16);
    --warn:            var(--accent-orange);
    --warn-soft:       rgba(229, 136, 60, 0.16);
    --accent-green:    var(--accent-blue); /* "synced" tally dot — was green, now blue (positive/clean state); dirty state already used orange */

    /* Typography */
    --font-display:    'Lexend Deca', Helvetica, Arial, sans-serif;
    --font-body:       'Source Sans 3', 'Open Sans', Helvetica, Arial, sans-serif;
    --font-mono:       ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Geometry — panels 4px, ordinary inputs 8px, everything clickable
       (buttons/pills/badges/switches) is a full 999px pill. */
    --container:       1520px;
    --radius:          8px;
    --radius-sm:       6px;
    --radius-lg:       4px;
    --radius-pill:     999px;
    --shadow-sm:       none;
    --shadow:          none;
    --shadow-lg:       none;
}


/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); }

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
    margin: 0 0 12px;
    letter-spacing: 0;
    text-transform: none;
}
h1 { font-size: clamp(24px, 3.2vw, 32px); line-height: 1.15; }
h3 { font-size: 18px; }
h4 { font-size: 14px; }

p { margin: 0 0 12px; }

a { color: var(--accent-blue); text-decoration: none; }
a:hover { color: var(--accent-blue-hover); text-decoration: underline; }

code, pre { font-family: var(--font-mono); font-size: 0.9em; }
code { background: var(--panel-inset); padding: 1px 6px; border-radius: 4px; color: var(--text-primary); border: 1px solid var(--border); }

::selection { background: rgba(229, 136, 60, 0.30); color: #fff; }

.hidden { display: none !important; }

/* Native browser focus-ring reset — without this, a plain mouse CLICK on
   a focusable element with no outline rule of its own falls through to
   the browser's NATIVE outline (Safari's follows the OS accent color,
   not this theme). :focus-visible below is the only source of a ring. */
a, button, select, input, [tabindex] {
    outline: none;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}


/* ---------- Demo header — canonical product-theme gradient bar ---------- */
.demo-header {
    background: linear-gradient(180deg, #00486c 0%, #00486c 25%, #0f8dc8 100%);
    border-bottom: 1px solid #0f8dc8;
    padding: 9px 24px;
    position: sticky;
    top: 0;
    z-index: 30;
}

.demo-header-inner {
    max-width: var(--container);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.demo-logo-link { display: inline-flex; align-items: center; }
.demo-logo      { height: 26px; width: auto; display: block; }
.studio-logo    { height: 30px; width: auto; display: block; flex: none; }

.demo-header-titles { display: flex; flex-direction: column; min-width: 0; }
.demo-eyebrow {
    margin: 0;
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 400; /* Lexend Deca Regular — eyebrow is the one place it's not Bold */
    letter-spacing: 0.09em;
    text-transform: uppercase;
}
.demo-title {
    margin: 1px 0 0;
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.15;
}

.demo-header-meta { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.demo-chip {
    font-family: var(--font-body);
    font-size: 12px;
    color: #ffffff;
    padding: 5px 14px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--radius-pill);
    background: transparent;
}


/* ---------- Page layout ---------- */
/* Outer page padding wrapper using direct child rules — the SAME
   min(calc(100% - Npx), container) formula everywhere (header uses
   equivalent 24px-padding-on-a-full-width-bar math — see body below)
   so header/section/footer edges line up at every viewport width. */
body > details.section,
body > #configurationSection {
    width: min(calc(100% - 48px), var(--container));
    margin: 18px auto;
}


/* ---------- Section card ---------- */
.section,
details.section {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    margin: 0 0 16px;
}

.section h3 { margin: 0 0 16px; }

/* Collapsible <details>/<summary> as section header — a pill button,
   matching every other clickable control in this theme. */
details.collapsible > summary {
    list-style: none;
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    color: #ffffff;
    background: var(--accent-blue);
    width: fit-content;
    padding: 8px 18px 8px 34px;
    margin: 0 0 14px;
    border-radius: var(--radius-pill);
    position: relative;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: background-color 0.15s ease;
}
details.collapsible > summary:hover { background: var(--accent-blue-hover); }
details.collapsible > summary > select {
    width: auto;
    margin: 0;
    padding: 4px 10px;
    font-size: 13px;
    background: var(--panel-inset);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    cursor: pointer;
}
details.collapsible:not([open]) > summary { margin-bottom: 0; }
details.collapsible { padding-top: 12px; padding-bottom: 12px; }
details.collapsible > summary::-webkit-details-marker { display: none; }
details.collapsible > summary::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: translateY(-65%) rotate(-45deg);
    transition: transform 0.18s ease;
}
details.collapsible[open] > summary::before {
    transform: translateY(-50%) rotate(45deg);
}

.section-subhead {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    color: #ffffff;
    margin: 20px 0 10px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.section-actions { margin-top: 20px; }


/* ---------- Forms ---------- */
label {
    display: block;
    margin: 0 0 6px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    color: #ffffff;
    letter-spacing: 0.01em;
}

/* Plain uniform border on every side, deliberately — no colored
   left-accent stripe on any field, ever. If a field needs to flag an
   error state, use border-color on ALL sides, never a single edge. */
input,
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    margin: 0 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel-inset);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, select:focus, textarea:focus {
    border-color: var(--accent-blue);
}
input[type="checkbox"], input[type="radio"] {
    width: 16px; height: 16px;
    margin: 0;
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    padding: 0;
    accent-color: var(--accent-blue); /* product-theme convention: checked checkboxes are blue */
}

textarea {
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.55;
    min-height: 110px;
    resize: vertical;
}

/* Range sliders */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 22px;
    padding: 0;
    margin: 0 0 4px;
    border: 0;
    background: transparent;
    cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: var(--border);
    border-radius: var(--radius-pill);
}
input[type="range"]::-moz-range-track {
    height: 4px;
    background: var(--border);
    border-radius: var(--radius-pill);
    border: 0;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px; height: 16px;
    margin-top: -6px;
    border-radius: 50%;
    background: var(--accent-orange);
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 1px var(--accent-orange);
    transition: transform 0.12s;
}
input[type="range"]::-moz-range-thumb {
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--accent-orange);
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 1px var(--accent-orange);
}
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.1); }

/* Literal channel colors (RGB sliders) — the color IS the data being
   represented (the red/green/blue channel of the key color), not a
   status indicator, so these stay real red/green/blue on purpose. */
input[type="range"].red::-webkit-slider-thumb,   input[type="range"].red::-moz-range-thumb   { background: #E53935; box-shadow: 0 0 0 1px #E53935; }
input[type="range"].green::-webkit-slider-thumb, input[type="range"].green::-moz-range-thumb { background: #2E8B57; box-shadow: 0 0 0 1px #2E8B57; }
input[type="range"].blue::-webkit-slider-thumb,  input[type="range"].blue::-moz-range-thumb  { background: var(--accent-blue); box-shadow: 0 0 0 1px var(--accent-blue); }


/* ---------- Buttons — every clickable control is a pill ---------- */
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    letter-spacing: 0.01em;
    color: var(--text-on-accent);
    background: var(--accent-orange);
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.05s ease;
    margin-right: 8px;
}
button:hover { background: var(--accent-orange-hover); }
button:active { transform: translateY(1px); }
button:disabled {
    background: var(--panel-inset);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}

/* Secondary — blue */
.btn-secondary {
    background: var(--accent-blue);
    color: var(--text-on-accent);
}
.btn-secondary:hover { background: var(--accent-blue-hover); }

/* Utility / low-emphasis outline (used for compact table + icon-only
   actions) */
.btn-xs {
    background: var(--accent-orange);
    color: var(--text-on-accent);
    border: none;
}
.btn-xs:hover { background: var(--accent-orange-hover); }
.btn-outline {
    background: transparent;
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
}
.btn-outline:hover {
    color: var(--text-on-accent);
    background: var(--accent-blue);
}

/* Size variants */
.btn-sm { padding: 8px 16px; font-size: 13px; margin: 0; white-space: nowrap; }
.btn-xs { padding: 5px 12px; font-size: 12px; margin: 0; }
.btn-glyph { color: var(--text-on-accent); font-size: 12px; line-height: 1; }

/* Hidden native color-picker — keeps label clickable */
.native-picker-hidden {
    width: 0; height: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    position: absolute;
    pointer-events: none;
}


/* ---------- Layout helpers ---------- */
.form-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
}
.form-row.tight { gap: 6px; }
.form-row.wrap  { flex-wrap: wrap; }
.form-row > label { margin: 0; white-space: nowrap; flex-shrink: 0; }
.form-row > .grow { flex: 1; min-width: 0; }
.form-row > input,
.form-row > select { margin: 0; }

.action-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.action-row > .grow { flex: 1; min-width: 0; }

.adj-status-row { margin-top: 10px; min-height: 0; color: var(--text-secondary); }
.adj-status-row:empty { display: none; }

.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.overlay-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ---------- Info / banner / result ---------- */
.info {
    background: var(--panel-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin: 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
}
.info.sm { font-size: 12px; padding: 8px 12px; margin-bottom: 12px; }
.info code { background: rgba(64, 139, 195, 0.14); color: var(--text-primary); padding: 1px 6px; border-radius: 4px; border: none; }

.result {
    background: var(--panel-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-top: 10px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 320px;
    overflow-y: auto;
}
/* Success/failure read via border-color + icon/label, not hue — both
   sit on the same neutral inset background used everywhere else. */
.success { border-color: var(--accent-blue); color: var(--text-primary); }
.error   { border-color: var(--accent-orange); color: var(--text-primary); }


/* ---------- Mode tabs (Create / Reuse) — pill segmented control ---------- */
.mode-tabs-row {
    display: flex;
    gap: 10px;
    margin: 4px 0 18px;
}
.mode-tab {
    flex: 1;
    padding: 8px 16px;
    margin: 0;
    border-radius: var(--radius-pill);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-secondary);
    background: var(--panel-inset);
    border: 1px solid var(--border);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.mode-tab.left:hover,
.mode-tab.left.active {
    background: var(--accent-orange);
    color: var(--text-on-accent);
    border-color: var(--accent-orange);
}
.mode-tab.left.active:hover { background: var(--accent-orange-hover); }
.mode-tab.right:hover,
.mode-tab.right.active {
    background: var(--accent-blue);
    color: var(--text-on-accent);
    border-color: var(--accent-blue);
}
.mode-tab.right.active:hover { background: var(--accent-blue-hover); }

/* ---------- Auth tabs (API Key | Email & Password) — pill/segmented ---------- */
.auth-tabs-row {
    display: inline-flex;
    gap: 0;
    margin: 4px 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--panel-inset);
    overflow: hidden;
}
.auth-tab {
    padding: 6px 18px;
    margin: 0;
    border-radius: 0;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary);
    border: 0;
    transition: background 0.15s, color 0.15s;
}
.auth-tab + .auth-tab { border-left: 1px solid var(--border); }
.auth-tab:hover { color: #ffffff; }
.auth-tab.active { background: var(--accent-blue); color: var(--text-on-accent); }
.auth-tab.active:hover { background: var(--accent-blue-hover); }
.auth-pane { /* shown/hidden by JS */ }

/* ---------- Chroma section (nested box inside a panel) ---------- */
.chroma-section {
    background: var(--panel-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin: 0 0 14px;
}
.chroma-section h4 {
    margin: 0 0 12px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.slider-header label { margin: 0; }

/* Value readout — reads as a small pill chip */
.value-badge,
.value-input {
    display: inline-block;
    min-width: 56px;
    padding: 3px 12px;
    background: var(--accent-orange);
    color: var(--text-on-accent);
    border: none;
    border-radius: var(--radius-pill);
    text-align: center;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.value-input {
    width: 76px;
    margin: 0;
    -moz-appearance: textfield;
}
.value-input::-webkit-outer-spin-button,
.value-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.value-input:focus { outline: 2px solid #fff; outline-offset: -3px; }

.param-slider { width: 100%; margin: 0 0 6px; }

.help-text {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin: 8px 0 0;
    line-height: 1.45;
}


/* ---------- Key Color picker ---------- */
/* The swatches below show the actual chroma-key pixel color (green- or
   blue-screen) — literal color-as-data, not status, so real green/blue
   stay on purpose (see file header note). */
.color-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text-primary);
}
.color-indicator .swatch-box {
    width: 22px; height: 22px;
    border-radius: 6px;
    background: #00FF00;
    border: 2px solid var(--panel);
    box-shadow: 0 0 0 1px var(--border);
}

.preset-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    margin: 0;
    background: var(--panel-inset);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.preset-btn:hover:not(.active) {
    border-color: var(--accent-blue);
    color: #ffffff;
}
.preset-btn.active {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    color: var(--text-on-accent);
}
.preset-btn .swatch {
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
    display: inline-block;
}
.preset-btn .swatch.green { background: #00FF00; }
.preset-btn .swatch.blue  { background: #0057FF; }
.preset-btn.picker-label  { cursor: pointer; }

.color-compact {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 16px;
    align-items: start;
}
.color-left  { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.color-right { display: flex; flex-direction: column; gap: 10px; }
.color-preview-compact {
    width: 76px; height: 76px;
    border-radius: var(--radius-lg);
    background: #00FF00;
    border: 2px solid var(--panel);
    box-shadow: 0 0 0 1px var(--border);
}

.rgb-inline { display: flex; gap: 12px; align-items: center; }
.rgb-channel { display: flex; gap: 8px; align-items: center; flex: 1; min-width: 0; }
.rgb-label   { font-size: 12px; font-weight: 700; width: 14px; text-align: center; }
.rgb-label.red   { color: #E53935; }
.rgb-label.green { color: #2E8B57; }
.rgb-label.blue  { color: var(--accent-blue); }
.rgb-slider { flex: 1; margin: 0; min-width: 0; }
.rgb-value {
    width: 52px;
    margin: 0;
    padding: 4px 6px;
    background: var(--panel-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.hex-row-compact {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.hex-row-compact .hex-prefix { font-size: 14px; color: var(--text-secondary); font-weight: 700; }
.hex-row-compact input {
    flex: 1;
    margin: 0;
    padding: 6px 10px;
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: var(--panel-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}


/* ---------- Despill control row ---------- */
.despill-fields {
    display: grid;
    grid-template-columns: auto auto minmax(240px, 1fr);
    align-items: center;
    gap: 12px;
}
.despill-enable { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; }
.despill-type   { display: inline-flex; align-items: center; gap: 8px; }
.despill-mix    { display: flex; align-items: center; gap: 10px; min-width: 0; }
.despill-mix label { margin: 0; font-size: 12px; color: var(--text-secondary); }
.despill-mix .param-slider { flex: 1 1 auto; min-width: 90px; margin: 0; }
.despill-mix .value-input  { width: 76px; }

/* Hide sub-options when Despill/EQ checkboxes are unchecked. */
.chroma-section:has(#despillEnabled:not(:checked)) .despill-type,
.chroma-section:has(#despillEnabled:not(:checked)) .despill-mix,
.chroma-section:has(#despillEnabled:not(:checked)) .despill-fields > button,
.chroma-section:has(#despillEnabled:not(:checked)) #despillAdvanced,
.chroma-section:has(#despillEnabled:not(:checked)) #despillPreview {
    display: none !important;
}
.chroma-section:has(#eqEnabled:not(:checked)) #eqFields,
.chroma-section:has(#eqEnabled:not(:checked)) #eqPreview {
    display: none !important;
}

/* Despill-type radio — the swatch shows the literal spill color being
   removed (green or blue), same literal-color exception as above. */
.color-radio {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 7px 14px;
    background: var(--panel-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: border-color 0.15s;
}
.color-radio input { position: absolute; opacity: 0; pointer-events: none; }
.color-radio-square {
    width: 20px; height: 20px;
    border: 2px solid #fff;
    border-radius: 5px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
.color-radio-green .color-radio-square { background: #00FF00; }
.color-radio-blue .color-radio-square  { background: #0057FF; }
.color-radio:has(input:checked) {
    border-color: var(--accent-orange);
    color: #ffffff;
}


/* ---------- Stream info table ---------- */
#streamInfo { margin: 6px 0 18px; }

.stream-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel-inset);
    margin-bottom: 12px;
}
.stream-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.stream-table th,
.stream-table td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap;
}
.stream-table th {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    background: var(--panel);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.stream-table tr:last-child td { border-bottom: 0; }
.stream-table tr:hover td { background: rgba(255, 255, 255, 0.03); }
.stream-table .mono {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 12.5px;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-radius: 6px;
    -webkit-user-select: all;
    user-select: all;
}
.stream-table a.mono { color: var(--accent-blue); background: rgba(255, 255, 255, 0.06); }
.stream-table a.mono:hover { color: var(--accent-blue-hover); text-decoration: underline; }
.stream-table .stream-bg-select,
.stream-table .stream-bg-input {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--panel-inset);
    color: var(--text-secondary);
    max-width: 260px;
    width: 100%;
}
.stream-table .copyable { cursor: pointer; color: var(--text-primary); }
.stream-table .copyable:hover { color: var(--accent-orange); }
.stream-table .muted { color: var(--text-secondary); }
.stream-table .copy-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 0;
    padding: 0 6px;
    margin: 0 0 0 4px;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.15s;
}
.stream-table .copy-btn:hover { color: var(--accent-orange); }

.stream-meta {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin: 4px 0 12px;
}
.stream-meta code { background: rgba(255, 255, 255, 0.06); color: var(--text-primary); padding: 1px 6px; border-radius: 4px; border: none; }

.stream-type-badge {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}
.ingest-badge {
    background: rgba(64, 139, 195, 0.16);
    color: var(--accent-blue-hover);
}
.target-badge {
    background: rgba(229, 136, 60, 0.16);
    color: var(--accent-orange-hover);
}

/* Ingest row — blue is the structural/source cue, target rows are
   unmarked (orange is reserved for actions/attention, not a permanent
   row-type wash on every target row). */
.stream-table tr.ingest-row td {
    background: rgba(64, 139, 195, 0.08);
    border-bottom: 2px solid var(--accent-blue);
}
.stream-table tr.ingest-row:hover td {
    background: rgba(64, 139, 195, 0.13);
}
.stream-table tr.ingest-row td:first-child {
    box-shadow: inset 3px 0 0 var(--accent-blue);
}

/* Per-target delete button */
.stream-table .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.target-del-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 4px 12px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: color .15s, background .15s, border-color .15s;
}
.target-del-btn:hover {
    color: var(--text-on-accent);
    background: var(--accent-orange);
    border-color: var(--accent-orange);
}
/* Open the stream overview in the dashboard (per-stream icon link) */
.stream-table .dash-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-right: 6px;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    vertical-align: middle;
    transition: color .15s, background .15s, border-color .15s;
}
.stream-table .dash-link:hover {
    color: var(--accent-orange);
    border-color: var(--accent-orange);
    background: rgba(229, 136, 60, 0.10);
}

/* Auth status + org hash live inside the <summary> so they stay visible
   when the panel is collapsed. */
.auth-summary-status, .auth-summary-org {
    font-size: 12px; font-weight: 600;
    text-transform: none; letter-spacing: 0;
    color: #fff; white-space: nowrap;
}
.auth-summary-org code { font-family: var(--font-mono); text-transform: none; letter-spacing: 0; }
.auth-summary-org.hidden { display: none; }
.auth-summary-status:empty { display: none; }
.auth-summary-status .result {
    display: inline; margin: 0; padding: 0;
    background: none; border: 0; border-radius: 0;
    max-height: none; overflow: visible;
    font-family: var(--font-body); font-size: 12px; white-space: nowrap;
}
.auth-summary-status .success { color: var(--accent-blue-hover); }
.auth-summary-status .error   { color: var(--accent-orange-hover); background: none; }

.bg-select {
    width: 100%;
    margin: 0;
    padding: 6px 8px;
    font-size: 13px;
}


/* ---------- Upload area + file list + preview ---------- */
.upload-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(240px, 1.1fr) minmax(280px, 1.4fr);
    gap: 16px;
    margin-top: 10px;
}
@media (max-width: 900px) { .upload-grid { grid-template-columns: 1fr; } }
.upload-grid > div { min-width: 0; }

.upload-col-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 8px;
    font-size: 13px;
}
.upload-col-title strong {
    color: #ffffff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--panel-inset);
    color: var(--text-secondary);
    text-align: center;
    cursor: pointer;
    padding: 24px 12px;
    min-height: 130px;
    display: grid;
    place-content: center;
    gap: 4px;
    transition: border-color 0.15s, color 0.15s;
}
.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--accent-orange);
    color: #ffffff;
}
.upload-area.compact { padding: 18px 10px; font-size: 13px; }
.upload-area .drop-icon {
    width: 36px;
    height: 28px;
    margin: 0 auto 6px;
    border: 2px solid var(--accent-orange);
    border-top-width: 8px;
    border-radius: 4px 4px 6px 6px;
    opacity: 0.95;
}

.upload-card-heading {
    background: var(--panel-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin: 10px 0 8px;
    font-size: 12.5px;
}
.upload-card-heading ul {
    margin: 6px 0 0;
    padding-left: 18px;
    color: var(--text-secondary);
    font-size: 12px;
}

.upload-progress {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--panel-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12.5px;
    color: var(--text-secondary);
}
.upload-progress .bar {
    height: 6px;
    margin-top: 6px;
    background: var(--border);
    border-radius: var(--radius-pill);
    overflow: hidden;
}
.upload-progress .fill {
    height: 100%;
    width: 0%;
    background: var(--accent-orange);
    transition: width 0.3s;
}

.file-list-empty {
    color: var(--text-muted);
    font-size: 12.5px;
    padding: 18px 8px;
    text-align: center;
}
.file-list-box {
    background: var(--panel-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    max-height: 280px;
    overflow-y: auto;
}
.file-list-item {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12.5px;
    color: var(--text-secondary);
    border: 1px solid transparent;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.file-list-item:hover    { background: rgba(255, 255, 255, 0.05); color: #ffffff; }
.file-list-item.selected {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-orange);
    color: #ffffff;
}
.file-list-item .fname {
    font-family: var(--font-mono);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.file-list-item .fmeta {
    color: var(--text-secondary);
    font-size: 11.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.preview-box {
    background: var(--panel-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 20px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
}
.preview-box img,
.preview-box video {
    max-width: 100%;
    max-height: 260px;
    border-radius: var(--radius-sm);
    background: #000;
}
.preview-box .placeholder {
    color: var(--text-secondary);
    font-size: 12.5px;
    text-align: center;
}
.preview-box .fname-line {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-secondary);
    word-break: break-all;
    text-align: center;
    margin: 0;
}


/* ---------- Validation list (rendered by JS) ---------- */
.validation-item {
    list-style: none;
    padding: 7px 0;
    border-bottom: 1px solid var(--line-faint);
}
.validation-item .title { font-weight: 600; }
.validation-item .meta  { font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; }
.validation-item.ok    { color: var(--accent-blue-hover); }
.validation-item.warn  { color: var(--accent-orange-hover); }
.validation-item.err   { color: var(--accent-orange-hover); }
.validation-item.warn .meta.accent { color: var(--accent-orange-hover); }
.validation-loading    { color: var(--text-secondary); list-style: none; padding: 6px 0; }


/* ---------- Switch (inline checkbox + label) ---------- */
.switch-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}
.switch-label input[type="checkbox"] { accent-color: var(--accent-blue); cursor: pointer; }


/* ---------- Workbench layout (preview on left, controls on right) ---------- */
#workbenchBlock {
    width: min(calc(100% - 48px), var(--container));
    margin: 18px auto 30px;
}

.workbench-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 8px;
    padding: 0 2px;
}
.workbench-header .eyebrow {
    margin: 0 0 4px;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-orange);
}
.workbench-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 21px;
}
.workbench-status {
    flex: 0 1 560px;
    min-width: 220px;
    max-width: 100%;
    font-size: 12.5px;
    color: var(--text-secondary);
    padding: 6px 14px;
    background: var(--panel-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    overflow-wrap: anywhere;
    text-align: right;
    white-space: normal;
}

.workbench-layout {
    display: grid;
    grid-template-columns: minmax(720px, 1fr) minmax(390px, 440px);
    gap: 18px;
    align-items: start;
    width: 100%;
    margin: 0;
}
.workbench-preview,
.workbench-controls { min-width: 0; }

.workbench-preview,
.workbench-controls {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.workbench-preview {
    position: sticky;
    top: 96px;
    padding: 16px;
}

.workbench-controls {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 92px;
    max-height: calc(100vh - 116px);
    overflow: auto;
    padding: 18px;
    scrollbar-color: var(--border) var(--panel);
}
.workbench-controls .chroma-section { margin-bottom: 0; }
.workbench-controls > .grid-2col { grid-template-columns: 1fr; gap: 0; }
.workbench-controls > .grid-2col .chroma-section + .chroma-section { margin-top: 16px; }
.workbench-controls #despillAdvanced,
.workbench-controls #eqFields { grid-template-columns: 1fr 1fr !important; gap: 12px; }
.workbench-controls .despill-fields { grid-template-columns: auto 1fr; gap: 14px; }
.workbench-controls .despill-mix {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) 76px;
    gap: 10px;
}
.workbench-controls .despill-fields > button {
    grid-column: 1 / -1;
    justify-self: start;
}
.workbench-controls > .action-row {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 4px 0 0;
    padding: 12px 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

#configurationSection {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    margin: 16px auto;
}
#configurationSection > .section,
#configurationSection > .mode-tabs-row,
#configurationSection > h3,
#configurationSection > h4,
#configurationSection > .section-subhead,
#configurationSection > #targetCountRow,
#configurationSection > #streamInfo,
#configurationSection > #createPane,
#configurationSection > #reusePane {
    max-width: var(--container);
    margin-left: auto;
    margin-right: auto;
}
#configurationSection > h3,
#configurationSection > h4,
#configurationSection > .section-subhead,
#configurationSection > #targetCountRow,
#configurationSection > #streamInfo,
#configurationSection > #createPane,
#configurationSection > #reusePane,
#configurationSection > .mode-tabs-row {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    margin: 0 0 16px;
}
#configurationSection > .mode-tabs-row { padding: 8px 22px; }
#configurationSection > h3 { border-left: 3px solid var(--accent-orange); }

/* Adjust-panel (legacy; kept hidden by JS but styled for completeness) */
.adjust-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin: 14px 0;
}
.adjust-panel > h4 { color: #ffffff; font-size: 14px; margin: 0 0 12px; }
.adj-mode {
    padding: 6px 16px;
    background: var(--panel-inset);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 12px;
    cursor: pointer;
}
.adj-mode.active { background: var(--accent-orange); border-color: var(--accent-orange); color: var(--text-on-accent); }


/* ---------- Player section ---------- */
.player-section { margin: 0; }
.player-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.player-header h4 {
    margin: 0;
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.player-header-actions {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.player-tabs-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    min-height: 36px;
}
.player-tab {
    padding: 7px 16px;
    margin: 0;
    min-height: 34px;
    background: var(--panel-inset);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.player-tab:hover {
    color: #ffffff;
    border-color: var(--accent-blue);
}
.player-tab.active {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    color: var(--text-on-accent);
}

.player-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.15s;
}
#playerDiv { width: 100%; height: 100%; }
#playerDiv > * { max-width: 100%; }
.player-placeholder {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    text-align: center;
}

/* Tally border on the stage. Broadcast tally lights are conventionally
   amber/red — not available here, so this reuses the theme's own
   action-color logic instead: Preview is the safe/monitoring state
   (blue, same as any secondary action), Live is the state that's
   actually pushing to the real output stream (orange — the brand rule
   explicitly buckets "live" into the same attention hue as
   error/warning, and orange is already this theme's "committing
   action" color everywhere else, which is a good semantic match for
   "you are on air"). */
#workbenchPreview.tally-preview .player-stage {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 1px rgba(64, 139, 195, 0.35);
}
#workbenchPreview.tally-live .player-stage {
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 2px rgba(229, 136, 60, 0.55);
}

/* Caption strip pinned to the top of the canvas stage — reminds you
   this is the local preview, not the real on-air output. */
.preview-mode-hint {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 2;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-align: center;
    color: var(--accent-blue-hover);
    background: rgba(64, 139, 195, 0.14);
    border-bottom: 1px solid rgba(64, 139, 195, 0.35);
}
.preview-mode-hint strong { color: var(--accent-blue-hover); }

#previewCanvas {
    background: #050607;
}


/* ---------- Text helpers ---------- */
.text-muted    { color: var(--text-secondary); font-size: 12.5px; }
.text-muted-sm { color: var(--text-secondary); font-size: 11.5px; }


/* ---------- Demo footer — full-width orange bar, column-aligned ---------- */
.demo-footer {
    background: var(--accent-orange);
    padding: 16px 24px;
    margin-top: 48px;
}
.demo-footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: #ffffff;
}
.demo-footer-inner a { color: #ffffff; text-decoration: underline; }
.demo-footer-inner a:hover { color: rgba(255, 255, 255, 0.75); }

.page-version {
    display: flex;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.02em;
}


/* ---------- Source rows / switcher / stream cards / combos ---------- */
/* Structural rules for these live in chroma-setup-tuner.html's own
   <style> block (page-specific components not shared with any other
   page) — this file only needs to supply the tokens they reference,
   which the :root above already does (--surface-2/--surface-3/--border/
   --orange/--blue etc. all resolve to canonical values now, so no
   separate override block is needed here the way the old "dark grey
   workspace theme" section required). */


/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
    .workbench-layout { grid-template-columns: 1fr; }
    .workbench-preview { position: static; }
    .workbench-controls {
        position: static;
        max-height: none;
        overflow: visible;
    }
    .player-stage { min-height: 0; }
}

@media (max-width: 760px) {
    body { font-size: 14.5px; }

    body > details.section,
    body > #configurationSection,
    #workbenchBlock {
        width: min(calc(100% - 24px), var(--container));
    }

    .demo-header { padding: 12px 16px; }
    .demo-header-inner { gap: 12px; }
    .demo-header-meta { display: flex; }

    .section, details.section,
    #configurationSection > h3,
    #configurationSection > h4,
    #configurationSection > .section-subhead,
    #configurationSection > #targetCountRow,
    #configurationSection > #streamInfo,
    #configurationSection > #createPane,
    #configurationSection > #reusePane,
    .workbench-header,
    .workbench-preview,
    .workbench-controls { padding: 14px; }

    .workbench-header { display: block; }
    .workbench-status {
        display: inline-block;
        margin-top: 10px;
        text-align: left;
        white-space: normal;
    }

    .grid-2col,
    .workbench-controls #despillAdvanced,
    .workbench-controls #eqFields,
    .despill-fields { grid-template-columns: 1fr !important; }
    .color-compact { grid-template-columns: 1fr; }
    .mode-tabs-row { flex-direction: column; }
    .mode-tab.left, .mode-tab.right { margin: 0 0 4px; }
    .btn-sm, .btn-xs, button { width: 100%; margin-right: 0; }
}
