/* ── trans custom UI · three-zone (modes | canvas | params + bottom bar) ──────
   Monochrome palette (record red is the only colour). The WebGPU engine is
   untouched; Tweakpane stays alive off-screen as the side-effect registry. ── */

:root{
  --ui-bg:#0c0c0c; --ui-bg2:#171717; --ui-line:rgba(255,255,255,.10);
  --ui-text:#f0f0f0; --ui-mut:rgba(240,240,240,.5); --ui-accent:#f0f0f0;
  --ui-accent-soft:rgba(240,240,240,.16); --ui-rec:#ff5b5b;
  --ui-font:ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  --left:150px; --right:232px; --bottom:46px;
}

/* hide scrollbars everywhere (still scrollable) */
*{ scrollbar-width:none; -ms-overflow-style:none; }
*::-webkit-scrollbar{ width:0; height:0; display:none; }

/* hide the old Tweakpane panel but keep it functional off-screen */
#side{ left:-9999px !important; pointer-events:none; }
#toggle-panel{ display:none !important; }

/* canvas occupies the centre, bounded by the three control zones */
#stage{ inset:0 var(--right) var(--bottom) var(--left) !important; padding:8px !important; transition:inset .16s ease; }
body.no-left  #stage{ left:0 !important; }
body.no-right #stage{ right:0 !important; }

/* ── left rail: mode grid ── */
#ui-left{
  position:fixed; left:0; top:0; bottom:var(--bottom); width:var(--left); z-index:300;
  background:var(--ui-bg); border-right:1px solid var(--ui-line);
  overflow-y:auto; padding:10px 8px 16px; font:11px/1.35 var(--ui-font); color:var(--ui-text);
}
body.no-left #ui-left{ display:none; }
.mgroup{ margin-bottom:11px; }
.mgroup h4{ color:var(--ui-mut); font-size:9px; text-transform:uppercase; letter-spacing:.09em; margin:0 0 5px 1px; font-weight:600; }
.chip{
  position:relative; display:block; width:100%; margin-bottom:4px; height:62px;
  border:1px solid var(--ui-line); border-radius:4px; overflow:hidden;
  cursor:pointer; font:inherit; color:var(--ui-text); transition:.1s;
  background:var(--ui-bg2) center/cover no-repeat; filter:grayscale(1);
}
.chip:hover{ border-color:rgba(240,240,240,.4); }
.chip .nm{
  position:absolute; left:0; right:0; bottom:0; padding:3px 6px 4px;
  font-size:10px; line-height:1.15; letter-spacing:.01em;
  background:linear-gradient(transparent, rgba(0,0,0,.82) 55%); color:#fff;
}
.chip.sel{ border-color:var(--ui-accent); box-shadow:0 0 0 1px var(--ui-accent) inset; }
.chip.sel .nm{ background:linear-gradient(transparent, rgba(255,255,255,.92) 55%); color:#000; font-weight:600; }

/* hover-zoom preview */
#thumbzoom{ position:fixed; z-index:400; display:none; pointer-events:none;
  border:1px solid var(--ui-accent); border-radius:6px; overflow:hidden;
  box-shadow:0 8px 30px rgba(0,0,0,.6); background:#000; }
#thumbzoom.on{ display:block; }
#thumbzoom img{ display:block; width:320px; height:200px; object-fit:cover; filter:grayscale(1); }
#thumbzoom .zl{ position:absolute; left:0; right:0; bottom:0; padding:5px 9px; font:12px var(--ui-font);
  color:#fff; background:linear-gradient(transparent, rgba(0,0,0,.85)); }

/* ── right rail: params ── */
#ui-right{
  position:fixed; right:0; top:0; bottom:var(--bottom); width:var(--right); z-index:300;
  background:var(--ui-bg); border-left:1px solid var(--ui-line);
  overflow-y:auto; padding:12px 12px 18px; font:11px/1.4 var(--ui-font); color:var(--ui-text);
}
body.no-right #ui-right{ display:none; }
#ui-right .modehead{ font-size:13px; color:var(--ui-text); font-weight:600; margin:0 0 10px; letter-spacing:.01em; }
.psec{ margin-bottom:13px; }
.psec.dim{ opacity:.3; }
.psec.dim .row input,.psec.dim .row select{ pointer-events:none; }
.psec h4{
  color:var(--ui-mut); font-size:9px; text-transform:uppercase; letter-spacing:.09em;
  margin:0 0 7px; font-weight:600; border-bottom:1px solid var(--ui-line); padding-bottom:4px;
}
.psec.dim h4::after{ content:" · n/a"; color:#5a5a5a; font-weight:400; letter-spacing:0; }
.row{ display:flex; align-items:center; gap:7px; margin-bottom:6px; }
.row .lab{ flex:1; min-width:0; color:var(--ui-mut); font-size:10.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.row input[type=range]{ width:96px; flex-shrink:0; accent-color:var(--ui-accent); height:3px; }
.row .val{ width:38px; flex-shrink:0; text-align:right; font-size:10px; color:var(--ui-text); font-variant-numeric:tabular-nums; }
.row.check label{ display:flex; align-items:center; gap:6px; cursor:pointer; color:var(--ui-text); font-size:10.5px; }
.row.check input{ accent-color:var(--ui-accent); }
.row select{ flex:1; min-width:0; }
.row input[type=color]{ width:34px; height:20px; padding:0; border:1px solid var(--ui-line); background:none; border-radius:3px; cursor:pointer; }

/* ── bottom bar ── */
#ui-bottom{
  position:fixed; left:0; right:0; bottom:0; height:var(--bottom); z-index:310;
  display:flex; align-items:center; gap:9px; padding:0 12px;
  background:var(--ui-bg); border-top:1px solid var(--ui-line);
  font:12px/1 var(--ui-font); color:var(--ui-text); overflow-x:auto; white-space:nowrap;
}
#ui-bottom .grp{ display:flex; align-items:center; gap:6px; }
#ui-bottom .sep{ width:1px; height:22px; background:var(--ui-line); flex-shrink:0; }
#ui-bottom label{ color:var(--ui-mut); font-size:10px; text-transform:uppercase; letter-spacing:.05em; }

.btn{
  background:var(--ui-bg2); color:var(--ui-text); border:1px solid var(--ui-line);
  border-radius:5px; padding:6px 11px; cursor:pointer; font:inherit; font-size:12px;
}
.btn:hover{ background:#242424; border-color:rgba(240,240,240,.35); }
.btn.on{ background:var(--ui-accent); color:#000; border-color:var(--ui-accent); }
.btn.ghost{ padding:6px 8px; color:var(--ui-mut); }
.btn.rec{ color:var(--ui-rec); }
.btn.rec.busy{ background:#3a1414; color:#ff9b9b; border-color:#5a2222; }

select,input[type=number]{
  background:#000; color:var(--ui-text); border:1px solid var(--ui-line);
  border-radius:4px; padding:5px 7px; font:inherit; font-size:11.5px; outline:none;
}
input[type=number]{ width:62px; }
select:focus,input:focus{ border-color:var(--ui-accent); }
#recwrap{ position:relative; display:inline-flex; }
#recbar{ position:absolute; left:0; bottom:-3px; height:3px; width:0%; background:var(--ui-rec); border-radius:2px; transition:width .1s linear; }
#recbar.done{ background:var(--ui-accent); }

/* point-placing / paint controls in the right rail */
.ptsbar{ display:flex; gap:6px; margin-top:6px; flex-wrap:wrap; align-items:center; }
.btn.sm{ padding:5px 8px; font-size:10.5px; }
.ptsbar .hint{ color:var(--ui-mut); font-size:10px; line-height:1.3; }

/* popovers (sources / presets / folder) anchored above the bottom bar */
#ui-pop{ position:fixed; z-index:420; display:none; min-width:220px; max-width:420px; max-height:62vh; overflow-y:auto;
  background:var(--ui-bg); border:1px solid var(--ui-line); border-radius:7px; padding:12px;
  box-shadow:0 -8px 36px rgba(0,0,0,.6); }
#ui-pop.on{ display:block; }
#ui-pop .pop-title{ font-size:9px; letter-spacing:.09em; text-transform:uppercase; color:var(--ui-mut); margin-bottom:8px; font-weight:600; }
#ui-pop .pop-row{ display:flex; gap:6px; margin-top:6px; align-items:center; }
#ui-pop select,#ui-pop input[type=text]{ background:#000; color:var(--ui-text); border:1px solid var(--ui-line); border-radius:4px; padding:5px 7px; font:inherit; font-size:11.5px; }
/* the relocated source slots/library inherit their own CSS from style.css */
#ui-pop #slot-bar,#ui-pop #library-section{ position:static; width:auto; }

/* progress scrubber in the bottom bar */
#ui-scrub{ width:140px; accent-color:var(--ui-accent); height:3px; }
#scrub-grp .val{ width:34px; color:var(--ui-mut); font-size:10px; }
