/* fx-lab: interactive widget lab (bento grid) inside #work. Rendered by js/fx-lab.js.
   Hidden entrance states only exist under .lab-wait (added by the script), so without JS
   or with html.no-anim everything is static and fully visible. */

.lab {
  --e: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --lab-r: calc(var(--r) * 1.6);
  display: grid; gap: 16px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-areas:
    "tog tog tog tog tog sld sld sld sld key key key"
    "col col col col tab tab tab tab tab cmb cmb cmb"
    "col col col col plt plt plt plt plt plt plt plt"
    "ntf ntf ntf ntf ntf ntf ntf lod lod lod lod lod";
}
.lab:empty { display: none; }
.lab-tog { grid-area: tog; } .lab-sld { grid-area: sld; } .lab-key { grid-area: key; }
.lab-col { grid-area: col; } .lab-tab { grid-area: tab; } .lab-cmb { grid-area: cmb; }
.lab-plt { grid-area: plt; } .lab-ntf { grid-area: ntf; } .lab-lod { grid-area: lod; }

/* ---------- tile ---------- */
.lab-tile {
  position: relative; min-width: 0; display: flex; flex-direction: column;
  padding: 24px; border-radius: var(--lab-r); background: var(--s1, #0a0a0a); border: 1px solid var(--line, #1c1c1c);
  container-type: inline-size;
  transition: border-color .3s ease;
}
.lab-tile:hover { border-color: var(--line-2, #2a2a2a); }
.lab-tile.is-open { z-index: 6; }
/* top hairline, same language as the process cards */
.lab-tile::after {
  content: ""; position: absolute; top: -1px; left: 24px; right: 24px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
}
/* pointer spotlight: soft interior glow + brighter 1px ring near the pointer */
.lab-tile::before {
  content: ""; position: absolute; inset: -1px; padding: 1px; border-radius: inherit; pointer-events: none; z-index: 0;
  background: radial-gradient(340px circle at var(--mx, -999px) var(--my, -999px), rgba(255,255,255,.5), rgba(255,255,255,.12) 36%, transparent 70%);
  -webkit-mask: linear-gradient(rgba(0,0,0,.16) 0 0) content-box, linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: source-over, xor;
  mask: linear-gradient(rgba(0,0,0,.16) 0 0) content-box, linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: add, exclude;
  opacity: 0; transition: opacity .35s ease;
}
@media (hover: hover) and (pointer: fine) {
  .lab.lab-anim .lab-tile:hover::before { opacity: 1; }
}
.lab-tile > * { position: relative; z-index: 1; }

.lab-head { margin-bottom: 20px; }
.lab-k { display: block; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim, #666); }
.lab-k b { font-weight: 500; color: var(--muted, #a1a1a1); }
.lab-t { margin: 14px 0 0; font-size: 16px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; color: var(--text, #fafafa); }
.lab-d { margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--muted, #a1a1a1); }

/* recessed panel the widget lives in (like a child window) */
.lab-well {
  flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center;
  padding: 16px; border-radius: var(--r); background: #050505; border: 1px solid var(--line, #1c1c1c);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.lab-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lab-mini { font: 500 11px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim, #666); }
.lab-fl { font-size: 13px; color: var(--muted, #a1a1a1); }
.lab-read { font: 500 13px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--text, #fafafa); }
.lab-ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- entrance ---------- */
html:not(.no-anim) .lab.lab-anim .lab-tile {
  transition: opacity .75s var(--e) var(--d, 0ms), translate .75s var(--e) var(--d, 0ms),
              scale .75s var(--e) var(--d, 0ms), filter .75s var(--e) var(--d, 0ms), border-color .3s ease;
}
html:not(.no-anim) .lab.lab-wait .lab-tile:not(.in) { opacity: 0; translate: 0 28px; scale: .985; filter: blur(6px); }
.lab.lab-lite.lab-wait .lab-tile:not(.in) { filter: none !important; }

/* ---------- buttons ---------- */
.lab-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  border: 1px solid transparent; border-radius: var(--r); font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .2s ease, border-color .2s ease, opacity .2s ease, transform .2s var(--e);
}
.lab-btn:active { transform: translateY(1px) scale(.98); }
.lab-btn .lab-ic { width: 15px; height: 15px; }
.lab-btn-primary { background: var(--accent, #fafafa); color: var(--on-accent, #000); }
.lab-btn-primary:hover { opacity: .88; }
.lab-btn-ghost { background: var(--s2, #111); border-color: var(--line-2, #2a2a2a); color: var(--text, #fafafa); }
.lab-btn-ghost:hover { background: var(--s3, #171717); border-color: #3a3a3a; }
.lab-btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }

/* ===================== 01 toggles ===================== */
.lab-well-tg { padding: 6px 16px 6px; }
.lab-row-cap { padding: 10px 0 8px; }
.lab-tg-list { display: flex; flex-direction: column; }
.lab-tg-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%;
  padding: 14px 0; border: 0; border-top: 1px solid var(--line, #1c1c1c); background: none; text-align: left; cursor: pointer;
  border-radius: 0;
}
.lab-tg-row:focus-visible { border-radius: 6px; }
.lab-tg-txt { display: flex; flex-direction: column; min-width: 0; }
.lab-tg-name { font-size: 14px; font-weight: 500; color: var(--text, #fafafa); }
.lab-tg-sub { font-size: 12.5px; color: var(--dim, #666); transition: color .2s ease; }
.lab-tg-row:hover .lab-tg-sub { color: var(--muted, #a1a1a1); }
.lab-tg {
  position: relative; flex: none; width: 36px; height: 20px; border-radius: 999px;
  background: #1c1c1c; box-shadow: inset 0 0 0 1px #2a2a2a; transition: background .3s var(--e), box-shadow .3s var(--e);
}
.lab-tg-knob {
  position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 999px; background: #8a8a8a;
  transition: translate .5s var(--spring), width .25s var(--e), background .3s var(--e);
}
.lab [role="switch"][aria-checked="true"] .lab-tg { background: var(--accent, #fafafa); box-shadow: inset 0 0 0 1px var(--accent, #fafafa); }
.lab [role="switch"][aria-checked="true"] .lab-tg-knob { translate: 16px 0; background: #000; }
.lab [role="switch"]:active .lab-tg-knob { width: 18px; }
.lab [role="switch"][aria-checked="true"]:active .lab-tg-knob { translate: 12px 0; }
/* compact switch with a label in front (the plot's "Live" pause control) */
.lab-sw-inline {
  display: inline-flex; align-items: center; gap: 10px; height: 28px; padding: 0 2px 0 4px; border: 0; border-radius: 6px;
  background: none; color: var(--muted, #a1a1a1); font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; white-space: nowrap; transition: color .2s ease;
}
.lab-sw-inline:hover { color: var(--text, #fafafa); }

/* ===================== shared range (slider + hue) ===================== */
.lab-range {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 20px; margin: 0; padding: 0;
  background: transparent; cursor: pointer; --fill: calc(7px + (100% - 14px) * var(--pf, .5));
}
.lab-range::-webkit-slider-runnable-track {
  height: 4px; border-radius: 999px;
  background: linear-gradient(to right, var(--accent, #fafafa) var(--fill), #222 var(--fill));
}
.lab-range::-moz-range-track { height: 4px; border-radius: 999px; background: #222; }
.lab-range::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--accent, #fafafa); }
.lab-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-top: -5px; border: 0; border-radius: 50%;
  background: #000; box-shadow: 0 0 0 2px var(--accent, #fafafa), 0 2px 8px rgba(0,0,0,.6);
  transition: transform .35s var(--spring), box-shadow .2s ease;
}
.lab-range::-moz-range-thumb {
  width: 14px; height: 14px; border: 0; border-radius: 50%; background: #000;
  box-shadow: 0 0 0 2px var(--accent, #fafafa), 0 2px 8px rgba(0,0,0,.6); transition: transform .35s var(--spring);
}
.lab-range:hover::-webkit-slider-thumb, .lab-range:focus-visible::-webkit-slider-thumb { transform: scale(1.15); }
.lab-range:active::-webkit-slider-thumb { transform: scale(1.3); box-shadow: 0 0 0 2px var(--accent, #fafafa), 0 0 0 7px rgba(255,255,255,.1); }
.lab-range:hover::-moz-range-thumb, .lab-range:focus-visible::-moz-range-thumb { transform: scale(1.15); }
.lab-range:active::-moz-range-thumb { transform: scale(1.3); }
.lab-range:focus-visible { outline: 2px solid var(--accent, #fafafa); outline-offset: 3px; border-radius: 6px; }

/* ===================== 02 slider ===================== */
.lab-well-sl {
  --rr: 12px; --glow-a: .35; gap: 18px; border-radius: var(--rr);
  border-color: rgba(255,255,255, calc(.07 + var(--glow-a) * .2));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 0 46px -14px rgba(255,255,255, calc(var(--glow-a) * .38));
  transition: border-radius .35s var(--e), box-shadow .35s var(--e), border-color .35s var(--e);
}
.lab-sl-field { position: relative; margin-top: 32px; padding-bottom: 24px; }
.lab-bubble {
  position: absolute; top: -30px;
  left: calc(7px + (100% - 14px) * var(--pf, .5)); translate: -50% 0;
  min-width: 30px; padding: 3px 7px; border-radius: 6px; background: var(--accent, #fafafa); color: #000;
  font: 600 11.5px/1.2 var(--mono); text-align: center; font-variant-numeric: tabular-nums;
  box-shadow: 0 6px 16px -6px rgba(0,0,0,.8);
  transition: scale .3s var(--spring), translate .3s var(--spring);
}
.lab-bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -4px; width: 8px; height: 8px; translate: -50% 0; rotate: 45deg;
  background: inherit; border-radius: 1px; z-index: -1;
}
.lab-sl-field.is-drag .lab-bubble { scale: 1.12; translate: -50% -2px; }
.lab-ticks { position: absolute; left: 0; right: 0; bottom: 0; height: 20px; }
.lab-tick {
  position: absolute; top: 0; left: calc(7px + (100% - 14px) * var(--tf)); translate: -50% 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font: 500 10.5px/1 var(--mono); color: var(--dim, #666); transition: color .25s ease;
}
.lab-tick i { width: 1px; height: 5px; background: #2a2a2a; transition: background .25s ease; }
.lab-tick.on { color: var(--muted, #a1a1a1); }
.lab-tick.on i { background: #555; }

/* ===================== 03 keybind ===================== */
.lab-well-kb { gap: 14px; }
.lab-kb-list { display: flex; flex-direction: column; gap: 10px; }
/* wraps instead of squeezing: a long combo drops under its name in narrow tiles */
.lab-kb-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; min-width: 0; }
.lab-kb-name { flex: 0 1 auto; min-width: 0; font-size: 13.5px; color: var(--muted, #a1a1a1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lab-kb-row .lab-chip { margin-left: auto; }
.lab-chip {
  flex: none; min-width: 64px; max-width: 100%; height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2, #2a2a2a); background: var(--s2, #111); color: var(--text, #fafafa);
  font: 500 12px/1 var(--mono); letter-spacing: .02em; cursor: pointer; white-space: nowrap;
  box-shadow: inset 0 -2px 0 rgba(255,255,255,.04);
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  transition: border-color .2s ease, background .2s ease, color .2s ease, box-shadow .3s ease;
}
.lab-chip:hover { border-color: #3a3a3a; background: var(--s3, #171717); }
/* combos: each key is its own small cap inside the pill */
.lab-chip.is-combo { padding: 0 4px; }
.lab-chip.is-combo .lab-kc {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 999px;
  background: #1c1c1c; box-shadow: inset 0 0 0 1px #2a2a2a, inset 0 -1px 0 rgba(255,255,255,.05); font-size: 11px;
}
.lab-chip.is-listening, .lab-chip.is-set.is-listening {
  border-color: var(--accent, #fafafa); color: var(--muted, #a1a1a1);
  box-shadow: 0 0 0 3px rgba(255,255,255,.08); animation: lab-listen 1.4s ease-in-out infinite;
}
@keyframes lab-listen { 50% { box-shadow: 0 0 0 5px rgba(255,255,255,.03); } }
.lab-chip.is-set { animation: lab-set .7s var(--e); }
@keyframes lab-set { from { background: var(--accent, #fafafa); color: #000; } }
.lab-kb-mode { display: flex; flex-direction: column; gap: 8px; }
.lab-kb-live { margin: 0; padding-top: 12px; border-top: 1px solid var(--line, #1c1c1c); font: 11.5px/1.5 var(--mono); color: var(--dim, #666); min-height: 2.5em; }

/* ===================== 04 color picker ===================== */
.lab-col .lab-well { display: flex; flex-direction: column; gap: 14px; flex: 1 1 auto; }
.lab-sv {
  position: relative; flex: 1 1 auto; min-height: 150px; max-height: 272px; border-radius: 8px; cursor: crosshair; touch-action: none;
  background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, var(--hue, #00f));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.lab-sv-dot {
  position: absolute; left: var(--sx, 50%); top: var(--sy, 50%); width: 16px; height: 16px; translate: -50% -50%;
  border-radius: 50%; background: var(--pick, #fff); box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0,0,0,.45), 0 4px 12px rgba(0,0,0,.5);
  pointer-events: none; transition: scale .3s var(--spring);
}
.lab-sv.is-drag .lab-sv-dot { scale: 1.2; }
.lab-sv:focus-visible { outline: 2px solid var(--accent, #fafafa); outline-offset: 3px; }
.lab-hue { height: 20px; }
.lab-hue::-webkit-slider-runnable-track {
  height: 8px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  background: linear-gradient(to right, #f00, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00);
}
.lab-hue::-moz-range-track { height: 8px; border-radius: 999px; background: linear-gradient(to right, #f00, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00); }
.lab-hue::-moz-range-progress { background: transparent; }
.lab-hue::-webkit-slider-thumb { margin-top: -3px; }
.lab-cp-strips { display: flex; flex-direction: column; gap: 8px; }
.lab-cp-strip { display: grid; grid-template-columns: 46px minmax(0, 1fr) 40px; align-items: center; gap: 10px; }
.lab-cp-v { font: 500 12px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--text, #fafafa); text-align: right; }
/* alpha: checkerboard under a transparent -> color ramp */
.lab-alpha { height: 20px; --chk: conic-gradient(#2a2a2a 25%, #161616 0 50%, #2a2a2a 0 75%, #161616 0) 0 0 / 8px 8px; }
.lab-alpha::-webkit-slider-runnable-track {
  height: 8px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  background: linear-gradient(to right, transparent, var(--pick, #fafafa)), var(--chk);
}
.lab-alpha::-moz-range-track { height: 8px; border-radius: 999px; background: linear-gradient(to right, transparent, var(--pick, #fafafa)), var(--chk); }
.lab-alpha::-moz-range-progress { background: transparent; }
.lab-alpha::-webkit-slider-thumb { margin-top: -3px; }
.lab-cp-rgb { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.lab-cp-rgb span {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; height: 28px; padding: 0 9px;
  border-radius: 6px; background: #0c0c0c; box-shadow: inset 0 0 0 1px var(--line, #1c1c1c);
  font: 500 12px/1 var(--mono); font-variant-numeric: tabular-nums;
}
.lab-cp-rgb i { font-style: normal; color: var(--dim, #666); }
.lab-cp-rgb b { font-weight: 500; color: var(--text, #fafafa); }
.lab-sws { display: flex; flex-wrap: wrap; gap: 10px; }
.lab-sw {
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); transition: transform .3s var(--spring), box-shadow .2s ease;
}
.lab-sw:hover { transform: scale(1.12); }
.lab-sw[aria-pressed="true"] { box-shadow: 0 0 0 2px #050505, 0 0 0 3.5px var(--accent, #fafafa); }
.lab-cp-foot { display: flex; align-items: center; gap: 10px; }
.lab-cp-recent { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lab-rcs { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.lab-rc {
  width: 18px; height: 18px; padding: 0; border: 0; border-radius: 5px; cursor: pointer; background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); transition: transform .3s var(--spring);
}
.lab-rc:hover { transform: scale(1.12); }
.lab-cp-chip {
  flex: 1 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
  border-radius: var(--r); color: #fff; font-size: 13px; font-weight: 600;
  background: linear-gradient(var(--pick-a, #7286c8), var(--pick-a, #7286c8)), conic-gradient(#2a2a2a 25%, #161616 0 50%, #2a2a2a 0 75%, #161616 0) 0 0 / 10px 10px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 8px 24px -14px var(--pick-a, #7286c8);
  transition: background .2s ease, color .2s ease;
}
.lab-cp-chip i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .75; }
.lab-cp-chip.dark { color: #000; }
.lab-hex {
  flex: none; width: 100px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2, #2a2a2a);
  background: var(--s2, #111); color: var(--text, #fafafa); font: 500 12.5px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase;
  transition: border-color .2s ease;
}
.lab-hex:hover { border-color: #3a3a3a; }
.lab-hex:focus-visible { outline: 2px solid var(--accent, #fafafa); outline-offset: 3px; }
.lab-hex[aria-invalid="true"] { border-color: #e5484d; }

/* ===================== 05 tabs ===================== */
.lab-seg {
  position: relative; display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); padding: 3px;
  border-radius: var(--r); background: #111; border: 1px solid var(--line, #1c1c1c);
}
.lab-seg-ind {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n, 3));
  translate: calc(100% * var(--i, 0)) 0; border-radius: calc(var(--r) - 3px);
  background: var(--accent, #fafafa); box-shadow: 0 2px 10px -2px rgba(0,0,0,.6);
  transition: translate .45s var(--e);
}
.lab-seg-tab {
  position: relative; z-index: 1; height: 30px; padding: 0 8px; border: 0; border-radius: calc(var(--r) - 3px);
  background: none; color: var(--muted, #a1a1a1); font-size: 13px; font-weight: 500; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .3s var(--e);
}
.lab-seg-tab:hover { color: var(--text, #fafafa); }
.lab-seg-tab[aria-selected="true"], .lab-seg-tab[aria-checked="true"] { color: #000; }
.lab-seg-sm .lab-seg-tab { height: 26px; font-size: 12.5px; }
.lab-panels { display: grid; margin-top: 12px; }
.lab-panel {
  grid-area: 1 / 1; display: flex; flex-direction: column; border-radius: 6px;
  opacity: 0; visibility: hidden; translate: 0 6px;
  transition: opacity .35s var(--e), translate .45s var(--e), visibility 0s linear .35s;
}
.lab-panel.on { opacity: 1; visibility: visible; translate: none; transition: opacity .35s var(--e) .05s, translate .45s var(--e) .05s, visibility 0s; }
.lab-kv { display: grid; grid-template-columns: minmax(0, 1fr) 64px auto; align-items: center; gap: 12px; padding: 8px 2px; font-size: 13px; color: var(--muted, #a1a1a1); }
.lab-kv + .lab-kv { border-top: 1px solid var(--line, #1c1c1c); }
.lab-kv b { min-width: 64px; text-align: right; font: 500 12.5px/1 var(--mono); color: var(--text, #fafafa); }
.lab-kv-bar { height: 3px; border-radius: 3px; background: #1c1c1c; overflow: hidden; }
.lab-kv-bar i { display: block; height: 100%; width: calc(var(--w, .5) * 100%); background: #8a8a8a; border-radius: inherit; }
.lab-panel.on .lab-kv-bar i { animation: lab-grow .8s var(--e) both; }
@keyframes lab-grow { from { width: 0; } }
@container (max-width: 360px) {
  .lab-kv { grid-template-columns: minmax(0, 1fr) auto; }
  .lab-kv-bar { display: none; }
}

/* ===================== 06 combo ===================== */
.lab-well-cb { display: flex; flex-direction: column; gap: 10px; }
.lab-cb { position: relative; }
.lab-cb-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 12px;
  border-radius: var(--r); border: 1px solid var(--line-2, #2a2a2a); background: var(--s2, #111); cursor: pointer; text-align: left;
  font-size: 13.5px; font-weight: 500; transition: border-color .2s ease, background .2s ease;
}
.lab-cb-btn:hover { border-color: #3a3a3a; background: var(--s3, #171717); }
.lab-cb-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-cb-chev { width: 15px; height: 15px; color: var(--muted, #a1a1a1); transition: rotate .35s var(--e); }
.lab-cb.open .lab-cb-chev { rotate: 180deg; }
.lab-dots { display: inline-flex; flex: none; }
.lab-dots i { width: 12px; height: 12px; margin-left: -4px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1.5px #111, inset 0 0 0 1px rgba(255,255,255,.16); }
.lab-dots i:first-child { margin-left: 0; }
.lab-lb {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5; margin: 0; padding: 4px; list-style: none;
  border-radius: var(--r); background: rgba(16,16,16,.9); border: 1px solid rgba(255,255,255,.08);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 24px 60px -24px #000, 0 10px 30px -10px rgba(0,0,0,.8);
  opacity: 0; visibility: hidden; translate: 0 -6px; scale: .98; transform-origin: 50% 0;
  transition: opacity .25s var(--e), translate .35s var(--e), scale .35s var(--e), visibility 0s linear .25s;
}
.lab-cb.up .lab-lb { top: auto; bottom: calc(100% + 6px); transform-origin: 50% 100%; translate: 0 6px; }
.lab-cb.open .lab-lb { opacity: 1; visibility: visible; translate: none; scale: none; transition: opacity .25s var(--e), translate .35s var(--e), scale .35s var(--e), visibility 0s; }
.lab-lb:focus-visible { outline: 2px solid var(--accent, #fafafa); outline-offset: 3px; }
.lab-opt {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 6px; cursor: pointer;
  font-size: 13.5px; color: var(--muted, #a1a1a1); transition: background .15s ease, color .15s ease;
}
.lab-opt-n { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-opt.is-active { background: rgba(255,255,255,.07); color: var(--text, #fafafa); }
.lab-opt[aria-selected="true"] { color: var(--text, #fafafa); }
.lab-opt-ck { width: 14px; height: 14px; opacity: 0; transition: opacity .2s ease; }
.lab-opt[aria-selected="true"] .lab-opt-ck { opacity: 1; }
.lab-cb-hint { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 4px 0 0; font: 11.5px/1.4 var(--mono); color: var(--dim, #666); }
.lab-cb-hint b { justify-self: end; font-weight: 500; color: var(--muted, #a1a1a1); text-transform: uppercase; }

/* ===================== 07 plot ===================== */
.lab-plt .lab-well { display: flex; flex-direction: column; gap: 12px; }
.lab-plot-top { flex-wrap: wrap; row-gap: 6px; }
.lab-plot-top .lab-mini { white-space: nowrap; }
.lab-plot-head { display: inline-flex; align-items: baseline; gap: 10px; margin-left: auto; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lab-plot-now { min-width: 7.5ch; text-align: right; font-size: 13px; font-weight: 500; color: var(--text, #fafafa); white-space: nowrap; }
.lab-plot-fps { min-width: 7ch; padding: 2px 8px; white-space: nowrap; border-radius: 999px; border: 1px solid var(--line-2, #2a2a2a); font-size: 11px; color: var(--muted, #a1a1a1); text-align: center; }
.lab-plot-box {
  position: relative; height: 128px; border-radius: 6px; overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.015), transparent);
  box-shadow: inset 0 0 0 1px var(--line, #1c1c1c);
}
.lab-plot-cv { display: block; width: 100%; height: 100%; }
/* target label: a small knockout pill sitting on the dashed guide at the left edge, above the line */
.lab-plot-guide {
  position: absolute; left: 8px; top: calc(100% - 6px - (6.94 / 11) * (100% - 14px)); translate: 0 -50%; z-index: 1;
  padding: 3px 7px; border-radius: 999px; background: #050505; box-shadow: inset 0 0 0 1px var(--line, #1c1c1c);
  font: 10px/1 var(--mono); letter-spacing: .04em; color: var(--dim, #666); white-space: nowrap; pointer-events: none;
}
.lab-plot-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; }
.lab-plot-stats { display: flex; flex-wrap: wrap; gap: 6px 20px; font: 11.5px/1 var(--mono); color: var(--dim, #666); font-variant-numeric: tabular-nums; }
.lab-plot-stats span { white-space: nowrap; }
.lab-plot-foot .lab-sw-inline { margin-left: auto; }
.lab-plot-cv { transition: opacity .3s ease; }
.lab-well-plot.is-paused .lab-plot-cv { opacity: .55; }
.lab-well-plot.is-paused .lab-plot-fps { color: var(--dim, #666); }
.lab-plot-stats b { font-weight: 500; color: var(--muted, #a1a1a1); }

/* ===================== 08 notifications ===================== */
.lab-well-nt { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.lab-nt-ctl { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-width: 0; }
.lab-nt-stats { display: flex; flex-direction: column; }
.lab-nt-stats > span, .lab-nt-sw { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 13px; }
.lab-nt-stats > * + * { border-top: 1px solid var(--line, #1c1c1c); }
.lab-nt-sw { width: 100%; border: 0; border-top: 1px solid var(--line, #1c1c1c); border-radius: 0; background: none; text-align: left; cursor: pointer; }
.lab-nt-sw:focus-visible { border-radius: 6px; }
.lab-nt-sw:hover i { color: var(--text, #fafafa); }
.lab-nt-stats i { font-style: normal; color: var(--muted, #a1a1a1); transition: color .2s ease; }
.lab-nt-stats b { font: 500 12.5px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--text, #fafafa); }
.lab-nt-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.lab-toasts {
  position: relative; height: 100%; min-height: 172px; min-width: 0; overflow: hidden; border-radius: 8px;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.012) 0 6px, transparent 6px 12px);
  box-shadow: inset 0 0 0 1px var(--line, #1c1c1c);
}
.lab-toasts-empty {
  position: absolute; inset: 0; display: grid; place-items: center; font: 11px/1 var(--mono); letter-spacing: .08em;
  text-transform: uppercase; color: var(--dim, #666); transition: opacity .3s ease;
}
.lab-toasts.has .lab-toasts-empty { opacity: 0; }
.lab-toast {
  position: absolute; top: 0; left: 0; right: 0; height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  border-radius: var(--r); background: rgba(20,20,20,.92); border: 1px solid rgba(255,255,255,.08); overflow: hidden;
  box-shadow: 0 14px 30px -14px #000; will-change: transform, opacity;
}
.lab-toast-ic { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent, #fafafa); color: #000; }
.lab-toast-ic .lab-ic { width: 14px; height: 14px; stroke-width: 2.4; }
.lab-toast-txt { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; line-height: 1.3; }
.lab-toast-txt b { font-size: 13px; font-weight: 600; color: var(--text, #fafafa); }
.lab-toast-txt span { font-size: 12px; color: var(--muted, #a1a1a1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lab-toast-t { flex: none; font: 10.5px/1 var(--mono); color: var(--dim, #666); }
.lab-toast-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255,255,255,.55); transform-origin: 0 50%; }
@container (max-width: 520px) {
  .lab-well-nt { grid-template-columns: minmax(0, 1fr); }
}

/* ===================== 09 loader ===================== */
.lab-well-ld { display: flex; flex-direction: column; gap: 14px; }
.lab-ld-top { display: flex; align-items: center; gap: 12px; }
.lab-sp-wrap { position: relative; flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #111; box-shadow: inset 0 0 0 1px var(--line-2, #2a2a2a); }
.lab-sp { width: 22px; height: 22px; transition: opacity .3s ease, scale .4s var(--e); }
.lab-sp circle { fill: none; stroke-width: 2.4; }
.lab-sp-track { stroke: #222; }
.lab-sp-arc { stroke: var(--accent, #fafafa); stroke-linecap: round; }
.lab-sp-ok { position: absolute; width: 16px; height: 16px; stroke-width: 2.4; opacity: 0; scale: .5; transition: opacity .3s ease, scale .5s var(--spring); }
.lab-well-ld.is-done .lab-sp { opacity: 0; scale: .6; }
.lab-well-ld.is-done .lab-sp-ok { opacity: 1; scale: 1; }
.lab-well-ld.is-done .lab-sp-wrap { background: var(--accent, #fafafa); color: #000; box-shadow: none; transition: background .3s ease; }
.lab-ld-txt { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; line-height: 1.35; }
.lab-ld-status { font-size: 14px; font-weight: 500; color: var(--text, #fafafa); }
/* screen-reader-only live region (loader announcements after Replay) */
.lab-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.lab-ld-sub { font: 11.5px/1.4 var(--mono); color: var(--dim, #666); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lab-ld-pct { font: 500 13px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--text, #fafafa); min-width: 4ch; text-align: right; }
.lab-bar { position: relative; height: 4px; border-radius: 999px; background: #222; overflow: hidden; }
.lab-bar-fill { position: absolute; inset: 0; border-radius: inherit; background: var(--accent, #fafafa); transform-origin: 0 50%; transform: scaleX(0); box-shadow: 0 0 10px rgba(255,255,255,.5); }
.lab-ld-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lab-ld-steps { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; }
.lab-ld-step { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--dim, #666); transition: color .3s ease; }
.lab-ld-step i { width: 7px; height: 7px; border-radius: 50%; background: #2a2a2a; transition: background .3s ease, box-shadow .3s ease; }
.lab-ld-step.cur { color: var(--text, #fafafa); }
.lab-ld-step.cur i { background: var(--accent, #fafafa); box-shadow: 0 0 0 3px rgba(255,255,255,.12); }
.lab-ld-step.done { color: var(--muted, #a1a1a1); }
.lab-ld-step.done i { background: #8a8a8a; }
/* step log, like a console pane: file on the left, time on the right */
.lab-ld-log {
  display: flex; flex-direction: column; margin: 0; padding: 7px 12px; list-style: none; border-radius: 8px;
  background: #080808; box-shadow: inset 0 0 0 1px var(--line, #1c1c1c);
  font: 11.5px/1 var(--mono); font-variant-numeric: tabular-nums;
}
.lab-ld-ln { display: flex; align-items: center; gap: 8px; height: 22px; min-width: 0; color: var(--dim, #666); transition: color .3s ease; }
.lab-ld-ln + .lab-ld-ln { border-top: 1px dashed #161616; }
.lab-ld-ln i { flex: none; width: 5px; height: 5px; border-radius: 50%; background: #2a2a2a; transition: background .3s ease; }
.lab-ld-ln span { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-ld-ln b { flex: none; margin-left: auto; padding-left: 10px; font-weight: 500; white-space: nowrap; }
.lab-ld-ln.cur { color: var(--text, #fafafa); }
.lab-ld-ln.cur i { background: var(--accent, #fafafa); }
.lab-ld-ln.cur b { color: var(--muted, #a1a1a1); }
.lab-ld-ln.done { color: var(--muted, #a1a1a1); }
.lab-ld-ln.done i { background: #8a8a8a; }
.lab-ld-ln.done b { color: var(--text, #fafafa); }

/* ===================== responsive ===================== */
@media (max-width: 1080px) {
  .lab {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "tog tog" "sld key" "col tab" "col cmb" "plt plt" "ntf ntf" "lod lod";
  }
  .lab-lod .lab-well { max-width: none; }
}
@media (max-width: 640px) {
  .lab { grid-template-columns: minmax(0, 1fr); gap: 12px; grid-template-areas: "tog" "sld" "key" "col" "tab" "cmb" "plt" "ntf" "lod"; }
  .lab-tile { padding: 20px; }
  .lab-tile::after { left: 20px; right: 20px; }
  .lab-sv { min-height: 170px; }
  .lab-plot-box { height: 112px; }
}

/* static mode: nothing moves */
html.no-anim .lab-tile { opacity: 1 !important; translate: none !important; scale: none !important; filter: none !important; }
html.no-anim .lab-chip.is-listening, html.no-anim .lab-chip.is-set, html.no-anim .lab-panel.on .lab-kv-bar i { animation: none; }
@media print {
  .lab-tile { opacity: 1 !important; translate: none !important; scale: none !important; filter: none !important; }
}
