.bits-lab{--ink:#29382d;--paper:#fbfaf5;--accent:#e6ba4f;color:var(--ink);background:var(--paper);border:1px solid #efece2;border-radius:25px;overflow:hidden;box-shadow:0 20px 65px #02081835;margin:14px 0 32px;font-family:inherit}.bits-head{padding:22px 25px 16px;display:flex;justify-content:space-between;gap:16px;align-items:center}.bits-head h1{color:#283b32!important;font-size:clamp(26px,3vw,40px)!important;text-shadow:none!important;margin:4px 0}.bits-head p,.bits-head .eyebrow{color:#6a7364!important;margin:0}.bits-head .eyebrow{font-size:10px;letter-spacing:2.5px}.bits-head-actions{display:flex;gap:8px;flex-wrap:wrap}.bits-lab button,.bits-lab select{font:inherit;cursor:pointer}.bits-lab button{border-radius:11px;min-height:40px;border:1px solid #d9dfd2;background:#fffef9;color:#34463c;padding:9px 12px;box-shadow:0 2px 0 #29382d0b}.bits-lab button:hover{background:#f0f5ea;border-color:#a7b49f}.bits-lab button:focus-visible,.bits-lab input:focus-visible,.bits-lab select:focus-visible{outline:3px solid #327ede;outline-offset:3px}.bits-lab button:disabled{opacity:.42;cursor:default}.bits-lab .bits-run{background:#355c44;color:white;border-color:#355c44;font-weight:750}.bits-lab .bits-run.running{background:#ab493c}.bits-tools{display:flex;gap:7px;padding:10px 22px;background:#eff1e9;border-block:1px solid #dfe4d7;align-items:center;flex-wrap:wrap}.bits-tools label{font-size:12px;display:flex;align-items:center;gap:6px}.bits-tools select{padding:9px;border:1px solid #d4dacb;border-radius:9px;background:white;color:#34463c;max-width:210px}.bits-layout{display:grid;grid-template-columns:210px minmax(0,1fr);position:relative}.bits-library{background:#fafaf5;border-right:1px solid #dce1d5;max-height:660px;overflow:auto;padding:13px}.bits-library summary{font-weight:800;font-size:13px;cursor:pointer;padding:8px 0 12px}.bits-library .bits-catalog{display:flex;flex-direction:column;gap:7px}.bits-library button{display:flex;gap:9px;text-align:left;align-items:center;padding:6px;border-left:4px solid var(--bit);min-height:65px}.bits-library img{width:59px;height:49px;object-fit:contain;mix-blend-mode:multiply}.bits-library strong{font-size:12px;display:block}.bits-library small{font-size:10px;opacity:.65;display:block}.bits-library .bits-plus{margin-left:auto;color:#5b8063;font-size:20px}.bits-scene-wrap{min-width:0;position:relative;background:#d6b78b}.bits-scene{height:clamp(420px,65vh,660px);width:100%;position:relative;overflow:hidden;touch-action:none}.bits-scene canvas{display:block;width:100%;height:100%;touch-action:none;outline:none}.bits-scene-hint{position:absolute;top:14px;left:16px;right:90px;pointer-events:none;font-size:12px;font-weight:650;color:#574830;text-shadow:0 1px #fff7}.bits-view-buttons{position:absolute;right:12px;top:12px;display:flex;flex-direction:column;gap:6px}.bits-view-buttons button{width:42px;background:#fff9eeeb}.bits-canvas-label{position:absolute;bottom:16px;left:16px;max-width:calc(100% - 32px);padding:8px 13px;border-radius:99px;background:#fff8e9e8;color:#65513b;font-size:12px;font-weight:600;pointer-events:none}.bits-inspector{border-top:1px solid #e1e4d8;padding:17px 22px;display:grid;grid-template-columns:minmax(170px,1fr) minmax(260px,2fr);gap:22px;align-items:start;background:#fffffb}.bits-selected-title{display:flex;gap:12px;align-items:center}.bits-selected-title img{width:80px;height:70px;object-fit:contain;mix-blend-mode:multiply}.bits-selected-title h2{font-size:19px!important;color:#2f4536!important;text-shadow:none!important;margin:0 0 3px}.bits-selected-title small{font-size:11px;color:#788070}.bits-description{font-size:13px;line-height:1.55;color:#67715e!important;margin:8px 0!important}.bits-controls{display:flex;flex-wrap:wrap;gap:12px 20px;align-items:end}.bits-control{display:flex;flex-direction:column;min-width:125px;flex:1;gap:7px;font-size:12px;color:#4f614f}.bits-control label{font-weight:700}.bits-control input[type=range]{width:100%;accent-color:#5c8d62;min-height:24px}.bits-control select{padding:9px;border:1px solid #d6ddcf;border-radius:8px;min-height:40px;color:#34483c;background:#f7f9f3}.bits-control output{font-variant-numeric:tabular-nums;color:#507159;float:right;margin-left:10px}.bits-hold{background:#f6dd99!important;font-weight:800;touch-action:none;user-select:none;-webkit-user-select:none}.bits-hold:active{background:#ecc253!important;transform:translateY(1px)}.bits-module-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:12px}.bits-module-actions button{font-size:12px}.bits-connect{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:12px;border-top:1px solid #e7eadf;padding-top:12px;font-size:12px}.bits-connect select{max-width:175px;border:1px solid #d2d9ca;border-radius:7px;padding:7px;background:#f4f6f0;color:#354836}.bits-status{padding:12px 22px;border-top:1px solid #dce2d3;background:#f2f5ec;font-size:13px;display:flex;gap:10px;align-items:center;flex-wrap:wrap}.bits-status-dot{width:8px;height:8px;border-radius:50%;background:#8b9d84;flex-shrink:0}.bits-status-dot.on{background:#4b9d53;box-shadow:0 0 0 4px #78ad691b}.bits-status #bits-save-state{margin-left:auto;color:#71816b;font-size:11px}.bits-foot{font-size:11px!important;line-height:1.5;padding:12px 22px!important;margin:0!important;color:#7d8675!important;background:#fafbf7}.bits-foot a{color:#547453}.bits-empty{padding:30px;background:#fff8ed;border-radius:15px;color:#6d5b46}.adventure-card.bits .adventure-art{background-color:#d5b58b;background-size:contain;background-repeat:no-repeat}.adventure-card.bits .adventure-art img{display:none}.bits-guide{padding:12px 22px;background:#fff9e8;font-size:13px;color:#6a5a37}.bits-guide summary{cursor:pointer;font-weight:700}.bits-guide ol{padding-left:22px;line-height:1.8}.bits-layout.collapsed{grid-template-columns:52px minmax(0,1fr)}.bits-layout.collapsed .bits-library{padding:8px}.bits-layout.collapsed .bits-library summary{writing-mode:vertical-rl;min-height:90px}.bits-lab.full-workbench{position:fixed;inset:0;margin:0;border-radius:0;z-index:1000;overflow:auto}.full-workbench .bits-scene{height:calc(100dvh - 330px);min-height:330px}.bits-tooltip{position:absolute;pointer-events:none;background:#23392fe8;color:white;border-radius:8px;padding:7px 10px;font-size:12px;display:none;z-index:3}
@media(max-width:780px){.bits-layout{grid-template-columns:155px minmax(0,1fr)}.bits-head{padding:16px;align-items:start}.bits-head-actions{max-width:150px}.bits-head-actions button{font-size:12px}.bits-library{padding:7px}.bits-library img{width:38px}.bits-library strong{font-size:11px}.bits-inspector{grid-template-columns:1fr;padding:15px;gap:8px}.bits-scene{height:420px}.bits-tools{padding:8px 12px}.bits-tools button{font-size:12px}.bits-scene-hint{font-size:10px}.bits-view-buttons button{width:36px}.bits-control{min-width:110px}}
@media(max-width:480px){.bits-layout{grid-template-columns:112px minmax(0,1fr)}.bits-library button{flex-wrap:wrap;gap:2px;position:relative}.bits-library img{width:100%;height:38px}.bits-library .bits-plus{position:absolute;right:5px;top:4px}.bits-library strong{font-size:10px}.bits-head h1{font-size:25px!important}.bits-head p{font-size:11px}.bits-scene{height:380px}.bits-tools select{max-width:140px}.bits-head-actions{max-width:105px}.bits-head-actions button{padding:7px}.bits-control{min-width:100px}}

.bits-name-layer{position:absolute;inset:0;pointer-events:none;overflow:hidden}.bits-name-tag{position:absolute;top:0;left:0;display:block;background:#fffef4f5;color:#253b36;border:2px solid;border-radius:8px;padding:4px 9px;font-size:14px;font-weight:800;line-height:16px;white-space:nowrap;box-shadow:0 2px 5px #32210f22;pointer-events:none}.bits-name-tag[hidden]{display:none}.bits-name-tag.selected{background:#233c35;color:white;z-index:1}.bits-library strong{font-size:14px}.bits-library small{font-size:11px}@media(max-width:780px){.bits-library strong{font-size:12px}.bits-name-tag{font-size:13px}}

/* Controls stay beside the workbench instead of beneath the entire page. */
.bits-lab{position:relative}.bits-layout{padding-right:292px}.bits-inspector{position:absolute;right:0;top:170px;width:292px;max-height:610px;overflow:auto;grid-template-columns:1fr;gap:8px;padding:16px;background:#fffef5;border:1px solid #dce3d4;border-radius:15px 0 0 15px;z-index:4;box-shadow:-5px 5px 20px #20352614}.bits-selected-title img{width:57px;height:55px}.bits-description{font-size:12px!important;line-height:1.45}.bits-controls{gap:9px}.bits-control{min-width:115px}.bits-controls-close{position:absolute;right:5px;top:4px;min-height:28px!important;padding:2px 8px!important;border:0!important}.bits-advanced{font-size:12px;margin-top:10px}.bits-advanced summary{cursor:pointer;font-weight:750}.bits-inspector:not(:has(.bits-control)){min-height:110px}.bits-name-tag{padding:3px 7px;font-size:13px;box-shadow:0 1px 3px #32210f20}.bits-lab:not(.has-selection) .bits-inspector{display:none}.bits-lab:not(.has-selection) .bits-layout{padding-right:0}.full-workbench .bits-inspector{top:160px;max-height:calc(100dvh - 210px)}
@media(max-width:1050px){.bits-layout{padding-right:250px}.bits-inspector{width:250px;padding:12px}.bits-controls{display:block}.bits-control{margin-bottom:10px}}
@media(max-width:760px){.bits-layout{padding-right:0!important}.bits-inspector{position:fixed;top:auto;bottom:10px;right:10px;left:10px;width:auto;max-height:38dvh;border-radius:17px;box-shadow:0 -8px 25px #23352e25;padding:14px 18px}.bits-inspector .bits-description{display:none}.bits-inspector .bits-selected-title img{width:35px;height:35px}.bits-inspector .bits-module-actions{margin-top:5px}.bits-inspector .bits-controls{display:flex;gap:10px}.bits-inspector .bits-controls .bits-control{min-width:130px;flex:1}.bits-inspector .bits-controls-close{z-index:2}.bits-lab.has-selection{padding-bottom:10px}.bits-name-tag{font-size:12px}.full-workbench .bits-inspector{top:auto;max-height:38dvh}}

.bits-torch-beam{position:absolute;pointer-events:none;z-index:2;border-radius:50%;transform:translate(-50%,-50%);background:radial-gradient(circle,#fffbea9c 0%,#fff68863 45%,#fff1a000 72%);border:1px solid #ffe58166;box-shadow:0 0 18px #ffeb8050}.bits-torch-beam[hidden]{display:none}#bits-torch[aria-pressed=true]{background:#fff2ae;border-color:#c79d26;color:#554309}.bits-controls small{font-size:11px;line-height:1.4}
/* Match the library to the canvas; no unused wooden strip under the scene. */
.bits-lab{--workbench-height:clamp(420px,65vh,660px)}.bits-library{height:var(--workbench-height);max-height:var(--workbench-height);align-self:start}.bits-scene{height:var(--workbench-height)}.bits-inspector{top:var(--bits-panel-top,170px);max-height:var(--workbench-height)}.bits-lab.full-workbench{--workbench-height:max(330px,calc(100dvh - 230px))}.bits-lab.full-workbench .bits-scene{height:var(--workbench-height);min-height:330px}.bits-lab.full-workbench .bits-inspector{top:var(--bits-panel-top,170px);max-height:var(--workbench-height)}#bits-labels[aria-pressed=true]{background:#e3f0dd;border-color:#a0b994}.bits-name-layer[hidden]{display:none!important}@media(max-width:780px){.bits-lab{--workbench-height:420px}}@media(max-width:480px){.bits-lab{--workbench-height:380px}}@media(max-width:760px){.bits-inspector,.bits-lab.full-workbench .bits-inspector{top:auto;max-height:38dvh}}

/* Touch workbench: the controls belong to the layout, never cover the table. */
.bits-layout,.bits-layout.collapsed{padding-right:0;grid-template-columns:190px minmax(0,1fr) 280px;align-items:start}
.bits-lab:not(.has-selection) .bits-layout{grid-template-columns:190px minmax(0,1fr)}
.bits-inspector,.bits-lab.full-workbench .bits-inspector{position:relative;inset:auto;width:auto;max-height:var(--workbench-height);border-radius:0;box-shadow:none;min-width:0;padding:16px;overscroll-behavior:contain;touch-action:pan-y}
.bits-lab button,.bits-lab select{min-height:48px;touch-action:manipulation}
.bits-lab .bits-hold{touch-action:none;min-height:58px;min-width:130px;font-size:17px}
.bits-controls-close{position:relative;justify-self:end;min-width:48px;min-height:44px!important;font-size:24px;line-height:1}
.bits-control input[type=range]{min-height:44px;touch-action:pan-y}
.bits-control input[type=range]::-webkit-slider-thumb{width:28px;height:28px}
.bits-controls{gap:16px}.bits-control{font-size:14px;min-width:0}.bits-control select{font-size:16px}
.bits-library{padding:10px;overscroll-behavior:contain;touch-action:pan-y}
.bits-library summary{min-height:48px;font-size:15px;writing-mode:horizontal-tb!important}
.bits-library button{min-height:76px}.bits-library strong{font-size:14px}.bits-library img{width:52px}
.bits-layout.collapsed .bits-library{padding:10px}.bits-layout.collapsed .bits-library summary{min-height:48px}
.bits-example-tip{margin:0;padding:12px 20px;background:var(--ui-soft,#edf2f7);color:var(--ui-text,#293b50);font-size:14px;line-height:1.5}
.bits-scroll-grip{display:none}.bits-scene-hint{font-size:13px;right:72px;line-height:1.5;max-width:340px}
.bits-view-buttons button{width:48px;min-height:48px;font-size:22px}.bits-view-buttons{right:8px;gap:8px}
.bits-tools label{font-size:14px}.bits-tools select{max-width:240px;font-size:16px}
.bits-selected-title h2{font-size:21px!important}.bits-description{display:block!important;font-size:14px!important}
.bits-lab .bits-inspector .bits-selected-title img{width:60px;height:56px}
@media(max-width:1180px){
 .bits-layout,.bits-layout.collapsed,.bits-lab:not(.has-selection) .bits-layout{grid-template-columns:minmax(0,1fr) 270px}
 .bits-library{grid-column:1/-1;height:auto;max-height:240px;border-right:0;border-bottom:1px solid var(--ui-border,#dce1d5)}
 .bits-library .bits-catalog{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
 .bits-library button{flex-wrap:nowrap;min-width:0}.bits-library img{width:44px;height:44px}.bits-library .bits-plus{position:static}
 .bits-lab:not(.has-selection) .bits-scene-wrap{grid-column:1/-1}
}
@media(pointer:coarse){
 .bits-scene-wrap{padding-right:42px}.bits-scroll-grip{position:absolute;right:0;top:0;bottom:0;width:42px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:var(--ui-soft,#edf2f7);color:var(--ui-text,#293b50);font-size:24px;touch-action:pan-y}
 .bits-scroll-grip span{writing-mode:vertical-rl;font-size:12px;letter-spacing:1px}.bits-view-buttons{right:50px}
 .bits-scene-hint{display:none}.bits-canvas-label{left:8px;bottom:8px;max-width:calc(100% - 55px);font-size:12px}
 .bits-name-tag{font-size:13px}.bits-library summary{padding:12px 0}
}
@media(max-width:850px){
 .bits-lab{--workbench-height:clamp(290px,44svh,450px);border-radius:18px}
 .bits-layout,.bits-layout.collapsed,.bits-lab:not(.has-selection) .bits-layout{grid-template-columns:minmax(0,1fr)}
 .bits-inspector,.bits-lab.full-workbench .bits-inspector{position:relative;inset:auto;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);max-height:330px;width:auto;grid-column:1/-1;border-radius:0;padding:14px;gap:12px}
 .bits-controls-close{position:absolute;right:8px;top:4px}.bits-selected-title{padding-right:36px}.bits-inspector .bits-controls{display:flex}
 .bits-inspector .bits-controls .bits-control{min-width:120px;margin-bottom:8px}
 .bits-library .bits-catalog{grid-template-columns:repeat(3,minmax(0,1fr))}.bits-library{max-height:230px}
 .bits-head{padding:16px;flex-wrap:wrap}.bits-head-actions{max-width:none;width:100%}.bits-head-actions button{flex:1;font-size:15px}
 .bits-tools{gap:8px;padding:12px}.bits-tools label{width:100%;justify-content:space-between}.bits-tools select{max-width:70%}
 #bits-add-preset{flex:1;font-weight:800}#bits-undo-example{flex:1}.bits-tools button{font-size:14px}
 .bits-lab.full-workbench{--workbench-height:clamp(290px,44svh,450px)}.bits-lab.full-workbench .bits-scene{min-height:290px}
}
@media(max-width:520px){
 .bits-inspector,.bits-lab.full-workbench .bits-inspector{grid-template-columns:1fr;max-height:360px}
 .bits-library .bits-catalog{grid-template-columns:repeat(2,minmax(0,1fr))}.bits-library strong{font-size:13px}
 .bits-lab .bits-inspector .bits-selected-title img{width:45px;height:44px}.bits-description{margin:4px 0!important}
 .bits-head h1{font-size:27px!important}.bits-head p{font-size:14px}.bits-example-tip{padding:12px;font-size:13px}
 .bits-module-actions{gap:8px}.bits-module-actions button{flex:1;font-size:13px}.bits-status{padding:12px}
}
