/* ==========================================================
   NU-FX SLIDER FINAL CORRECTIONS — ui.css
   Based on the currently installed version (slider repair build).
   Two corrections only:
   1. KNOB NEVER DISAPPEARS: the active state now layers the
      highlight image OVER the normal image, so even if the
      highlighted asset fails to load, the normal knob remains
      visible during interaction.
   2. ONE SCALE ONLY: the slot is rendered with a top-half crop
      (background-size 100% 200%, anchored top), which shows the
      groove region of the slot graphic and clips its baked-in
      lower marked strip — the CSS measurement ruler remains the
      single, knob-aligned scale. (If the slot asset is groove-only
      with no baked marks, restore 100% 100% — one line per rule.)
   All dimensions, positioning, and behavior otherwise unchanged.

   REFRACT SLOT CORRECTION 001 (appended): the REFRACT primary
   slider's slot is reduced to ~6px tall; knob size, marks, and
   travel unchanged; the other 15 sliders are untouched.
   ========================================================== */

/* ---- uploaded fonts (paths relative to css/ui.css) ---- */
@font-face{
  font-family:"Montserrat";
  src:url("../app_images/font/Montserrat/Montserrat-Regular.ttf") format("truetype");
  font-weight:400;
  font-style:normal;
}
@font-face{
  font-family:"Montserrat";
  src:url("../app_images/font/Montserrat/Montserrat-VariableFont_wght.ttf") format("truetype");
  font-weight:100 900;
  font-style:normal;
}
@font-face{
  font-family:"Montserrat";
  src:url("../app_images/font/Montserrat/Montserrat-Italic-VariableFont_wght.ttf") format("truetype");
  font-weight:100 900;
  font-style:italic;
}
@font-face{
  font-family:"DS-Digital";
  src:url("../app_images/font/DS-Digital/DS-DIGI.TTF") format("truetype");
  font-weight:400;
  font-style:normal;
}
@font-face{
  font-family:"DS-Digital";
  src:url("../app_images/font/DS-Digital/DS-DIGIB.TTF") format("truetype");
  font-weight:700;
  font-style:normal;
}
@font-face{
  font-family:"DS-Digital";
  src:url("../app_images/font/DS-Digital/DS-DIGII.TTF") format("truetype");
  font-weight:400;
  font-style:italic;
}
@font-face{
  font-family:"DS-Digital";
  src:url("../app_images/font/DS-Digital/DS-DIGIT.TTF") format("truetype");
  font-weight:700;
  font-style:italic;
}

:root{
  --bg:#111111;
  --panel:#151515;
  --panel2:#1a1a1a;
  --panel3:#202020;
  --edge:#303030;
  --edge2:#424242;
  --text:#919191;
  --soft:#838383;
  --muted:#666666;
  --blue:#1768f0;
  --blue2:#2f6fff;
  --red:#e94b55;
  --black:#090909;
  /* SLIDER REPAIR: half-thumb insets so ruler marks follow the
     knob-CENTER travel path exactly (REFRACT and LAB thumbs 28px -> 14px). */
  --slider-inset-refract:14px;
  --slider-inset-lab:14px;
}

*{box-sizing:border-box}
html,body{
  margin:0;
  min-height:100%;
  background:var(--bg);
  color:var(--text);
  font-family:Montserrat,"Segoe UI",Arial,sans-serif;
}
button,input{font:inherit}
button{color:inherit}
.app-page{
  height:100vh;
  min-height:100vh;
  overflow:hidden;
  display:grid;
  grid-template-rows:86px minmax(0,1fr) 44px;
}

/* ==========================================================
   HEADER — copied to donor CG-FX geometry
   ========================================================== */
.topbar{
  height:86px;
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  padding:10px 18px;
  border-bottom:1px solid #181818;
  background:#101010;
}
.brand{display:flex;align-items:center;min-width:0}
.brand-mark{
  width:58px;height:58px;border-radius:50%;display:grid;place-items:center;
  margin-right:12px;overflow:hidden;
}
.brand-mark img{width:58px;height:58px;object-fit:contain;display:block}
.brand-copy{width:260px;min-width:0}
.brand-title{
  font-size:15px;font-weight:800;letter-spacing:.04em;color:#969696;white-space:nowrap
}
.brand-rule{height:1px;width:150px;background:#858585;margin:7px 0 3px 2px}
.brand-subtitle{font-size:14px;font-style:italic;color:#6f6f6f}

.header-center{
  display:flex;
  align-items:center;
  gap:14px;
  justify-self:center;
}
.status-cluster{
  width:226px;
  min-width:226px;
  max-width:226px;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:12px;
}
.status-led{
  width:64px !important;
  height:64px !important;
  min-width:64px !important;
  min-height:64px !important;
  max-width:64px !important;
  max-height:64px !important;
  flex:0 0 64px !important;
  display:inline-block;
  border-radius:50%;
  background-color:transparent;
  background-image:url("../app_images/LED/ready_LED.png");
  background-repeat:no-repeat;
  background-position:center;
  background-size:64px 64px;
}
.status-led.ready{
  background-image:url("../app_images/LED/ready_LED.png");
}
.status-led.processing{
  background-image:url("../app_images/LED/processing_LED.png");
}
.status-led.rendered{
  background-image:url("../app_images/LED/rendered_LED.png");
}
.status-readout{
  width:150px;
  min-width:150px;
  max-width:150px;
  height:36px;
  flex:0 0 150px;
  display:grid;
  place-items:center;
  white-space:nowrap;
  overflow:hidden;
  text-align:center;
  border:1px solid #222;
  background:#080808;
  color:var(--blue2);
  padding:0 12px;
  font-family:Consolas,monospace;
  font-size:15px;
  font-weight:700;
  letter-spacing:.04em;
}
.tune-readout{
  width:150px;
  min-width:150px;
  max-width:150px;
  height:36px;
  display:grid;
  place-items:center;
  background:#08090b;
  border:1px solid #5a1f26;
  color:var(--red);
  padding:0 12px;
  font:700 15px Consolas,monospace;
  letter-spacing:.04em;
  white-space:nowrap;
}
.top-nav{justify-self:end;display:flex;gap:8px}
.top-nav .home-link{
  display:block;
  width:52px;
  height:52px;
  padding:0;
  border:0;
  background:transparent;
  box-shadow:none;
}
.top-nav .home-link img{
  display:block;
  width:52px;
  height:52px;
  object-fit:contain;
}

/* ==========================================================
   MAIN DONOR GEOMETRY
   ========================================================== */
.neuro-image-layout{
  display:grid;
  grid-template-columns:440px minmax(0,1fr);
  height:100%;
  min-height:0;
  min-width:0;
}
.control-shell{
  margin:0 0 0 14px;
  border:1px solid var(--edge);
  background:#111;
  overflow:hidden;
  min-width:0;
}
.control-scroll{
  height:100%;
  overflow-y:scroll;
  overflow-x:hidden;
  padding:8px 14px 20px;
  scrollbar-color:#3b3f46 #111;
  scrollbar-width:thin;
}
.control-scroll::-webkit-scrollbar{width:10px}
.control-scroll::-webkit-scrollbar-track{background:#111}
.control-scroll::-webkit-scrollbar-thumb{background:#353941;border:1px solid #4b4f57}
.control-scroll::-webkit-scrollbar-thumb:hover{background:#454b55}

/* ==========================================================
   LEFT PANEL — donor row geometry
   ========================================================== */
.drawer{
  border:1px solid #36373b;
  background:#1c1d20;
  margin:0 0 10px;
}
.drawer-head{
  width:100%;
  min-height:32px;
  border:0;
  background:#232427;
  display:grid;
  grid-template-columns:20px 28px minmax(0,1fr) auto 22px;
  align-items:center;
  gap:9px;
  padding:5px 16px;
  color:#bdbdbd;
}
.arrow{
  width:20px;
  font-size:20px;
  line-height:1;
  text-align:center;
  color:#e4e4e4;
}
.drawer-bullet{
  width:20px;
  font-size:12px;
  line-height:1;
  text-align:center;
  color:#e4e4e4;
}
.re-chassis-head[role="button"]{cursor:pointer}
.re-chassis-head[role="button"]:focus-visible{outline:1px solid #5d7bff;outline-offset:-2px}
.mini-led{
  width:24px;
  height:24px;
  min-width:24px;
  min-height:24px;
  display:block;
  background-image:url("../app_images/LED_cat/LED_cat-off.png");
  background-repeat:no-repeat;
  background-position:center;
  background-size:24px 24px;
}
.mini-led.on{
  background-image:url("../app_images/LED_cat/LED_cat-on.png");
}
.drawer-title{
  min-width:0;
  font-size:12px;
  font-weight:800;
  letter-spacing:.04em;
  line-height:1.15;
  color:#a7a7a7;
  text-align:left;
}
.import-command{
  border:0;
  background:transparent;
  padding:0;
  cursor:pointer;
  color:var(--blue2);
}
.import-command:hover{color:#6f9bff}
.info-dot{
  width:22px;
  height:22px;
  border:1px solid #444;
  border-radius:50%;
  display:inline-grid;
  place-items:center;
  font-family:Montserrat,"Segoe UI",Arial,sans-serif;
  font-size:13px;
  color:#aaa;
}
.image-file-readout{
  box-sizing:border-box;
  width:154px;
  min-width:154px;
  max-width:210px;
  min-height:23px;
  padding:4px 8px;
  background:#08090B;
  border:1px solid #2C2D31;
  font-family:Consolas,"Courier New",monospace;
  font-size:11px;
  font-weight:700;
  letter-spacing:.33px;
  color:var(--blue2);
  text-align:center;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* ==========================================================
   AUXILIARY POWER 2 — shell-only donor chassis
   ========================================================== */
.re-root.re-paradigm{
  border:1px solid #3a3b3f;
  background:#161719;
  box-shadow:none;
  margin:0;
}
.re-root-head{
  position:relative;
  padding:0;
  border-bottom:0;
  background:#161719;
}
.re-chassis-head{
  min-height:34px !important;
  padding:5px 16px !important;
  gap:9px !important;
  background:#232427;
}
.re-breaker{
  width:92px;
  min-width:92px;
  height:37px;
  display:grid;
  place-items:center;
  overflow:hidden;
}
.re-breaker img{
  width:92px;
  height:37px;
  object-fit:fill;
  display:block;
}
.re-root-body{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:6px;
}
.re-root-body[hidden]{display:none !important;}
.re-param-body{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:10px;
  background:#1a1b1e;
  border-top:1px solid #2c2d31;
}
.re-param-line{display:block;margin:0}

/* ---- SLIDER FINAL: REFRACT / FX sliders ----
   ONE groove: the slot is top-cropped (top half of the asset) so
   any baked-in lower marked strip is clipped away; the CSS ruler
   below is the single measurement scale. Knob 28px centered on a
   24px track. Active state layers the highlight OVER the normal
   image, so the knob can never disappear. */
.re-param-slider{
  -webkit-appearance:none;
  appearance:none;
  display:block;
  width:100%;
  height:30px;
  margin:0;
  background:transparent;
  border:0;
  box-shadow:none;
}
.re-param-slider::-webkit-slider-runnable-track{
  height:24px;
  background:transparent url("../app_images/slider/slot.png") center top / 100% 200% no-repeat;
  border:0;
}
.re-param-slider::-webkit-slider-thumb{
  -webkit-appearance:none;
  appearance:none;
  width:28px;
  height:28px;
  margin-top:calc((24px - 28px) / 2);
  border:0;
  background-color:transparent;
  background-image:url("../app_images/slider/knob_normal.png");
  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;
  filter:drop-shadow(0 0 4px rgba(93,123,255,.35));
}
.re-param-slider:active::-webkit-slider-thumb{
  background-image:url("../app_images/slider/knob_highlighted.png"), url("../app_images/slider/knob_normal.png");
  background-size:contain, contain;
  background-repeat:no-repeat, no-repeat;
  background-position:center, center;
}
.re-param-slider::-moz-range-track{
  height:24px;
  background:transparent url("../app_images/slider/slot.png") center top / 100% 200% no-repeat;
  border:0;
}
.re-param-slider::-moz-range-thumb{
  width:28px;
  height:28px;
  margin-top:calc((24px - 28px) / 2);
  border:0;
  background-color:transparent;
  background-image:url("../app_images/slider/knob_normal.png");
  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;
  filter:drop-shadow(0 0 4px rgba(93,123,255,.35));
}
.re-param-slider:active::-moz-range-thumb{
  background-image:url("../app_images/slider/knob_highlighted.png"), url("../app_images/slider/knob_normal.png");
  background-size:contain, contain;
  background-repeat:no-repeat, no-repeat;
  background-position:center, center;
}

/* ---- SLIDER FINAL: measurement rulers ----
   ONE ruler per slider. The pseudo-element IS the inset tick box:
   its side margins equal exactly half the thumb width, so gradient
   percentages resolve against the true knob-center travel path.
   0%/100% marks sit under the knob centers at MIN/MAX; majors every
   25%, minors every 5%. A top gap separates the ruler from the slot;
   the VALUE readout strip below is separated from the ruler. */
.slider-scale{pointer-events:none;line-height:0}
.slider-scale::before{
  content:"";
  display:block;
  height:9px;
  margin:4px var(--slider-inset-refract) 0;
  background:
    repeating-linear-gradient(90deg,#56575c 0,#56575c 1px,transparent 1px,transparent 25%) top / 100% 9px no-repeat,
    repeating-linear-gradient(90deg,#393a3e 0,#393a3e 1px,transparent 1px,transparent 5%) top / 100% 5px no-repeat;
}
/* lab sliders use the same thumb inset as REFRACT (28px thumb -> 14px) */
#labGroups .slider-scale::before{
  margin:4px var(--slider-inset-lab) 0;
  height:7px;
  background:
    repeating-linear-gradient(90deg,#56575c 0,#56575c 1px,transparent 1px,transparent 25%) top / 100% 7px no-repeat,
    repeating-linear-gradient(90deg,#393a3e 0,#393a3e 1px,transparent 1px,transparent 5%) top / 100% 4px no-repeat;
}

.re-param-strip{
  display:flex;
  align-items:center;
  gap:6px;
  margin-top:6px;
}
.re-param-bookend{
  flex:none;
  width:12px;
  text-align:center;
  color:#8e8e8e;
  font:700 15px Montserrat,"Segoe UI",Arial,sans-serif;
}
.re-param-value{
  flex:1 1 0;
  width:auto;
  min-width:0;
  height:24px;
  line-height:22px;
  box-sizing:border-box;
  padding:0 6px;
  text-align:right;
  background:#08090b;
  border:1px solid #2c2d31;
  color:#6d8bff;
  font:700 13px Consolas,monospace;
  letter-spacing:.04em;
  overflow:hidden;
  white-space:nowrap;
}
.cg-calib-save{
  display:block;
  width:100%;
  min-height:28px;
  margin-top:0;
  border:1px solid #333;
  background:transparent;
  color:#858585;
  font-size:10px;
  font-weight:800;
}
.aux-preview-well{
  width:100%;
  height:176px;
  margin-top:0;
  border:1px solid #202020;
  background:#030303;
}

/* ==========================================================
   RENDER — donor padding / frame behavior
   ========================================================== */
.render-stage{
  min-width:0;
  min-height:0;
  display:flex;
  align-items:stretch;
  justify-content:stretch;
  padding:10px 14px 10px 12px;
  background:#111;
}
.render-frame{
  position:relative;
  width:100%;
  height:100%;
  min-width:0;
  min-height:0;
  overflow:hidden;
  border:1px solid #303030;
  background:#090909;
  display:flex;
  align-items:center;
  justify-content:center;
}
.source-image{
  display:block;
  max-width:100%;
  max-height:100%;
  width:auto;
  height:auto;
  object-fit:contain;
}
.empty-state{
  text-align:center;
  color:#454d55;
  pointer-events:none;
}
.empty-title{
  font-size:72px;
  font-weight:700;
  letter-spacing:.18em;
}
.empty-copy{
  margin-top:12px;
  font-size:10px;
  letter-spacing:.14em;
}
.corner-view-tag{
  position:absolute;
  right:10px;
  bottom:10px;
  border:1px solid #303030;
  background:rgba(0,0,0,.65);
  padding:5px 8px;
  font-size:10px;
  font-weight:800;
  color:#8a8a8a;
}

/* ==========================================================
   BOTTOM UTILITY STRIP — no extra footer
   ========================================================== */
.utility-strip{
  height:44px;
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  padding:0 18px;
  gap:8px;
  background:#111;
  border-top:1px solid #181818;
}
.utility-divider,.utility-dash{color:#525252;margin:0 4px}
.utility-label{font-size:11px;font-weight:800;color:#777}
.utility-button,.view-toggle{
  border:1px solid #2a2a2a;
  background:transparent;
  color:#7f7f7f;
  padding:7px 12px;
  font-size:11px;
  font-weight:800;
  cursor:pointer;
}
.view-toggle{
  padding:5px 9px;
  border:0;
}
.view-toggle.active{color:var(--blue2)}
.utility-button:hover,.view-toggle:hover{
  color:#aaa;border-color:#3c3c3c;background:#181818
}
.utility-button:disabled{
  opacity:.55;
  cursor:default;
}
.filename{
  margin-left:auto;
  color:#666;
  font-size:11px;
  max-width:280px;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}

/* donor breakpoints */
@media (max-width:1100px){
  .neuro-image-layout{grid-template-columns:330px minmax(0,1fr)}
}
@media (max-width:980px){
  .neuro-image-layout{grid-template-columns:270px minmax(0,1fr)}
}
@media (max-width:760px){
  body{overflow:auto}
  .app-page{height:auto;display:block}
  .topbar{grid-template-columns:1fr auto;height:auto;gap:10px}
  .header-center{
  display:flex;
  align-items:center;
  gap:14px;
  justify-self:center;
}
  .top-nav{grid-column:1/-1;justify-self:end}
  .neuro-image-layout{grid-template-columns:1fr;height:auto}
  .control-shell{margin:0 14px}
  .render-stage{height:60vh;min-height:420px}
}


/* force slight vertical overflow so the panel shows its slider like CG-FX */
.control-scroll::after{content:"";display:block;height:240px;}

.utility-spacer{justify-self:start}
.utility-center-group{
  justify-self:center;
  display:flex;
  align-items:center;
  gap:8px;
}
.utility-right{
  justify-self:end;
  display:flex;
  align-items:center;
  min-width:0;
}
.filename{
  margin-left:0;
  color:#666;
  font-size:11px;
  max-width:280px;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  text-align:right;
}


/* LEFT PANEL BLUE TAPERED LIGHT SEPARATORS */
.blue-separator{
  position:relative;
  height:12px;
  margin:2px 6px 7px;
  border:0;
  overflow:hidden;
}
.blue-separator::before{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top:5px;
  height:1px;
  background:linear-gradient(
    90deg,
    rgba(23,104,240,0) 0%,
    rgba(23,104,240,.28) 8%,
    rgba(47,111,255,.95) 28%,
    rgba(47,111,255,1) 50%,
    rgba(47,111,255,.95) 72%,
    rgba(23,104,240,.28) 92%,
    rgba(23,104,240,0) 100%
  );
  box-shadow:0 0 5px rgba(47,111,255,.22);
}

/* REFRACT category title uses the same muted-white label tone. */
.re-chassis-head > .drawer-title{
  color:#9fa8b9;
}

/* ==========================================================
   R10 VIEWPORT — ZOOM / PAN / BEFORE-AFTER COMPARE
   ========================================================== */
.render-frame{
  touch-action:none;
  user-select:none;
  cursor:default;
}
.render-frame.is-zoomed{cursor:grab;}
.render-frame.is-panning{cursor:grabbing;}
.viewport-surface{
  position:absolute;
  inset:0;
  transform-origin:center center;
  will-change:transform;
}
.viewport-surface[hidden]{display:none;}
.source-image{
  position:absolute;
  inset:0;
  display:block;
  width:100%;
  height:100%;
  max-width:none;
  max-height:none;
  object-fit:contain;
  pointer-events:none;
}
.after-clip{
  position:absolute;
  inset:0;
  overflow:hidden;
  clip-path:inset(0 0 0 0);
  pointer-events:none;
}
.compare-divider{
  position:absolute;
  top:0;
  bottom:0;
  left:100%;
  width:2px;
  transform:translateX(-1px);
  background:rgba(225,225,225,.82);
  box-shadow:0 0 0 1px rgba(0,0,0,.4), 0 0 12px rgba(0,0,0,.45);
  z-index:8;
  cursor:ew-resize;
  touch-action:none;
}
.compare-divider[hidden]{display:none;}
.compare-handle{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border:1px solid #5a5a5a;
  border-radius:50%;
  background:rgba(9,9,9,.88);
  color:#8aa7ff;
  font:600 16px Montserrat,"Segoe UI",Arial,sans-serif;
  box-shadow:0 0 0 2px rgba(0,0,0,.45);
}
.compare-divider:focus-visible .compare-handle{
  outline:1px solid var(--blue2);
  outline-offset:2px;
}
.save-shell:not(:disabled){
  color:#8f8f8f;
  border-color:#343434;
}
.save-shell:not(:disabled):hover{
  color:#c5c5c5;
  border-color:#4a4a4a;
}

/* R11 — NU-FX title artwork */
.brand-mark {
  width: 220px;
  height: 58px;
  display: flex;
  align-items: center;
  overflow: visible;
}

.brand-mark img {
  width: 100%;
  height: auto;
  max-height: 58px;
  object-fit: contain;
  object-position: left center;
  display: block;
}

.brand-copy {
  display: none;
}

/* R13 — REFRACT mask controls */
.mask-tools{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:7px;
  margin-top:4px;
}

#loadMaskButton{
  grid-column:1 / -1;
}

.mask-tool-button{
  min-height:30px;
  border:1px solid #33383f;
  background:#111317;
  color:#8f969f;
  padding:6px 8px;
  font-family:Montserrat,"Segoe UI",Arial,sans-serif;
  font-size:10px;
  font-weight:700;
  letter-spacing:.05em;
  cursor:pointer;
}

.mask-tool-button:hover:not(:disabled){
  color:#c2d7ff;
  border-color:#455b88;
  background:#151922;
}

.mask-tool-button:disabled{
  opacity:.36;
  cursor:default;
}

.mask-tool-button.active{
  color:#6d8bff;
  border-color:#4764b8;
}

.reset-category-button{
  grid-column:auto;
}

/* RESET CATEGORY (work order 11-14 #1): ALGORITHM LAB reset button
   spans the full mask-tools row, same convention as #loadMaskButton. */
#labResetCategoryButton{
  grid-column:1 / -1;
}


/* R19 — click-only INFO panels, positioned to the right of each INFO icon */
.re-chassis-head{position:relative;}
.info-icon-button{
  width:24px;
  height:24px;
  min-width:24px;
  padding:0;
  border:0;
  background:transparent;
  display:grid;
  place-items:center;
  cursor:pointer;
}
.info-icon-button img{
  display:block;
  width:22px;
  height:22px;
  object-fit:contain;
}
.info-icon-button:focus-visible{
  outline:1px solid var(--blue2);
  outline-offset:2px;
}
.info-tooltip{
  position:fixed;
  z-index:1000;
  width:460px;
  max-width:calc(100vw - 24px);
  padding:18px 20px;
  border:1px solid #46515f;
  background:#11151b;
  color:#c9cdd2;
  font-family:Montserrat,"Segoe UI",Arial,sans-serif;
  font-size:15px;
  line-height:1.65;
  font-weight:400;
  letter-spacing:.01em;
  box-shadow:0 10px 28px rgba(0,0,0,.72);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}
.info-tooltip strong{
  color:#d7dadd;
  font-family:Montserrat,"Segoe UI",Arial,sans-serif;
  font-size:15px;
  line-height:1.35;
  font-weight:600;
  letter-spacing:.06em;
}
.info-tooltip.is-open{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}

/* R22 — typography contract: Montserrat everywhere except digital readouts */
.info-tooltip{
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
.info-tooltip strong{font-weight:600;}


/* R24 — illustrated INFO blurbs */
.info-tooltip.info-blurb{
  width:540px;
  max-width:calc(100vw - 24px);
  padding:0;
  border:0;
  background:transparent;
  box-shadow:0 14px 34px rgba(0,0,0,.62);
  overflow:hidden;
}
.info-tooltip.info-blurb img{
  display:block;
  width:100%;
  height:auto;
  max-height:78vh;
  object-fit:contain;
}

/* R25 — UPLOAD VIDEO placeholder; visual structure only, no upload wiring. */
.video-upload-head{
  grid-template-columns:20px 28px minmax(0,1fr);
  cursor:pointer;
  list-style:none;
}
.video-upload-head::-webkit-details-marker{display:none;}
.video-upload-head .drawer-title{color:var(--blue2);}
.video-upload-head:focus-visible{outline:1px solid var(--blue2);outline-offset:-2px;}
.video-upload-drawer:not([open]) .video-upload-head .arrow{transform:rotate(-90deg);}
.video-upload-options{
  display:flex;
  flex-direction:column;
  padding:6px 12px 8px 55px;
  border-top:1px solid #33363d;
  background:#1a1b1e;
}
.video-upload-option{
  padding:9px 4px;
  border-bottom:1px solid #2b2e34;
  color:#9fa8b9;
  font-size:11px;
  font-weight:700;
  letter-spacing:.035em;
  line-height:1.25;
}
.video-upload-option:last-child{border-bottom:0;}

/* ==========================================================
   R26 — exclusive main-category accordions, subcategory LEDs and INFO.
   Only presentation/state is new. No VIDEO FRAME processing is connected.
   ========================================================== */
.category-head{
  position:relative;
  cursor:pointer;
  grid-template-columns:20px 28px minmax(0,1fr) auto 24px;
}
.category-head:focus-visible{
  outline:1px solid var(--blue2);
  outline-offset:-2px;
}
.category-head .drawer-title{color:#9fa8b9;}
.category-head .arrow{font-size:18px;}
.category-spacer{min-width:0;}
.category-body[hidden]{display:none !important;}
.category-body{
  border-top:1px solid #34363d;
  background:#1a1b1e;
}
.png-category-body{padding:5px 12px;}
.category-subrow{
  position:relative;
  display:grid;
  grid-template-columns:28px minmax(0,1fr) 24px;
  align-items:center;
  gap:9px;
  min-height:39px;
  color:#9fa8b9;
}
.category-subrow .mini-led{
  width:22px;
  height:22px;
  min-width:22px;
  min-height:22px;
  background-size:22px 22px;
}
.png-import-row{padding:4px 4px 4px 8px;}
.png-import-row .import-command{
  text-align:left;
  color:#9fa8b9;
  font-size:11px;
  font-weight:700;
  letter-spacing:.035em;
}
.video-upload-options{
  padding:6px 12px 8px 12px;
}
.video-upload-option{
  padding:5px 4px 5px 8px;
  border-bottom:1px solid #2b2e34;
}
.video-option-command{
  text-align:left;
  border:0;
  padding:5px 0;
  background:transparent;
  color:#9fa8b9;
  font-family:inherit;
  font-size:11px;
  font-weight:700;
  line-height:1.25;
  letter-spacing:.035em;
  text-decoration:none;
  cursor:pointer;
}
.video-option-command:hover,
.video-option-command[aria-pressed="true"]{
  color:var(--blue2);
}
.video-option-command:focus-visible,
.png-import-row .import-command:focus-visible{
  outline:1px solid var(--blue2);
  outline-offset:2px;
}
.info-tooltip.info-text{
  padding:15px 18px;
  width:420px;
  max-width:calc(100vw - 24px);
}
.info-tooltip.info-text strong{
  color:#cedcff;
  font-size:13px;
}
.info-tooltip.info-text p{
  margin:7px 0 0;
  font-size:13px;
  font-weight:400;
  line-height:1.6;
}

/* ==========================================================
   CHECKPOINT A — the engine's processed canvas fills the AFTER clip.
   ========================================================== */
#renderCanvas{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:block;
}

/* ==========================================================
   CHECKPOINT B — ALGORITHM LAB base styles.
   ========================================================== */
.algorithm-lab-drawer{
  border:1px solid #3a3b3f;
  background:#161719;
  margin:0;
}
.lab-head{
  width:100%;
  min-height:34px;
  border:0;
  background:#232427;
  display:grid;
  grid-template-columns:20px 28px minmax(0,1fr) auto;
  align-items:center;
  gap:9px;
  padding:5px 16px;
  color:#bdbdbd;
  cursor:pointer;
}
.lab-head:focus-visible{outline:1px solid #5d7bff;outline-offset:-2px}
.lab-head .drawer-title{color:#9fa8b9;}
.lab-body{
  border-top:1px solid #34363d;
  background:#1a1b1e;
  padding:8px;
}

/* ---- SLIDER FINAL: lab coefficient sliders ----
   Same three-element system, proportionally smaller: one 18px
   groove (top-cropped slot), 20px knob centered via calc(), one
   ruler with 10px inset. Active knob layers highlight over normal
   so it can never disappear. */
.lab-slider{
  -webkit-appearance:none;
  appearance:none;
  flex:0 0 30px;
  height:30px;
  min-height:30px;
  background:transparent;
  border:0;
  box-shadow:none;
  margin:0;
}
.lab-slider::-webkit-slider-runnable-track{
  height:18px;
  background:transparent url("../app_images/slider/slot.png") center top / 100% 200% no-repeat;
  border:0;
}
.lab-slider::-webkit-slider-thumb{
  -webkit-appearance:none;
  appearance:none;
  width:20px;
  height:20px;
  margin-top:calc((18px - 20px) / 2);
  border:0;
  background-color:transparent;
  background-image:url("../app_images/slider/knob_normal.png");
  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;
  filter:drop-shadow(0 0 4px rgba(93,123,255,.35));
}
.lab-slider:active::-webkit-slider-thumb{
  background-image:url("../app_images/slider/knob_highlighted.png"), url("../app_images/slider/knob_normal.png");
  background-size:contain, contain;
  background-repeat:no-repeat, no-repeat;
  background-position:center, center;
}
.lab-slider::-moz-range-track{
  height:18px;
  background:transparent url("../app_images/slider/slot.png") center top / 100% 200% no-repeat;
  border:0;
}
.lab-slider::-moz-range-thumb{
  width:20px;
  height:20px;
  margin-top:calc((18px - 20px) / 2);
  border:0;
  background-color:transparent;
  background-image:url("../app_images/slider/knob_normal.png");
  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;
  filter:drop-shadow(0 0 4px rgba(93,123,255,.35));
}
.lab-slider:active::-moz-range-thumb{
  background-image:url("../app_images/slider/knob_highlighted.png"), url("../app_images/slider/knob_normal.png");
  background-size:contain, contain;
  background-repeat:no-repeat, no-repeat;
  background-position:center, center;
}

.lab-number{
  width:70px;
  background:#08090b;
  color:#6d8bff;
  border:1px solid #2c2d31;
  padding:4px 6px;
  font:700 12px Consolas,monospace;
  text-align:right;
}
.lab-number:focus{outline:none;border-color:#4764b8}
.lab-reset{
  border:1px solid #33383f;
  background:#111317;
  color:#8f969f;
  padding:5px 8px;
  font-family:Montserrat,"Segoe UI",Arial,sans-serif;
  font-size:10px;
  font-weight:700;
  letter-spacing:.05em;
  cursor:pointer;
}
.lab-reset:hover{color:#c2d7ff;border-color:#455b88}

/* ==========================================================
   CHECKPOINT C — OPERATIONAL LABORATORY panel styles.
   ========================================================== */
.breaker{
  display:inline-block;
  width:64px;
  min-width:64px;
  height:26px;
  cursor:pointer;
  background-color:#2a2a2a;
  background-image:url("../app_images/breaker/breaker_off.png");
  background-repeat:no-repeat;
  background-position:center;
  background-size:64px 26px;
  border:0;
  position:relative;
}
.breaker.on{
  background-image:url("../app_images/breaker/breaker_on.png");
  background-color:#3a1515;
}
.breaker span{font-size:0;display:block;width:0;height:0;overflow:hidden}
.re-chassis-head .breaker{
  width:64px;min-width:64px;height:26px;background-size:64px 26px;
}
.category-fx-list{display:flex;flex-direction:column;gap:8px;margin-top:2px}
.category-fx-drawer{border:0;background:transparent;margin:0}
.category-fx-toggle{
  display:flex !important;
  align-items:center !important;
  flex-wrap:nowrap !important;
  gap:8px !important;
  width:100% !important;
  min-height:28px;
  border:0;
  background:transparent;
  padding:0;
  color:inherit;
  cursor:default;
}
#rootFxList .category-fx-toggle .category-fx-arrow{
  order:0;
  flex:0 0 14px;
  width:14px;
  justify-self:start;
}
#rootFxList .category-fx-toggle .refract-fx-led{
  order:1;
  display:block;
  flex:0 0 22px;
  width:22px;
  height:22px;
  min-width:22px;
  min-height:22px;
  background-size:22px 22px;
}
#rootFxList .category-fx-drawer.open .refract-fx-led{
  background-image:url("../app_images/LED_cat/LED_cat-on.png");
}
#rootFxList .category-fx-toggle .fx-name{
  order:2;
  flex:1 1 auto;
  min-width:0;
  font-size:11px;
  font-weight:700;
  letter-spacing:.035em;
  color:#9fa8b9;
  text-align:left !important;
}
#rootFxList .category-fx-toggle .fx-breaker{
  order:3;
  flex:0 0 64px;
  margin-left:auto !important;
  justify-self:end;
}
#rootFxList .category-fx-toggle .info-icon-button{
  order:4;
  flex:0 0 24px;
  margin-left:0;
}
.fx-body{padding:2px 0 0}
.control-line{display:flex;flex-direction:column;gap:4px;margin-bottom:2px}

.aux-preview-well{
  display:flex;align-items:center;gap:12px;padding:8px;
}
#rootMaskPreviewCanvas{border:1px solid #2c2d31;background:#000;display:block}
#rootMaskPreviewName{
  font:700 11px Consolas,monospace;letter-spacing:.05em;color:#8a8a8a;text-transform:uppercase;
}

.lab-group{margin-bottom:8px}
/* TYPOGRAPHY REFINEMENT 001 — subcategory heading weight -> 500 (Medium).
   SUPERSEDED for subcategory headings by the later TYPOGRAPHY CORRECTION:
   REFRACT (.fx-name) is the authoritative subcategory standard, so the
   lab groups and AUTO-MASK are overridden to 11px / 700 / .035em /
   #9fa8b9 (see the #labGroups rule and the AUTO-MASK rule in the M1
   corrections block). This base rule keeps its layout properties
   (flex, inner line, spacing) for the shared .lab-group-title class. */
.lab-group-title{
  display:flex;align-items:center;gap:6px;
  font-size:12px;font-weight:500;letter-spacing:.08em;color:#9fa8b9;
  text-transform:uppercase;cursor:pointer;
  border-bottom:1px solid #2c2d31;padding-bottom:4px;margin-bottom:4px;
}
#labGroups .lab-group-title > .lab-group-led{
  display:block;
  flex:0 0 22px;
  width:22px;
  height:22px;
  min-width:22px;
  min-height:22px;
  background-size:22px 22px;
}
.lab-group-toggle{font-size:9px;color:#8f969f}
.lab-group-rows{display:flex;flex-direction:column;gap:8px}
.lab-coef{
  display:flex;flex-direction:column;gap:4px;
  background:#131518;border:1px solid #26282d;padding:6px;
}
.lab-coef-head{display:flex;align-items:center;gap:8px}
.lab-coef-name{font-size:10px;font-weight:800;letter-spacing:.05em;color:#c9cdd2;flex:1 1 auto}
.lab-coef-default{font-size:9px;font-weight:700;letter-spacing:.05em;color:#777}
.lab-coef-default b{color:#6d8bff;font-family:Consolas,monospace;font-weight:700}
.lab-status{
  font-size:9px;font-weight:800;letter-spacing:.06em;
  color:#6d8bff;text-transform:uppercase;white-space:nowrap;
}
.lab-status-gated{color:#9a9a9a}
.lab-status-limit{color:#e94b55}
.lab-status-invalid{color:#e94b55}
.lab-coef-formula{font:700 10px Consolas,monospace;color:#8f969f}
.lab-coef-result{
  font:700 11px Consolas,monospace;color:#cedcff;
  background:#08090b;border:1px solid #2c2d31;padding:4px 6px;
}
.lab-coef-range,.lab-coef-value{
  display:flex;align-items:center;gap:6px;
  font-size:9px;font-weight:700;letter-spacing:.05em;color:#777;
}
.lab-coef-range .lab-number,.lab-coef-value .lab-number{flex:1 1 70px}
.lab-value-input{width:100%;font-size:12px}
.lab-coef-actions{display:flex;flex-wrap:wrap;gap:4px}
.lab-coef-expand{display:flex;flex-wrap:wrap;gap:4px}
.lab-coef-expand .lab-expand{font-size:9px;padding:3px 5px}

/* ================================================================
   SUB-CATEGORY ACCORDION REPAIR — arrow visibility (D1 baseline).
   ================================================================ */
#rootFxList .category-fx-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 14px;
  width: 14px;
  font-size: 14px;
  line-height: 1;
  color: #9fbaff;
}
#labGroups .lab-group-toggle { font-size: 12px; }

/* ================================================================
   ACCORDION FINAL — third-tier disclosure. Scoped to the SIX
   third-tier controls (LUMA WEIGHTS: RED/GREEN/BLUE; FEATHER
   BOUNDS: UPPER/LOWER/RELATIVE) which carry .lab-coef-third.
   CONTRAST / FX BLUR / CHROMA / RADIUS rows carry .lab-coef-plain
   plus .lab-coef-open and are NEVER hidden by this rule — they keep
   their normal, immediately visible controls.
   ================================================================ */
#labGroups .lab-coef-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 14px;
  width: 14px;
  font-size: 12px;
  line-height: 1;
  color: #9fbaff;
}
#labGroups .lab-coef.lab-coef-third .lab-coef-head { cursor: pointer; }
#labGroups .lab-coef.lab-coef-third:not(.lab-coef-open) > :not(.lab-coef-head) {
  display: none !important;
}

/* ================================================================
   REFRACT SLOT CORRECTION 001 — ONE CHANGE ONLY
   The REFRACT primary slider (#effectSlider) slot is reduced to
   approximately 6px tall while the knob keeps its 28px size and
   stays centered on the thinner slot. Scoped by id so the five FX
   sliders and the ten LAB sliders are untouched. Measurement ruler
   and travel are unchanged.
   ================================================================ */
#effectSlider::-webkit-slider-runnable-track{
  height:6px;
  background:transparent url("../app_images/slider/slot.png") center top / 100% 200% no-repeat;
  border:0;
}
#effectSlider::-webkit-slider-thumb{
  width:28px;
  height:28px;
  margin-top:calc((6px - 28px) / 2);
}
#effectSlider::-moz-range-track{
  height:6px;
  background:transparent url("../app_images/slider/slot.png") center top / 100% 200% no-repeat;
  border:0;
}
#effectSlider::-moz-range-thumb{
  width:28px;
  height:28px;
  margin-top:calc((6px - 28px) / 2);
}

/* ================================================================
   REFRACT VISUAL CORRECTION 002 — ruler proximity
   - The range element reserves 30px even though the slot is only 6px;
     the extra ruler spacing made the marks appear too far below it.
   - Only REFRACT is affected: 15 other sliders and their rulers remain
     unchanged. Only the ruler spacing is adjusted in this block.
   ================================================================ */
#refractBody .re-param-body > .re-param-line + .slider-scale::before {
  margin-top: -12px; /* 6px higher than correction 002; REFRACT only */
}

/* ================================================================
   REFRACT KNOB 003 — TRUE PNG STATE SWAP, NO ARTIFICIAL GLOW
   NORMAL at rest; HIGHLIGHTED on thumb hover or active drag.
   ================================================================ */
#effectSlider::-webkit-slider-thumb {
  background-image: url("../app_images/slider/knob_normal.png");
  filter: none;
}
#effectSlider::-moz-range-thumb {
  background-image: url("../app_images/slider/knob_normal.png");
  filter: none;
}
#effectSlider::-webkit-slider-thumb:hover,
#effectSlider:active::-webkit-slider-thumb {
  background-image: url("../app_images/slider/knob_highlight.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: none;
}
#effectSlider::-moz-range-thumb:hover,
#effectSlider:active::-moz-range-thumb {
  background-image: url("../app_images/slider/knob_highlight.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: none;
}

/* ================================================================
   SLIDER CHECKPOINT — REPLICATE VERIFIED REFRACT VISUALS
   The five FX sliders and ten Algorithm Lab sliders only.
   REFRACT (#effectSlider) remains byte-for-byte untouched above.
   Normal and highlighted knob PNGs are distinct files; do not layer.
   The actual server file is knob_highlight.png (NOT highlighted).
   No slider values, handlers, or accordion rules are changed.
   ================================================================ */

/* Five REFRACT FX slots: same 6px profile as verified REFRACT. */
#rootFxList .category-fx-slider::-webkit-slider-runnable-track {
  height: 6px;
  background: transparent url("../app_images/slider/slot.png") center top / 100% 200% no-repeat;
  border: 0;
}
#rootFxList .category-fx-slider::-moz-range-track {
  height: 6px;
  background: transparent url("../app_images/slider/slot.png") center top / 100% 200% no-repeat;
  border: 0;
}
#rootFxList .category-fx-slider::-webkit-slider-thumb {
  width: 28px;
  height: 28px;
  margin-top: calc((6px - 28px) / 2);
  background-image: url("../app_images/slider/knob_normal.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: none;
}
#rootFxList .category-fx-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  margin-top: calc((6px - 28px) / 2);
  background-image: url("../app_images/slider/knob_normal.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: none;
}
#rootFxList .category-fx-slider::-webkit-slider-thumb:hover,
#rootFxList .category-fx-slider:active::-webkit-slider-thumb {
  background-image: url("../app_images/slider/knob_highlight.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: none;
}
#rootFxList .category-fx-slider::-moz-range-thumb:hover,
#rootFxList .category-fx-slider:active::-moz-range-thumb {
  background-image: url("../app_images/slider/knob_highlight.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: none;
}
/* The control-line has 4px between children, so -10px gives the
   same ruler-to-groove separation as REFRACT's 6px gap / -12px. */
#rootFxList .slider-scale::before {
  margin-top: -10px;
}

/* Ten Algorithm Lab slots: same slim slot and 28px thumb as REFRACT. */
#labGroups .lab-slider::-webkit-slider-runnable-track {
  height: 6px;
  background: transparent url("../app_images/slider/slot.png") center top / 100% 200% no-repeat;
  border: 0;
}
#labGroups .lab-slider::-moz-range-track {
  height: 6px;
  background: transparent url("../app_images/slider/slot.png") center top / 100% 200% no-repeat;
  border: 0;
}
#labGroups .lab-slider::-webkit-slider-thumb {
  width: 28px;
  height: 28px;
  margin-top: calc((6px - 28px) / 2);
  background-image: url("../app_images/slider/knob_normal.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: none;
}
#labGroups .lab-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  margin-top: calc((6px - 28px) / 2);
  background-image: url("../app_images/slider/knob_normal.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: none;
}
#labGroups .lab-slider::-webkit-slider-thumb:hover,
#labGroups .lab-slider:active::-webkit-slider-thumb {
  background-image: url("../app_images/slider/knob_highlight.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: none;
}
#labGroups .lab-slider::-moz-range-thumb:hover,
#labGroups .lab-slider:active::-moz-range-thumb {
  background-image: url("../app_images/slider/knob_highlight.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: none;
}
/* Coefficient rows use a fixed 30px input and a 4px column gap.
   Keep the 14px-inset ruler aligned to the 28px knob centers. */
#labGroups .slider-scale::before {
  margin-top: -10px; /* stays 9px below the track center with a 30px input */
}


/* ================================================================
   FINAL VISUAL MATCH — HEADER LED + ALGORITHM LAB / REFRACT PARITY
   Scope: header status LED and Algorithm Lab group labels/sliders only.
   REFRACT controls and processing logic remain untouched.
   ================================================================ */

/* Direct image source avoids CSS-relative asset resolution failures.
   The PNG carries its own orb/glow; this preserves and gently reinforces it. */
img.status-led {
  display: block !important;
  width: 64px !important;
  height: 64px !important;
  min-width: 64px !important;
  min-height: 64px !important;
  max-width: 64px !important;
  max-height: 64px !important;
  flex: 0 0 64px !important;
  object-fit: contain;
  background: none !important;
  filter: drop-shadow(0 0 7px rgba(35, 125, 255, 0.42));
}

/* TYPOGRAPHY CORRECTION — REFRACT (.fx-name) is the authoritative
   subcategory font standard: 11px / 700 / .035em / #9fa8b9 / left.
   (TYPOGRAPHY REFINEMENT 001's 500 is superseded for subcategory
   headings by this correction.) */
#labGroups .lab-group-title {
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .035em !important;
  color: #9fa8b9 !important;
}

/* Match REFRACT (#effectSlider): full-width range, 6px slot,
   28px knob, same normal/highlight PNGs and the same interaction. */
#labGroups .lab-slider {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: block !important;
  width: 100% !important;
  height: 30px !important;
  min-height: 30px !important;
  flex: 0 0 30px !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

#labGroups .lab-slider::-webkit-slider-runnable-track {
  height: 6px !important;
  background: transparent url("../app_images/slider/slot.png") center top / 100% 200% no-repeat !important;
  border: 0 !important;
}

#labGroups .lab-slider::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 28px !important;
  height: 28px !important;
  margin-top: calc((6px - 28px) / 2) !important;
  border: 0 !important;
  background-color: transparent !important;
  background-image: url("../app_images/slider/knob_normal.png") !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  filter: none !important;
}

#labGroups .lab-slider::-webkit-slider-thumb:hover,
#labGroups .lab-slider:active::-webkit-slider-thumb {
  background-image: url("../app_images/slider/knob_highlight.png") !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  filter: none !important;
}

#labGroups .lab-slider::-moz-range-track {
  height: 6px !important;
  background: transparent url("../app_images/slider/slot.png") center top / 100% 200% no-repeat !important;
  border: 0 !important;
}

#labGroups .lab-slider::-moz-range-thumb {
  width: 28px !important;
  height: 28px !important;
  margin-top: calc((6px - 28px) / 2) !important;
  border: 0 !important;
  background-color: transparent !important;
  background-image: url("../app_images/slider/knob_normal.png") !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  filter: none !important;
}

#labGroups .lab-slider::-moz-range-thumb:hover,
#labGroups .lab-slider:active::-moz-range-thumb {
  background-image: url("../app_images/slider/knob_highlight.png") !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  filter: none !important;
}

/* The Lab ruler uses the same 14px half-thumb inset as REFRACT. */
#labGroups .slider-scale::before {
  margin-left: 14px !important;
  margin-right: 14px !important;
}

/* ================================================================
   RATCHET 001 — BEAUTIFY UI (PHASE I-B) — FOUR MAIN CATEGORIES
   -----------------------------------------------------------------
   Scope: presentation of the four MAIN categories only
   (PNG IMAGE / VIDEO FRAME / REFRACT / ALGORITHM LAB).

   ENGINE, BREAKER, LED, ACCORDION AND INFO BEHAVIOR ARE UNTOUCHED:
   - no engine selectors, no breaker/led rules, no info popup rules;
   - the lab_breakers.js / lab_info.js injected head grids
     (#refractHead, #algorithmLabHead) are intentionally NOT overridden;
   - the D1 accordion already toggles .open on each owner section,
     so the OPEN state needs no JavaScript at all.

   ROLLBACK: delete this entire block (to the end of the file) and
   the interface returns byte-for-byte to its previous appearance.
   ================================================================ */

:root{
  /* RATCHET 001 theme tokens (presentation only) */
  --rx-panel:#1A1C20;        /* LEFT PANEL background        */
  --rx-cat-light:#262626;    /* MAIN category — lighter tone */
  --rx-cat-dark:#202023;     /* MAIN category — darker tone  */
  --rx-letter:#C0BCBE;       /* MAIN lettering               */
  --rx-outline:#55555A;      /* resting outlines             */
  --rx-outline-hi:#99999F;   /* hover / open outlines        */
  --rx-outline-gap:3px;      /* inner-outline separation     */
  --rx-cat-gap:12px;         /* uniform category spacing     */
}

/* ---- MODULE 01 — header / left-panel surfaces ---- */
.topbar{
  background:#111111;
}
.control-shell{
  background:var(--rx-panel);
}
.control-scroll{
  scrollbar-color:#3b3f46 var(--rx-panel);
}
.control-scroll::-webkit-scrollbar-track{
  background:var(--rx-panel);
}

/* ---- MODULE 01 — checkerboard tones (section + head surfaces) ----
   Sequence: PNG IMAGE lighter, VIDEO FRAME darker,
             REFRACT lighter, ALGORITHM LAB darker. */
#pngCategory,
#pngCategory .drawer-head{
  background:var(--rx-cat-light);
}
#videoCategory,
#videoCategory .drawer-head{
  background:var(--rx-cat-dark);
}
.re-root.re-paradigm,
.re-root .re-root-head,
.re-root .re-chassis-head{
  background:var(--rx-cat-light);
}
#algorithmLabDrawer,
#algorithmLabDrawer .lab-head{
  background:var(--rx-cat-dark);
}

/* ---- MODULE 02 — double-outline framework ----
   Inner line  = 1px border on the section.
   Outer line  = 1px outline with a transparent 3px gap.
   Both sit on the section that CONTAINS head + expanded body, so
   the outer frame encompasses the revealed subcategories. */
#pngCategory,
#videoCategory,
.re-root.re-paradigm,
#algorithmLabDrawer{
  border:1px solid var(--rx-outline);
  outline:1px solid var(--rx-outline);
  outline-offset:var(--rx-outline-gap);
  margin:0 0 var(--rx-cat-gap);
  transition:border-color 150ms ease, outline-color 150ms ease;
}

/* ---- MODULE 04 — HOVER: temporary brightening while closed ---- */
#pngCategory:hover:not(.open),
#videoCategory:hover:not(.open),
.re-root.re-paradigm:hover:not(.open),
#algorithmLabDrawer:hover:not(.open){
  border-color:var(--rx-outline-hi);
  outline-color:var(--rx-outline-hi);
}

/* ---- MODULE 04 — OPEN: persistent highlight while expanded ----
   The D1 exclusive-accordion controller in ui_cmd.js already toggles
   the .open class on these owner sections; no JavaScript change. */
#pngCategory.open,
#videoCategory.open,
.re-root.re-paradigm.open,
#algorithmLabDrawer.open{
  border-color:var(--rx-outline-hi);
  outline-color:var(--rx-outline-hi);
}

/* ---- MODULE 03 — typography: Montserrat 700 / 12px / .04em ---- */
.drawer-title,
.category-head .drawer-title,
.lab-head .drawer-title,
.re-chassis-head > .drawer-title{
  font-family:Montserrat,"Segoe UI",Arial,sans-serif;
  font-size:12px;
  font-weight:700;
  letter-spacing:.04em;
  color:var(--rx-letter);
}

/* ---- MODULE 02 — blue separator lines removed (CSS-only; the
   divs remain in the markup so rollback is a single block delete) */
.blue-separator{
  display:none;
}

/* ================================================================
   MASK PREVIEW CORRECTION — REFRACT full-size mask display
   -----------------------------------------------------------------
   The preview canvas fills the entire existing preview well; the
   filename overlays the bottom-left corner so it never reduces the
   usable viewing area. Container dimensions (176px height, full
   width) are unchanged. Display-only; no engine involvement.
   ================================================================ */
.aux-preview-well{
  position:relative;
  display:block;
  padding:0;
}
#rootMaskPreviewCanvas{
  width:100%;
  height:100%;
  box-sizing:border-box;
  border:1px solid #2c2d31;
  background:#000;
  display:block;
}
#rootMaskPreviewName{
  position:absolute;
  left:6px;
  bottom:5px;
  max-width:calc(100% - 12px);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  padding:2px 6px;
  background:rgba(0,0,0,.62);
  border:1px solid #2c2d31;
  font:700 10px Consolas,monospace;
  letter-spacing:.05em;
  color:#8a8a8a;
  text-transform:uppercase;
  pointer-events:none;
}

/* ================================================================
   RATCHET 002 — REFRACT FIVE SUBCATEGORIES CHECKERBOARD
   -----------------------------------------------------------------
   The five Tier-1 FX rows alternate light/dark with the established
   palette (#262626 / #202023). Row heights, alignment, arrows, LEDs,
   breakers and INFO icons are preserved; only surface colors and a
   subtle 1px frame (with restrained hover / persistent open
   highlighting) change. The .open class is already toggled by the
   existing FX accordion, so no JavaScript is required.
   ================================================================ */
#rootFxList .category-fx-drawer{
  border:1px solid var(--rx-outline);
  padding:0 6px;
  transition:border-color 150ms ease;
}
#rootFxList .category-fx-drawer:hover:not(.open){
  border-color:var(--rx-outline-hi);
}
#rootFxList .category-fx-drawer.open{
  border-color:var(--rx-outline-hi);
}
#rootFxList .category-fx-drawer[data-category-fx="FEATHER"]{
  background:var(--rx-cat-light);
}
#rootFxList .category-fx-drawer[data-category-fx="SATURATE"]{
  background:var(--rx-cat-dark);
}
#rootFxList .category-fx-drawer[data-category-fx="DESATURATE"]{
  background:var(--rx-cat-light);
}
#rootFxList .category-fx-drawer[data-category-fx="OPACITY"]{
  background:var(--rx-cat-dark);
}
#rootFxList .category-fx-drawer[data-category-fx="BLUR"]{
  background:var(--rx-cat-light);
}

/* ================================================================
   RATCHET 003 — ALGORITHM LAB SIX SUBCATEGORIES CHECKERBOARD
   -----------------------------------------------------------------
   Same design language as the REFRACT five-row checkerboard
   (Ratchet 002): alternating light/dark tones, a subtle 1px palette
   outline, restrained 150ms hover brightening and a persistent
   outline highlight on the expanded group. The open state is read
   from the existing group LED class (.mini-led.on), which the
   accordion controller toggles on open and clears on close/reset —
   no JavaScript is added or changed. Group order (CONTRAST →
   FEATHER BOUNDS) is fixed by ap2_lab.js buildPanel(), and the
   :nth-child selectors follow that exact order.
   ================================================================ */
#labGroups > .lab-group{
  border:1px solid var(--rx-outline);
  padding:0 6px;
  transition:border-color 150ms ease;
}
#labGroups > .lab-group:hover{
  border-color:var(--rx-outline-hi);
}
#labGroups > .lab-group:has(> .lab-group-title > .mini-led.on){
  border-color:var(--rx-outline-hi);
}
#labGroups > .lab-group:nth-child(1){ background:var(--rx-cat-light); }  /* CONTRAST */
#labGroups > .lab-group:nth-child(2){ background:var(--rx-cat-dark); }   /* FX BLUR */
#labGroups > .lab-group:nth-child(3){ background:var(--rx-cat-light); }  /* CHROMA */
#labGroups > .lab-group:nth-child(4){ background:var(--rx-cat-dark); }   /* LUMA WEIGHTS */
#labGroups > .lab-group:nth-child(5){ background:var(--rx-cat-light); }  /* RADIUS */
#labGroups > .lab-group:nth-child(6){ background:var(--rx-cat-dark); }   /* FEATHER BOUNDS */

/* ================================================================
   TWO-ROW CONTROL LAYOUT — ALGORITHM LAB coefficient panels
   -----------------------------------------------------------------
   Exactly two horizontal rows of adjustment buttons in every
   coefficient panel (plain and third-tier alike):
   ROW 1: RESET COEFFICIENT | −F | +F | ×10 | ÷10
   ROW 2: RESET RANGE | ÷1e6 | ÷1e3 | ÷10 | ×10 | ×1e3 | ×1e6
   flex-wrap is forced off so a third row can never appear; buttons
   shrink with ellipsis only if the panel is unusually narrow.
   Compact and uniform: 4px gap (existing), 9px labels, 3px/5px
   padding. All button handlers are unchanged.
   ================================================================ */
#labGroups .lab-coef-actions,
#labGroups .lab-coef-expand{
  flex-wrap:nowrap;
}
#labGroups .lab-coef-actions .lab-reset,
#labGroups .lab-coef-expand .lab-reset{
  flex:0 1 auto;
  min-width:0;
  padding:3px 5px;
  font-size:9px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* ================================================================
   ALGORITHM LAB — FINAL COEFFICIENT LAYOUT (MASTER TEMPLATE)
   -----------------------------------------------------------------
   Removes panel clutter per the approved standard: ORIGINAL text,
   NOT ACTIVE (gated) diagnostics, mathematical formulas and
   calculated-result displays are hidden. LIMIT / INVALID safety
   messages, INFO icons, MIN/MAX, VALUE, the slider + ruler and both
   button rows remain visible. All mathematical functions and
   original defaults are untouched.
   ================================================================ */
#labGroups .lab-coef-default,
#labGroups .lab-status-gated,
#labGroups .lab-coef-formula,
#labGroups .lab-coef-result{
  display:none;
}

/* ==========================================================
   M1 VISUAL CORRECTIONS — MASK CATEGORY (FINAL: CONTRAST TEMPLATE)
   ----------------------------------------------------------
   Brings MASK + AUTO-MASK onto the established RATCHET theme
   (palette tokens and outline framework at the top of the
   RATCHET block). NU-FX conventions only; no new visual style.
   · MASK MAIN = checkerboard LIGHT tone (sequence: light,
     dark, light, dark, LIGHT) with the same double outline
     (1px inner border + 1px outer outline at the 3px gap),
     12px category spacing, 150ms hover brightening and the
     persistent open highlight — identical to the other MAINs.
   · AUTO-MASK = first subcategory → the CONTRAST subcategory
     TEMPLATE (final correction): its markup carries the lab's
     own classes (lab-section lab-group / lab-group-title /
     lab-group-toggle / mini-led lab-group-led / lab-group-rows),
     so spacing, typography, arrow, LED and accordion behavior
     come from the actual shared lab rules. Only the
     #labGroups-scoped rules are mirrored below with identical
     values; no existing lab rule text is edited.
   · VC002 — four-side inset, matching the ALGORITHM LAB
     subcategory reference exactly: the MASK body gets the
     .lab-body 8px padding treatment and AUTO-MASK gets the
     .lab-group 8px bottom spacing (now supplied by the
     template class itself).
   · VC004 — AUTO-MASK breaker switch: the CONTRAST group-breaker
     template (64x26 ON/OFF artwork from the shared .breaker base
     rules, right-aligned in the title row), installed dynamically
     exactly like lab_breakers.js so the engine never binds it;
     independent ON/OFF state only, reserved for RIGHT PANEL
     mask-overlay visibility — no engine connection.
   No other stylesheet rule is added or changed.
   ========================================================== */
/* MAIN — surface tone (checkerboard: light after LAB's dark) */
#maskCategory,
#maskCategory .drawer-head{
  background:var(--rx-cat-light);
}
/* MAIN — double-outline framework (MODULE 02 equivalent) */
#maskCategory{
  border:1px solid var(--rx-outline);
  outline:1px solid var(--rx-outline);
  outline-offset:var(--rx-outline-gap);
  margin:0 0 var(--rx-cat-gap);
  transition:border-color 150ms ease, outline-color 150ms ease;
}
#maskCategory:hover:not(.open){
  border-color:var(--rx-outline-hi);
  outline-color:var(--rx-outline-hi);
}
#maskCategory.open{
  border-color:var(--rx-outline-hi);
  outline-color:var(--rx-outline-hi);
}
/* MASK body — .lab-body treatment (VC002): 8px inset on all four sides */
#maskBody{
  padding:8px;
}
/* SUB-CATEGORY — AUTO-MASK (CONTRAST template). The markup carries the
   lab's own classes, so .lab-group spacing, .lab-group-title typography
   and .lab-group-toggle arrow rules apply directly. The rules below are
   value-identical mirrors of the lab's #labGroups-scoped rules (scoped
   here so no existing lab rule text is edited):
     #labGroups > .lab-group{ border / padding / transition }
     #labGroups > .lab-group:hover / :has(...mini-led.on){ border-color hi }
     #labGroups .lab-group-title > .lab-group-led{ 22px LED } */
#autoMaskSubcategory{
  border:1px solid var(--rx-outline);
  padding:0 6px;
  background:var(--rx-cat-light);
  transition:border-color 150ms ease;
}
/* PAINT MASK — second MASK subcategory: same frame, checkerboard DARK
   (second subcategory position, lab/FX pattern). */
#paintMaskSubcategory{
  border:1px solid var(--rx-outline);
  padding:0 6px;
  background:var(--rx-cat-dark);
  transition:border-color 150ms ease;
}
#autoMaskSubcategory:hover,
#paintMaskSubcategory:hover{
  border-color:var(--rx-outline-hi);
}
#autoMaskSubcategory:has(> .lab-group-title > .mini-led.on),
#paintMaskSubcategory:has(> .lab-group-title > .mini-led.on){
  border-color:var(--rx-outline-hi);
}
#autoMaskSubcategory .lab-group-title > .lab-group-led,
#paintMaskSubcategory .lab-group-title > .lab-group-led{
  display:block;
  flex:0 0 22px;
  width:22px;
  height:22px;
  min-width:22px;
  min-height:22px;
  background-size:22px 22px;
}
/* TYPOGRAPHY CORRECTION — REFRACT (.fx-name) is the authoritative
   subcategory font standard: 11px / 700 / .035em / #9fa8b9, left,
   vertically centered. AUTO-MASK and the generic framework
   subcategories mirror it exactly; the ALGORITHM LAB groups use the
   same values via the #labGroups rule above. */
#autoMaskSubcategory .lab-group-title,
#paintMaskSubcategory .lab-group-title,
.generic-main .lab-group-title{
  font-size:11px;
  font-weight:700;
  letter-spacing:.035em;
  color:#9fa8b9;
}
/* AUTO-MASK breaker (VC004) — CONTRAST group-breaker template, installed
   dynamically (the engine never binds it). The shared .breaker base rules
   supply the 64x26 ON/OFF artwork; these scoped mirrors reproduce the
   lab_breakers.js injected rules for the same reset and placement.
   PAINT MASK shares the identical treatment. */
#autoMaskSubcategory .lab-ui-breaker,
#paintMaskSubcategory .lab-ui-breaker{
  appearance:none;
  -webkit-appearance:none;
  border:0;
  padding:0;
  margin:0;
  vertical-align:middle;
  flex:0 0 auto;
  cursor:pointer;
}
#autoMaskSubcategory .lab-ui-breaker:focus-visible,
#paintMaskSubcategory .lab-ui-breaker:focus-visible{
  outline:1px solid #6d8bff;
  outline-offset:2px;
}
#autoMaskSubcategory .lab-group-title > .lab-group-breaker,
#paintMaskSubcategory .lab-group-title > .lab-group-breaker{
  width:64px;
  min-width:64px;
  height:26px;
  background-size:64px 26px;
  margin-left:auto;
}
/* ==========================================================
   GENERIC CATEGORY FRAMEWORK — 10 UI-only MAIN categories
   (001main..010main), three expandable subcategories each.
   Reuses the approved MASK/AUTO-MASK visual standard through
   shared class selectors (no per-category CSS duplication).
   Checkerboard continues after MASK (light): dark, light, …;
   within each MAIN the first subcategory is light, the second
   dark, the third light (lab/FX pattern). Presentation only —
   no engine, processing, render or SAVE involvement.
   ========================================================== */
.generic-main.generic-dark,
.generic-main.generic-dark .drawer-head{
  background:var(--rx-cat-dark);
}
.generic-main.generic-light,
.generic-main.generic-light .drawer-head{
  background:var(--rx-cat-light);
}
.generic-main{
  border:1px solid var(--rx-outline);
  outline:1px solid var(--rx-outline);
  outline-offset:var(--rx-outline-gap);
  margin:0 0 var(--rx-cat-gap);
  transition:border-color 150ms ease, outline-color 150ms ease;
}
.generic-main:hover:not(.open){
  border-color:var(--rx-outline-hi);
  outline-color:var(--rx-outline-hi);
}
.generic-main.open{
  border-color:var(--rx-outline-hi);
  outline-color:var(--rx-outline-hi);
}
.generic-main .category-body{
  padding:8px;
}
.generic-main .lab-group{
  border:1px solid var(--rx-outline);
  padding:0 6px;
  transition:border-color 150ms ease;
}
.generic-main .lab-group.generic-sub-light{
  background:var(--rx-cat-light);
}
.generic-main .lab-group.generic-sub-dark{
  background:var(--rx-cat-dark);
}
.generic-main .lab-group:hover{
  border-color:var(--rx-outline-hi);
}
.generic-main .lab-group:has(> .lab-group-title > .mini-led.on){
  border-color:var(--rx-outline-hi);
}
.generic-main .lab-group-title > .lab-group-led{
  display:block;
  flex:0 0 22px;
  width:22px;
  height:22px;
  min-width:22px;
  min-height:22px;
  background-size:22px 22px;
}
.generic-main .lab-ui-breaker{
  appearance:none;
  -webkit-appearance:none;
  border:0;
  padding:0;
  margin:0;
  vertical-align:middle;
  flex:0 0 auto;
  cursor:pointer;
}
.generic-main .lab-ui-breaker:focus-visible{
  outline:1px solid #6d8bff;
  outline-offset:2px;
}
.generic-main .lab-group-title > .lab-group-breaker{
  width:64px;
  min-width:64px;
  height:26px;
  background-size:64px 26px;
  margin-left:auto;
}
/* ==========================================================
   UNIVERSAL SUBCATEGORY STANDARD — REFRACT is the sole visual
   authority. One shared rule block makes every subcategory row
   (ALGORITHM LAB, MASK, CAMERA (GEAR), GENERIC) match REFRACT's
   actual disclosure-row metrics exactly:
     · box: border 1px var(--rx-outline), padding 0 6px,
            margin 0 0 8px (8px vertical spacing), 150ms hover
     · title row: flex, center, gap 8px, min-height 26px,
            padding 0, border 0 (no inner line), width 100%
     · arrow column 14px (font 14px/1, #9fbaff) · LED 22px ·
            label flex:1 1 auto (11px/700/.035em/#9fa8b9, left,
            set by the shared typography rules) · breaker 64x26
            right-aligned · INFO 24px where applicable
   Global box-sizing:border-box => outer rendered row height =
   26px + 2x1px borders = 28px, identical to REFRACT.
   REFRACT rules are untouched.
   ========================================================== */
#labGroups .lab-group,
#maskBody .lab-group,
#cameraMainBody .lab-group,
.generic-main .lab-group{
  margin:0 0 8px;
  border:1px solid var(--rx-outline);
  padding:0 6px;
  transition:border-color 150ms ease;
}
#labGroups .lab-group-title,
#maskBody .lab-group-title,
#cameraMainBody .lab-group-title,
.generic-main .lab-group-title{
  display:flex;
  align-items:center;
  gap:8px;
  width:100%;
  min-height:26px;
  padding:0;
  margin:0;
  border:0;
}
#labGroups .lab-group-title > .lab-group-toggle,
#maskBody .lab-group-title > .lab-group-toggle,
#cameraMainBody .lab-group-title > .lab-group-toggle,
.generic-main .lab-group-title > .lab-group-toggle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 14px;
  width:14px;
  font-size:14px;
  line-height:1;
  color:#9fbaff;
}
#labGroups .lab-group-title > span:not([class]),
#maskBody .lab-group-title > span:not([class]),
#cameraMainBody .lab-group-title > span:not([class]),
.generic-main .lab-group-title > span:not([class]){
  flex:1 1 auto;
  min-width:0;
}

/* MAIN BREAKER MATCH — REFASHION and REFRACTOR use 64 x 26px switches.
   Scoped only to the ALGORITHM LAB/REFASHION MAIN header.
   No subcategory breakers or JS behavior changed. */
#algorithmLabHead .breaker {
  width:64px;
  min-width:64px;
  height:26px;
  background-size:64px 26px;
}

/* UI PAINT 2026-11-21: INFO artwork 15% smaller; keep 24px hit area and layout unchanged. */
.info-icon-button img { transform: scale(.85); transform-origin: center center; }

/* UI PAINT 2026-11-21: MAIN CATEGORY disclosure arrows 10% smaller.
   Visual scale only: preserve the arrow's layout box and all internal arrows. */
.category-drawer > .category-head > .arrow,
.category-drawer > .drawer-head > .arrow,
.re-root > .re-root-head > .re-chassis-head > .arrow,
#algorithmLabHead > .arrow {
  transform: scale(0.9);
  transform-origin: center center;
}

/* ================================================================
   NU-FX — CHARCOAL CHECKERBOARD FIX 003 — UI ONLY
   Corrects numeric-leading HTML IDs using attribute selectors.
   Main order starts IMPORT PNG LIGHT and alternates to final row.
   Scoped strictly to category surfaces and two panel surrounds.
   ================================================================ */
:root {
  --rx-panel: #080808;
  --rx-cat-light: #222225;
  --rx-cat-dark: #19191c;
}
/* The exposed panel backgrounds match; render/image content is unchanged. */
.control-shell, .control-scroll, .render-stage {
  background-color: #080808;
}
.control-scroll::-webkit-scrollbar-track { background-color: #080808; }

/* First six mains; later generic categories are listed separately. */
#pngCategory, #pngCategory > .drawer-head,
.re-root.re-paradigm, .re-root .re-root-head, .re-root .re-chassis-head,
#maskCategory, #maskCategory > .drawer-head {
  background-color: var(--rx-cat-light);
}
#videoCategory, #videoCategory > .drawer-head,
#algorithmLabDrawer, #algorithmLabDrawer > .lab-head,
#cameraMain, #cameraMain > .drawer-head {
  background-color: var(--rx-cat-dark);
}

/* Numeric-leading IDs MUST use [id="..."] rather than #001main. */
/* HARMONIZE — LIGHT */
section.generic-main[id="001main"],
section.generic-main[id="001main"] > .drawer-head {
  background-color: var(--rx-cat-light);
}
/* ENGINE PART — DARK */
section.generic-main[id="002main"],
section.generic-main[id="002main"] > .drawer-head {
  background-color: var(--rx-cat-dark);
}
/* HUE — LIGHT */
section.generic-main[id="003main"],
section.generic-main[id="003main"] > .drawer-head {
  background-color: var(--rx-cat-light);
}
/* TEXTURE — DARK */
section.generic-main[id="004main"],
section.generic-main[id="004main"] > .drawer-head {
  background-color: var(--rx-cat-dark);
}
/* BIAS — DARK (alternates with DISTRESS LIGHT) */
section.generic-main[id="005main"],
section.generic-main[id="005main"] > .drawer-head {
  background-color: var(--rx-cat-dark);
}
/* ANISOTROPICS — LIGHT */
section.generic-main[id="006main"],
section.generic-main[id="006main"] > .drawer-head {
  background-color: var(--rx-cat-light);
}
/* PHENOMENA — LIGHT */
section.generic-main[id="007main"],
section.generic-main[id="007main"] > .drawer-head {
  background-color: var(--rx-cat-light);
}
/* LUMENAL FLUX — DARK */
section.generic-main[id="008main"],
section.generic-main[id="008main"] > .drawer-head {
  background-color: var(--rx-cat-dark);
}
/* GENERIC 009 — LIGHT */
section.generic-main[id="009main"],
section.generic-main[id="009main"] > .drawer-head {
  background-color: var(--rx-cat-light);
}
/* GENERIC 010 — DARK */
section.generic-main[id="010main"],
section.generic-main[id="010main"] > .drawer-head {
  background-color: var(--rx-cat-dark);
}


/* ==============================================================
   NU-FX — RESTORED DEFAULT IMAGE / EXACT MATTE MATCH
   Uploaded default_image.png corner pixels: RGB (21, 21, 21), #151515.
   Applies ONLY to panel surrounds and letterboxed renderer areas;
   main-category checkerboard, labels, LEDs, arrows, and borders
   remain unchanged.
   ============================================================== */
:root { --rx-panel: #151515; }
.control-shell,
.control-scroll,
.render-stage,
.render-frame { background-color: var(--rx-panel); }
.control-scroll::-webkit-scrollbar-track { background-color: var(--rx-panel); }


/* ================================================================
   NU-FX — PANEL SURROUNDS: EXACT DEFAULT_IMAGE.PNG MATCH (UI ONLY)
   Both exposed panel backgrounds are RGB(21,21,21) = #151515,
   matching the corner pixels of the original default_image.png.
   Does not change render image, artwork, category checkerboard,
   LEDs, icons, layout, or processing.
   ================================================================ */
body.app-page .control-shell,
body.app-page .control-scroll,
body.app-page .render-stage {
  background-color: #151515;
}
body.app-page .control-scroll::-webkit-scrollbar-track {
  background-color: #151515;
}


/* ==================================================================
   NU-FX — DARKER PANEL SURROUNDS: USER-REQUESTED CORRECTION
   Selected charcoal-black #050505, darker than previous #151515.
   Applies only to panel surfaces (including render matte), NOT the
   image pixels, checkerboard categories, or any controls.
   ================================================================== */
:root { --rx-panel: #050505; }
body.app-page .control-shell,
body.app-page .control-scroll,
body.app-page .render-stage,
body.app-page .render-frame {
  background-color: #050505;
}
body.app-page .control-scroll::-webkit-scrollbar-track {
  background-color: #050505;
}

/* BIAS R01 — scoped UI clone, no render/engine changes */
[id="005mainBody"].bias-body{padding:6px;background:#121212}
[id="005main"] .bias-sub{margin:0 0 5px;border:1px solid #303030;background:#181818}
[id="005main"] .bias-sub:nth-child(even){background:#232323}
[id="005main"] .bias-sub-head{min-height:43px;display:flex;align-items:center;gap:8px;padding:5px 8px;cursor:pointer;color:#999;font-size:10px;font-weight:800}
[id="005main"] .bias-sub-head:hover{outline:1px solid #505050;outline-offset:-1px}
[id="005main"] .bias-arrow{width:10px;color:#9a9a9a}[id="005main"] .bias-name{flex:1;min-width:0}
[id="005main"] .bias-breaker{flex:none;background:#0b0b0b;border:1px solid #66452c;color:#b8784d;padding:5px;min-width:47px;font-size:9px;cursor:pointer}
[id="005main"] .bias-breaker[aria-checked="true"]{border-color:#2268b8;color:#3994ff}
[id="005main"] .bias-info{flex:none;border:1px solid #555;border-radius:50%;width:17px;height:17px;color:#999;background:transparent;font-size:12px;padding:0;cursor:pointer}
[id="005main"] .bias-sub-body{padding:6px;border-top:1px solid #303030}
[id="005main"] .bias-sub-body[hidden],[id="005mainBody"][hidden]{display:none!important}
[id="005main"] .bias-preview{width:100%;aspect-ratio:16/9;background:#020202;border:1px solid #303030;display:flex;align-items:flex-end;padding:4px;color:#595959;font:9px Arial,sans-serif}
[id="005main"] .bias-actions{display:grid;gap:4px;margin-top:5px}
[id="005main"] .bias-actions button,[id="005main"] .bias-save,[id="005main"] .bias-reset,[id="005main"] .bias-target button{background:#151515;border:1px solid #303030;color:#858585;padding:7px;font-size:10px;font-weight:700}
[id="005main"] .bias-target{display:flex;align-items:center;gap:5px;margin:5px 0;padding:4px 2px;color:#888;font-size:9px;font-weight:700}
[id="005main"] .bias-target output{flex:1;background:#090909;border:1px solid #303030;text-align:right;padding:5px}
[id="005main"] .bias-slider-head{display:flex;justify-content:space-between;align-items:center;margin-top:6px;color:#949494;font-size:10px;font-weight:800}
[id="005main"] .bias-slider-head output{background:#070707;color:#368cff;border:1px solid #303030;padding:4px 6px}
[id="005main"] .bias-range{width:100%;accent-color:#2979d1;margin:10px 0}
[id="005main"] .bias-bounds{display:flex;align-items:center;gap:5px;justify-content:center;padding:5px 0;border:1px solid #303030;color:#aaa}
[id="005main"] .bias-bounds input{min-width:0;width:38%;background:#050505;border:1px solid #333;text-align:center;color:#368cff;font-size:10px;padding:4px}
[id="005main"] .bias-save{display:block;width:100%;margin-top:5px}
[id="005main"] .bias-reset{display:block;width:100%;margin-top:7px;cursor:pointer}
[id="005main"] button:disabled{opacity:.55;cursor:not-allowed}

/* BIAS R03: CG-FX drawer contents / NU-FX approved hardware-style breakers.
   Assets resolve relative to /css/ui.css. No render/engine integration. */
[id="005main"] .bias-sub-head{min-height:43px;gap:6px;padding:4px 5px}
[id="005main"] .bias-sub-head .mini-led{flex:0 0 auto}
[id="005main"] .bias-name{flex:1 1 auto;white-space:nowrap;font:800 10px/1.25 Montserrat,"Segoe UI",Arial,sans-serif;color:#a5a5a5}
[id="005main"] .bias-breaker{
  -webkit-appearance:none;appearance:none;display:inline-block;
  flex:0 0 64px;width:64px;min-width:64px;height:26px;
  margin:0 3px 0 auto;padding:0;border:0;outline:0;
  background:transparent center/64px 26px no-repeat;
  cursor:pointer;color:transparent;font-size:0;
}
[id="005main"] .bias-breaker[aria-checked="false"]{background-image:url("../app_images/breaker/breaker_off.png");border:0;color:transparent}
[id="005main"] .bias-breaker[aria-checked="true"]{background-image:url("../app_images/breaker/breaker_on.png");border:0;color:transparent}
[id="005main"] .bias-breaker span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
[id="005main"] .bias-breaker:focus-visible{outline:1px solid #6d8bff;outline-offset:2px}
[id="005main"] .bias-sub-body{padding:6px 5px 8px;background:#121212}
[id="005main"] .bias-preview{aspect-ratio:16/9;min-height:150px;border:1px solid #42454b;background:#000;position:relative}
[id="005main"] .bias-preview span{position:absolute;bottom:-13px;left:0;font:italic 8px Montserrat,Arial,sans-serif}
[id="005main"] .bias-actions{margin-top:16px;gap:3px}
[id="005main"] .bias-actions button,[id="005main"] .bias-save,[id="005main"] .bias-target button,[id="005main"] .bias-reset{border:1px solid #313439;background:#1a1a1a;color:#8b9199;min-height:26px;padding:4px 7px;font:800 9px Montserrat,Arial,sans-serif;text-align:center}
[id="005main"] .bias-target{border:1px solid #303030;min-height:26px;padding:2px 4px;margin:4px 0;gap:4px}
[id="005main"] .bias-target output{color:#77859a;min-width:0;font:800 9px Montserrat,Arial,sans-serif}
[id="005main"] .bias-target button{color:#628ef2;background:#0b0b0b;min-height:21px;padding:2px 4px}
[id="005main"] .bias-slider-head{margin-top:8px}
[id="005main"] .bias-range{-webkit-appearance:none;appearance:none;width:100%;height:30px;margin:6px 0 2px;background:transparent;cursor:pointer}
[id="005main"] .bias-range::-webkit-slider-runnable-track{height:6px;background:transparent url("../app_images/slider/slot.png") center top/100% 200% no-repeat}
[id="005main"] .bias-range::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:28px;height:28px;margin-top:-11px;background:transparent url("../app_images/slider/knob_normal.png") center/contain no-repeat;border:0}
[id="005main"] .bias-range:hover::-webkit-slider-thumb,[id="005main"] .bias-range:focus-visible::-webkit-slider-thumb{background-image:url("../app_images/slider/knob_highlight.png")}
[id="005main"] .bias-range::-moz-range-track{height:6px;background:transparent url("../app_images/slider/slot.png") center/100% 200% no-repeat}
[id="005main"] .bias-range::-moz-range-thumb{width:28px;height:28px;border:0;background:transparent url("../app_images/slider/knob_normal.png") center/contain no-repeat}
[id="005main"] .bias-bounds{background:#090909;padding:4px 6px;gap:5px}
[id="005main"] .bias-bounds input{flex:1 1 0;width:auto;max-width:none}
[id="005main"] .bias-save{margin-top:5px}
[id="005main"] .bias-info{margin-left:0;border:0;background:transparent;color:#999;font-size:16px}

/* BIAS R04 — theme INFO button and click tooltip. No engine changes. */
[id="005main"] .bias-info.info-icon-button{flex:0 0 24px;width:24px;height:24px;min-width:24px;padding:0;margin:0;border:0;border-radius:0;background:transparent;display:grid;place-items:center;cursor:pointer}
[id="005main"] .bias-info.info-icon-button img{display:block;width:22px;height:22px;object-fit:contain}
[id="005main"] .bias-tooltip{position:fixed;z-index:2000}
[id="005main"] .bias-tooltip p{margin:8px 0 0}

/* ANISOTROPICS R07: derived from verified BIAS UI styling, scoped to 006main. */
[id="006mainBody"].bias-body{padding:6px;background:#121212}
[id="006main"] .bias-sub{margin:0 0 5px;border:1px solid #303030;background:#181818}
[id="006main"] .bias-sub:nth-child(even){background:#232323}
[id="006main"] .bias-sub-head{min-height:43px;display:flex;align-items:center;gap:8px;padding:5px 8px;cursor:pointer;color:#999;font-size:10px;font-weight:800}
[id="006main"] .bias-sub-head:hover{outline:1px solid #505050;outline-offset:-1px}
[id="006main"] .bias-arrow{width:10px;color:#9a9a9a}[id="006main"] .bias-name{flex:1;min-width:0}
[id="006main"] .bias-breaker{flex:none;background:#0b0b0b;border:1px solid #66452c;color:#b8784d;padding:5px;min-width:47px;font-size:9px;cursor:pointer}
[id="006main"] .bias-breaker[aria-checked="true"]{border-color:#2268b8;color:#3994ff}
[id="006main"] .bias-info{flex:none;border:1px solid #555;border-radius:50%;width:17px;height:17px;color:#999;background:transparent;font-size:12px;padding:0;cursor:pointer}
[id="006main"] .bias-sub-body{padding:6px;border-top:1px solid #303030}
[id="006main"] .bias-sub-body[hidden],[id="006mainBody"][hidden]{display:none!important}
[id="006main"] .bias-preview{width:100%;aspect-ratio:16/9;background:#020202;border:1px solid #303030;display:flex;align-items:flex-end;padding:4px;color:#595959;font:9px Arial,sans-serif}
[id="006main"] .bias-actions{display:grid;gap:4px;margin-top:5px}
[id="006main"] .bias-actions button,[id="006main"] .bias-save,[id="006main"] .bias-reset,[id="006main"] .bias-target button{background:#151515;border:1px solid #303030;color:#858585;padding:7px;font-size:10px;font-weight:700}
[id="006main"] .bias-target{display:flex;align-items:center;gap:5px;margin:5px 0;padding:4px 2px;color:#888;font-size:9px;font-weight:700}
[id="006main"] .bias-target output{flex:1;background:#090909;border:1px solid #303030;text-align:right;padding:5px}
[id="006main"] .bias-slider-head{display:flex;justify-content:space-between;align-items:center;margin-top:6px;color:#949494;font-size:10px;font-weight:800}
[id="006main"] .bias-slider-head output{background:#070707;color:#368cff;border:1px solid #303030;padding:4px 6px}
[id="006main"] .bias-range{width:100%;accent-color:#2979d1;margin:10px 0}
[id="006main"] .bias-bounds{display:flex;align-items:center;gap:5px;justify-content:center;padding:5px 0;border:1px solid #303030;color:#aaa}
[id="006main"] .bias-bounds input{min-width:0;width:38%;background:#050505;border:1px solid #333;text-align:center;color:#368cff;font-size:10px;padding:4px}
[id="006main"] .bias-save{display:block;width:100%;margin-top:5px}
[id="006main"] .bias-reset{display:block;width:100%;margin-top:7px;cursor:pointer}
[id="006main"] button:disabled{opacity:.55;cursor:not-allowed}

/* BIAS R03: CG-FX drawer contents / NU-FX approved hardware-style breakers.
   Assets resolve relative to /css/ui.css. No render/engine integration. */
[id="006main"] .bias-sub-head{min-height:43px;gap:6px;padding:4px 5px}
[id="006main"] .bias-sub-head .mini-led{flex:0 0 auto}
[id="006main"] .bias-name{flex:1 1 auto;white-space:nowrap;font:800 10px/1.25 Montserrat,"Segoe UI",Arial,sans-serif;color:#a5a5a5}
[id="006main"] .bias-breaker{
  -webkit-appearance:none;appearance:none;display:inline-block;
  flex:0 0 64px;width:64px;min-width:64px;height:26px;
  margin:0 3px 0 auto;padding:0;border:0;outline:0;
  background:transparent center/64px 26px no-repeat;
  cursor:pointer;color:transparent;font-size:0;
}
[id="006main"] .bias-breaker[aria-checked="false"]{background-image:url("../app_images/breaker/breaker_off.png");border:0;color:transparent}
[id="006main"] .bias-breaker[aria-checked="true"]{background-image:url("../app_images/breaker/breaker_on.png");border:0;color:transparent}
[id="006main"] .bias-breaker span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
[id="006main"] .bias-breaker:focus-visible{outline:1px solid #6d8bff;outline-offset:2px}
[id="006main"] .bias-sub-body{padding:6px 5px 8px;background:#121212}
[id="006main"] .bias-preview{aspect-ratio:16/9;min-height:150px;border:1px solid #42454b;background:#000;position:relative}
[id="006main"] .bias-preview span{position:absolute;bottom:-13px;left:0;font:italic 8px Montserrat,Arial,sans-serif}
[id="006main"] .bias-actions{margin-top:16px;gap:3px}
[id="006main"] .bias-actions button,[id="006main"] .bias-save,[id="006main"] .bias-target button,[id="006main"] .bias-reset{border:1px solid #313439;background:#1a1a1a;color:#8b9199;min-height:26px;padding:4px 7px;font:800 9px Montserrat,Arial,sans-serif;text-align:center}
[id="006main"] .bias-target{border:1px solid #303030;min-height:26px;padding:2px 4px;margin:4px 0;gap:4px}
[id="006main"] .bias-target output{color:#77859a;min-width:0;font:800 9px Montserrat,Arial,sans-serif}
[id="006main"] .bias-target button{color:#628ef2;background:#0b0b0b;min-height:21px;padding:2px 4px}
[id="006main"] .bias-slider-head{margin-top:8px}
[id="006main"] .bias-range{-webkit-appearance:none;appearance:none;width:100%;height:30px;margin:6px 0 2px;background:transparent;cursor:pointer}
[id="006main"] .bias-range::-webkit-slider-runnable-track{height:6px;background:transparent url("../app_images/slider/slot.png") center top/100% 200% no-repeat}
[id="006main"] .bias-range::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:28px;height:28px;margin-top:-11px;background:transparent url("../app_images/slider/knob_normal.png") center/contain no-repeat;border:0}
[id="006main"] .bias-range:hover::-webkit-slider-thumb,[id="006main"] .bias-range:focus-visible::-webkit-slider-thumb{background-image:url("../app_images/slider/knob_highlight.png")}
[id="006main"] .bias-range::-moz-range-track{height:6px;background:transparent url("../app_images/slider/slot.png") center/100% 200% no-repeat}
[id="006main"] .bias-range::-moz-range-thumb{width:28px;height:28px;border:0;background:transparent url("../app_images/slider/knob_normal.png") center/contain no-repeat}
[id="006main"] .bias-bounds{background:#090909;padding:4px 6px;gap:5px}
[id="006main"] .bias-bounds input{flex:1 1 0;width:auto;max-width:none}
[id="006main"] .bias-save{margin-top:5px}
[id="006main"] .bias-info{margin-left:0;border:0;background:transparent;color:#999;font-size:16px}

/* BIAS R04 — theme INFO button and click tooltip. No engine changes. */
[id="006main"] .bias-info.info-icon-button{flex:0 0 24px;width:24px;height:24px;min-width:24px;padding:0;margin:0;border:0;border-radius:0;background:transparent;display:grid;place-items:center;cursor:pointer}
[id="006main"] .bias-info.info-icon-button img{display:block;width:22px;height:22px;object-fit:contain}
[id="006main"] .bias-tooltip{position:fixed;z-index:2000}
[id="006main"] .bias-tooltip p{margin:8px 0 0}



/* LUMENS DNA R08 — UI-only copy of the original CG-FX QUEEN WHITE layout.
   Scoped to main 010; does not alter other category styling. */
[id="010mainBody"].lumens-body{padding:6px;background:#121212;color:#888;font-family:Montserrat,"Segoe UI",Arial,sans-serif}
[id="010mainBody"][hidden],[id="010main"] .lumens-sub-body[hidden]{display:none!important}
[id="010main"] .lumens-preview{width:100%;aspect-ratio:16/9;display:flex;align-items:flex-end;background:#020202;border:1px solid #303030;color:#575757;font:9px Arial,sans-serif;padding:4px}
[id="010main"] .lumens-action,[id="010main"] .lumens-reset{display:block;width:100%;padding:7px;background:#171717;border:1px solid #303030;color:#929292;font-size:10px;font-weight:800;cursor:pointer;margin-top:4px}
[id="010main"] button:disabled{opacity:.55;cursor:not-allowed}
[id="010main"] .lumens-action[aria-pressed="true"]{color:#3789ff;border-color:#27578d}
[id="010main"] .lumens-line{display:flex;align-items:center;gap:5px;min-height:27px;padding:3px 4px;border:1px solid #303030;margin-top:4px;font-size:10px;font-weight:800}
[id="010main"] .lumens-line>span,[id="010main"] .lumens-line>label{margin-right:auto;color:#898989}
[id="010main"] .lumens-shape button{background:transparent;color:#989898;border:1px solid transparent;font-size:9px;font-weight:800;padding:4px 5px;cursor:pointer}
[id="010main"] .lumens-shape button[aria-pressed="true"]{color:#378cff;border-color:#27578d;background:#111c2a}
[id="010main"] .lumens-line select{max-width:140px;background:#090909;color:#b5b5b5;border:1px solid #383838;font-size:10px;padding:3px}
[id="010main"] .lumens-fx-heading{padding:10px 6px 5px;margin-top:7px;color:#9a9a9a;font-size:10px;font-weight:800;border-top:1px solid #1451a4}
[id="010main"] .lumens-sub{margin:0 0 5px;border:1px solid #303030;background:#181818}
[id="010main"] .lumens-sub:nth-of-type(even){background:#232323}
[id="010main"] .lumens-sub-head{display:flex;align-items:center;gap:6px;min-height:43px;padding:4px 5px;cursor:pointer;font-size:10px;font-weight:800}
[id="010main"] .lumens-sub-head:hover{outline:1px solid #505050;outline-offset:-1px}
[id="010main"] .lumens-arrow{flex:0 0 10px;color:#a0a0a0}
[id="010main"] .lumens-name{flex:1 1 auto;white-space:nowrap;color:#aaa}
[id="010main"] .lumens-breaker{appearance:none;display:inline-block;flex:0 0 64px;width:64px;min-width:64px;height:26px;padding:0;border:0;margin:0 3px 0 auto;background:transparent center/64px 26px no-repeat;cursor:pointer}
[id="010main"] .lumens-breaker[aria-checked="false"]{background-image:url("../app_images/breaker/breaker_off.png")}
[id="010main"] .lumens-breaker[aria-checked="true"]{background-image:url("../app_images/breaker/breaker_on.png")}
[id="010main"] .lumens-breaker span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
[id="010main"] .lumens-info{flex:0 0 24px;width:24px;height:24px;border:0;padding:0;background:transparent;display:grid;place-items:center;cursor:pointer}
[id="010main"] .lumens-info img{width:22px;height:22px;object-fit:contain}
[id="010main"] .lumens-sub-body{padding:6px 5px 8px;background:#121212;border-top:1px solid #303030}
[id="010main"] .lumens-slider-top{display:flex;align-items:center;justify-content:space-between;color:#999;font-size:10px;font-weight:800}
[id="010main"] .lumens-slider-top output{color:#368cff;background:#090909;border:1px solid #303030;padding:4px 6px}
[id="010main"] .lumens-slider{appearance:none;width:100%;height:30px;margin:9px 0 0;background:transparent;cursor:pointer}
[id="010main"] .lumens-slider::-webkit-slider-runnable-track{height:6px;background:transparent url("../app_images/slider/slot.png") center top/100% 200% no-repeat}
[id="010main"] .lumens-slider::-webkit-slider-thumb{appearance:none;width:28px;height:28px;margin-top:-11px;background:transparent url("../app_images/slider/knob_normal.png") center/contain no-repeat;border:0}
[id="010main"] .lumens-slider:hover::-webkit-slider-thumb{background-image:url("../app_images/slider/knob_highlight.png")}
[id="010main"] .lumens-tooltip{position:fixed;z-index:2000}
[id="010main"] .lumens-tooltip p{margin:8px 0 0}

/* R09: noninteractive gradations beneath all five LUMENS DNA sliders. */
[id="010main"] .lumens-slider-top{justify-content:flex-end}
[id="010main"] .lumens-slider-ticks{
  height:7px; width:calc(100% - 28px);margin:-1px auto 6px;
  background:repeating-linear-gradient(to right,#606060 0,#606060 1px,transparent 1px,transparent 5%);
  opacity:.85;pointer-events:none;
}

/* R10 — LUMENS DNA: same finished slider theme as PATINATE/DISTRESS. */
[id="010main"] .lumens-theme-unit{margin:0 0 7px;background:#14161a}
[id="010main"] .lumens-theme-unit:nth-of-type(even){background:#202226}
[id="010main"] .lumens-theme-unit .texture-slider-head .texture-slider-label{display:flex;align-items:center;gap:6px;min-width:0;flex:1}
[id="010main"] .lumens-theme-unit .texture-slider-actions{display:flex;align-items:center;gap:5px;flex:none}
[id="010main"] .lumens-theme-unit .lumens-breaker{flex:0 0 64px;margin:0;width:64px;height:26px}
[id="010main"] .lumens-theme-unit .texture-slider-info-wrap{position:relative;display:flex;align-items:center}
[id="010main"] .lumens-theme-unit .texture-slider-tooltip[hidden]{display:none!important}
[id="010main"] .lumens-theme-unit .texture-slider-tooltip:not([hidden]){display:block;position:absolute;top:100%;right:0;z-index:90;width:240px;max-width:calc(100vw - 40px)}
