/* 4E demo starter 1.0.0: the live demo panel's styles (kit, web/landing/demo_starter/demo.css). Copy to
   <V>/site/src/demo/demo.css. Everything sits inside .fd, so it works on the landing (over landing.css) and on its own
   (the preview page). Colours are the kit tokens (brand/tokens.css) with fallbacks; the tool's accent is --fd-acc
   (demo_kit sets it from cfg.accent). The panel follows the page theme (dark and light); the stage stays the dark
   viewport in both, as in the window and the web Studio. A tool changes the look of its stage in its engine and, if
   it must, the values in "the tool's own" at the end; it never restyles another tool's demo. */
.demo.fd{--fd-acc:var(--sig,#5fb4f5);--fd-on-acc:#06121f;
  --fd-bg:rgba(14,17,24,.86);--fd-text:#e9edf3;--fd-dim:#8995ab;--fd-line:rgba(255,255,255,.09);
  --fd-ctl:rgba(255,255,255,.045);--fd-ctl-line:rgba(255,255,255,.13);--fd-ctl-hover:rgba(255,255,255,.09);--fd-track:rgba(255,255,255,.16);
  --fd-stage:radial-gradient(120% 90% at 50% 20%,#20283a 0%,#0d1018 70%);--fd-stage-h:380px;
  container:fd / inline-size;position:relative;display:flex;flex-direction:column;background:var(--fd-bg);color:var(--fd-text);border:1px solid var(--fd-line);border-radius:18px;overflow:hidden;
  box-shadow:0 30px 80px -20px rgba(0,0,0,.6),inset 0 1px 0 rgba(255,255,255,.06);font:14px/1.45 var(--ui,"Inter",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif);
  -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);text-align:left}
@media (prefers-color-scheme:light){:root:not([data-theme="dark"]) .demo.fd{--fd-bg:var(--card,#fff);--fd-text:var(--text,#141821);--fd-dim:var(--dim,#4f586b);
  --fd-line:rgba(20,24,33,.11);--fd-ctl:rgba(20,24,33,.035);--fd-ctl-line:rgba(20,24,33,.17);--fd-ctl-hover:rgba(20,24,33,.075);--fd-track:rgba(20,24,33,.16);
  box-shadow:0 24px 60px -24px rgba(20,24,40,.35)}}
:root[data-theme="light"] .demo.fd{--fd-bg:var(--card,#fff);--fd-text:var(--text,#141821);--fd-dim:var(--dim,#4f586b);
  --fd-line:rgba(20,24,33,.11);--fd-ctl:rgba(20,24,33,.035);--fd-ctl-line:rgba(20,24,33,.17);--fd-ctl-hover:rgba(20,24,33,.075);--fd-track:rgba(20,24,33,.16);
  box-shadow:0 24px 60px -24px rgba(20,24,40,.35)}
.fd *{box-sizing:border-box}
.fd svg{width:16px;height:16px;flex:none}
.fd button{font-family:inherit}
.fd :focus-visible{outline:2px solid var(--fd-acc);outline-offset:2px}

/* head */
.fd .fd-head{display:flex;align-items:center;gap:10px;padding:11px 14px;border-bottom:1px solid var(--fd-line);font-size:13px;min-width:0}
.fd .fd-head b{font-weight:600;white-space:nowrap}
.fd .fd-head .live{display:inline-flex;align-items:center;gap:6px;color:var(--fd-acc);font-size:11.5px;font-weight:600;text-transform:uppercase;letter-spacing:.06em}
.fd .fd-head .live i{width:7px;height:7px;border-radius:50%;background:var(--fd-acc);animation:fd-pulse 1.8s infinite}
@keyframes fd-pulse{50%{opacity:.35}}
.fd .fd-head .sp{flex:1}
@media (prefers-color-scheme:light){:root:not([data-theme="dark"]) .fd .fd-head .live{color:color-mix(in srgb,var(--fd-acc) 62%,#141821)}}
:root[data-theme="light"] .fd .fd-head .live{color:color-mix(in srgb,var(--fd-acc) 62%,#141821)}
.fd .fd-sub{color:var(--fd-dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}

/* stage: the biggest part (>= 55 % of the panel) */
.fd .fd-stage{position:relative;height:var(--fd-stage-h);flex:none;background:var(--fd-stage);cursor:default;touch-action:auto;overflow:hidden;color:#e9edf3}
.fd .fd-stage>canvas,.fd .fd-three{position:absolute;inset:0;display:block;width:100%;height:100%}
.fd .fd-three canvas{display:block;width:100%!important;height:100%!important;touch-action:none}
.fd .fd-three[hidden],.fd .fd-stage>canvas[hidden]{display:none}
.fd .fd-draw{z-index:3;cursor:crosshair;touch-action:none;background:rgba(6,8,14,.18)}
.fd .fd-stats{position:absolute;left:12px;bottom:10px;display:flex;flex-wrap:wrap;gap:6px;pointer-events:none;z-index:2;max-width:calc(100% - 70px)}
.fd .chip{font:500 11.5px var(--mono,ui-monospace,Menlo,Consolas,monospace);padding:3px 8px;border-radius:7px;background:rgba(0,0,0,.45);border:1px solid rgba(255,255,255,.12);color:#d7deea}
.fd .chip.ok{color:#fff;border-color:color-mix(in srgb,var(--fd-acc) 60%,transparent)}
.fd .fd-hint{position:absolute;right:12px;top:10px;font-size:11.5px;color:#9aa7bd;pointer-events:none;z-index:2}
.fd.drawing .fd-hint{display:none}
.fd .fd-play{position:absolute;right:10px;bottom:10px;z-index:4;width:36px;height:36px;border-radius:10px;border:1px solid rgba(255,255,255,.16);
  background:rgba(8,10,14,.72);color:#e9edf3;display:grid;place-items:center;cursor:pointer;padding:0}
.fd .fd-play:hover{background:rgba(40,46,60,.9)}
.fd .fd-play[aria-pressed="true"] .i-play,.fd .fd-play[aria-pressed="false"] .i-pause{display:none}
.fd .fd-drawbar{position:absolute;left:10px;top:10px;z-index:5;display:flex;align-items:center;gap:3px;padding:4px;border-radius:11px;
  background:rgba(8,10,16,.8);border:1px solid rgba(255,255,255,.12);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
.fd .fd-drawbar[hidden]{display:none}
.fd .fd-drawbar button{height:30px;padding:0 11px;border-radius:8px;border:0;background:transparent;color:#d3dbe8;font:500 12.5px var(--ui,system-ui);cursor:pointer}
.fd .fd-drawbar button:hover{background:rgba(255,255,255,.1)}
.fd .fd-drawbar button[aria-pressed="true"]{background:var(--fd-acc);color:var(--fd-on-acc)}
.fd .fd-drawbar .fd-done{background:rgba(255,255,255,.12);color:#fff;font-weight:600}
.fd .fd-sep{width:1px;height:18px;background:rgba(255,255,255,.16);margin:0 3px}
.fd .fd-drop{position:absolute;inset:8px;z-index:6;display:grid;place-items:center;border:2px dashed var(--fd-acc);border-radius:14px;
  background:rgba(11,13,19,.8);color:#eef2f8;font:600 14px var(--ui,system-ui);opacity:0;pointer-events:none;transition:opacity .15s}
.fd.dropping .fd-drop{opacity:1}
.fd .fd-toast{position:absolute;left:50%;top:12px;z-index:7;transform:translate(-50%,-8px);padding:7px 12px;border-radius:9px;background:rgba(8,10,16,.88);
  border:1px solid rgba(255,255,255,.14);color:#eef2f8;font-size:12.5px;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;white-space:nowrap}
.fd .fd-toast.on{opacity:1;transform:translate(-50%,0)}
.fd .fd-err{position:absolute;inset:0;display:grid;place-items:center;padding:24px;text-align:center;color:#b9c3d4}
.fd .fd-err[hidden]{display:none}

/* controls */
.fd .fd-ctl{padding:12px 14px 10px;display:grid;gap:10px}
.fd .fd-presets{display:flex;flex-wrap:wrap;gap:6px}
.fd .fd-presets button,.fd .fd-plug button,.fd .fd-words{height:32px;display:inline-flex;align-items:center;gap:7px;padding:0 12px;border-radius:9px;
  border:1px solid var(--fd-ctl-line);background:var(--fd-ctl);color:var(--fd-text);font:500 12.5px var(--ui,system-ui);cursor:pointer;white-space:nowrap;transition:background .15s,border-color .15s}
.fd .fd-presets button:hover,.fd .fd-plug button:hover{background:var(--fd-ctl-hover)}
.fd .fd-presets button[aria-pressed="true"]{background:var(--fd-acc);border-color:var(--fd-acc);color:var(--fd-on-acc);font-weight:600}
.fd .fd-sliders{display:grid;grid-template-columns:1fr 1fr;gap:2px 20px}
.fd .fd-sl{display:grid;grid-template-columns:92px minmax(0,1fr) 46px;align-items:center;gap:10px;font-size:12.5px;color:var(--fd-dim);min-width:0}
.fd .fd-sl span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fd .fd-sl output{font:500 12px var(--mono,ui-monospace,Menlo,Consolas,monospace);color:var(--fd-text);text-align:right}
.fd input[type=range]{-webkit-appearance:none;appearance:none;width:100%;height:24px;margin:0;background:transparent;cursor:pointer}
.fd input[type=range]::-webkit-slider-runnable-track{height:5px;border-radius:9px;background:linear-gradient(90deg,var(--fd-acc) var(--p,50%),var(--fd-track) var(--p,50%))}
.fd input[type=range]::-moz-range-track{height:5px;border-radius:9px;background:var(--fd-track)}
.fd input[type=range]::-moz-range-progress{height:5px;border-radius:9px;background:var(--fd-acc)}
.fd input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;margin-top:-5.5px;border-radius:50%;background:#fff;border:0;box-shadow:0 1px 4px rgba(0,0,0,.45)}
.fd input[type=range]::-moz-range-thumb{width:16px;height:16px;border-radius:50%;background:#fff;border:0;box-shadow:0 1px 4px rgba(0,0,0,.45)}
.fd .fd-own{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.fd .fd-own[hidden]{display:none}
.fd .fd-own-l{font-size:12px;font-weight:600;color:var(--fd-dim);text-transform:uppercase;letter-spacing:.05em;margin-right:4px}
.fd .fd-plug{display:inline-flex;align-items:center;gap:2px;min-width:0}
.fd .fd-plug button span{max-width:140px;overflow:hidden;text-overflow:ellipsis}
.fd .fd-plug button.on,.fd .fd-plug button[aria-pressed="true"]{border-color:var(--fd-acc);background:color-mix(in srgb,var(--fd-acc) 16%,transparent)}
.fd .fd-plug button:disabled{opacity:.4;cursor:default}
.fd .fd-plug .fd-x{width:28px;padding:0;justify-content:center;border-color:transparent;background:transparent;color:var(--fd-dim)}
.fd .fd-plug .fd-x[hidden]{display:none}
.fd .fd-words{cursor:text;padding:0 10px;min-width:0}
.fd .fd-words input{border:0;background:transparent;color:var(--fd-text);font:500 13px var(--ui,system-ui);outline:none;width:120px;min-width:0;padding:0}
.fd .fd-words input::placeholder{color:var(--fd-dim)}
.fd .fd-words:focus-within{border-color:var(--fd-acc)}

/* foot: what the full tool adds + the hand-off */
.fd .fd-foot{display:flex;align-items:center;gap:12px;padding:10px 14px 14px;border-top:1px solid var(--fd-line);flex-wrap:wrap}
.fd .fd-adds{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0;flex:1 1 300px;min-width:0;font-size:12.5px;color:var(--fd-dim)}
.fd .fd-adds b{font-weight:600;color:var(--fd-text);margin-right:2px}
.fd .fd-adds .fd-lock{display:inline-flex;align-items:center;gap:5px;padding:3px 9px 3px 7px;border-radius:99px;border:1px dashed var(--fd-ctl-line);white-space:nowrap}
.fd .fd-adds .fd-lock svg{width:12px;height:12px;opacity:.75}
.fd .fd-open{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:38px;padding:0 16px;border-radius:10px;border:1px solid var(--fd-acc);
  background:var(--fd-acc);color:var(--fd-on-acc);font:600 13.5px var(--ui,system-ui);cursor:pointer;white-space:nowrap;margin-left:auto;
  box-shadow:0 8px 22px -10px color-mix(in srgb,var(--fd-acc) 80%,transparent);transition:filter .15s,transform .12s}
.fd .fd-open:hover{filter:brightness(1.08)}
.fd .fd-open:active{transform:translateY(1px)}

/* a narrow panel (the landing hero's column, 480-680 px): a taller stage, compact controls, "Your own" on one line */
@container fd (min-width:480px) and (max-width:680px){
  .fd .fd-stage{height:calc(var(--fd-stage-h) + 20px)}
  .fd .fd-ctl{gap:8px}
  .fd .fd-sliders{gap:0 14px}
  .fd .fd-sl{grid-template-columns:74px minmax(0,1fr) 42px;gap:7px}
  .fd .fd-own-l{display:none}
  .fd .fd-presets button,.fd .fd-plug button,.fd .fd-words{padding:0 9px;gap:6px}
  .fd .fd-plug .fd-x{width:24px;padding:0}
  .fd .fd-words{flex:1 1 110px}.fd .fd-words input{width:100%}
  .fd .fd-plug button span{max-width:104px}
}
/* phone */
@media (max-width:560px){
  .demo.fd{--fd-stage-h:270px}
  .fd .fd-sliders{grid-template-columns:1fr}
  .fd .fd-sl{grid-template-columns:84px minmax(0,1fr) 44px}
  .fd .fd-hint,.fd .fd-sub{display:none}
  .fd .fd-presets button{padding:0 10px;flex:1 1 auto;justify-content:center}
  .fd .fd-own-l{width:100%}
  .fd .fd-words{flex:1 1 140px}
  .fd .fd-words input{width:100%}
  .fd .fd-plug button span{max-width:96px}
  .fd .fd-open{width:100%;margin-left:0;height:42px}
  .fd .fd-stats .chip:nth-child(n+3){display:none}
}
@media (pointer:coarse){.fd .fd-presets button,.fd .fd-plug button,.fd .fd-words{height:36px}.fd .fd-drawbar button{height:34px}}
@media (prefers-reduced-motion:reduce){.fd .fd-head .live i{animation:none}.fd .fd-toast{transition:none}}

/* ?embed=demo (4E Vault's "Try demo here"): only the panel, filling the window (landing.js or demo_kit.js sets it) */
html.embed-demo,html.embed-demo body{height:100%;margin:0;overflow:hidden;background:#0b0d12}
html.embed-demo body>*:not(.demo):not(svg):not(script){display:none!important}
html.embed-demo .demo.fd{position:fixed;inset:0;width:auto;max-width:none;margin:0;border:0;border-radius:0;overflow:auto;opacity:1;transform:none}
html.embed-demo .fd .fd-stage{flex:1 1 auto;height:auto;min-height:240px}

/* ---- the tool's own (below this line: the stage's look, a different stage height, extra controls) ---- */
/* Kinetic (kit demo starter 1.0.0 + the tool's own): one panel, three tabs, each tab a starter panel (.fd.kd-tab)
   inside the outer .demo.fd. The accent is Kinetic's gold; the stage is the dark slate of the window, the web Studio
   and the renders (#0b0d10), the Hop strobe's look kept as it was. */
.demo.fd.kd{--fd-acc:#f4e07b;--fd-on-acc:#1a1606;--fd-stage:#0b0d10;--fd-stage-h:330px}
.kd .kd-tab{display:flex;flex-direction:column;min-width:0}
.kd .kd-tab[hidden]{display:none}
.kd .kd-tab>.fd-head{display:none}
/* the tabs, in the head: the kit's segmented look, the open one in the accent */
.kd .kd-tabs{display:inline-flex;gap:2px;padding:3px;border-radius:10px;background:var(--fd-ctl);border:1px solid var(--fd-line)}
.kd [role=tab]{height:28px;padding:0 12px;border:0;border-radius:7px;background:transparent;color:var(--fd-text);opacity:.82;font:500 12.5px var(--ui,system-ui);cursor:pointer;white-space:nowrap}
.kd [role=tab]:hover{background:var(--fd-ctl-hover);opacity:1}
.kd [role=tab][aria-selected="true"]{background:var(--fd-acc);color:var(--fd-on-acc);font-weight:600;opacity:1}
/* the tool's own small controls: an on/off switch on the stage (top right), the prop row, the big empty-stage hint */
.kd .kd-toggle{position:absolute;right:10px;top:10px;z-index:5;display:inline-flex;align-items:center;gap:7px;height:30px;padding:0 11px 0 9px;border-radius:9px;
  border:1px solid rgba(255,255,255,.14);background:rgba(8,10,16,.8);color:#d3dbe8;font:500 12.5px var(--ui,system-ui);cursor:pointer}
.kd .kd-toggle::before{content:"";width:9px;height:9px;border-radius:50%;border:1.5px solid currentColor;box-sizing:border-box}
.kd .kd-toggle[aria-pressed="true"]{color:#fff6ce;border-color:color-mix(in srgb,var(--fd-acc) 55%,transparent)}
.kd .kd-toggle[aria-pressed="true"]::before{background:var(--fd-acc);border-color:var(--fd-acc)}
.kd .kd-toggle:hover{background:rgba(40,46,60,.9)}
.kd .kd-samples{display:inline-flex;flex-wrap:wrap;gap:6px}
.kd .kd-samples button{height:32px;padding:0 12px;border-radius:9px;border:1px solid var(--fd-ctl-line);background:var(--fd-ctl);color:var(--fd-text);font:500 12.5px var(--ui,system-ui);cursor:pointer;white-space:nowrap}
.kd .kd-samples button:hover{background:var(--fd-ctl-hover)}
.kd .kd-samples button[aria-pressed="true"]{border-color:var(--fd-acc);background:color-mix(in srgb,var(--fd-acc) 16%,transparent)}
.kd .kd-hint{position:absolute;left:50%;top:50%;z-index:4;transform:translate(-50%,-50%);margin:0;display:flex;align-items:center;gap:9px;
  padding:10px 16px;border-radius:12px;border:1px dashed rgba(244,224,123,.5);color:#efe3a6;font:500 14px var(--ui,system-ui);
  background:rgba(11,13,16,.7);pointer-events:none;white-space:nowrap}
.kd .kd-hint svg{width:18px;height:18px}
.kd .kd-hint[hidden]{display:none}
/* Draw: Pen only (the kit's draw bar keeps Clear); the pen layer stays on, see-through, so the engine's draw-on shows */
.kd #kdDraw .fd-drawbar [data-fd-dmode],.kd #kdDraw .fd-drawbar [data-fd-ddone],.kd #kdDraw .fd-drawbar .fd-sep{display:none}
.kd #kdDraw .fd-draw{background:transparent}
@media (pointer:coarse){.kd [role=tab]{height:32px}.kd .kd-samples button{height:36px}}
@media (max-width:560px){
  .demo.fd.kd{--fd-stage-h:260px}
  .kd .kd-try{display:none}
  .kd [role=tab]{padding:0 10px}
  .kd .kd-hint{font-size:13px}
}
/* the hero's narrow column: a little shorter, so the whole panel sits above the fold at 1440 x 900 */
@container fd (min-width:480px) and (max-width:680px){
  .kd .kd-try,.kd .fd-sub{display:none}
  .kd .fd-stage{height:300px}
  .kd .fd-head{padding:8px 12px}
  .kd .fd-ctl{padding:10px 12px 8px}
  .kd .fd-foot{padding:8px 12px 12px;gap:8px}
  .kd .fd-adds{font-size:11.5px;gap:4px}
  .kd .fd-adds .fd-lock{padding:2px 7px 2px 5px}
  .kd .fd-sl{min-height:22px;grid-template-columns:74px minmax(0,1fr) 54px}
}
/* ?embed=demo: the open tab's stage fills the window */
html.embed-demo .demo.fd.kd{display:flex;flex-direction:column}
html.embed-demo .kd .kd-tab:not([hidden]){flex:1 1 auto;min-height:0}
