/*
  render-the-lab.css — "The Lab" (SKIN-G03) Render layer
  token map aligned to BU-CORE-UIUX-001 §4.1, 2026-07-03
  ===========================================================================
  Fires when data-theme="the-lab". ARENA/GAMIFIED category (student-facing
  only per BUP-UI-THEME-001 Rule 2).

  SOURCING CLASS: [AUTHORED PROPOSAL -- pending owner approval; no source
  values existed]. BUP-UI-SKIN-002 SKIN-G03 (lines 61-65) describes this
  skin only in prose: "Dark background with sharp neon accents -- greens,
  cyans, or electric blues... command center or research facility." No hex
  values exist. This file authors a neon-cyan accent (distinct hue from the
  cobalt family so The Lab reads as visually separate from the Cobalt/Fight
  Night sibling pair, per the catalog's "neon accents" language, which names
  green/cyan/electric-blue as alternatives to cobalt, not a repeat of it).

  Contrast check (WCAG AA, BUP-UI-SKIN-001 L-9): text-primary #e6fffa on
  canvas #040a09 = ~18.6:1. text-secondary #8fd9cf on canvas = ~11.6:1 --
  passes 4.5:1 minimum.
  ===========================================================================
*/

:root[data-theme="the-lab"] {
  --theme-bg-canvas: #040a09;
  --theme-bg-surface: rgba(0, 255, 220, 0.04);
  --theme-bg-frosted: var(--theme-bg-surface); /* alias — dialect has no distinct frosted-fill token; §4.1 requires this name, value derived from bg-surface */
  --theme-bg-card: rgba(0, 255, 220, 0.07);
  --theme-x-bg-sunken: #040a09;
  --theme-border-inactive: rgba(0, 255, 220, 0.14);
  --theme-border-active: #00d9b8;

  --theme-text-main: #e6fffa;
  --theme-x-text-secondary: #8fd9cf;
  --theme-text-muted: #5fa89e;
  --theme-x-text-inverse: #040a09;
  --theme-x-text-disabled: #3a5a55;

  --theme-accent-primary: #00d9b8;
  --theme-accent-secondary: var(--theme-accent-primary); /* alias — no distinct secondary accent hue exists in sources; §4.1 requires this name */
  --theme-x-accent-hover: #33ffdd;
  --theme-x-accent-active: #00a68c;
  --theme-x-accent-disabled: rgba(0, 217, 184, 0.35);
  --theme-x-accent-text: #040a09;
  --theme-x-focus-ring: #00d9b8;

  --theme-state-healthy: #33ffdd;
  --theme-state-warning: #f2c94c;
  --theme-state-error: #ff5c5c;
  --theme-x-state-info: #00d9b8;

  --theme-x-elevation-1: 0 1px 2px rgba(0, 0, 0, 0.5);
  --theme-x-elevation-2: 0 0 24px rgba(0, 217, 184, 0.25);
  --theme-x-elevation-3: 0 0 20px rgba(0, 217, 184, 0.5);
  --theme-accent-glow: 0 0 20px rgba(0, 217, 184, 0.5); /* derived — same glow value as --theme-x-elevation-3 (measured/authored glow shadow); §4.1 requires this name */
  --theme-accent-glow-secondary: 0 0 20px rgba(0, 217, 184, 0.5); /* derived — no distinct secondary glow exists in sources; aliased to primary glow value */
  --theme-x-glass-tint: rgba(0, 255, 220, 0.04);
  --theme-backdrop-blur: 22px;

  --theme-x-font-family-base: var(--structure-font-family);
  --theme-x-font-size-sm: 0.875rem;
  --theme-x-font-size-base: 1rem;
  --theme-x-font-size-lg: 1.25rem;
  --theme-x-font-size-xl: 1.75rem;
  --theme-x-line-height-base: 1.5;
  --theme-x-space-unit: 0.5rem;
}

/* Structural selector list mirrors render-greyscale-skeleton.css / render-fight-night.css
   1:1 (R-S7-10 / D-S07-FW-01: structure never forks per skin — value-only skin). */
:root[data-theme="the-lab"] body {
  background-color: var(--theme-bg-canvas);
  color: var(--theme-text-main);
}

:root[data-theme="the-lab"] a {
  color: var(--theme-text-main);
}

:root[data-theme="the-lab"] h1,
:root[data-theme="the-lab"] h2,
:root[data-theme="the-lab"] h3,
:root[data-theme="the-lab"] h4,
:root[data-theme="the-lab"] h5,
:root[data-theme="the-lab"] h6 {
  color: var(--theme-text-main);
}

:root[data-theme="the-lab"] p,
:root[data-theme="the-lab"] li {
  color: var(--theme-x-text-secondary);
}

:root[data-theme="the-lab"] .bu-panel {
  background-color: var(--theme-bg-surface);
  border: 1px solid var(--theme-border-inactive);
  border-top: 2px solid var(--theme-border-active);
  border-bottom: 2px solid var(--theme-border-active);
  box-shadow: var(--theme-x-elevation-2);
  backdrop-filter: blur(var(--theme-backdrop-blur));
  -webkit-backdrop-filter: blur(var(--theme-backdrop-blur));
  color: var(--theme-text-main);
}

:root[data-theme="the-lab"] .bu-rail {
  background-color: rgba(4, 10, 9, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--theme-border-inactive);
  color: var(--theme-text-main);
}

:root[data-theme="the-lab"] .bu-soffit {
  border-top: 1px solid var(--theme-border-inactive);
  color: var(--theme-text-muted);
  font-size: var(--structure-text-sm, 0.875rem);
}

:root[data-theme="the-lab"] .bu-soffit a {
  color: var(--theme-text-muted);
}

:root[data-theme="the-lab"] .bu-soffit a:hover {
  color: var(--theme-text-main);
}

:root[data-theme="the-lab"] .bu-brick {
  color: var(--theme-x-text-secondary);
}

:root[data-theme="the-lab"] .bu-badge-tag {
  background-color: var(--theme-bg-card);
  border: 1px solid var(--theme-border-active);
  color: var(--theme-text-main);
}

:root[data-theme="the-lab"] .bu-control {
  background-color: var(--theme-bg-surface);
  border-color: var(--theme-border-active);
  color: var(--theme-text-main);
}

:root[data-theme="the-lab"] .bu-control:hover {
  background-color: var(--theme-x-accent-hover);
  color: var(--theme-x-text-inverse);
}

:root[data-theme="the-lab"] .bu-control:focus-visible {
  outline: 2px solid var(--theme-x-focus-ring);
  outline-offset: 2px;
}

:root[data-theme="the-lab"] .bu-btn {
  background-color: rgba(0, 255, 220, 0.12);
  border-top: 2px solid var(--theme-border-active);
  border-bottom: 2px solid var(--theme-border-active);
  border-left-color: transparent;
  border-right-color: transparent;
  color: var(--theme-x-accent-text);
}

:root[data-theme="the-lab"] .bu-btn:hover {
  background-color: rgba(0, 255, 220, 0.2);
  border-top-color: var(--theme-x-accent-hover);
  border-bottom-color: var(--theme-x-accent-hover);
}

:root[data-theme="the-lab"] .bu-btn:disabled {
  background-color: rgba(0, 255, 220, 0.04);
  border-top-color: var(--theme-x-accent-disabled);
  border-bottom-color: var(--theme-x-accent-disabled);
  color: var(--theme-x-text-disabled);
}

:root[data-theme="the-lab"] .bu-btn-secondary {
  background-color: transparent;
  border-color: var(--theme-border-active);
  color: var(--theme-text-main);
}

:root[data-theme="the-lab"] .bu-btn-secondary:hover {
  border-color: var(--theme-x-accent-hover);
  color: var(--theme-x-accent-hover);
}

/* PG-035 demo skin switcher active-selection state (D-S07-SKIN-02 switcher UI). */
:root[data-theme="the-lab"] .bu-btn-secondary.is-active {
  background-color: var(--theme-accent-primary);
  border-color: var(--theme-accent-primary);
  color: var(--theme-x-accent-text);
}

:root[data-theme="the-lab"] .bu-btn:focus-visible,
:root[data-theme="the-lab"] .bu-btn-secondary:focus-visible {
  outline: 2px solid var(--theme-x-focus-ring);
  outline-offset: 2px;
}

:root[data-theme="the-lab"] .bu-gate {
  background-color: var(--theme-x-glass-tint);
  backdrop-filter: blur(var(--theme-backdrop-blur));
}

/* Brand lockup accent: the "UP" half of BELT|UP carries the accent hue, the
   rest inherits .bu-nav-brand's text colour. Uniform across every skin per
   D-S07-SKIN-02 (no partial-skin fallthrough) — added 2026-08-21 when an audit
   found this styled in only 2 of 20 skins. Uses the standard accent token, NOT
   the lighter hover tone. */
:root[data-theme="the-lab"] .bu-nav-brand span {
  color: var(--theme-accent-primary);
}

/* ==== #234 CONSTRUCTION FAMILY BEGIN ==== (TELEMETRY HUD, family 2 of 8) ====
   Skin "the-lab" belongs to the TELEMETRY HUD construction family. Colour variants of one
   family share this construction and differ only in the variables above. */
/* family variables: derived from this skin's own palette; contrast pairs verified >= 4.5:1 (fill/ink), >= 3:1 (edge, focus) against the canvas */
:root[data-theme="the-lab"] {
  --fam-edge: #00d9b8;
  --fam-hi: #33ffdd;
  --fam-hov: #33ffdd;
  --fam-fill: #00d9b8;
  --fam-ink: #040a09;
  --fam-deep: #00574a;
  --fam-focus: #33ffdd;
  --fam-glow: color-mix(in srgb, #00d9b8 55%, transparent);
}

/* ===========================================================================
   CONSTRUCTION FAMILY 2 of 8 — TELEMETRY HUD  [#234 / R-0823-01 / R-0823-02]
   Reference: six-terminals.html 03 "Telemetry HUD -- brackets, negative space".
   Frame strategy: NO closed frame. Four open corner brackets, a three-bar
   scale ticker on the left edge and a dashed range ring top-right; the panel
   body is a near-transparent void so the page shows through.
   Light source: the type itself (text-shadow glow); lines are dim.
   Palette discipline: a single hot accent on gunmetal/black, nothing else.
   Type: monospace throughout, labels tracked ~0.3em, tiny.
   [PILLAR-1: cognitive load -- negative space and an open frame remove chrome
   the reader has to parse; Fitts: the ring/ticks sit in the corner, off the
   reading path.]
   =========================================================================== */
:root[data-theme="the-lab"] body {
  font-family: var(--structure-font-family-mono);
  background-image: radial-gradient(color-mix(in srgb, var(--fam-edge) 16%, transparent) 1px, transparent 1.4px);
  background-size: 28px 28px;
}
:root[data-theme="the-lab"] .bu-panel {
  border: 0;
  border-radius: 0;
  isolation: isolate;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  background-color: color-mix(in srgb, var(--theme-bg-canvas) 82%, transparent);
  background-image:
    linear-gradient(var(--fam-edge), var(--fam-edge)), linear-gradient(var(--fam-edge), var(--fam-edge)),
    linear-gradient(var(--fam-edge), var(--fam-edge)), linear-gradient(var(--fam-edge), var(--fam-edge)),
    linear-gradient(var(--fam-edge), var(--fam-edge)), linear-gradient(var(--fam-edge), var(--fam-edge)),
    linear-gradient(var(--fam-edge), var(--fam-edge)), linear-gradient(var(--fam-edge), var(--fam-edge));
  background-repeat: no-repeat;
  background-position: left top, left top, right top, right top, left bottom, left bottom, right bottom, right bottom;
  background-size: 26px 2px, 2px 26px, 26px 2px, 2px 26px, 26px 2px, 2px 26px, 26px 2px, 2px 26px;
}
/* extra inset only on ordinary panels: the Admin slide-outs keep their tuned padding */
:root[data-theme="the-lab"] .bu-panel:not(.bu-drawer):not(.bu-slideout-content):not(.bu-report-widget-panel) { padding: calc(var(--structure-gap-lg, 1.5rem) + 6px); }
/* left-edge scale ticker: three bars of unequal length (reference tick rects) */
:root[data-theme="the-lab"] .bu-panel::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 42%;
  width: 14px;
  height: 14px;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(var(--fam-edge), var(--fam-edge)) 0 0 / 14px 2px no-repeat,
    linear-gradient(var(--fam-edge), var(--fam-edge)) 0 6px / 8px 2px no-repeat,
    linear-gradient(var(--fam-edge), var(--fam-edge)) 0 12px / 14px 2px no-repeat;
  opacity: 0.8;
}
/* dashed range ring, top-right, kept inside the panel box */
:root[data-theme="the-lab"] .bu-panel::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 14px;
  width: 54px;
  height: 54px;
  z-index: -1;
  pointer-events: none;
  border: 1px dashed var(--fam-edge);
  border-radius: 50%;
  opacity: 0.5;
}
:root[data-theme="the-lab"] h1, :root[data-theme="the-lab"] h2, :root[data-theme="the-lab"] h3, :root[data-theme="the-lab"] h4 { font-family: var(--structure-font-family-mono); font-weight: 500; letter-spacing: 0.04em; overflow-wrap: break-word; }
:root[data-theme="the-lab"] .bu-panel h2, :root[data-theme="the-lab"] .bu-panel h3, :root[data-theme="the-lab"] .bu-panel-title, :root[data-theme="the-lab"] .bu-panel-headline {
  text-transform: uppercase;
  text-shadow: 0 0 12px color-mix(in srgb, var(--fam-edge) 55%, transparent);
}
:root[data-theme="the-lab"] .bu-panel-sublabel, :root[data-theme="the-lab"] .bu-badge-tag, :root[data-theme="the-lab"] .bu-metric-label, :root[data-theme="the-lab"] .bu-panel-footnote, :root[data-theme="the-lab"] .bu-gauge-label {
  font-family: var(--structure-font-family-mono);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: var(--structure-text-xs, 0.75rem);
  color: var(--fam-hi);
}
:root[data-theme="the-lab"] .bu-badge-tag { background: transparent; border: 0; border-left: 2px solid var(--fam-edge); border-radius: 0; padding-left: 0.6rem; }
:root[data-theme="the-lab"] .bu-metric-value, :root[data-theme="the-lab"] .bu-gauge-value { font-family: var(--structure-font-family-mono); text-shadow: 0 0 10px color-mix(in srgb, var(--fam-edge) 50%, transparent); }
:root[data-theme="the-lab"] .bu-rail {
  border-bottom: 1px dashed color-mix(in srgb, var(--fam-edge) 55%, transparent);
  font-family: var(--structure-font-family-mono);
}
:root[data-theme="the-lab"] .bu-nav-links a { letter-spacing: 0.1em; text-transform: uppercase; font-size: var(--structure-text-sm, 0.875rem); }
:root[data-theme="the-lab"] .bu-nav-links a:hover, :root[data-theme="the-lab"] .bu-nav-links a.active {
  color: var(--fam-hi);
  text-decoration: underline dotted;
  text-underline-offset: 8px;
  text-decoration-color: var(--fam-edge);
}
/* primary: solid slab with a thick lead edge; secondary: open brackets only */
:root[data-theme="the-lab"] .bu-btn {
  background: var(--fam-fill);
  border: 0;
  border-left: 4px solid var(--fam-hi);
  border-radius: 0;
  color: var(--fam-ink);
  font-family: var(--structure-font-family-mono);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: none;
}
:root[data-theme="the-lab"] .bu-btn:hover { background: var(--fam-hov); color: var(--fam-ink); box-shadow: 0 0 14px -2px var(--fam-glow); }
:root[data-theme="the-lab"] .bu-btn-secondary {
  background:
    linear-gradient(var(--fam-edge), var(--fam-edge)) left top / 10px 1px no-repeat,
    linear-gradient(var(--fam-edge), var(--fam-edge)) left top / 1px 10px no-repeat,
    linear-gradient(var(--fam-edge), var(--fam-edge)) right top / 10px 1px no-repeat,
    linear-gradient(var(--fam-edge), var(--fam-edge)) right top / 1px 10px no-repeat,
    linear-gradient(var(--fam-edge), var(--fam-edge)) left bottom / 10px 1px no-repeat,
    linear-gradient(var(--fam-edge), var(--fam-edge)) left bottom / 1px 10px no-repeat,
    linear-gradient(var(--fam-edge), var(--fam-edge)) right bottom / 10px 1px no-repeat,
    linear-gradient(var(--fam-edge), var(--fam-edge)) right bottom / 1px 10px no-repeat;
  border: 0;
  border-radius: 0;
  color: var(--fam-hi);
  font-family: var(--structure-font-family-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
:root[data-theme="the-lab"] .bu-btn-secondary:hover { background-color: color-mix(in srgb, var(--fam-edge) 14%, transparent); color: var(--fam-hi); }
:root[data-theme="the-lab"] .bu-btn-secondary.is-active { background: var(--fam-fill); border-left: 4px solid var(--fam-hi); color: var(--fam-ink); }
:root[data-theme="the-lab"] .bu-control, :root[data-theme="the-lab"] .bu-field input[type="text"], :root[data-theme="the-lab"] .bu-field input[type="email"], :root[data-theme="the-lab"] .bu-field input[type="tel"],
:root[data-theme="the-lab"] .bu-field input[type="password"], :root[data-theme="the-lab"] .bu-field input[type="number"], :root[data-theme="the-lab"] .bu-field select, :root[data-theme="the-lab"] .bu-field textarea,
:root[data-theme="the-lab"] input.bu-input, :root[data-theme="the-lab"] select.bu-input, :root[data-theme="the-lab"] textarea.bu-input {
  background: transparent;
  border: 0;
  border-left: 2px solid var(--fam-edge);
  border-bottom: 1px solid var(--fam-edge);
  border-radius: 0;
  color: var(--theme-text-main);
  font-family: var(--structure-font-family-mono);
}
:root[data-theme="the-lab"] .bu-control:hover, :root[data-theme="the-lab"] .bu-field input:hover, :root[data-theme="the-lab"] .bu-field select:hover, :root[data-theme="the-lab"] .bu-field textarea:hover { background: color-mix(in srgb, var(--fam-edge) 10%, transparent); color: var(--theme-text-main); border-color: var(--fam-hi); }
:root[data-theme="the-lab"] .bu-table th, :root[data-theme="the-lab"] .bu-table td { border-bottom: 1px dashed color-mix(in srgb, var(--fam-edge) 40%, transparent); font-family: var(--structure-font-family-mono); }
:root[data-theme="the-lab"] .bu-table th { text-transform: uppercase; letter-spacing: 0.2em; font-weight: 500; }
:root[data-theme="the-lab"] .bu-progress-track { background-image: repeating-linear-gradient(90deg, transparent 0 8px, var(--theme-bg-canvas) 8px 10px); }

/* --- shared floors every family honours (state tokens, focus, option list) --- */
:root[data-theme="the-lab"] .bu-field select option,
:root[data-theme="the-lab"] select.bu-input option {
  background-color: var(--theme-bg-canvas);
  color: var(--theme-text-main);
}
:root[data-theme="the-lab"] .bu-btn:focus-visible,
:root[data-theme="the-lab"] .bu-btn-secondary:focus-visible,
:root[data-theme="the-lab"] .bu-control:focus-visible,
:root[data-theme="the-lab"] .bu-field input:focus-visible,
:root[data-theme="the-lab"] .bu-field select:focus-visible,
:root[data-theme="the-lab"] .bu-field textarea:focus-visible,
:root[data-theme="the-lab"] .bu-input:focus-visible,
:root[data-theme="the-lab"] .bu-nav-links a:focus-visible,
:root[data-theme="the-lab"] .bu-tab-btn:focus-visible {
  outline: 2px solid var(--fam-focus);
  outline-offset: 2px;
}
:root[data-theme="the-lab"] .bu-btn:disabled,
:root[data-theme="the-lab"] .bu-btn-secondary:disabled {
  background: transparent;
  border-color: var(--theme-x-accent-disabled);
  color: var(--theme-x-text-disabled);
  box-shadow: none;
  filter: none;
}
:root[data-theme="the-lab"] .bu-status-dot.is-healthy { background: var(--theme-state-healthy); }
:root[data-theme="the-lab"] .bu-status-dot.is-warning,
:root[data-theme="the-lab"] .bu-status-dot.is-alert { background: var(--theme-state-warning); }
:root[data-theme="the-lab"] .bu-status-dot.is-error { background: var(--theme-state-error); }
:root[data-theme="the-lab"] .bu-field-error { color: var(--theme-state-error); }
/* --- overlay / scroll-container panels (Admin drawers, slide-outs, the report widget) ---
   A family frame is drawn on pseudo-elements and a plate that would scroll away with the
   content, and some panel margins would leave a closed drawer peeking in. Overlay panels
   therefore get a solid attached fill, one plain outline, no pseudo frame, no clip. */
:root[data-theme="the-lab"] .bu-drawer, :root[data-theme="the-lab"] .bu-slideout-content, :root[data-theme="the-lab"] .bu-report-widget-panel {
  clip-path: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background-color: var(--theme-bg-canvas);
  background-image: linear-gradient(var(--theme-bg-surface), var(--theme-bg-surface));
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: 0 0;
  border: 1px solid var(--fam-edge);
  box-shadow: none;
  isolation: auto;
}
:root[data-theme="the-lab"] .bu-drawer::before, :root[data-theme="the-lab"] .bu-drawer::after,
:root[data-theme="the-lab"] .bu-slideout-content::before, :root[data-theme="the-lab"] .bu-slideout-content::after,
:root[data-theme="the-lab"] .bu-report-widget-panel::before, :root[data-theme="the-lab"] .bu-report-widget-panel::after { content: none; }

@media (prefers-reduced-motion: reduce) {
  :root[data-theme="the-lab"] .bu-btn, :root[data-theme="the-lab"] .bu-btn-secondary { transition: none; transform: none; }
}
:root[data-reduced-motion="true"][data-theme="the-lab"] .bu-btn,
:root[data-reduced-motion="true"][data-theme="the-lab"] .bu-btn-secondary { transition: none; transform: none; }
/* ==== #234 CONSTRUCTION FAMILY END ==== */
